Commit Graph

112 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
classabbyamp 4a034bef96 *: prefer systemd-boot stub to gummiboot
supported on more versions of linux (6.2+ without EFI_HANDOVER) and
supports more features (like splash images, better secureboot support)
2024-02-17 19:40:25 -05:00
Andrew J. Hesford f6812600f0 Bump to version 2.3.0+dev 2023-12-12 21:43:04 -05:00
Andrew J. Hesford 864cac1991 Bump to version 2.3.0 2023-12-12 21:08:03 -05:00
Zach Dykstra 3859fd5974
bin/zbm-kcl: fix a comment typo 2023-12-11 17:31:07 -06:00
Andrew J. Hesford 9d7eba40d1 Improve version handling in the repository and ZBM images
- Track installed version in ${zfsbootmenu_module_root}/zbm-release

- Install zbm-release as /etc/zbm-release in ZFSBootMenu images

- Add releng/version.sh to manage repository versioning

- Mark post-release development versions as part of release tagging

- Improve version handling in ZFSBootMenu build containers:

  * zbm-builder.sh: allow temporary, writable overlays of /zbm

  * releng/docker/build-init.sh: update ZBM version when possible

  * releng/docker/image-build.sh: install git in standard images
2023-11-26 15:03:46 -05:00
Zach Dykstra 55f08b96bc generate-zbm: remove integrated syslinux support 2023-11-07 10:23:58 -06:00
Andrew J. Hesford 60128db05d bin/zbm-kcl: use proper offset when overwriting EFI KCL
The overwrite will use the gap between the .cmdline section and the next
higher section as the maximum size for new KCLs. In practice, alignment
requirements in the stub loader mean that the maximum KCL size is likely
to be 4 kB.
2023-10-25 09:18:41 -04:00
Andrew J. Hesford 943252be08 Bump to version 2.2.2 2023-10-24 23:17:57 -04:00
Zach Dykstra 5607d5db6a
bin/generate-zbm: add .linux section last
systemd-boot's ukify script recommends adding the .linux section last so
that when it's decompressed, it doesn't overflow other sections.

https://github.com/systemd/systemd/blob/main/src/ukify/ukify.py#L774-L817
2023-10-24 14:54:20 -05:00
Zach Dykstra 0893838236 bin/generate-zbm: use mkinitcpio method to calc offsets
Newer versions of the EFI stub provided by systemd-boot are incompatible
with the method used by generate-zbm to add sections to the output
bundle. mkinitcpio uses a process that evaluates the sizes of each
component being combined into the EFI bundle and adjusts their section
VMA accordingly.

This has been tested with the latest systemd-boot EFI stub and the most
recent Gummiboot EFI stub.
2023-10-24 10:13:10 -05:00
Zach Dykstra cbae0d0fd7 Bump to version 2.2.1 2023-10-13 16:02:36 -04:00
Andrew J. Hesford 05e42d52be Bump to version 2.2.0 2023-05-21 19:21:30 -04:00
Andrew J. Hesford ddcee9dd2e generate-zbm: allow globs for kernel-version specs
Closes: #420.
2023-03-28 11:08:37 -04:00
Andrew J. Hesford c28a44f023 zbm-kcl, zbm-efi-kcl: unify, allow streaming EFI modifications
- Copy necessary functions from zfsbootmenu/lib/zfsbootmenu-kcl.sh to
  avoid a dependency on this file at runtime

- Expand concept of "boot environment" to include "ZBM EFI executable"

- Allow streaming manipulations of EFI executables with "-" indicating
  stdin as a source and stdout as a destination
2023-01-13 22:20:50 -05:00
Zach Dykstra d73fad86fd
UEFI: improve stub handling
* Note the package requirement for Debian
* Improve error handling and messages in generate-zbm

