Skip to content

Commit a99a8de

Browse files
RoundDuckKiraahesford
authored andcommitted
Update README.md to explain driver exclusions and teardown hooks
Nvidia is poorly documented and this could be a big roadblock for many to use zfsbootmenu, unless if they beg for help on the issues page or look deep. So I'm gonna add a section for Nvidia based on the advice I got from @ahesford. Co-authored-by: RoundDuckKira <[email protected]> Co-authored-by: Andrew J. Hesford <[email protected]> Closes: #141 Closes: #142 [via git-merge-pr]
1 parent 5ac481f commit a99a8de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,24 @@ If (and only if) `generate-zbm` is run without a `--config` option (*i.e.*, it a
193193

194194
Whenever `generate-zbm` attempts to migrate configuraton files, it will exit with a zero exit code on successful conversion and a nonzero exit code if problems were encountered during the conversion. No boot images will be produced in the same invocation as a migration attempt.
195195

196+
## Dealing with driver conflicts
197+
198+
For some combination of hardware and kernel modules, the ZFSBootMenu kernel may leave hardware in an unexpected state and prevent the boot environment from properly initializing and attaching drivers. The simplest way to avoid this issue is to disable the affected kernel modules in ZFSBootMenu, leaving all hardware initialization to the final kernel. For example, if Nvidia graphics hardware does not function as expected, a dracut configuration file can be added to `/etc/zfsbootmenu/dracut.conf.d` to exclude the `nouveau` and `nvidia` drivers from ZFSBootMenu. Adding the line
199+
200+
```
201+
omit_drivers+=" nouveau nvidia "
202+
```
203+
204+
to a file called, *e.g.*, `/etc/zfsbootmenu/dracut.conf.d/nvidia.conf` should restore expected functionality to your boot environment after recreating your ZFSBootMenu image with `generate-zbm`.
205+
206+
In other cases, it is not possible to exclude drivers without depriving ZFSBootMenu of critical hardware support. For example, some XHCI USB controllers may not be properly initialized after a `kexec`, leaving a boot environment without USB devices like a keyboard. However, excluding XHCI drivers from ZFSBootMenu would make the same keyboard inoperable in the boot menu, making it impossible to interact with the menus. ZFSBootMenu provides "teardown hooks" that can sometimes be used to address these situations. Teardown hooks are invoked immediately before a target kernel is booted via `kexec` and provide an opportunity to run last-minute commands to prepare the system for the boot. Scripts may be registered as teardown hooks by adding text of the form
207+
208+
```
209+
zfsbootmenu_teardown+=" <path to script> "
210+
```
211+
212+
where `<path to script>` points to an **executable** script or program. A sample [XHCI teardown script](contrib/xhci-teardown.sh) demonstrates the use of teardown hooks to unbind the XHCI driver from the USB controllers in the ZFSBootMenu kernel before launching the selected boot environment, allowing the next kernel to properly initialize the controller.
213+
196214
# Native encryption
197215

198216
ZFSBootMenu can import pools or filesystems with native encryption enabled. If your boot environments are not encrypted but, for example, `/home` is, you will not receive a decryption prompt during boot. To ensure that you can decrypt your pool to load the kernel and initramfs, you'll need to you have the filesystem parameters configured correctly.

0 commit comments

Comments
 (0)