You are not logged in.

#1 2024-07-31 00:53:21

gcb
Member
Registered: 2014-02-12
Posts: 213

/etc/mkinitcpio.conf.d/

how /etc/mkinitcpio.conf.d/ is supposed to be used?

All wiki pages which tell me to modify /etc/mkinitcpio.conf ignores this dir, so i'm assuming that is something used to generate the presets in /etc/mkinitcpio.d/? or can it really be used to avoid changing /etc/mkinitcpio.conf proper?

the actual description on the wiki makes it even more confusing: https://wiki.archlinux.org/title/Mkinit … figuration

it mentions the files in there are indeed used, but only when no -p is used.. and looking at the pacman hooks, -p seems to always be used on a linux package install/update (or I read the scripts wrong?)

then it says ends with "Additionally, preset definitions are provided by kernel packages in the /etc/mkinitcpio.d directory" without any clue on what it means. Looking at the preset files i see the .conf file commented out. which means? i'm not sure. Will it force only that file? is it commented because it is the default?

Last edited by gcb (2024-07-31 00:56:46)

Offline

#2 2024-07-31 01:00:30

gcb
Member
Registered: 2014-02-12
Posts: 213

Re: /etc/mkinitcpio.conf.d/

well, still confused by all the wiki text, but dropping a file there and reinstalling linux package shows

==> Using drop-in configuration file: '0_gcb.conf'

which solves the mistery. Wonder why the wiki pages don't mention to drop files there for each feature instead of changing the main conf file.

Offline

#3 2024-07-31 11:24:30

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,065

Re: /etc/mkinitcpio.conf.d/

Because the main config file isn't suitable for many and keeping all changes in one file makes maintenance easier ?

here are my changes as an example

$ diff --unified --text /etc/mkinitcpio.conf.pacnew /etc/mkinitcpio.conf
--- /etc/mkinitcpio.conf.pacnew 2024-05-29 14:09:53.000000000 +0200
+++ /etc/mkinitcpio.conf        2024-05-03 21:44:49.600598988 +0200
@@ -4,7 +4,7 @@
 # run.  Advanced users may wish to specify all system modules
 # in this array.  For instance:
 #     MODULES=(usbhid xhci_hcd)
-MODULES=()
+MODULES=(amdgpu ext4)
 
 # BINARIES
 # This setting includes any additional binaries a given user may
@@ -52,7 +52,9 @@
 #
 ##   NOTE: If you have /usr on a separate partition, you MUST include the
 #    usr and fsck hooks.
-HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
+#HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont
+
+HOOKS=(base udev autodetect modconf block keyboard numlock fsck)
 
 # COMPRESSION
 # Use this to compress the initramfs image. By default, zstd compression
$ 

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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2024-07-31 12:03:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: /etc/mkinitcpio.conf.d/

Whatever the best solution might be, the way the wiki explains it could indeed be confusing to somebody who isn't used to dealing with drop-in configs. Even mkinitcpio.conf(5) doesn't explain how they work and especially how precedence is being established beyond .conf.d over .conf. Alphabetically, higher number higher priority?

I completely understand any dissatisfaction here.

Offline

#5 2024-07-31 12:29:49

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: /etc/mkinitcpio.conf.d/

You can guess the order they're sourced by looking at https://gitlab.archlinux.org/archlinux/ … cpio#L1116, i.e.:

$ LC_ALL=C.UTF-8 find /etc/mkinitcpio.conf.d/ -maxdepth 1 -xtype f -name '*.conf'

Mind that the way this is implemented may change in the future. See archlinux/mkinitcpio/mkinitcpio!389.

The reason why the drop-ins are not used in the wiki is probably because the feature is relatively new and that it's not very useful for constructing the HOOKS array using appending. E.g. MODULES+=(ext4) would be fine in a drop-in, but for the HOOKS array where the order often matters, it may complicate the setup compared to simply editing one file.

Offline

Board footer

Powered by FluxBB