Commit Graph

8 Commits

Author SHA1 Message Date
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 b521e28f7f zbm-builder.sh: generalize volume option to handle arbitrary options 2022-11-27 11:12:46 -05:00
Andrew J. Hesford 1d61421797 zbm-builder.sh: remove redundant option handling 2022-11-27 00:26:26 -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 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
James R. Todd 79829710cd zbm-builder.sh: support custom build/source paths and hooks
* Build from a local source tree with `-l`
* Override build directory with `-b`
* Include hooks in $BUILD_DIRECTORY/hooks.{early_setup,setup,teardown}.d
* Update command-line documentation and docs/BUILD.md

Co-authored-by: James R. Todd <toddy@toddy.cloud>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #282.
2022-03-24 09:53:58 -04:00
James Todd 1aca5d13c8 Bug fixes and use local repository option for zbm-builder.sh
Fixes for the `zbm-builder.sh` script.

Unlike Podman, Docker does not accept `.` or `./` as arguments for bind volumes at the command line. Modifying `zbm-builder.sh` to use `${PWD}` instead of `.` works for both Docker and Podman.

A typo in the default `config.yaml` causes `zbm-build.sh` to fail, fixed.

Added option to use a local repository as opposed to a remote one.

Currently, `zbm-build.sh` is hard-coded to pull the required tag from `zbm-dev/zfsbootmenu`. Adding this command line option allows builds using a local repository tree.
2022-03-05 17:33:13 -06:00
Andrew J. Hesford e1bd7081cf zbm-builder.sh: add script to build custom images using GHCR container 2022-01-27 12:54:09 -05:00