system: render interfaces in convert_config() #5768

This brings it in line with migrations although both hinge on
the idea that rc.configure_firmware is called to execute this
code.  Both need a better integration but bringing them to the
same level seems to make the most sense.

After reboot the config is in a consistent state now too...

Remove previous plugins_interfaces() call and always use full
path to pluginctl like most spots already do.
This commit is contained in:
Franco Fichtner 2022-07-12 20:39:58 +02:00
parent f0ffed3c58
commit bad28afe70
5 changed files with 7 additions and 6 deletions

View File

@ -350,7 +350,7 @@ upgrade-check:
upgrade: upgrade-check clean-pkgdir package
@${PKG} delete -fy ${CORE_NAME} || true
@${PKG} add ${PKGDIR}/*.pkg
@pluginctl webgui
@${.CURDIR}/src/sbin/pluginctl webgui
lint-shell:
@find ${.CURDIR}/src ${.CURDIR}/Scripts \

View File

@ -100,6 +100,9 @@ function convert_config($verbose = false)
mwexecf($cmd);
}
/* register pluggable interfaces */
mwexecf('/usr/local/sbin/pluginctl -i');
/* factory reset on release type and plugins if necessary */
$cmd = '/usr/local/opnsense/scripts/firmware/register.php resync_factory';
if ($verbose) {
@ -141,8 +144,6 @@ function write_config($desc = '', $backup = true)
}
}
plugins_interfaces();
$cnf = OPNsense\Core\Config::getInstance();
$cnf->fromArray($config);
$revision_info = make_config_revision_entry($desc);

View File

@ -76,7 +76,7 @@ function ntpd_cron()
$jobs = array();
if (ntpd_enabled() && !empty($config['ntpd']['clientmode'])) {
$jobs[]['autocron'] = array('pluginctl -s ntpd restart', '0', '2');
$jobs[]['autocron'] = ['/usr/local/sbin/pluginctl -s ntpd restart', '0', '2'];
}
return $jobs;

View File

@ -64,7 +64,7 @@ repository="error"
sets_upgraded=
upgrade_needs_reboot="0"
product_suffix="-$(pluginctl -g system.firmware.type)"
product_suffix="-$(/usr/local/sbin/pluginctl -g system.firmware.type)"
if [ "${product_suffix}" = "-" ]; then
product_suffix=
fi

View File

@ -45,7 +45,7 @@ if [ "$(opnsense-version -a)" != "$(opnsense-version -x)" ]; then
fi
# figure out the release type from config
SUFFIX="-$(pluginctl -g system.firmware.type)"
SUFFIX="-$(/usr/local/sbin/pluginctl -g system.firmware.type)"
if [ "${SUFFIX}" = "-" ]; then
SUFFIX=
fi