Add support for building grml ISOs with zfs
authorAndrás Korn <korn-github.com@elan.rulez.org>
Sun, 21 Aug 2022 08:38:22 +0000 (10:38 +0200)
committerAndrás Korn <korn-github.com@elan.rulez.org>
Sun, 21 Aug 2022 08:38:22 +0000 (10:38 +0200)
commit48f94bbb6a097f02f984d87a0b165093056a901b
tree88efcf09b88ed758c6f97191ede21705b7fe9031
parent6f72e3fc92a467723c27f8aca3cc026d839ffa06
Add support for building grml ISOs with zfs

The `ZFS` FAI class will, via the `instsoft.ZFS` hook, install the packages
needed to build the zfs modules, build the zfs modules, then remove the
development packages again to avoid bloating the ISO. The ZFS
`package_config` now only installs `zfsutils-linux` so that the iso contains
the userspace zfs tools.

In my tests, the ZFS class now only increases the size of the ISO by about
3MB.

I wanted to rely on apt autoremove to get rid of automatically installed
packages, but for some reason as of 2.5.2 autoremove doesn't actually remove
some of the development packages (e.g. gcc-11) even though they're Priority
optional, marked as auto-installed, and not depended on by anything that
isn't auto-installed.

So, to avoid bloating the ISO with hundreds of MB of development packages,
the `instsoft.ZFS` script works out which packages it installs and removes
those explicitly, using potentially brittle parsing of `apt-get` output.
This has been tested to work and should do until a better solution is found.
etc/grml/fai/config/hooks/instsoft.ZFS [new file with mode: 0755]
etc/grml/fai/config/package_config/ZFS