Mkinitcpio.conf correct hooks and syntax

Can some of the developers please tell us what are the correct hooks and syntax in the mkinitcpio.conf ? The current stable update triggered a discussion that seems to be about 2 years old and inconclusive. Sample topics here and here and here

Now, my current hooks line is

HOOKS="base udev autodetect modconf block keyboard keymap consolefont plymouth filesystems resume fsck"

The only thing i customized was adding the resume hook. Otherwise it should be identical with the installation produced by May 2023 XFCE ISO. Since i do not remember dealing with .pacnew about that file. Maybe there was and i oversaw it??

Still, the mystery continues. In the above mentioned threads someone mentioned that part is not really customized and the arch line from the file with last change a year ago is

HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)

We than have the manjaro patches, last change 3 months ago

HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

Last but not least, if we download the mkinitcpio package 37-1 from a synced mirror in the stable branch, we see something else there

HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)

That seems like the arch line, although that package is overlayed by manjaro (@Yochanan )
So at the end of the day, what should it be? Parenthesis? Plymouth instead of KMS? Etc…

2 Likes

That’s the only changes we make, otherwise the package is identical to Arch’s. You can see the upstream changes to mkinitcpio.conf here.

1 Like

So…how did i end up with quotes, and plymouth, and consolefont, and withouth kms then? Calamares?

The quote were changed in an old upgrade.

Mine looks like this: (I only added resume to have hibernation working)

HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems resume fsck)

1 Like

I found a post on Arch forum showing syntax change from brackets to double quotes in 2017
New mkinitcpio config syntax / Newbie Corner / Arch Linux Forums

My pacman log shows 4 instances when mkinitcpio.conf.pacnew was created
2017-10-26
2020-11-05
2022-07-11
2022-12-01

I also found a post on Manjaro forum showingn both mkinitcpio.conf.pacnew and mkinitcpio.conf using brackets
[Stable Update] 2022-07-12 - Kernels, Pipewire, Mesa, KDE Gear, Plasma, KDE Frameworks, Gnome, Python, Haskell - #18 by medmedin

So syntax change from double quotes to brackets was probably November 2020, but I cannot find any comments on Arch or Manjaro to confirm this

1 Like

So i did not oversaw it. It is just not there, because i installed in June 2023.

I guess that means either someone on the @Manjaro-Team developer team messed it up since then, or Calamares messed it up. Which is not an excuse really, not having control of critical aspects of your own distribution is not exactly a compliment for the team’s abilities. We had this discussion once with the tmpfs mounts in /etc/fstab. The statement then was “it is not our fault, it is calamares”. I guess we should call it “manjaro-calamares” then, if calamares developers make half of the important decisions.

p.s. i just extracted the latest official ISO, in the root.sfs the file is indeed with brackets, and kms and withouth plymouth…so it is indeed Calamares. Sadly, manjaro without Calamares and Pamac is pretty much arch. But the discussion if we really need 100 Distros with 5 developers each or is the linux community better of with 10 distros but with 50 developers and less bugs is entirely another matter.

1 Like

It was around that time, yes, and there was a .pacnew file for it, too. :wink:

By the way, I still propose…

  • replacing base and udev — as well as resume and/or usr, if present — by systemd;…
  • replacing keymap and consolefont by sd-vconsole; and…
  • replacing encrypt (if present) by sd-encrypt.

It shaves off a bit — not a whole lot, but it’s noticeable — from the boot time, and it makes the initramfs a bit smaller. The way the systemd hook works is that it will build the initcpio with what is currently needed by the running system.

Also, base doesn’t really make any sense anymore, because it only provides a busybox rescue shell, but the rescue shell is unusable because the root account in the initramfs is locked. So that rescue shell is just sitting there in the initramfs for no reason at all.

4 Likes

Hmm…

I manually backup files that have a .pacnew and only see one on 05-11-2020.
The other dates mentioned are absent.
:man_shrugging:

Yep, November 2020 sounds about right.

OR remove those too if you dont use them.

I use this:

(autodetect systemd modconf kms block keyboard filesystems fsck)

And I could probably do without keyboard.
Though a Note about that may be worth highlighting for those that use encryption:

Which seems like it could be a snag that could hit users with the current default configuration.
(keyboard is placed after autodetect in the ISOs)

Good proposal. I’m surprised no one has created an upstream issue to change the defaults yet. Feel free to do so.

2 Likes

