Skip to content

Commit

Permalink
Move the code to touch needs_package_sync into the shell script porti…
Browse files Browse the repository at this point in the history
…on 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 pfsense#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.
  • Loading branch information
jim-p committed May 24, 2011
1 parent 7a18dfa commit a90896f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 7 additions & 3 deletions tmp/post_upgrade_command
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand All @@ -37,20 +43,18 @@ 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

# 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

if [ -f /usr/local/sbin/php ]; then
rm /usr/local/sbin/php
fi

3 changes: 0 additions & 3 deletions tmp/post_upgrade_command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a90896f

Please sign in to comment.