|
133 | 133 | .\" ======================================================================== |
134 | 134 | .\" |
135 | 135 | .IX Title "zfsbootmenu 7" |
136 | | -.TH zfsbootmenu 7 "2021-10-31" "1.11.0" "ZFSBootMenu" |
| 136 | +.TH zfsbootmenu 7 "2021-11-19" "1.11.0" "ZFSBootMenu" |
137 | 137 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
138 | 138 | .\" way too many mistakes in technical documents. |
139 | 139 | .if n .ad l |
@@ -299,7 +299,30 @@ Any installed hooks are run right before the ZFSBootMenu menu will be presented; |
299 | 299 | .IX Item "zfsbootmenu_teardown=<executable-list>" |
300 | 300 | An optional variable specifying a space-separated list of paths to teardown hooks that will be installed in the ZFSBootMenu initramfs. Any path in the list \fB<executable\-list>\fR that exists and is executable will be installed. |
301 | 301 | .Sp |
302 | | -Some hardware initialized by the kernel used to boot ZFSBootMenu may not be properly reinitialized when a boot environment is launched. Any teardown hooks installed into the ZFSBootMenu initramfs, will be run immediately before \fBkexec\fR is invoked to jump into the selected kernel. This script can be used, for example, to unbind drivers from hardware or remove kernel modules. |
| 302 | +Some hardware initialized by the kernel used to boot ZFSBootMenu may not be properly reinitialized when a boot environment is launched. Any teardown hooks installed into the ZFSBootMenu initramfs will be run immediately before \fBkexec\fR is invoked to jump into the selected kernel. This script can be used, for example, to unbind drivers from hardware or remove kernel modules. |
| 303 | +.Sp |
| 304 | +Teardown hooks have access to three environment variables that describe the boot environment that is about to be launched: |
| 305 | +.RS 4 |
| 306 | +.IP "\fB\s-1ZBM_SELECTED_BE\s0\fR" 4 |
| 307 | +.IX Item "ZBM_SELECTED_BE" |
| 308 | +The \s-1ZFS\s0 filesystem containing the boot environment that is about to be launched. |
| 309 | +.IP "\fB\s-1ZBM_SELECTED_KERNEL\s0\fR" 4 |
| 310 | +.IX Item "ZBM_SELECTED_KERNEL" |
| 311 | +The path to the kernel that will be booted, relative to the root of \fB\s-1ZBM_SELECTED_BE\s0\fR. |
| 312 | +.IP "\fB\s-1ZBM_SELECTED_INITRAMFS\s0\fR" 4 |
| 313 | +.IX Item "ZBM_SELECTED_INITRAMFS" |
| 314 | +The path to the initramfs corresponding to the selected kernel, again relative to the root of \fB\s-1ZBM_SELECTED_BE\s0\fR. |
| 315 | +.RE |
| 316 | +.RS 4 |
| 317 | +.Sp |
| 318 | +The hook \fImust not\fR assume that the filesystem \fB\s-1ZBM_SELECTED_BE\s0\fR is currently mounted or that the pool on which it resides is currently imported. However, a teardown hook has the freedom to import a pool (preferably read-only) and mount the boot environment to inject additional processing before boot. To abort a pending boot, invoking |
| 319 | +.Sp |
| 320 | +.Vb 1 |
| 321 | +\& kexec \-\-unload |
| 322 | +.Ve |
| 323 | +.Sp |
| 324 | +should be sufficient to return to the main menu. Likewise, the hook may construct and execute its own \fIkexec\fR command to alter boot-time parameters. This may be useful, for example, to allow ZFSBootMenu to select a boot environment and then restructure the boot process to launch a Xen kernel with the selected environment configured as dom0. |
| 325 | +.RE |
303 | 326 | .SH "SEE ALSO" |
304 | 327 | .IX Header "SEE ALSO" |
305 | 328 | \&\fBgenerate-zbm\fR(5) \fBgenerate-zbm\fR(8) \fBdracut.conf\fR(5) |
|
0 commit comments