33 lines
1.0 KiB
Markdown
33 lines
1.0 KiB
Markdown
# Module interface:
|
|
|
|
May call the functions:
|
|
|
|
- `load_module ${mod_filename}` to depend on another module
|
|
|
|
May adjust the variables:
|
|
|
|
- `packages` (array of depspecs) packages to download and install
|
|
|
|
- `cache_packages` (array of depspecs) packages to download but not
|
|
install
|
|
|
|
- `pre_install` (array of `uint:funcname` pairs) functions to call
|
|
after `${packages[@]}` and `${cache_packages[@]}` are downloaded,
|
|
but before `${packages[@]}` are installed. The listed functions
|
|
are called in numeric order of the provided number. Each function
|
|
is called with the image mountpoint as an argument.
|
|
|
|
You are encouraged to prefix your function names with `modulename:`
|
|
to avoid naming conflicts. Typical use looks like:
|
|
|
|
```bash
|
|
pre_install+=(99:mymodule:last_thing)
|
|
mymodule:last_thing() {
|
|
local arg_mountpoint=$2
|
|
# function body here
|
|
}
|
|
```
|
|
|
|
- `post_install` (array of `uint:funcname` pairs) like `pre_install`,
|
|
functions to call but called after `${packages[@]}` are installed.
|