Commit Graph

58 Commits

Author SHA1 Message Date
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
classabbyamp a16297f9b3 remove remaining pod docs, references to them, and releng scripts 2022-12-22 20:58:28 -05:00
Zach Dykstra 5b61268d19
releng: add kpartx and wipefs to recovery images 2022-12-22 11:08:08 -06:00
classabbyamp 0064be524d releng/rst2help.sh: remove unhandled roles from docs before conversion 2022-12-21 16:42:18 -06:00
classabbyamp 586a1cfecb releng/tag-release.sh: update docs/conf.py on release 2022-12-21 16:42:18 -06:00
Zach Dykstra 19f5c378f5 documentation: adapt tooling to use rst docs 2022-12-21 16:42:18 -06:00
Andrew J. Hesford a58b5a27d5 releng/tag-release.sh: fix quoting bug for regular releases 2022-12-19 22:01:11 -05:00
Andrew J. Hesford e05f88ad52 releng: clean up EFI/tarball nomenclature 2022-12-19 21:16:25 -05:00
Zach Dykstra 977d0131bb
Clean up a few basic shellcheck warnings 2022-12-13 17:31:30 -06:00
Andrew J. Hesford 8f7a5eb33c releng/make-binary.sh: build properly with new container image 2022-12-02 00:01:14 -05:00
Zach Dykstra 71adb06065 releng: add zbm-efi-kcl to release files 2022-12-01 22:23:41 -06:00
Andrew J. Hesford 235eb17d1a Stop installing zpool.cache
None of the `zpool import` instances actually use the cache file, so
there is no value in including it in the initramfs.
2022-11-28 20:27:56 -05:00
Andrew J. Hesford bfb635fb48 releng/docker/image-build.sh: noextract the initramfs kernel hooks
Allowing dracut or mkinitcpio kernel hooks to build a system initramfs
inside the container just wastes space and time, so eliminate the hooks.
2022-11-28 09:41:45 -05: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 087892c37c releng/docker/zbm-build.sh: rename to build-init.sh
The in-container `zbm-build.sh` is hard to differentiate from the
`zbm-builder.sh` helper script.
2022-11-26 17:32:42 -05:00
Zach Dykstra 9f85003fa4 Include the OpenSSH client in recovery images 2022-10-30 14:40:32 -05:00
Andrew J. Hesford d4b35a0272 zbm-build.sh: don't upgrade packages when installing custom software
In cases where the `zfs` package has been updated since the container
image was built, this would trigger an upgrade of `zfs`; however, the
container does not include Linux headers by default, so the rebuild will
fail. Instead, skip the package upgrade. In the worst case, adding new
packages fails and the container image must be rebuilt.
2022-07-02 21:53:15 -04:00
Andrew J. Hesford cb033d9cb7 tag-release.sh: add all docs/ to the bump commit 2022-06-28 11:23:52 -04:00
Andrew J. Hesford 7bd69555a0 Use servercentral.com in ZBM build containers 2022-06-28 10:24:45 -04:00
Andrew J. Hesford 8db6cb3ff5 tag-release.sh: update location of CHANGELOG for change checks 2022-06-28 10:05:44 -04:00
Andrew J. Hesford 48b2cf9439 Enhance configurability of containerized builds
- Allow container images to include custom Void packages via
  image-build.sh

- Allow container instances to include custom Void packages via
  zbm-build.sh

- Allow specification of custom Void packages and volume mounts via
  user-facing zbm-builder.sh
2022-06-27 15:37:59 -04:00
Andrew J. Hesford 2c06e38d2c image-build.sh: force re-sync after updating xbps
If the xbps package is actually updated with

    xbps-install -Syu xbps

it seems that it invalidates locally cached repos. Forcing a resync when
updating the rest of the packages should be sufficient to avoid this
problem.
2022-06-24 16:56:42 -04:00
Zach Dykstra 327a218b6a
Add minimal man page for zbm-efi-kcl
Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2022-06-24 14:24:17 -05:00
Grzegorz Uriasz f1b0270806
Include cryptsetup in containarized builds
Closes #291
2022-04-26 11:51:33 -05:00
Zach Dykstra fc83894a69
Document scrolling keys in help viewer 2022-03-22 09:01:03 -05:00
Zach Dykstra 17fd12d2d2 Move all documentation to docs/ 2022-03-17 21:52:14 -05:00
Andrew J. Hesford 3dcaa88fdf Improve container-based builds and support mkinitcpio images
zbm-build.sh now tells the difference between old (pre-2.0) and new
repository layouts and will correctly set up its container to build in
either environment. The default buildroot has been moved to /build so it
is much easier to launch a build container with a single bind-mount that
contains a configuration as well as optional hostid and zpool.cache and
will hold a build/ subdirectory with build products afterwards.
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
Andrew J. Hesford 20a8ac7ca5 Add manual page for zbm-kcl 2022-01-26 10:05:12 -05:00
Zach Dykstra 4b836f3cf0 Generate release and recovery image builds 2022-01-23 10:21:29 -06:00
Zach Dykstra 914a3cdff3
Add script to prune old CI/CD workflows 2022-01-22 14:59:00 -06:00
Zach Dykstra 16b989107b Add a documentation linting stage
Both pod2man and pod2text default to 'die' on any POD formatting errors.
We can leverage that by enabling `set -e` in pod2man.sh and pod2help.sh.
tag-release.sh will now also trap any errors from either script and exit
accordingly.
2021-12-20 10:03:54 -06:00
Andrew J. Hesford 6789ee221d Provide, and use, a buildah script to construct zbm-builder images
Using buildah directly provides flexibility that can not be achieved
with a Dockerfile. It also prevents the layer problem that bloats image
sizes, avoiding the need to squash the image.