I don’t have a GitLab account. You on the other hand do, and you have more experience dealing with developers than I do. :man_shrugging:

2 Likes

Well, create one then. :wink:

Your proposal above is written very clearly and concisely. I encourage you to open an issue with that proposal. If you don’t, then nothing will every happen. :man_shrugging:

It doesn’t need to be proposed to Arch, per se. It’ll suffice if it gets adopted into Manjaro. After all, you said yourself that Manjaro adds its own patches to mkinitcpio. :point_down:

We only have patches to adapt it to Manjaro kernels and revert the change to default zstd compression as older kernels do not support it. We will not be deviating from upstream other than that.

Yes, well, you can submit the proposal or not. You’re the Manjaro Team member, so it’s up to you. I’ve already long ago made the changes here on my own system — along with several others, including some pam and sudoers changes — so I personally don’t have any dog in that particular fight.

Like I said, I don’t have any GitLab or GitHub accounts, and I am not going to create any either. I’ve got too much on my hands already (and too many worries as well) to take that on in addition to everything else.

1 Like

I won’t be submitting anything. I’m perfectly satisfied with customizing my own system beyond the defaults–just as you are. :wink:

before ! in manjaro fr :
post #7 2018-08-20, we have a cat /etc/mkinitcpio.conf with brackets

Another (2018-01-14 !!! ) .pacnew with this change

# This setting is similar to BINARIES above, however, files a   # This setting is similar to BINARIES above, however, files a
# as-is and are not parsed in any way.  This is useful for co   # as-is and are not parsed in any way.  This is useful for co
FILES=()                                                      | FILES=""

# HOOKS                                                         # HOOKS
# This is the most important setting in this file.  The HOOKS   # This is the most important setting in this file.  The HOOKS
# modules and scripts added to the image, and what happens at   # modules and scripts added to the image, and what happens at
# Order is important, and it is recommended that you do not c   # Order is important, and it is recommended that you do not c
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook n   # order in which HOOKS are added.  Run 'mkinitcpio -H <hook n
# help on a given hook.                                         # help on a given hook.
# 'base' is _required_ unless you know precisely what you are   # 'base' is _required_ unless you know precisely what you are
# 'udev' is _required_ in order to automatically load modules   # 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modu   # 'filesystems' is _required_ unless you specify your fs modu
# Examples:                                                     # Examples:
##   This setup specifies all modules in the MODULES setting    ##   This setup specifies all modules in the MODULES setting 
##   No raid, lvm2, or encrypted root is needed.                ##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)                                             | #    HOOKS="base"
#                                                               #
##   This setup will autodetect all modules for your system a   ##   This setup will autodetect all modules for your system a
##   work as a sane default                                     ##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)           | #    HOOKS="base udev autodetect block filesystems"
#                                                               #
##   This setup will generate a 'full' image which supports m   ##   This setup will generate a 'full' image which supports m
##   No autodetection is done.                                  ##   No autodetection is done.
#    HOOKS=(base udev block filesystems)                      | #    HOOKS="base udev block filesystems"
#                                                               #
##   This setup assembles a pata mdadm array with an encrypte   ##   This setup assembles a pata mdadm array with an encrypte
##   Note: See 'mkinitcpio -H mdadm' for more information on    ##   Note: See 'mkinitcpio -H mdadm' for more information on 
#    HOOKS=(base udev block mdadm encrypt filesystems)        | #    HOOKS="base udev block mdadm encrypt filesystems"
#                                                               #
##   This setup loads an lvm2 volume group on a usb device.     ##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)                 | #    HOOKS="base udev block lvm2 filesystems"
#                                                               #
##   NOTE: If you have /usr on a separate partition, you MUST   ##   NOTE: If you have /usr on a separate partition, you MUST
#    usr, fsck and shutdown hooks.                              #    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboar | HOOKS="base udev autodetect modconf block keyboard keymap res

1 Like

Doing that may cause problems for ZFS users. See the end of section 5 - Install Arch Linux on ZFS - ArchWiki

I deed the minimal installation on September 5, manual partitioning, ext4 and swap

removed plymouth and hibernation with their hook (plymouth and resume)

my mkinitcpio.conf was this

HOOKS="base udev autodetect modconf block keyboard keymap consolefonts filesystems fsck"

no kms, if I change “” to () the color of the text change from red to blue
now I’ve removed consolefonts for that warning and keymap too

if I change to systemd and sd-vconsole I get more warnings