From efea84d9489e12d4c7a56e4dd5bf2be7e493b1cf Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 8 Jun 2015 09:52:58 +0200 Subject: [PATCH] firmware: fold package updates into opnsense-update(8) --- src/etc/rc.initial.firmware | 13 +++++-------- src/opnsense/scripts/pkg_upgrade.sh | 16 +++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/etc/rc.initial.firmware b/src/etc/rc.initial.firmware index 837f28e2e..713d60e9b 100755 --- a/src/etc/rc.initial.firmware +++ b/src/etc/rc.initial.firmware @@ -42,9 +42,7 @@ esac echo # upgrade all packages if possible -pkg upgrade -y -pkg autoremove -y -pkg clean -y +opnsense-update -p echo @@ -54,8 +52,7 @@ echo echo # if we can update base, we'll do that as well -if opnsense-update -c; then - opnsense-update && /usr/local/etc/rc.reboot -else - opnsense-update -fi +REBOOT= +opnsense-update -c -bk && REBOOT=1 +opnsense-update -bk +[ -n "${REBOOT}" ] /usr/local/etc/rc.reboot diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index 8868cbab5..2b3471a6b 100755 --- a/src/opnsense/scripts/pkg_upgrade.sh +++ b/src/opnsense/scripts/pkg_upgrade.sh @@ -40,18 +40,16 @@ if [ -z "$pkg_running" ]; then echo '***STARTING UPGRADE***' >> ${PKG_PROGRESS_FILE} if [ "$package" == "all" ]; then # update all installed packages - pkg upgrade -y >> ${PKG_PROGRESS_FILE} - pkg autoremove -y >> ${PKG_PROGRESS_FILE} - pkg clean -y >> ${PKG_PROGRESS_FILE} + opnsense-update -p >> ${PKG_PROGRESS_FILE} # restart the web server /usr/local/etc/rc.restart_webgui >> ${PKG_PROGRESS_FILE} # if we can update base, we'll do that as well - if opnsense-update -c; then - echo "!!!!!!!!!!!! ATTENTION !!!!!!!!!!!" >> ${PKG_PROGRESS_FILE} - echo "A kernel/base upgrade is required." >> ${PKG_PROGRESS_FILE} - echo "try to perform immediately" >> ${PKG_PROGRESS_FILE} - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ${PKG_PROGRESS_FILE} - if opnsense-update >> ${PKG_PROGRESS_FILE}; then + if opnsense-update -c -bk; then + echo "!!!!!!!!!!!! ATTENTION !!!!!!!!!!!!!!" >> ${PKG_PROGRESS_FILE} + echo "A kernel/base upgrade is in progress." >> ${PKG_PROGRESS_FILE} + echo "Please do not turn off the system." >> ${PKG_PROGRESS_FILE} + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ${PKG_PROGRESS_FILE} + if opnsense-update -bk >> ${PKG_PROGRESS_FILE}; then REBOOT=1 fi fi