Closes #394
2023-01-05 15:23:05 -06:00
classabbyamp b15890a0de docs/man/: convert pod manpages to rst
- re-title config.yaml manual page
- pregenerate manpages in docs/man/dist
2022-12-20 21:53:42 -06:00
Andrew J. Hesford cdd41637c0 Bump to version 2.1.0 2022-12-19 21:16:47 -05:00
Zach Dykstra 7b9d4221db deprecation: remove big endian checks
With the removal of `skim` support, we no longer have a fuzzy finder for
64bit Big Endian systems. As such, there's no need to do any endianness
checks in a few option paths.
2022-12-10 10:04:26 -06:00
Andrew J. Hesford 5dabcdad33 bin/generate-zbm: add --showver argument to report ZBM version
Also always print $VERSION in creation messages, rather than using
whatever value might be set by Global.Version or --version; those
variables only govern the version string added to output images.
2022-12-02 00:01:14 -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
Andrew J. Hesford a3f15ed982 generate-zbm: deprecate syslinux support 2022-11-02 12:41:46 -04:00
Zach Dykstra 2fa207ee90
fix: ensure $uefi_stub is defined before checking if it is a file 2022-08-15 18:50:27 -05:00
Andrew J. Hesford fb98c59851 Bump to version 2.0.0 2022-06-28 11:24:47 -04:00
Zach Dykstra 8933a577e1 Basic EFI KCL editor 2022-05-03 09:21:52 -05:00
Andrew J. Hesford 7548af5a8c zbm-kcl: remove dracut from ZBM_MODULEDIR warning 2022-02-14 22:09:50 -05:00
Zach Dykstra 2bd6757e14 generate-zbm: remove INI migration support 2022-02-03 14:37:53 -06: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
Andrew J. Hesford af34fa9904 Support building mkinitcpio images in generate-zbm 2022-01-27 12:56:11 -05:00
Andrew J. Hesford 520f78da20 zbm-kcl: fix typo in usage
Closes: #250.
2022-01-26 16:35:06 -05:00
Zach Dykstra 70b5a2132f
Bump to version 1.12.0 2022-01-25 20:44:48 -06:00
Zach Dykstra 46b0eb9b7f Completely rewrite KCL handling
- For internal manipulation, tokenize KCLs with one argument per line,
  respecting double-quoted arguments

- Add functions to suppress and append arguments that work on
  stdin/stdout by simply dropping or adding lines as appropriate

- Use the new capability to parse the KCL for ZBM, replacing the
  dependency on dracut-lib.sh with simpler and more correct functions

