mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Keep a copy of old mtree binary during upgrade and use it to avoid crashing. Fixes #4563
This commit is contained in:
parent
0ab90dd074
commit
0e40454d52
@ -31,7 +31,12 @@ rm -f /root/*.md5 >/dev/null 2>&1
|
||||
|
||||
# Fixup permissions on installed files
|
||||
if [ -f ${ROOT}etc/installed_filesystem.mtree ]; then
|
||||
/usr/sbin/mtree -U -e -q -f ${ROOT}etc/installed_filesystem.mtree -p ${ROOT} > /conf/mtree.log
|
||||
if [ -x "/tmp/mtree.old" ]; then
|
||||
MTREE_BIN=/tmp/mtree.old
|
||||
else
|
||||
MTREE_BIN=/usr/sbin/mtree
|
||||
fi
|
||||
${MTREE_BIN} -U -e -q -f ${ROOT}etc/installed_filesystem.mtree -p ${ROOT} > /conf/mtree.log
|
||||
fi
|
||||
|
||||
# Make sure to preserve existing time zone
|
||||
|
||||
@ -26,7 +26,8 @@ if [ ${PRIOR_VERSION} -le 8 ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; t
|
||||
cp -fp /bin/sh /tmp/sh.old
|
||||
kill ${PID} >/dev/null 2>&1
|
||||
kill -9 ${PID} >/dev/null 2>&1
|
||||
sed -i '' -e 's,sh /,/tmp/sh.old /,' /etc/rc.firmware
|
||||
sed -i '' -e 's,sh /,/tmp/sh.old /,' \
|
||||
-e 's,/usr/sbin/mtree,/tmp/mtree.old,' /etc/rc.firmware
|
||||
# To avoid restarting rc.firmware twice because of #4328
|
||||
sed -i '' -e '/^restore_chflags()/, /^}/ s/mtree *-PU/mtree -P/' /etc/rc.firmware
|
||||
/etc/rc.firmware pfSenseupgrade "${IMG}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user