mkinitcpio - Arch Linux initramfs generation tools

CHANGES WITH v37.2:

        Bugfix release:

        * Fix tests to use system library loading mechanism instead of absolute
          paths.
        * Check if the parent directory is a symlink when adding a file. Add
          the full target directory and create the symlink to avoid placing
          duplicate files in the image thus increasing its size.
        * install/block: quote module names suffixed with "?" to prevent
          interpreting them as file globs.
        * 50-mkinitcpio.install: pass path to kernel image to mkinitcpio to
          avoid issues with a kernel image in a non-standard location.
        * kernel-install: account for upstream changes to the default value of
          KERNEL_INSTALL_UKI_GENERATOR.

        Contributions from: Levente Polyak, Thomas Weißschuh, cvlc12, nl6720

        – 2024-01-15

CHANGES WITH v37.1:

        Bugfix release:

        * The 40-microcode.install kernel-install script was missing from the
        Makefile.

        Contributions from: nl6720, Vladimir Kochnev

        – 2023-12-03

CHANGES WITH v37

        Breaking Change:

        * add_module_from_symbol has been renamed into
          add_all_modules_from_symbol.

        New Features:

        * add_checked_modules_from_symbol imports modules based off on the list
          generated by the autodetect hook. Similar to add_checked_modules.

        Changes in mkinitcpio:

        * Kernel version parser now supports zboot images.

        * /usr/local has been removed from the exported paths.

        * Drop-in configurations in /etc/mkinitcpio.conf.d/ and /etc/cmdline.d/
          can now be symlinks.

        * The kernel-install script was split into two scripts. One processing
          microcode (40-microcode.install) and one script for the assembly
          (50-mkinitcpio.install).

        * mkinitcpio will now to try to accurately detect the UEFI architecture
          during UKI generation.

        * The error message when binaries are not found will now be more
          helpful and include the name of the binary.

        Changes in hooks:

        * install/autodetect will now give up on autodetection if there are
          no modules found, or when encountering an error.

        * install/autodetect will attempt to retry its uevents lookup to try
          and avoid a race condition with udevadm settle.

        * install/consolefont now includes the setfont binary. Meaning the
          console font will now be loaded using the kbd project's setfont
          instead of the busybox's built-in one.

        * install/sd-vconsole now defaults to the 'us' keymap if there are no
          KEYMAP specified in /etc/vconsole.conf.

        * install/keymap and install/sd-vconsole now supports KEYMAP=@kernel in
          /etc/vconsole.conf which preserves the kernel keymap.

        * hook/consolefont now has a hack to ensure the font is changed during
          quiet boot.

        * install/block will now include all PCI controller modules to support
          virtio-blk devices.

        * install/autodetect got several changes that will more accurately try
          to find the correct kernel modules.

        * install/block will now include Linux voltage and current regulator
          modules as some MMC controllers require them.

        * install/sd-vconsole now installs systemd-vconsole-setup.service.

        * install/filesystems now attempts to unconditionally include external
          mount helper binaries needed by some filesystems.

        * install/block has had changes to it module list. This only affects
          unconditionally added modules, autodetect will still include them if
          they are in use.

            Removals:
                * sr_mod
                * firewire-sdp2

            Includes:
                * uas
                * virtio_scsi
                * achi
                * nvme

        Changes in packaging:

        * The libalpm hook has a new path target (usr/lib/firmware/*) to ensure
          the initrd is rebuilt when firmware packages are updated.

        * The libalpm hook will now rebuild the initramfs when there has been
          changes to /usr/src/*/dkms.conf. This is to ensure DKMS modules are
          always updated in the initramfs.

        Contributions from: classabbyamp, cvlc12, Damon Harris, Emil Velikov,
        Evan James, Felix Yan, Gene C, Leo Pham, Maxim Mikityanskiy,
        Morten Linderud, nl6720, solsTiCe d'Hiver, Xiaotian Wu

        - 2023-11-15

CHANGES WITH v36:

        New Features:

        * Kernel command line options can now be read from the drop-in directory
          /etc/cmdline.d/.

        * mkinitcpio can now be configured from the drop-in directory
          /etc/mkinitcpio.conf.d/.

        * Hooks can now use a find_module_from_symbol function to include modules
          based on symbol lookups. This is useful to include all modules that
          provide a given function, instead of including all of them.

        * The --no-cmdline option omits embedding the kernel command line files,
          allowing to pass kernel command line options directly through the boot
          entry. This is practical if you need to retain the ability to edit
          these options, or overrride them during boot.

        Changes in mkinitcpio:

        * preset_options can now be a bash array.

        * Created UKIs now contain a .uname section in the binary.

        * The VERSION_ID in a UKI osrel section is now suffixed with the
          mkinitcpio preset name (except for "default"). This makes it easier
          to distinguish images generated for different kernels.

        Changes in hooks:

        * A regression was fixed where the busybox init hook did not wait for
          devices to come online before resolving them.

        * run_emergencyhook is a new function that allows running functions
          before the emergency shell is launched.

        Changes in packaging:

        * Split out make install into two new targets.
          install-generator installs the generated scripts from make prepare
          along with kernel-install hooks.  install-hooks installs the alpm
          hooks. install by defaults now runs both of these targets.

        Contributions from: Adam Maroti, Balló György, cvlc12, Joel McBride,
        Markus Weippert, Morten Linderud, nl6720, Yishen Miao

        – 2023-05-26

CHANGES WITH v35.2:

        Bugfix release:

        * install/sd-vconsole: include font map and font unimap files in the
          initramfs.

        * Fix support for adding firmware files that a kernel module specifies
          using glob syntax.

        * Do not show a misleading "Possibly missing firmware for module"
          warning when a firmware file was already added once.

        * install/keymap: make sure keymap file adding works on non-UTF-8
          locales.

        Contributions from: Balló György, nl6720

        – 2023-03-24

CHANGES WITH v35.1:

        Bugfix release:

        * mkinitcpio failed to setup the required files in /dev/fd to support process
          substitution. This resulted in hooks/resume failing to work after a shellcheck
          fix up.

        Contributions from: Morten Linderud

        – 2023-03-19

CHANGES WITH v35:

        New Features:

        * mkinitcpio now has support for post-generation hooks. These can be
          used to act on generated initramfs images such as Secure Boot signing.
          The feature is documented in the mkinitcpio(8) man page.

        Changes in mkinitcpio:

        * Improved code quality of scripts with shellcheck.

        * Replaced hexdump usage with od.

        * The makefile was taught `coverage` which generates a coverage report of
          mkinitcpio.

        * Several improvements on the symlink handling of mkinitcpio.

        * add_binary was taught to check for script interpreters and warns about
          missing interpreters.

        * UKIs are now generated with dynamically allocated section sizes instead
          of the previous hard coded values.

        * xz compression is now always executed in "multithreaded mode" through
          the -T0 switch after the xz utilitiy's recent improvements in reproducibility.

        * Several fixups to improve consistency for msg/error/warning messages.

        * Preset scripts are now documented in the mkinitcpio(8) man page.

        * mkinitcpio will now attempt to more thoroughly clean up its temporary files upon
          exit.

        * Modules included in the initramfs now retain their permissions instead of being
          hard coded to 644.

        * The kernel-install script will now utilize the staging area as expected by
          systemd.

        * The init script now passes file system labels, file system UUIDs, partition
          labels and partition UUIDs directly to the mount and fsck commands instead of
          resolving them.

        Changes in hooks:

        * install/sd-vconsole is now executed inside a subshell to avoid
          affecting the global scope.

        * install/sd-vconsole and install/consolefont now look for zstd compressed fonts.

        Changes in packaging:

        * The installed preset now includes commented-out suggestions for UKI and
          default_options.

        * libalpm/scripts/mkinitcpio will now also delete UKIs when
          uninstalling a kernel.

        Contributions from: Adam Maroti, cedric cvl, ff0x, Florian Eitel,
        Josephine Pfeiffer, Markus Weippert, Michael Kopp, Morten Linderud,
        nl6720, rogueai, Sebastian Wiesner, Tobias Powalowski, Yishen Miao

        – 2023-03-18

CHANGES WITH v34:

        Announcement of future breaking changes:

        * Preset variables *_efi_image are deprecated in favor of *_uki and
          option --uefi is deprecated in favor with --uki. The old variables and
          options still work, but emit a deprecation warning.

        Changes in mkinitcpio:

        * Preserve relativity of symbolic links that reside in the same
          directory as their targets.

        * Fix symbolic link creation and create target files with correct
          permissions.

        * Document add_udev_rule that has been available since v31.

        * Instead of using stat to get the file permissions and install to copy
          it, use cp unless custom permissions are specified. This improves
          overall speed of file additions.

        * Existing test suite is migrated to bats (Bash Automated Testing
          System) and more tests are now available.

        * Ensure /proc/cmdline is read as text and make sure to append a newline
          and NUL to the .cmdline embedded in unified kernel images. This works
          around an issue where /proc/cmdline contains garbage.

        * The kernel-install plugin now supports generating unified kernel
          images.

        * Warn if the interpreter (from the shebang) is missing when adding
          "binaries" that are actually scripts.

        Changes in hooks:

        * hooks/shutdown once again works when /run/initramfs/ already exists in
          the initramfs.

        * install/autodetect looks up modules in the target kernel version
          instead of the currently running one.

        * install/consolefont, install/keymap and install/sd-vconsole now
          declare vconsole.conf supported variables as local to prevent
          conflicts with misconstructed hooks may set these variables globally.

        * install/memdisk uses the add_udev_rule function available since v31.

        Contributions from: Adam Maroti, Christian Hesse, Geert Hendrickx,
        Hector Martin, Morten Linderud, Tcc, Tobias Powalowski, nl6720, rogueai

        – 2022-12-07

CHANGES WITH v33:

        Announcements:

        * Development has moved to the Arch Linux GitLab instance. The new
          URL is https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio

        Changes in mkinitcpio:

        * Introduce DECOMPRESS_MODULES in mkinitcpio.conf. Allows the user to
          toggle if modules should be recompressed during initramfs creation or
          not. Defaults to "yes".

        * Support UKI generation on AArch64.

        * Introduce a new --remove switch which allows mkinitcpio to remove all
          mkinitcpio generated files. Only works together
          with the -p/-P switches currently.

        * In the initramfs the file /etc/os-release, symlinked to
          /etc/initrd-release, is now included. systemd enabled initramfs
          environments might need this file.

        * Supports finding kernel version in gzipped non-x86 kernels.

        * Try to properly resolve symlinks when adding files into the initramfs.

        Changes in hooks:

        * install/fsck now includes the e2fsck binary and symlinks fsck.ext*
          utilities to this binary.

        * install/fsck will no longer attempt to include nonexistent fsck
          helpers.

        * install/kms will attempt to include modules that implement the privacy
          screen feature. Currently the module names are hardcoded.

        Changes in packaging:

        * mkinitcpio-remove and mkinitcpio-install are now unified into a single
          script installed to 'libalpm/scripts/mkinitcpio'.

        Contributions from: 0x7F, Felix Yan, Hugo Osvaldo Barrera,
        Morten Linderud, nl6720, rogueai, Simon Brüggen, Tobias Powalowski

        – 2022-11-20
