Update mkinitcpio.conf hooks for upstream consistency (#2515)

This commit adjusts the hooks in mkinitcpio.conf to follow the changes
in the upstream mkinitcpio repository.
It also add the consolefont hook if udev is used instead of systemd.

Addresses upstream commits:
[mkinitcpio.conf: add kms to the default HOOKS array](b99eb1c0d5)
[mkinitcpio.conf: adjust the placement of the modconf hook for consistency](0b052b1461)

Additionally, it replaces the missing `consolefont` hook if the
`keyboard` hook is used instead of the `sd-vconsole` hook.
For more details, see the Arch Wiki:
[dm-crypt/System configuration - 1.1 mkinitcpio](https://wiki.archlinux.org/title/Dm-crypt/System_configuration#mkinitcpio)
This commit is contained in:
Alexandre Petit 2024-05-25 09:57:04 +02:00 committed by GitHub
parent 6863994118
commit 6b48d788b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -83,8 +83,8 @@ class Installer:
# systemd, sd-vconsole and sd-encrypt will be replaced by udev, keymap and encrypt
# if HSM is not used to encrypt the root volume. Check mkinitcpio() function for that override.
self._hooks: List[str] = [
"base", "systemd", "autodetect", "microcode", "keyboard",
"sd-vconsole", "modconf", "block", "filesystems", "fsck"
"base", "systemd", "autodetect", "microcode", "modconf", "kms", "keyboard",
"sd-vconsole", "block", "filesystems", "fsck"
]
self._kernel_params: List[str] = []
self._fstab_entries: List[str] = []
@ -709,7 +709,7 @@ class Installer:
# This is purely for stability reasons, we're going away from this.
# * systemd -> udev
# * sd-vconsole -> keymap
self._hooks = [hook.replace('systemd', 'udev').replace('sd-vconsole', 'keymap') for hook in self._hooks]
self._hooks = [hook.replace('systemd', 'udev').replace('sd-vconsole', 'keymap consolefont') for hook in self._hooks]
mkinit.write(f"HOOKS=({' '.join(self._hooks)})\n")