Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mkdumprd: explicitly add dracut 99squash module
The handling of compression in the initrd currently is a total mess. There are multiple problems: 1) It is handled in two different locations, mkdumprd and 99kdumpbase, making the code unnecessarily complex. 2) While mkdumprd only adds the --squash-compressor option when there is no compression requested in kdump.conf:dracut_args, 99kdumpbase unconditionally adds the 99squash module. But once 99squash is added dracut ignores all compression options passed on the command line and produces an uncompressed initrd (assuming the compression is done in the squashfs image). So adding a compression option to dracut_args will neither compress the initrd nor the squashfs image. 3) To depend on 99squash, 99kdumpbase only checks whether the required kernel modules are present but doesn't check whether the squashfs-tools are installed. This can lead to failures when building the initrd as 99squash fails to install. At the moment this only works as the dracut-squash rpm depends on the squashfs-tools. But once support for erofs is added this might no longer be the case. 4) In case 99squash cannot be used mkdumprd compresses the initrd with zstd. But that doesn't really makes sense. For one compressing the initrd only reduces the on-disk size but not the memory usage during runtime of the initrd. Plus in case no compression is specified dracut will automatically compress the initrd. For that it checks for the 'best' available compression algorithm with zstd being the default. Clean this mess up be moving everything to mkdumprd, only addding 99squash when there is no compression given in the dracut_args, drop setting the --compress option and, only include 99squash when the squashfs-tools are installed. Note: Only checking the squashfs-tools is sufficient as it doesn't make sense to have them installed, when the kernel doesn't support squashfs. There might be a use case to build images that then get used on an other machine where the kernel supports it. But as the initrd is build with --hostonly that is no use case we need to consider for kdump. Signed-off-by: Philipp Rudo <[email protected]>
- Loading branch information