firmware: use cannonical -p and -t update

opnsense-update can now handle it correctly and we save another
invoke from here.
This commit is contained in:
Franco Fichtner 2021-02-17 15:03:23 +01:00
parent e321ab47a6
commit 1e4aac005a
2 changed files with 15 additions and 8 deletions

View File

@ -45,11 +45,18 @@ fi
rm -f ${PIPEFILE}
mkfifo ${PIPEFILE}
echo "***GOT REQUEST TO UPGRADE***" >> ${LOCKFILE}
if [ -z "${RELEASE}" ]; then
# XXX essentially this is a copy of update.sh
echo "***GOT REQUEST TO UPDATE***" >> ${LOCKFILE}
# figure out the release type from config
SUFFIX="-$(pluginctl -g system.firmware.type)"
if [ "${SUFFIX}" = "-" ]; then
SUFFIX=
fi
# upgrade all packages if possible
(opnsense-update -p 2>&1) | ${TEE} ${LOCKFILE}
(opnsense-update -pt "opnsense${SUFFIX}" 2>&1) | ${TEE} ${LOCKFILE}
# trigger a webgui restart to cope with changes
(/usr/local/etc/rc.restart_webgui 2>&1) | ${TEE} ${LOCKFILE}
@ -65,6 +72,9 @@ if [ -z "${RELEASE}" ]; then
fi
fi
else
# XXX essentially this is a copy of upgrade.sh
echo "***GOT REQUEST TO UPGRADE***" >> ${LOCKFILE}
# upgrade to a major release
${TEE} ${LOCKFILE} < ${PIPEFILE} &
if opnsense-update -u > ${PIPEFILE} 2>&1; then

View File

@ -38,11 +38,8 @@ if [ "${SUFFIX}" = "-" ]; then
SUFFIX=
fi
# update all installed packages
opnsense-update -p >> ${PKG_PROGRESS_FILE} 2>&1
# change the release type
opnsense-update -t "opnsense${SUFFIX}" >> ${PKG_PROGRESS_FILE} 2>&1
# upgrade all packages if possible
opnsense-update -pt "opnsense${SUFFIX}" >> ${PKG_PROGRESS_FILE} 2>&1
# restart the web server
/usr/local/etc/rc.restart_webgui >> ${PKG_PROGRESS_FILE} 2>&1