diff options
author | jim-p <jimp@pfsense.org> | 2010-07-29 13:59:59 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-07-29 14:03:19 -0400 |
commit | bf07217998ed65da6f9aea2d1a2db2f078202731 (patch) | |
tree | a357255daee4116d393f9bcf9dec1aef2067c186 | |
parent | 439b0e26bc443b208f5112d348a4621bab25e14e (diff) | |
download | pfsense-bf07217998ed65da6f9aea2d1a2db2f078202731.zip pfsense-bf07217998ed65da6f9aea2d1a2db2f078202731.tar.gz |
Save the old shutdown binary in an attempt to smooth a firmware upgrade that crosses to/from 32/64-bit.
-rwxr-xr-x | etc/rc.bootup | 4 | ||||
-rwxr-xr-x | etc/rc.firmware | 2 | ||||
-rwxr-xr-x | etc/rc.reboot | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/etc/rc.bootup b/etc/rc.bootup index 408949a..a433568 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -372,6 +372,10 @@ upnp_start(); /* If powerd is enabled, lets launch it */ activate_powerd(); +/* Remove the old shutdown binary if we kept it. */ +if (file_exists("/sbin/shutdown.old")) + unlink("/sbin/shutdown.old"); + /* done */ unset($g['booting']); diff --git a/etc/rc.firmware b/etc/rc.firmware index f752335..036c340 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -83,6 +83,8 @@ binary_update() { ERR_F="/tmp/bdiff.log" rm ${ERR_F} 2>/dev/null /bin/mkdir /tmp/patched /tmp/patches 2>>${ERR_F} + # Save the old shutdown binary. If we switch from i386 to amd64 (or back) the reboot binary won't run at the end since it doesn't match up. + /bin/cp /sbin/shutdown /sbin/shutdown.old backup_chflags remove_chflags cd /tmp/patches diff --git a/etc/rc.reboot b/etc/rc.reboot index ecc47c2..66efae4 100755 --- a/etc/rc.reboot +++ b/etc/rc.reboot @@ -23,4 +23,9 @@ fi sleep 1 -/sbin/shutdown -r now +SHUTDOWN=/sbin/shutdown +if [ -f /sbin/shutdown.old ]; then + SHUTDOWN=/sbin/shutdown.old +fi + +$SHUTDOWN -r now |