You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zbm-builder.sh: support custom build/source paths and hooks
* Build from a local source tree with `-l`
* Override build directory with `-b`
* Include hooks in $BUILD_DIRECTORY/hooks.{early_setup,setup,teardown}.d
* Update command-line documentation and docs/BUILD.md
Co-authored-by: James R. Todd <[email protected]>
Co-authored-by: Andrew J. Hesford <[email protected]>
Closes: #282.
Copy file name to clipboardExpand all lines: docs/BUILD.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,13 +66,25 @@ The default behavior of `zbm-builder.sh` will:
66
66
2. If `./config.yaml` exists, inform the builder to use that custom configuration instead of the default
67
67
3. Run the internal build script to produce output in the `./build` subdirectory
68
68
69
-
### Customizing Images
69
+
### Custom ZFSBootMenu Hooks
70
70
71
-
A custom `config.yaml` may be provided in the working directory to override the
72
-
default ZFSBootMenu configuration. The build container runs its build script
73
-
from the working directory on the host. Therefore, relative paths in a custom
74
-
`config.yaml` will be interpreted relative to the working directory when
75
-
`zbm-builder.sh` is invoked.
71
+
ZFSBootMenu supports [custom hooks](pod/zfsbootmenu.7.pod#options-for-dracut) in three stages:
72
+
73
+
1.`early_setup` hooks run after the `zfs` kernel driver has been loaded, but before ZFSBootMenu attempts to import any pools.
74
+
2.`setup` hooks run after pools are imported, right before ZFSBootMenu will either boot a default environment or present a menu.
75
+
3.`teardown` hooks run immediately before ZFSBootMenu will `kexec` the kernel for the selected environment.
76
+
77
+
When `zbm-builder.sh` runs, it will identify custom hooks as executable files in the respective subdirectories of its build directory:
78
+
79
+
1.`hooks.early_setup.d`
80
+
2.`hooks.setup.d`
81
+
3.`hooks.teardown.d`
82
+
83
+
For each hook directory that contains at least one executable file, `zbm-builder.sh` will write custom configuration snippets for `dracut` and `mkinitcpio` that will include these files in the output images.
84
+
85
+
### Fully Customizing Images
86
+
87
+
A custom `config.yaml` may be provided in the working directory to override the default ZFSBootMenu configuration. The build container runs its build script from the working directory on the host. Therefore, relative paths in a custom `config.yaml` will be interpreted relative to the working directory when `zbm-builder.sh` is invoked.
76
88
77
89
> The internal build script **always** overrides the output paths for ZFSBootMenu components and UEFI executables to ensure that the images will reside in the `./build` subdirectory upon completion. Relative paths are primarily useful for specifying local `dracut` or `mkinitcpio` configuration paths.
0 commit comments