Commit Graph

47 Commits

Author SHA1 Message Date
classabbyamp 5b61ab9f2b bin/generate-zbm: support including a splash image in unified EFI bundles 2024-02-17 19:40:25 -05:00
Zach Dykstra 3ac3466d0d
recovery image: remove broken cryptsetup
More parts are apparently needed to make this functional. Remove until
it can be tested/verified as functional.

See #566
2023-12-21 09:09:46 -06:00
Zach Dykstra fd4d0129df recovery shell: ESP-related tooling
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.
2023-12-18 21:04:57 -06:00
Zach Dykstra 55f08b96bc generate-zbm: remove integrated syslinux support 2023-11-07 10:23:58 -06:00
Zach Dykstra 29a3c51507
release/recovery EFI: set loglevel=0 by default 2023-10-24 18:10:06 -05:00
Zach Dykstra 025361e922
release/recovery EFI: set quiet by default on KCL 2023-10-16 19:10:40 -05:00
Zach Dykstra 3f3e831e80
zfsbootmenu: make zbm.autosize a system hook
Vendor a subset of Terminus console fonts and add a basic installation
routine to Dracut/mkinitcpio modules.
2023-09-16 19:41:32 -05:00
Zach Dykstra 9b348b458a zfsbootmenu-core: disable spl_hostid warnings
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.
2023-09-16 18:34:51 -05:00
Andrew J. Hesford 640af57ad6 Refactor user runtime hooks installation and processing
- 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.
2023-09-12 21:15:04 -04:00
Zach Dykstra ff5956298a zfsbootmenu: refactor installation, support system and user runtime hooks
- 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>
2023-09-12 10:32:31 -04:00
Andrew J. Hesford 75b2395072 Add dm-crypt to recovery images, so cryptsetup works
Fixes: #468.
2023-09-08 21:39:40 -04:00
Zach Dykstra deefabd4df release,recovery: add tools to images
* 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
2023-07-17 08:30:37 -05:00
Zach Dykstra 534adcfc24
omit-drivers: blacklist intel screen orientation sensor 2023-02-03 20:46:53 -06:00
Zach Dykstra 84da18e64e contrib/: expand font setting capabilities
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.
2023-01-30 13:59:39 -06:00
Zach Dykstra 5b61268d19
releng: add kpartx and wipefs to recovery images 2022-12-22 11:08:08 -06:00
Andrew J. Hesford 5427883f17 Improve containerized builds
- "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
2022-11-26 17:33:44 -05:00
Andrew J. Hesford c023517a12 Automatically select initramfs generator when not forced
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.
2022-11-15 10:52:52 -05:00
Zach Dykstra 9f85003fa4 Include the OpenSSH client in recovery images 2022-10-30 14:40:32 -05:00
Andrew J. Hesford 91900d3576
Explicitly require bash, blacklist dash 2022-10-30 11:23:31 -05:00
gardar 9c91afa4f4 Make default efi path distro agnostic 2022-08-01 10:27:43 -04:00
Andrew J. Hesford 10e3624cee Exploit common configurations for recovery/release images 2022-07-01 11:10:23 -04:00
Andrew J. Hesford 1be8ed0fd3 Drop drm module from standard dracut config 2022-07-01 11:10:23 -04:00
Zach Dykstra ada36c8d38
Include cryptsetup in recovery images
Closes #292
2022-04-26 11:51:33 -05:00
Zach Dykstra fd52d7c876 Omit video drivers by default 2022-04-21 10:21:35 -05:00
Andrew J. Hesford 644b0f14c6 Use an early-setup hook to force console init in release images
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.
2022-02-12 08:46:06 -05:00
Andrew J. Hesford f93687f640 Annotate mkinitcpio.conf to explain ZBM specifics 2022-01-27 12:56:11 -05:00
Zach Dykstra 91b4b3bc4d De-prioritize Dracut as the primary generator
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>
2022-01-27 12:56:11 -05:00
Zach Dykstra 12fa3e990e
recovery image: switch to manual networking 2022-01-24 20:17:14 -06:00
Zach Dykstra 4b836f3cf0 Generate release and recovery image builds 2022-01-23 10:21:29 -06:00
Zach Dykstra 2497b0b7ba
Pare down release builds
* 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
2022-01-15 16:01:08 -06:00
Zach Dykstra 2c8eacc63a Add support early/late hooks in generate-zbm
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.
2021-12-10 10:26:05 -06:00
Andrew J. Hesford b3e3c3ef8c Move configuration out of make-binary.sh
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.
2021-08-03 22:14:11 -04:00
Zach Dykstra 24e6e6ae64 Blacklist plymouth; it directly conflicts with how we manage the tty 2021-05-26 18:05:16 -05:00
Zach Dykstra 4fc557a362 Remove rootfs-block blacklist
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
2020-10-27 15:56:37 -05:00
Zach Dykstra cd8f889498 omit rootfs-block; it will never generate a correct KCL 2020-09-21 20:30:14 -05:00
Zach Dykstra c96165c8f1 Omit systemd related modules
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.
2020-09-21 10:03:24 -05:00
Andrew J. Hesford 14b88b93f9 generate-zbm: enable components in config.yaml
Also force boolean output with --enable/--disable
2020-08-23 11:24:41 -04:00
Andrew J. Hesford 1e73ec96e2 Remove --- header from default YAML config 2020-08-10 10:56:18 -04:00
Andrew J. Hesford bf14f5f877 Move proposed.yaml into place as default config 2020-08-10 10:52:29 -04:00
Zach Dykstra 5c9c0b463b Release 0.8.1 2020-01-19 15:31:59 -06:00
Zach Dykstra 01b504f107 Usability fixes
- 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
2020-01-19 15:10:59 -06:00
Zach Dykstra 7586dfb8d4 Make syslinux use built components 2020-01-18 22:13:59 -06:00
Zach Dykstra 73776c277d Fix small issue with default config.ini 2020-01-07 21:51:00 -06:00
Zach Dykstra 09b1833297 Initial support for syslinux 2019-12-31 20:54:11 -06:00
Zach Dykstra 8707518746 Create generate-zbm which can be used to manage the lifecycle of the
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
2019-12-19 18:53:01 -06:00
Zach Dykstra 5c2bfb7041 Default to host-only initramfs creation 2019-12-10 11:19:13 -06:00
Zach Dykstra b7b9119395 Include etc directory layout for packaging needs 2019-12-08 22:09:56 -06:00