mirror of
https://github.com/opnsense/core.git
synced 2026-02-18 18:18:13 -05:00
firmware: restructure upgrade code
Goes over the previous change by calling the reboot only once instead of three times: Here we are told there are upgrades pending and the upgrade hooks were returning successfully. Apply the kernel immediately if necessary to save a reboot. Contrary to popular belief the kernel can still apply during a reboot if something went wrong, but this way we save a reboot. After that don't question that a reboot is necessary to avoid ever falling into the error case for no reason.
This commit is contained in:
parent
0e31c27ef7
commit
22b36dcc4b
1 changed files with 2 additions and 6 deletions
|
|
@ -31,14 +31,10 @@ REQUEST="UPGRADE"
|
|||
|
||||
if output_cmd opnsense-update -u; then
|
||||
if output_cmd /usr/local/etc/rc.syshook upgrade; then
|
||||
# no pending kernels but still need a reboot
|
||||
if ! output_cmd opnsense-update -K -c; then
|
||||
output_reboot keep-log
|
||||
# pending kernel applies before reboot
|
||||
elif output_cmd opnsense-update -K; then
|
||||
output_reboot keep-log
|
||||
if output_cmd opnsense-update -K -c; then
|
||||
output_cmd opnsense-update -K
|
||||
fi
|
||||
# kernel is already applied so continue
|
||||
output_reboot keep-log
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue