From a759338381a809b759fa69c3bbd1c767dc190337 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 31 May 2021 14:49:27 +0200 Subject: [PATCH] firmware: push automatic flags to firmware for #5025 --- .../app/controllers/OPNsense/Core/Api/FirmwareController.php | 4 ++-- src/opnsense/scripts/firmware/sets.sh | 4 ++-- src/opnsense/service/conf/actions.d/actions_firmware.conf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php b/src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php index 67973e1e9..74e51b1c2 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php @@ -792,7 +792,7 @@ class FirmwareController extends ApiControllerBase $configPlugins = explode(",", $config->system->firmware->plugins); } - $keys = array('name', 'version', 'comment', 'flatsize', 'locked', 'license', 'repository', 'origin'); + $keys = array('name', 'version', 'comment', 'flatsize', 'locked', 'automatic', 'license', 'repository', 'origin'); $backend = new Backend(); $response = array(); @@ -838,7 +838,7 @@ class FirmwareController extends ApiControllerBase $translated['provided'] = '1'; } $translated['path'] = "{$translated['repository']}/{$translated['origin']}"; - $translated['configured'] = in_array($translated['name'], $configPlugins) ? '1' : '0'; + $translated['configured'] = in_array($translated['name'], $configPlugins) || $translated['automatic'] == '1' ? '1' : '0'; $packages[$translated['name']] = $translated; /* figure out local and remote plugins */ diff --git a/src/opnsense/scripts/firmware/sets.sh b/src/opnsense/scripts/firmware/sets.sh index 03d90b8c8..e164407c7 100755 --- a/src/opnsense/scripts/firmware/sets.sh +++ b/src/opnsense/scripts/firmware/sets.sh @@ -44,6 +44,6 @@ opnsense-update -Tb || BL=1 opnsense-update -Tk || KL=1 cat << EOF -${BN}${SEP}${BV}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}${LIC}${SEP}${REPO}${SEP} -${KN}${SEP}${KV}${SEP}${OS} kernel set${SEP}${KS}${SEP}${KL}${SEP}${LIC}${SEP}${REPO}${SEP} +${BN}${SEP}${BV}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP} +${KN}${SEP}${KV}${SEP}${OS} kernel set${SEP}${KS}${SEP}${KL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP} EOF diff --git a/src/opnsense/service/conf/actions.d/actions_firmware.conf b/src/opnsense/service/conf/actions.d/actions_firmware.conf index 701eba08c..11aa2c30f 100644 --- a/src/opnsense/service/conf/actions.d/actions_firmware.conf +++ b/src/opnsense/service/conf/actions.d/actions_firmware.conf @@ -151,14 +151,14 @@ type:script_output message:Querying %s package details [local] -command: pkg query "%n|||%v|||%c|||%sh|||%k|||%L|||%R|||%o"; \ +command: pkg query "%n|||%v|||%c|||%sh|||%k|||%a|||%L|||%R|||%o"; \ /usr/local/opnsense/scripts/firmware/sets.sh '|||' parameters: type:script_output message:view local packages [remote] -command: pkg rquery "%n|||%v|||%c|||%sh|||0|||%L|||%R|||%o" +command: pkg rquery "%n|||%v|||%c|||%sh|||0|||0|||%L|||%R|||%o" parameters: type:script_output message:view remote packages