loader: add set-module-path to support scripting the module load path change
The loader.conf is to assign set of environment variables defining what and how to boot, but also is describing the loadable modules. The modules part is tricky because the "variables" which do define the module, are not handled as environment variables, but are used to set up the in memory list of modules. The module configuration is therefore only controlled by entries in loader config files and not in environment.
To get information and manage module loading, there are commands: show-module, show-module-options, enable-module, disable-module, toggle-module. The current implementation is only allowing
interactive use case, and it does only allow setting module loading on and off.
In some scenarios it would be useful to change already declared module attributes, namely, the name of the file we want to load. This update will add new word: set-module-path. It will take 2 string arguments - the new path and the name of the module to be changed.
To share the code, we also update find-module to allow module name to be passed in stack, thus, making all above mentioned module related commands scriptable.
here is sample of the code:
s" alternate_kernel" getenv s" bootfile" setenv
s" alternate_archive_path" getenv s" boot_archive" set-module-path
s" boot_archive.hash" disable-module
Tested interactively and in scripts.
Updated by Electric Monk over 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit f2aacf291ef503fdf8ae4e69995bee851d6d10ae Author: Toomas Soome <email@example.com> Date: 2018-11-30T22:23:47.000Z 9981 loader: add set-module-path to support scripting the module load path change Reviewed by: Rob Johnston <firstname.lastname@example.org> Approved by: Joshua M. Clulow <email@example.com>