Project

General

Profile

Feature #9981

loader: add set-module-path to support scripting the module load path change

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
2018-11-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

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:

: set_alternate_boot
s" alternate_kernel" getenv s" bootfile" setenv
s" alternate_archive_path" getenv s" boot_archive" set-module-path
s" boot_archive.hash" disable-module
boot
;

Tested interactively and in scripts.

History

#1

Updated by Electric Monk about 1 year ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit f2aacf291ef503fdf8ae4e69995bee851d6d10ae

commit  f2aacf291ef503fdf8ae4e69995bee851d6d10ae
Author: Toomas Soome <tsoome@me.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 <rob.johnston@joyent.com>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

Also available in: Atom PDF