- Manage a cache of the ZBM KCL at $BASE/zbm.cmdline and prefer it when
  searching for arguments, rather than repeatedly assembling a KCL from
  /etc/cmdline, /etc/cmdline.d/*.conf and /proc/cmdline

- Move zbm-kcl remove/append capability to new library functions

Closes: #244.

Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2022-01-07 16:11:05 -05:00
Andrew J. Hesford bd736f161f Add a shell utility to modify and review KCL properties
Closes: #243.
2022-01-06 21:47:33 -05: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 8a5d71ee5c Bump to version 1.11.0 2021-10-31 17:03:44 -04:00
Zach Dykstra 86e0743081 Bump to version 1.10.1 2021-07-04 12:51:43 -05:00
Andrew J. Hesford f65771797f generate-zbm: fix hostid comparison 2021-07-02 10:14:43 -04:00
Andrew J. Hesford 48cf438341 Bump to version 1.10.0 2021-07-01 23:45:50 -04:00
Zach Dykstra 64bd359687
Set a hostname in ZBM, check if spl.spl_hostid matches /etc/hostid
Set a hostname in ZFSBootMenu so that read-write pool imports reflect that we were the last host to import the pool.

If spl.spl_hostid is non-zero, compare the value to what is recorded in /etc/hostid. If they're different generate-zbm will print a warning but take no action.
2021-04-10 16:09:19 -05:00
Zach Dykstra 93765ba313 Bump to version 1.9.0 2021-03-29 22:37:43 -05:00
Zach Dykstra 7e1a98be72 When debug mode is enabled, do not set -q on the dracut command line 2021-02-18 16:23:37 -06:00
Andrew J. Hesford a6e02c0759 Only specify `--uefi-stub` when EFI.Stub is configured
When `--uefi` is passed to dracut without a `--uefi-stub` argument, it
looks first for a stub provided by systemd-boot and, if one isn't found,
for a stub provided by gummiboot. The gummiboot location agrees with our
default location at /usr/lib/gummiboot/linuxx64.efi.stub.

By dropping the `--uefi-stub` unless the `generate-zbm` configuration
explicitly specifies a value, `generate-zbm` should work out of the box
on systems that use gummiboot as well as its successor, systemd-boot. If
a user specifies a value in EFI.Stub, the `--uefi-stub` argument will be
passed with the configured value.

Fixes: #135.
Closes: #138.
2021-01-16 23:17:12 -05:00
Andrew J. Hesford 893cbe9d41 Improve kernel version detection.
The dracut lsinitrd utility determines kernel versions by looking for
strings of the form `[0-9]+\.[0-9]+\.[0-9]+`, so we might as well adopt
similar logic to try to recover versions when the file name is not
sufficient. This improvement attempts to parse both the file name and
kernel strings for version-like sequences. If it finds both, they must
agree or the kernel is ignored; if it finds only one source of
versioning, that is preferred automatically.

With more reliable version detection, we can again relax the kernel
detection to look for `/boot/<prefix>` rather than requiring the more
strict `/boot/<prefix>-<version>`, and an output kernel prefix becomes
just the name of the kernel with the determined version removed (if it
exists).

This *should* allow Arch users to rely on automatic version detection
rather than requiring explicit specification of the kernel path and
version. This also allows Arch users to run `generate-zbm` after
updating a kernel package but before rebooting, when using a
`%{current}` version string will fail because `/lib/modules/$(uname -r)`
has been removed and the kernel file is of a different version anyway.

Closes: #132.
2021-01-16 16:54:56 -05:00
Andrew J. Hesford ac8a8edafb Bump to version 1.8.1 2021-01-12 10:17:15 -05:00
Andrew J. Hesford ab95346f4c Expect names of the form <prefix>-<version> when finding latest kernel
If a specific kernel version is not defined in config.yaml, the name of
the kernel is split on the first '-' to determine the prefix and the
version. If no version can be found, this is a hard error.

The latestKernel subroutine is only called if neither a kernel path nor
the kernel version is specified, which means its output will always be
split on '-' to identify a prefix and a version. Thus, in the
subroutine, only look for files of the form <prefix>-*, silently
ignoring kernels with non-conforming names. This allows for clean
operation if at least one kernel does match the expected pattern, and
also provides for more meaningful error messages if no kernels match the
expected pattern (for example, on Arch).

Fixes #128.
2021-01-06 12:25:06 -05:00
Andrew J. Hesford df382a4c9e Bump to version 1.8.0 2020-12-15 10:36:02 -05:00
Andrew J. Hesford d559b96505 Improve key handling
The key_wrapper function has been collapsed into load_key, which tries
to do the right thing when handling encryptionroot and unencrypted
filesystems. The mount_zfs function now also checks if a filesystem is
locked and, if so, fails the mount; because mount_zfs tends to be run in
a subshell, attempting to mount a locked dataset will hang.
2020-12-05 11:50:28 -05:00
Zach Dykstra 25baa486e9 Log dracut command, add man page documentation 2020-12-02 00:38:07 -05:00
Andrew J. Hesford 3f02b8f358 Prevent copying of partial files when target volume is full
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
2020-12-02 00:38:07 -05:00
Andrew J. Hesford 258d18a19b Merge fuctionality of createInitramfs and unifiedEFI 2020-12-02 00:38:07 -05:00