summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-26 20:30:26 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-26 20:30:26 -0400
commit36fcc0ad6a935b2438dc695d7672201cd13a4392 (patch)
treeb0c6b602eb64ba3522dd3c0ba47cf6829dfa8329 /etc/rc.firmware
parent93585de91be476d1bc6194328d3632d08c46c343 (diff)
downloadpfsense-36fcc0ad6a935b2438dc695d7672201cd13a4392.zip
pfsense-36fcc0ad6a935b2438dc695d7672201cd13a4392.tar.gz
Move stray |
Write out log to /cf/upgrade_log.txt so we can see the upgrade log after reboot
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware24
1 files changed, 13 insertions, 11 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 18b2526..d2afd9c 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -170,6 +170,9 @@ pfSenseNanoBSDupgrade)
/bin/mkdir -p /tmp/configbak
cp -p /conf/* /tmp/configbak 2>/dev/null
+ touch /cf/upgrade_log.txt
+ echo "" >> /cf/upgrade_log.txt
+
echo "Installing $IMG." | logger -p daemon.info -i -t Upgrade
# resolve glabel label that we booted from
@@ -193,25 +196,23 @@ pfSenseNanoBSDupgrade)
GLABEL_SLICE="pfsense0"
fi
- echo $SLICE
- echo $TOFLASH
- echo $BOOT_DRIVE
+ echo $SLICE >> /cf/upgrade_log.txt
+ echo $TOFLASH >> /cf/upgrade_log.txt
+ echo $BOOT_DRIVE >> /cf/upgrade_log.txt
# Foot shooting is fun!
- /sbin/sysctl kern.geom.debugflags=16
+ /sbin/sysctl kern.geom.debugflags=16 >> /cf/upgrade_log.txt
# Remove TOFLASH and get ready for new flash image
dd if=/dev/zero of=/dev/${TOFLASH} bs=1m count=1
- echo "dd if=/dev/zero of=/dev/${TOFLASH} bs=1m count=1"
- #>/dev/null 2>&1
+ echo "dd if=/dev/zero of=/dev/${TOFLASH} bs=1m count=1" >> /cf/upgrade_log.txt
# Stream gzipped image to dd and explode image to new area
- echo "/usr/bin/gunzip -S "" -c $IMG | /bin/dd of=/dev/${TOFLASH} bs=16k" |
+ echo "/usr/bin/gunzip -S "" -c $IMG | /bin/dd of=/dev/${TOFLASH} bs=16k" >> /cf/upgrade_log.txt
/usr/bin/gunzip -S "" -c $IMG | /bin/dd of=/dev/${TOFLASH} bs=16k
- #>/dev/null 2>&1
# Ensure that our new system is sound and bail if it is not and file a notice
- echo "/sbin/fsck_ffs -y /dev/$COMPLETE_PATH"
+ echo "/sbin/fsck_ffs -y /dev/$COMPLETE_PATH" >> /cf/upgrade_log.txt
/sbin/fsck_ffs -y /dev/$COMPLETE_PATH
if [ $? != 0 ]; then
/usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF
@@ -226,9 +227,10 @@ ENDOFF
fi
# Add back the corresponding glabel
+ echo "/sbin/tunefs -L pfsense${GLABEL_SLICE} /dev/$COMPLETE_PATH" >> /cf/upgrade_log.txt
/sbin/tunefs -L pfsense${GLABEL_SLICE} /dev/$COMPLETE_PATH
- echo "/usr/sbin/boot0cfg -s ${SLICE} -v /dev/${BOOT_DRIVE}"
+ echo "/usr/sbin/boot0cfg -s ${SLICE} -v /dev/${BOOT_DRIVE}" >> /cf/upgrade_log.txt
/usr/sbin/boot0cfg -s ${SLICE} -v /dev/${BOOT_DRIVE}
#>/dev/null 2>&1
@@ -247,7 +249,7 @@ ENDOFF
fi
# Update fstab
sed -i "" "s/pfsense${OLDSLICE}/pfsense${SLICE}/g" /tmp/$TOFLASH/etc/fstab
- cat /tmp/$TOFLASH/etc/fstab
+ cat /tmp/$TOFLASH/etc/fstab >> /cf/upgrade_log.txt
umount /tmp/$TOFLASH
# remount /cf ro
OpenPOWER on IntegriCloud