Move the code to touch needs_package_sync into the shell script portion of the post upgrade command. The PHP portion will fail spectacularly during the 1.2.3-to-2.0 upgrade trying to run the new binaries on the old OS. The shell script part still works. Fixes #1251 enough for what we need. The PHP code can never run properly there, but at least we can trigger the package reinstall and the rest can sort itself out when 2.0 boots the first time.

This commit is contained in:
jim-p 2011-05-24 12:21:33 -04:00
parent 7a18dfa4ed
commit a90896fd64
2 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,9 @@
/etc/rc.conf_mount_rw
PFSENSETYPE=`cat /etc/platform`
KERNELTYPE=`cat /boot/kernel/pfsense_kernel.txt`
if [ $KERNELTYPE = "wrap" ]; then
if [ -f /kernels/kernel_wrap.gz ]; then
tar xzpf /kernels/kernel_wrap.gz --exclude loader.conf -C /boot/
@ -26,6 +28,10 @@ if [ $KERNELTYPE = "UP" ]; then
fi
fi
if [ $PFSENSETYPE = "pfSense" ] || [ $PFSENSETYPE = "nanobsd" ]; then
touch /conf/needs_package_sync
fi
# Detect interactive logins and display the shell
echo "if [ \`env | grep SSH_TTY | wc -l\` -gt 0 ] || [ \`env | grep cons25 | wc -l\` -gt 0 ]; then" > $CVS_CO_DIR/root/.shrc
echo " /etc/rc.initial" >> $CVS_CO_DIR/root/.shrc
@ -37,7 +43,7 @@ echo " exit" >> $CVS_CO_DIR/root/.profile
echo "fi" >> $CVS_CO_DIR/root/.profile
# Now turn on or off serial console as needed
php -f /tmp/post_upgrade_command.php
/tmp/post_upgrade_command.php
# Remove any previous MD5 sum files
rm -f /root/*.md5
@ -45,7 +51,6 @@ rm -f /root/*.md5
# File moved to pfSense php shell (pfSsh.php)
rm -rf /usr/local/sbin/cvs_sync.sh
PFSENSETYPE=`cat /etc/platform`
if [ $PFSENSETYPE = "embedded" ]; then
cp /etc/ttys_wrap /etc/ttys
fi
@ -53,4 +58,3 @@ fi
if [ -f /usr/local/sbin/php ]; then
rm /usr/local/sbin/php
fi

View File

@ -20,9 +20,6 @@
setup_serial_port();
if($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
touch("/conf/needs_package_sync");
$files_to_process = split("\n", file_get_contents("/etc/pfSense.obsoletedfiles"));
foreach($files_to_process as $filename)
if(file_exists($filename))