diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-03-22 05:15:20 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-03-22 05:15:20 +0000 |
commit | c922e45b00749236c1df7246303686bf94ae5e26 (patch) | |
tree | 4368df346967c5e6dbad8db07a9db56e8852f31e /etc | |
parent | 450c5e9794fee59830ed1d0f10ded72426bec4f1 (diff) | |
download | pfsense-c922e45b00749236c1df7246303686bf94ae5e26.zip pfsense-c922e45b00749236c1df7246303686bf94ae5e26.tar.gz |
* Use /tmp/firmwareupgrades
* Explode a mtree out to guarnatee we can extract a file
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.firmware | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index fbe09f0..61b4ab7 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -174,6 +174,11 @@ upgrade) echo "Extracting $IMG." | logger -p daemon.info -i -t Upgrade gzip -d $IMG echo "Installing $NEWIMG." | logger -p daemon.info -i -t Upgrade + mkdir -p /tmp/firmwareupgrade/usr + mtree -deU -f /etc/mtree/BSD.usr.dist -p /tmp/firmwareupgrade/usr + mtree -deU -f /etc/mtree/BSD.root.dist -p /tmp/firmwareupgrade/ + mkdir -p /tmp/firmwareupgrade/kernels/ + for i in `/usr/bin/tar tvf $NEWIMG | egrep "(^d)" | nawk '{print $9;}'`; do if [ ! -d /$i ]; then @@ -186,13 +191,13 @@ upgrade) FILE=`basename ${i}` echo "Working on ${FILE} - /${i}" echo "Working on ${FILE} - /${i}" | logger -p daemon.info -i -t Upgrade - (cd /tmp && /usr/bin/tar xf ${NEWIMG} ${i}) - echo "Installing /usr/bin/install -S /tmp/${i} /${i}" + (cd /tmp/firmwareupgrade && /usr/bin/tar xf ${NEWIMG} ${i}) + echo "Installing /usr/bin/install -S /tmp/firmwareupgrade/${i} /${i}" echo "Installing /${i}" | logger -p daemon.info -i -t Upgrade - /usr/bin/install -S "/tmp/${i}" "/${i}" - chflags noschg "/tmp/${i}" + /usr/bin/install -S "/tmp/firmwareupgrade/${i}" "/${i}" + chflags noschg "/tmp/firmwareupgrade/${i}" chflags noschg "/${i}" - /bin/rm -f "/tmp/${i}" + /bin/rm -f "/tmp/firmwareupgrade/${i}" done /usr/bin/find / -name CVS -exec rm -fr {} \; echo "Image installed $IMG." | logger -p daemon.info -i -t Upgrade @@ -207,6 +212,7 @@ upgrade) echo "Custom image $CUSTOMIMG installed." | logger -p daemon.info -i -t Upgrade fi fi + rm -rf /tmp/firmwareupgrade/ # restore config cp -p /tmp/configbak/* /conf 2>/dev/null # restore /etc symlinks |