diff options
author | Renato Botelho <renato@netgate.com> | 2016-03-03 15:02:39 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-03-03 15:02:39 -0300 |
commit | bed6c19b3c78bf1841f360a076ee10a457716d2d (patch) | |
tree | e6c13315d64c7dc9e6437dd89f253fcaea40a81f /src/etc/inc | |
parent | c86db913df4c996020d73e0016e76fba49e2cfbe (diff) | |
download | pfsense-bed6c19b3c78bf1841f360a076ee10a457716d2d.zip pfsense-bed6c19b3c78bf1841f360a076ee10a457716d2d.tar.gz |
Detect binary packages installed but not registered in the system and do it during boot
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 3977ce8..cae55bf 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -453,6 +453,37 @@ function get_pkg_info($pkgs = 'all', $info = 'all', $only_local = false) { } /* + * If binary pkg is installed but post-install tasks were not + * executed yet, fo it now. + * This scenario can happen when a pkg is pre-installed during + * build phase, and at this point, cannot find a running system + * to register itself in config.xml and also execute custom + * install functions + */ +function register_all_installed_packages() { + global $g, $config, $pkg_interface; + + $pkg_info = get_pkg_info('all', 'all', true); + + foreach ($pkg_info as $pkg) { + if (!isset($pkg['installed'])) { + continue; + } + + pkg_remove_prefix($pkg['name']); + + if (is_package_installed($pkg['name'])) { + continue; + } + + update_status(sprintf(gettext( + "Running last steps of %s installation.") . "\n", + $pkg['name'])); + install_package_xml($pkg['name']); + } +} + +/* * resync_all_package_configs() Force packages to setup their configuration and rc.d files. * This function may also print output to the terminal indicating progress. */ |