- 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
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.
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.
- 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
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.
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.
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.
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>
- 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>
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.
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.
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.
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.
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.
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.