You are not logged in.

#1 2022-12-19 07:15:56

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 57

recent changes to default mkinitcpio.conf

Recently some changes were made to the default mkinitcpio.conf. I have no idea when precisely that was, though that is not relevant to my question. In any case, these are the changes I am talking about:

 diff /etc/mkinitcpio.conf /etc/mkinitcpio.conf.pacnew
6c6
< #     MODULES=(piix ide_disk reiserfs)
---
> #     MODULES=(usbhid xhci_hcd)
32c32
< ##   No raid, lvm2, or encrypted root is needed.
---
> ##   No RAID, lvm2, or encrypted root is needed.
37c37
< #    HOOKS=(base udev autodetect block filesystems)
---
> #    HOOKS=(base udev autodetect modconf block filesystems fsck)
41c41
< #    HOOKS=(base udev block filesystems)
---
> #    HOOKS=(base udev modconf block filesystems fsck)
43,45c43,45
< ##   This setup assembles a pata mdadm array with an encrypted root FS.
< ##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
< #    HOOKS=(base udev block mdadm encrypt filesystems)
---
> ##   This setup assembles a mdadm array with an encrypted root file system.
> ##   Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
> #    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
47,48c47,48
< ##   This setup loads an lvm2 volume group on a usb device.
< #    HOOKS=(base udev block lvm2 filesystems)
---
> ##   This setup loads an lvm2 volume group.
> #    HOOKS=(base udev modconf block lvm2 filesystems fsck)
51,52c51,52
< #    usr, fsck and shutdown hooks.
< HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
---
> #    usr and fsck hooks.
> HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)
67a68,73
>
> # MODULES_DECOMPRESS
> # Decompress kernel modules during initramfs creation.
> # Enable to speedup boot process, disable to save RAM
> # during early userspace. Switch (yes/no).
> #MODULES_DECOMPRESS="yes"

My question is this: there were quite a few changes. What is the overall purpose of them? In particular the default hooks went from
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
to
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)

So not only hooks were added, but their order changed, for example the keyboard hook.

The reason I ask is that while my desktop and laptop still booted with the previous settings, I would like to bring my settings close to the default. In the case of the desktop I was using the default hooks, however for the laptop I had made a number of changes because it has a more complicated configuration. I ask for more information as I don't want to shoot myself in the foot!

Offline

#2 2022-12-19 09:30:51

seth
Member
Registered: 2012-09-03
Posts: 35,051

Re: recent changes to default mkinitcpio.conf

Only kms, keymap & consolefont have been sorted in (by the evil wiki admin)
https://gitlab.archlinux.org/archlinux/ … quests/126

kms does https://wiki.archlinux.org/title/Kernel … _KMS_start - the other ones are mostly relevant for encrypted systems.

Offline

#3 2022-12-19 10:01:49

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,638

Re: recent changes to default mkinitcpio.conf

Note that the keymap & consolefont hooks will fail unless /etc/vconsole.conf exists.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2022-12-19 10:07:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,127

Re: recent changes to default mkinitcpio.conf

Even on an encrypted system, you may not need keymap or consolefont, if your machine boots at the moment (e.g. because you have a US keyboard and don't need special characters or layout to decrypt).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-12-19 16:52:43

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,796
Website

Re: recent changes to default mkinitcpio.conf

archdub wrote:

I would like to bring my settings close to the default

Why? Would it not make more sense to customise it for your needs? For example the new KMS hook isn't needed if you add your graphics driver to the MODULES array.

See also http://blog.falconindy.com/articles/opt … tcpio.html

Offline

#6 2022-12-19 21:24:35

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 57

Re: recent changes to default mkinitcpio.conf

Thanks Seth for the pointer to the commit. I am still left wondering why the order changed (for example keypad) as it is not obvious from the commit log.

Thanks, Lone_Wolf and cfr. I will look into what you said.

Thanks, Head_on_a_Stick. I will look into your idea about using MODULES. Generally I like to have my settings close to the default settings so that if the default changes (pacnew appears) I can look at it and try to figure out if it affects me or not. What I do then is I port my changes on top of the new version of the configuration file.

Offline

#7 2022-12-20 02:24:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,127

Re: recent changes to default mkinitcpio.conf

Do you mean the 'keyboard' hook?

I don't know, but I suspect it is because having it earlier by default will avoid problems when people add encrypt or sd-encrypt hooks and where the keyboard is not default US or special characters are needed to decrypt. In that case, you need keyboard before decrypt.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2022-12-20 08:35:18

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 57

Re: recent changes to default mkinitcpio.conf

cfr wrote:

Do you mean the 'keyboard' hook?

I don't know, but I suspect it is because having it earlier by default will avoid problems when people add encrypt or sd-encrypt hooks and where the keyboard is not default US or special characters are needed to decrypt. In that case, you need keyboard before decrypt.

Yes, I meant keyboard hook. Thanks, cfr.

Offline

#9 2022-12-20 08:50:45

seth
Member
Registered: 2012-09-03
Posts: 35,051

Re: recent changes to default mkinitcpio.conf

Regrouping, I presume.
The order of the hooks matters only inbetween some of them, but eg. "keyboard" and "keymap" and "block", "filesystems" and "fsck" are thematically related.
"keyboard" is a bit stray in the line up of "block filesystems keyboard fsck"

Offline

Board footer

Powered by FluxBB