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>
* Add a -r randomized name option, which creates Docker-style (roughly) random names from a dictionary file (words-en).
* Add the -p option to allow setting a pool name from the command line.
* Instead of naming the qemu-img file zfsbootmenu-pool.img, create the file as <pool name>-pool.img. This works cleanly with the default *-pool.img glob with ./run.sh -D <test setup.
* Check for imported pools that match the randomized or user-provided name, or files on disk that match either. If a file is detected with that pool name, or an imported pool matches that name:
- Append an indexed number to the pool name / file OR
- Generate a new randomized name
All pool name / file selection logic has been pushed into setup.sh; helpers/image.sh is now strictly responsible for creating a qemu image / pool.
Closes#152
It is sometimes helpful to have multiple active test setups, and it is
also convenient to be able to destroy a test setup with one command
rather than having to delete multiple different files and directories.
This command adds a `-D` argument to setup.sh, allowing all activity in
the setup script to occur within a specified directory. When a
subdirectory is not specified, a default of `test.$(uname -r)` is used.
The run.sh script is also now aware of the test directory, searching for
a default of `test.$(uname -r)` and allowing manual specification by
setting the TESTDIR environment variable. If the TESTDIR does not exist,
run.sh reverts to running from the CWD.
Also, the image-creation script has been pulled out of a heredoc in
setup.sh into a standalone script, making maintenance a little easier.
To further split testing/ apart from the base OS, the following is now
done:
- Create a duplicated dracut modules.d directory with symlinks to system
modules, and the git zfsbootmenu module
- Create a dracut.conf.d directory, with a default dracut config file
- Update local.yaml to use these two directories by updating
DracutConfDir and adding a new DracutFlags config option, with the
--local value passed to dracut
- setup.sh is now able to be run in sections, or as a single pass. It
internally uses sudo to create the test pool, install an OS onto it
and configure it.
Closes: #82