2.3 KiB
How Dracut and OSTree Work Together
The Fedora discussion explains the relationship between Dracut and OSTree:
-
Initramfs Generation: In OSTree systems, the initramfs is generated when building the OSTree commit, not on the target system. The
98ostree/module-setup.shmodule ensures the initramfs contains the necessary hooks for OSTree's pivot root magic. -
OSTree Integration: OSTree manages the boot process directly through code like
ostree-bootloader-grub2.c, and both the kernel and initramfs are stored in the OSTree commit. -
Local Rebuilds: If you override kernel packages, rpm-ostree can rebuild the initramfs locally and place it in the appropriate location in a locally generated commit.
Modern Approaches for Initramfs Customization
The GitHub issue discusses a more sophisticated approach called initramfs-setup that's being developed for Universal Blue projects:
Benefits of File-Based Approach
- Cleaner deployments: Uses files instead of kernel arguments, making it easier to track and remove modifications
- Seamless rebasing: Automatically handles cleanup when switching between different images
- Better maintainability: Supports abstracted modifications through YAML files
Current Implementation Challenges
The discussion mentions that existing implementations like Bazzite's bazzite-hardware-setup have limitations:
- Manual intervention required for some operations
- Limited logging and automatic detection capabilities
- Potential conflicts with RPM packages that also modify initramfs
Practical Methods
For including files in initramfs on Fedora OSTree systems, you have several options:
- rpm-ostree initramfs: Use
rpm-ostree initramfs --enableto rebuild initramfs with custom configurations - Dracut modules: Create custom dracut modules to include specific files
- Container-based builds: Use projects like BlueBuild to create custom images with initramfs modifications baked in
The trend seems to be moving toward more automated, container-based approaches that handle initramfs modifications as part of the image build process, making them more maintainable and reducing the chance of conflicts during system updates.
Would you like me to elaborate on any specific aspect of these approaches or help you implement a particular solution?