diff --git a/src/etc/rc.firmware.subr b/src/etc/rc.firmware.subr index 9f95eb04f..71022b7b0 100755 --- a/src/etc/rc.firmware.subr +++ b/src/etc/rc.firmware.subr @@ -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 diff --git a/src/opnsense/scripts/firmware/update.sh b/src/opnsense/scripts/firmware/update.sh index cd32d7b4d..4fefc3152 100755 --- a/src/opnsense/scripts/firmware/update.sh +++ b/src/opnsense/scripts/firmware/update.sh @@ -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