For those coming from the Arch ecosystem, mkinitcpio is a familiar tool. For others, let us clarify that it generates initial ramdisk environments (similar to Dracut or Booster) used during the boot process.
Essentially, it’s a Bash script that creates a compressed file system image that includes everything necessary to support the boot process before the main root filesystem is mounted.
The recent mkinitcpio 39 release brings several important updates and new features to enhance functionality and improve user experience. Hereโs what itโs all about.
mkinitcpio 39 Highlights
This update highlights the deprecation of global variables for accessing command-line parameters. Previously, scripts (known as hooks) that modify the boot process could use global variables to obtain these parameters.
Moving forward, mkinitcpio encourages developers to use the getarg
function instead. What necessitates this change? In short, it is part of a broader effort to modernize the tool and improve its robustness and security.
Moreover, the latest release introduces support for ARM zImage, expanding mkinitcpio’s compatibility with different architecturesโa welcome addition for developers working on ARM-based systems. Additionally, mkinitcpio 39 debuts a new hook, “install/acpi_override,” which facilitates ACPI table upgrades and overrides, further extending the tool’s customization capabilities.
Regarding changes to mkinitcpio itself, the placement of compressed files has been adjusted. They are now included in the early, uncompressed cpio instead of the compressed cpio. This modification avoids the inefficiency of double-compressing files, which can enhance boot speed, particularly on systems with less powerful CPUs.
Furthermore, the tool now defaults to decompressing module and firmware files during the boot process, which was previously a manual setting.
Other improvements include changes to file handling commands like add_file
and add_dir_early
, which enhance the tool’s flexibility and functionality. For example, add_file
now supports copying from file descriptors, allowing for more dynamic file operations during the boot process.
mkinitcpio 39 also updates lsinitcpio, a companion tool that lists, analyzes, and extracts from the initramfs images. It now supports new formats and provides more detailed output, which can be crucial for debugging and development.
Continuing with the changes, the packaging of mkinitcpio has also seen refinements, such as the integration of “mkinitcpio-generate-shutdown-ramfs.service” with various system targets to ensure smoother transitions during system power states like rebooting or shutting down.
Lastly, developers have also focused on refining the usability of mkinitcpio with various enhancements and bug fixes. These include improvements to how modules and files are included in the ramdisk, adjustments to default file permissions to enhance security, and more.
Check out the changelog for more details and the complete list of novelties in mkinitcpio 39.