Closes #230.
2021-11-17 10:56:45 -05:00
Zach Dykstra 8a79492359
Hint to rEFInd that the EFI asset is actually a linux kernel 2021-11-13 00:12:37 -06:00
Andrew J. Hesford ca9d259fac releng/make-binary.sh: squash builder images to save space 2021-10-31 22:01:35 -04:00
Andrew J. Hesford a84a83e244 Dockerfile: add terminus-font as well 2021-10-31 21:05:58 -04:00
Andrew J. Hesford 4aecd68cd8 Dockerfile: add kbd to the build environment 2021-10-31 20:49:32 -04:00
Zach Dykstra 0a4cb29bc3
Include generated help-files in the version bump commit 2021-10-31 14:40:11 -05:00
Zach Dykstra ba523168f6
Enable support for verbose output in zbm-build.sh
To allow for a complete picture of what's happening when the component
and EFI assets are built under GitHub Actions, it's necessary to pass
'--debug' to generate-zbm. zbm-build.sh now supports passing arbitrary
arguments to generate-zbm by adding them after -- to the zbm-build.sh
commandline.
2021-10-28 12:58:48 -05:00
Zach Dykstra 87cd20b9e3
Bump Dockerfile / note --squash build arg 2021-09-21 22:03:12 -05:00
Andrew J. Hesford 459e6ed0df Move contrib/docker to releng/docker
Containerized builds are becoming a core part of release engineering, so
let's put the content there.
2021-08-03 22:14:11 -04: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
Andrew J. Hesford 83b176696d Overhaul, generalize containerized build scripts
Accept command-line arguments and environment variables to specify:
- BUILDROOT: the default source of config, hostid and zpool.cache files
- ZBMCONF: a specific configuration file to use inside the container
- ZBMOUTPUT: a directory where build artifacts will be copied
- HOSTID: a specific hostid file to be copied to /etc/hostid
- POOLCACHE: a specific cache to be copied to /etc/zfs/zpool.cache
- ZBMTAG: a tag to fetch if /zbm is not pre-populated in container

The zbm-build.sh script now overrides ImageDir values and removes
Global.BootMountPoint from any configuration, writing artifacts to a
temporary directory and copying them to the output directory after a
successful run.

When /zbm is not pre-populated, it is now built in-container from a
tarball fetched from github.com rather than a git clone. This reduces
instantiation time and lightens the dependency burden.

Closes: #195.
2021-08-03 22:14:11 -04:00
Andrew J. Hesford cfa045540b releng/make-binary.sh: use containerized image builds
Using podman to containerize the production of release assets avoids
potential leakage of personal information. To support this, the
containerized build script has been modified to separate the repo path
at /zbm from a "build" directory (previously /zbm/contrib/docker was
hard coded, now it's just the default choice). The releng script creates
a temporary directory to serve as the "build" path, populates configs,
and runs the build container with the current repo at /zbm and the
temporary directory at /build. The outputs are copied as before, with
the EFI executable standing alone and the kernel/initramfs components
stored in a gzipped tarball.

If the releng script does not find the expected builder image
(zbm-builder by default, but this can be passed as a second argument to
the script), it will invoke `podman build` to create the image.
2021-07-20 16:28:57 -04:00
Andrew J. Hesford 66da4507b2 tag-release.sh: accept empty response to push and tag 2021-07-02 08:13:30 -04:00
Andrew J. Hesford 38bb3fced5 tag-release.sh: prompt for final release tag 2021-07-02 08:11:04 -04:00
Andrew J. Hesford de0f5c8425 tag-release.sh: delay upstream push as long as possible
Pushes should happen after asset creation and signing so any failure
will leave the upstream repository in a pristine state.
2021-07-01 23:43:36 -04:00
Zach Dykstra 46151bb965
Release notes and fixes for 1.10 (#186)
* Prepare for v1.10.0

* Only load spl.ko if it's not already loaded

Arch loads spl.ko early, and insmod returns a 1 if the module is already
present. Check is ^spl is present via lsmod, if it's not present find
the path to the module on disk and load it via insmod.

* Split the return before the subkey handler

* Remove zbm.import_retries documentation

* zfsbootmenu.7: clean up zbm.import_delay, describe hard requirements with zbm.prefer

* zfsbootmenu.7: improve rootprefix discussion

* zfsbootmenu.7: clarify behavior of spl.spl_hostid

* Shorten embedded kcl now that new defaults are in

* Fix releng/make-binary.sh

* Detect if we can't remove the system 90zfsbootmeu directory and error
  out. The copy from our current git clone needs to be used.

* cd to our custom dracut directory so that the --local option to dracut
  picks up our custom dracut modules directory.

* Exit if for some reason generate-zbm fails.

Co-Authored-By: Andrew J. Hesford <ajh@sideband.org>
Co-Authored-By: Zach Dykstra <dykstra.zachary@gmail.com>
2021-07-01 18:51:57 -05:00
Zach Dykstra ed5d23bf4b
Move documentation to discrete files (#170)
Instead of embedding documentation in zfsbootmenu-help.sh, it will now find and display files on disk. This lets us embed zfsbootmenu.7.pod in the initramfs so that the full system integration documentation is available at runtime.

The downside to this is that there's no reasonable way to fold/wrap these lines. releng/pod2help.sh now pre-computes three different sizes of documentation - suitable for 80, 120 and 160 column displays. Extremely narrow displays will fall back to the documentation formatted for 80 character displays. It won't look great, but it'll be there.

The file display name in the help menu is extracted from the zfsbootmenu - <description> line in each file. The first few lines are then stripped to normalize the display of man pages and help pages.
2021-04-26 20:58:22 -05:00
Andrew J. Hesford 0a4b1f7f46 Use signify to sign binary assets
Closes: #161
2021-03-18 07:25:39 -04:00