Add a mount_esp helper with tab completion. This is a very thin wrapper
over the new mount_block function.
Add the relevant kernel modules to the optional modules list for both
dracut and mkinitcpio images. Explicitly add the same modules to the
release/recovery shared config.
The default behavior of hostid matching is useful to have on in binary
releases. However, it generates a warning message that isn't really
relevant for users of that build.
It's expected that the spl_hostid value in ZFSBootMenu.EFI won't match
the local pool hostid - advising these users to manually set `spl_hostid`
on the ZBM KCL runs counter to how we recommend ZBM should be used.
- Add new hook points: load-key.d and boot-sel.d
- All hooks are installed in hook-point-specific subdirectories of
/libexec/hooks instead of in the top-level /libexec
- User hooks are recognized in level-specific subdirectories of a
zfsbootmenu_hook_root defined for dracut or mkinitcpio
- Deprecate zfsbootmenu_{early_setup,setup,teardown} variables
- Take advantage of zfsbootmenu_hook_root to simplify hooks in container
builds via zbm-builder.sh
- Simplify zbm.hookdir overrides
Closes: #477.
- All core components, docs and runtime hooks are handled by a common
install_helper that is aware of both dracut and mkinitcpio methods
- Installation now adds "system" runtime hooks in addition to those
configured by the user; user hooks with names that conflict with
system hooks will "mask" the system version
- The hooks `10-console-init.sh` and `xhci-teardown.sh` have been
elevated to "system" status and are always installed in ZBM images
- The `zfsbootmenu/hook` path has been renamed to `zfsbootmenu/pre-init`
to avoid confusion with the new `zfsbootmenu/hooks` directory of
system runtime hooks, and the dracut-only `hook` scripts have been
moved to the dracut module
- A new `zbm.skip_hooks` command-line argument allows a comma-separated
list of hooks to skip (matched on basename only) to provide an easy
mechanism for skipping default hooks without `zbm.hookroot`
- Create the `zfsbootmenu-run-hooks` libexec helper, allowing easy
addition of future hook points.
Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.org>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
* Add ca-certs to recovery image, so cURL can connect over HTTPS
* Add sgdisk to recovery image
* Add zbm-kcl / zbm-kcl.8 documentation to release and recovery images
Closes#400
ZFSBootMenu binary releases use a default font size that's barely
suitable for 2k screens and entirely unsuitable for 4k screens. In an
attempt to fix this, a new script has been added that introduces
automatic console font resizing.
Utilizing the Terminus font, we can pick a range of bold font sizes to
better match screen resolutions. Working backwards from the largest to
the smallest, the hook simply runs `setfont` and then checks if COLUMNS
is at least 100 characters. If it is not, the next font is selected and
it tries again.
Based on documentation, Terminus fonts prefixed with a 'v' have all
mappings/codepages in them; so they should support the maximal number of
languages.
contrib/20-console-autosize.sh is included in all release and recovery
images. The automatic font setting behavior can be disabled via
zbm.autosize=(0|off).
contrib/console-init.sh has been renamed to ensure it precedes this
hook, since 10-console-init.sh calls console_init from Dracut, which is
hard-coded to set a console font. Since console_init also performs setting
a keymap, it should always be executed.
The legacy behavior of setting a font via rd.vconsole.font
overrides/disables zbm.autosize.
- "Tiered" configuration simplifies management and allows more targeted
overrides, symlinking configs in `/etc/zfsbootmenu` in the container:
1. First tier comes from `etc/zfsbootmenu` (global defaults)
2. Second tier comes from `etc/zbm-builder` (container defaults)
3. Third tier comes from the build root (build specific)
Configurations in later tiers override those with conflicting names in
earlier tiers.
- Tiered configuration now includes mkinitcpio configuration, allowing
containers to build mkinitcpio images
- Container configuration for mkinitcpio supports dracut-style snippets
in `mkinitcpio.conf.d`
- The builder now looks for an `rc.d` subdirectory in the build root and
will invoke every executable file therein before generating images to
provide a means to "terraform" the build container
- The `zbm-builder.sh` wrapper now supports a configuration file to
allow defaults to be specified; this requires a two-pass getopts to
find and load the configuration file before parsing remaining options
- A new option to `zbm-builder.sh`, `-R`, will remove any existing host
files (`hostid` and `zpool.cache`) from the build root to make sure
they are always up to date with the host versions
- The container entrypoint now configures `generate-zbm` to write its
output directly to the desired output directory rather than staging in
a temporary output directory, allowing `generate-zbm` to manage
version rollovers as it does in host installations
- Remove superfluous arguments from container entrypoint to manage
`hostid`, `zpool.cache` and `config.yaml`; the files either exist in
the build root or the container will use defaults
- Drop `docker-compose.yml` and now-obsolete `config.yaml.default`
- Update documentation to better reflect current build procedure
If no command-line or configuration option to force one of dracut or
mkinitcpio is specified, prefer dracut if the command is available and
mkinitcpio otherwise.
Setting rd.hostonly=0 in the release and recovery images causes dracut
to throw out the initqueue hooks that ZBM installs to force the event
loop to fire at least once. As a result, the console is often not
initialized before ZBM takes control. ZFSBootMenu early-setup hooks
provide a convenient place to force the console initialization, allowing
things like fonts and keymaps to be set before password prompts might
appear.
All core ZFSBootMenu libraries / hooks / binaries have been moved to a
generic 'zfsbootmenu' directory intended to be installed in /usr/share.
The dracut-specific module-setup.sh script has been moved to a 'dracut'
directory and it, along with the 'initcpio' hook scripts, have been
adapted to use common tooling in 'zfsbootmenu/install-helpers.sh'. Both
of these refer to the core components in '/usr/share/zfsbootmenu' when
creating a new image. The zbm-kcl utilit looks there by default.
The testing tools are now capable of producing images with mkinitcpio.
Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
* nvdimm is unrelated firmware bits, seemingly for powerpc
* fs-lib provides fsck binaries - these can be safely omitted
* rootfs-block adds cmdline hooks, we don't ever need Dracut to dig around to find a root filesystem
* dm installs udev persistent rules, dmesetup, etc
* dmraid adds a hook for dmraid storage
* crypt adds two hooks - one for a key device, one to parse luks
Closes#247
Since generate-zbm only knows how to manage one ESP, it can be a
challenge to keep multiple redundant ESPs up-to-date on a system. To
help with this, Global.PreHooksDir and Global.PostHooksDir can now be
defined to point to a directory of executable hooks. These are executed
without any additional environment context or arguments.
The more general approach to containerized image builds makes it easier
to move configuration logic out of make-binary.sh to static configs and
volume mounts.
rootfs-block is a dependency of crypt, which is required for users with
zpools on top of a LUKS container. rootfs-block can cause problems with
host only configs, but those are not enabled/supported out of the box.
Closes#88
Per the discussion in #81, systemd-related Dracut modules cause problems
with the execution of our pre-mount hook. If the modules aren't present
on a system (ala Void) there are no issues omitting them.
- Add the ability to automatically mount/unmount an EFI or syslinux
partition before generating any files.
- Change execute to return an array, with the status code as the final
array item.
- Add a fix for petitboots brainded syslinux.cfg parser. Any kernels
ending in .0 are stripped - so v0.x.0 releases are 'broken'. Appends
_1 to all versions to work around this behavior.
- Merges in kernel version sorting via Sort::Versions
initramfs, kernel and combined EFI image needed to boot a system.
This script is considered beta, ensure you have backups of the files in
your ESP before using it.
Remove old void packages