From 36fcc0ad6a935b2438dc695d7672201cd13a4392 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 26 Jun 2009 20:30:26 -0400 Subject: Move stray | Write out log to /cf/upgrade_log.txt so we can see the upgrade log after reboot --- etc/rc.firmware | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'etc/rc.firmware') 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 <> /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 -- cgit v1.1