Skip to content

Commit 037bb55

Browse files
committed
README.md: rework introduction, de-emphasize dracut
1 parent 65167e6 commit 037bb55

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,61 @@
22

33
[![Build check](https://github.com/zbm-dev/zfsbootmenu/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/zbm-dev/zfsbootmenu/actions/workflows/build.yml) [![latest packaged version(s)](https://repology.org/badge/latest-versions/zfsbootmenu.svg)](https://repology.org/project/zfsbootmenu/versions)
44

5-
ZFSBootMenu is a Dracut module that intends to provide Linux distributions with an experience similar to FreeBSD's bootloader. By taking advantage of ZFS features, it allows a user to have multiple "boot environments" (with different distros, for example), manipulate snapshots before booting, and, for the adventurous user, even bootstrap a system installation via `zfs recv`.
5+
ZFSBootMenu is a Linux bootloader that attempts to provide an experience similar to FreeBSD's bootloader. By taking advantage of ZFS features, it allows a user to have multiple "boot environments" (with different distros, for example), manipulate snapshots before booting, and, for the adventurous user, even bootstrap a system installation via `zfs recv`.
6+
7+
In essence, ZFSBootMenu is a small, self-contained Linux system that knows how to find other Linux kernels and initramfs images within ZFS filesystems. When a suitable kernel and initramfs are identified (either through an automatic process or direct user selection), ZFSBootMenu launches that kernel using the `kexec` command.
68

79
![screenshot](/media/v1.11.0-multi-be.png?raw=true)
810

911
In broad strokes, it works as follows:
1012

11-
* Via direct EFI booting, `rEFInd`, `syslinux`, etc, boot a Linux kernel along with an initramfs containing ZFSBootMenu.
12-
* Look for `zfsbootmenu` in the kernel command line.
13-
* Optionally specify a default pool (if multiple are present).
13+
* Via direct EFI booting, an EFI boot manager like refind, `rEFInd`, a BIOS bootloader like `syslinux`, or some other means, boot ZFSBootMenu (as either a self-contained UEFI application or a dedicated Linux kernel and initramfs image).
1414
* Find all healthy ZFS pools and import them.
15-
* If a specific pool was set, look for the `bootfs` pool value. Prefer this boot environment.
16-
* If no pool was defined in the command line, use the `bootfs` value on the first-found pool.
17-
* If a `bootfs` value is defined, start a 10 second (by default) countdown to boot that environment with the highest versioned kernel found in `/boot`.
18-
* If no `bootfs` value is defined, find every filesystem that mounts to `/` with a `/boot` directory, and find every kernel image. Prompt for boot environment selection via a fuzzy finder.
19-
* If needed, prompt for encryption passphrases.
20-
* Once the countdown has been reached for the bootfs-selected environment, prompt for the encryption passphrase if needed.
21-
* Mount the filesystem and find the highest versioned kernel in `/boot` in the selected boot environment.
22-
* Load the selected kernel and initramfs with the kernel command line defined in the `org.zfsbootmenu:commandline` property into memory with `kexec`.
15+
* If appropriate, select a preferred boot environment:
16+
* If the ZFSBootMenu command line specifies no pool preference, prefer the filesystem indicated by the `bootfs` property (if defined) on the first-found pool.
17+
* If the ZFSBootMenu command line specifies a pool preference, and that pool has been imported, prefer the filesystem indicated by its `bootfs` property (if defined).
18+
* If a `bootfs` value has been identified, start an interruptable countdown (by default, 10 seconds) to automatically boot that environment.
19+
* If no `bootfs` value can be identified or the automatic countdown was interrupted, search all imported pools for filesystems that set `mountpoint=/` and contain a `/boot` subdirectory that contains Linux kernels and initramfs images. Present a list of identified environments for user selection via `fzf`.
20+
* Mount the filesystem representing the selected boot environment and find the highest versioned kernel in `/boot` in the selected boot environment.
21+
* Using `kexec`, load the selected kernel and initramfs into memory, setting the kernel command line with the contents of the `org.zfsbootmenu:commandline` property for that filesystem.
2322
* Unmount all ZFS filesystems.
2423
* Boot the final kernel and initramfs.
2524

2625
At this point, you'll be booting into your usual OS-managed kernel and initramfs, along with any arguments needed to correctly boot your system.
2726

27+
Whenever ZFSBootMenu encounters natively encrypted ZFS filesystems that it intends to scan for boot environments, it will prompt the user to enter a passphrase as necessary.
28+
2829
This tool makes uses of the following additional software:
2930
* [fzf](https://github.com/junegunn/fzf)
3031
* [kexec-tools](https://github.com/horms/kexec-tools)
3132
* [mbuffer](http://www.maier-komor.de/mbuffer.html)
3233
* [Linux Kernel](https://www.kernel.org)
3334
* [ZFS on Linux](https://zfsonlinux.org)
34-
* [dracut](https://github.com/dracutdevs/dracut)
3535

36-
ZFSBootMenu has been tested successfully with Kernel 5.8.14, Dracut 050 and OpenZFS 2.0.0-rc4.
36+
The ZFSBootMenu image is created from your regular system utilities using an initramfs generator. Image creation is known to work and explicitly supported with:
37+
38+
* [dracut](https://github.com/dracutdevs/dracut), and
39+
* [mkinitcpio](https://github.com/archlinux/mkinitcpio)
40+
41+
Note that ZFSBootMenu does *not* replace your regular initramfs image. In fact, it is possible to use one of the supported generators to produce a ZFSBootMenu image even on Linux distributions entirely different program to produce their initramfs images (*e.g.*, `initramfs-tools` on Debian or Ubuntu).
42+
43+
ZFSBootMenu is capable of booting just about any Linux distribution. Major distributions that are known to boot without requiring any special configuration include:
44+
45+
* Void
46+
* Arch
47+
* Alpine
48+
* Gentoo
49+
* Debian and its descendants (Ubuntu, Linux Mint, Devuan, etc.)
50+
51+
Red Hat and its descendants (RHEL, CentOS, Fedora, etc.) are expected to work as well but have never been tested. ZFSBootMenu also provides several configuration options that can be used to fine-tune the boot process for nonstandard configurations.
52+
53+
Each release includes pre-generated images (both a monolithic UEFI applications as well as separate kernel and initramfs components suitable for both UEFI and BIOS systems) based on Void Linux. Building a custom image is known to work in the following configurations:
54+
55+
* With `mkinitcpio` or `dracut` on Void (the `zfsbootmenu` package will make sure all prerequisites are available)
56+
* With `mkinitcpio` or `dracut` on Arch
57+
* With `dracut` on Debian or Ubuntu (installed as `dracut-core` to avoid replacing the system `initramfs-tools` setup)
58+
59+
If you run Docker or [podman](https://podman.io/), it is also possible to build custom ZFSBootMenu images in a container. The [zbm-builder.sh](zbm-builder.sh) script provides a simpler wrapper that will use your own configuration in the current directory to produce custom images.
3760

3861
# ZFS boot environments
3962

0 commit comments

Comments
 (0)