feat: add initramfs rebuilding with support for user defined initramfs args #586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds come needed flexibility to how bazzite-hardware-setup handles initramfs args.
Changes:
Added
/etc/bazzite/initramfs/
as $INITRAMFS_DIRAdded
/etc/bazzite/initramfs/args.d/
as $INITRAMFS_CUSTOM_ARGS_DIRRebuilding to load new modules or user args
Creating the file
/etc/bazzite/initramfs/rebuild
will now trigger a rebuild of initramfs on the next boot and then reboot when the build is done to then load the new initramfs.This makes it possible for users to add dracut drivers and configs to
/etc/dracut.d/
and then rebuild initramfs without jumping through hoops to trickbazzite-hardware-setup
into thinking something is wrong with the initramfs args, rebuilding initramfs twice or manually do a rebuild which will have its args removed next time bazzite updates initramfs...Initramfs argument configuration
bazzite-hardware-setup
will now generate it's needed initramfs args like before (so no changes needed), but will write them to$INITRAMFS_DIR/hardware-setup.args
for storage, this is because rpm-ostree has no good way to just give you the initramfs arguments you have used without parsingrpm-ostree status
, which can lead to wrong results.NOTE: some initramfs args requires you to pass
--arg
multiple times torpm-ostree
andrpm-ostree initramfs
does not show you which args belong into their own--arg
parameter, hence the need for this file.Building initramfs
When
bazzite-hardware-setup
builds initramfs, it will get the generated hardware-setup args from thehardware-setup.args
file and any custom arguments from$INITRAMFS_CUSTOM_ARGS_DIR/args.d/
.The files inside the
args.d/
directory can have comments and can be written as single lines or as multiple lines, as bazzite-hardware-setup will combine all the files (excluding commented lines) into a single initramfs argument, this will be done alphabetically by filename.For consistency and simplicity the initramfs arg files will follow the same syntax for initramfs arguments as
rpm-ostree initramfs --help
This means the files will be 1:1 with the
rpm-ostree initramfs --enable
command and easy to parse and understand.Added example file for user defined initramfs args
The example file can be found in
$INITRAMFS_CUSTOM_ARGS_DIR/args.d/00-example.conf
hardware-setup.args
This file is currently generated by
bazzite-hardware-setup
and will always reflect whatever the last "hardcoded" initramfs args for the users system will be based on the lastHW_VER
bump, this file should not be edited by the user as any changes will be overwritten the next timebazzite-hardware-setup
detects missing needed initramfs arguments.