Copy /boot/loader.conf.local to the newly imaged slice. Ticket #892
Use rc.firmware_notify to send a message when upgrade starts and completed
Broadcast when a firmware upgrade is completed
Use cp -p to preserve permissions (exec)
Save the old shutdown binary in an attempt to smooth a firmware upgrade that crosses to/from 32/64-bit.
Remove logs from temp config backup so they aren't clobbered when restored.
Standardize upgrade log filenames
Backup all of /conf including subdirectories during upgrade instead of just files in /conf/
Insulate some variables as they are used.
Add missing unmount calls.
Note that the file will be labeled nanobsd upgrade
Patch from Ron Lockard that fixed restore_chflags due to a STDOUT redirection issue
Correctly note that the pfSenseupgrade is starting
Remove upgrade IMG file after failure
Remove image file when error occour because image file is greater than partition size
Add 1 meg to on size disk image
Remove /var/run/firmware.lock as well
Show what each of the numbers are during a upgrade size failure check
Show size of detected on disk partition and size of upgrade file
Minor commnets
Set kern.geom.debugflags=16
Add a seatbelt check to ensure the on disk partition is the same size (or larger) and bail if it has any issues.
Set boot slice correctly (reversed logic)
Add and use fdisk_upgrade_log.txt
Send file list to its own logfile
Remove foot shooting code that was commented out. It is not necessary for this. Enhance a comment about why we need boot0cfg
Use obs and gzip -dc
Set active partition with boot0cfg too
Use bzcat
Remove debugflags and boot0cfg. NanoBSD does not use either of these when upgrading.
Reset log file on each invocation
Use fsck_ufs
Get a complete find prinout of disk structure
Use 64k block size
Use same block size (64k) as builder scripts.
Make upgrade file easier to read
Output bsdlabel -A diagnostics as well
Output all slice information prior to upgrade, after dd operations and the final.
Output logs to /conf/
revert
Use COMPLETE_PATH
Sleep for 10 seconds before rebooting and allow disks to catch up
Mount RW when script launches
Send log file to /conf/
Add bit when restoring for diagnostics
Alert when we are doing a NanoBSD style upgrade.
Mount RW so we can write to logs. Duh. Mount RO if we exit out of an upgrade.
Copy host /etc/fstab to newly created area
If anything goes wrong when updating fstab then abort the upgrade and file a notice.
Use GLABEL_SLICE
Add a function named file_notice which invokes the php version.
Just for kicks I tried to use a full upgrade file instead of a file labaled upgrade. Bad things hapeppened. Prevent this in the future and error out and file a notice when this is attempted and give a hint that a file namebed "upgrade" must be used.
Use gzcat
s/config/conf/
Oops use /config/
Reinstall packages after upgrade
Use OLD_UFS_ID when replacing the old fstab entry (needs to be 0 or 1, not 1 or 2). Confusing!
Use UDS_ID when updating fstab
Use gpart to set the active partition slice
Turn off foot shooting when we are done.
Fix diagnostics text
use GLABEL_SLICE
umount correct slice. cleanup code and add log for normal upgrade too
Use '' since we are already in a ""
Output ls -lah /dev/ as well
Oops, add spacer before command name output
Add some extra diagnostics which might help diagnose an upgrade problem after the fact
Do not append variable
Move stray |Write out log to /cf/upgrade_log.txt so we can see the upgrade log after reboot
Use correct names. Mount correct directory and modify fstab
Check for pfsense and not pfsense1
Foot shooting is fun. Add some debugging echos to logger
When running fsck_ffs to check the validity of the upgrade, check ${TOFLASH}a
Out image to the slice and not a
Use REAL_BOOT_DEVICE
Set slice as well
Add my (C) since I have rewritten large portions of this file. Remove firmware lock if we exit before doing an upgrade.
Operate on real devices instead of glabels
Output more text
Output everything for debugging. Do not sleep.
No need to remove firmware.lock twice
Mount $TOFLASH and check for post upgrade command
Stop sleeping
Pre_upgrade commands not supported ATM on nanobsd upgrades
Reboot after upgrade and do not check for /tmp/ file which will never be able to be set.
Exit on failure
No need to \" in this case
/root/pfsense/
rename root0 and root1 pfsense0 and pfsense1
Remove copy-and-pasted code. Add globals.inc, too we need to define $g
Add support for nanobsd upgrades
Use updatep1 from /root/
Oops, zcat not cat the nanobsd update file
Let update1 handle file modifications
Add pfSenseNanoBSDupgrade upgrade routine
Remove lock hold later on
Correct ordering, use a lock file. Launch upgrade in bg and look for lock file to guess if upgrade is in progress