Why is the kernel in /boot?

I just installed Endeavour without a bootloader, intending to boot it using my existing OpenCore bootloader. However, OpenCore is having issues seeing it because the kernel, initramfs, etc. are located on the main partition in /boot, rather than being placed on the ESP (which mounts by default to /efi).

I believe I should be able to get around this by configuring a custom boot entry and installing the Linux filesystem drivers from rEFInd. However, I was under the impression that the reason the installer defaults to a 2GB ESP is to better enable installation and use of multiple kernels. Why, then, is the kernel not installed to the ESP by default? Can I make the ESP the kernel install location, and are there any risks to doing so?

There a bunch of ways to change this but one easy way is to simply mount the ESP on /boot.

Alternatively, if you want it to work using our kernel-install automation, remove eos-dracut and install kernel-install-for-dracut. Then run sudo reinstall-kernels.

1 Like

Okay, thanks. Is the placement of the generated initrds the only difference between eos-dracut and kernel-install-for-dracut? I’m having difficulty finding documentation for either one.

Edit: I just did as you said—pacman -R eos-dracut, then pacman -S kernel-install-for-dracut—making no other changes, and after running sudo reinstall-kernels, the kernel image was still installed to /boot, and /efi remained empty.

Then kernel is placed in /boot due to LSB.

A good idea would be to move initrd to /boot.

The initrds are already in /boot, that’s the problem. I don’t see how LSB has anything to do with it.

I meant the kernel modules move to /boot.

But I want the kernel on /efi, not /boot—unless you’re suggesting that I change the EFI mountpoint to /boot?

In my installation, he kernel is placed in /boot.

What is the actual default when no bootloader is selected?

SystemD - post education.

I don’t know what you mean by “post education.”

Not only the placement. It is also the naming of the initrds and kernels. kernel-install-for-dracut also creates entries for systemd-boot.

When no bootloader is selected, you get eos-dracut which puts everything in /boot and uses naming similar to what Arch uses by default with mkinitcpio.

Okay, that is useful information, thank you. It should probably be stated explicitly somewhere, but maybe I’m just bad at searching the documentation.

Okay, that makes sense. Two questions:

  1. Is this explicitly documented anywhere? I cannot find anything on either of the packages’ Github pages, or on dracut’s page on Discovery (which merely says that systemd-boot uses one and GRUB uses the other, and links to the same Github pages just containing the packages). I know that they’re relatively simple, but I still feel that their functionality should be explicitly laid out somewhere. If the documentation does not exist, I would be more than happy to write it.
  2. Do you have any idea why, in my case, switching to kernel-install-for-dracut and running reinstall-kernels did not actually build the initrds in /efi?

Also, what, if anything, would changing the ESP mount point to /boot break in the automation?

1 Like

Not really. There is some info on the kernel-install-for-dracut gitlab page but not a ton of detail. eos-dracut isn’t really documented outside of the PKGBUILD which isn’t much at all.

That would be very helpful.

No, can you share the full output from the command so I can see what is happening?

Probably nothing, it would just be kind of pointless to use kernel-install-for-dracut with your ESP mounted at /boot. If you are using your own bootloader, it seems like it would be easier for it detect the files if you used eos-dracut instead for that setup. That being said, I have never used opencore so I have no idea what it actually does. :slight_smile:

1 Like

The full output from sudo reinstall-kernels is as follows:

Installing kernel 6.17.4-arch2-1
dracut[I]: Detected container-other container.
dracut[I]: Executing: /usr/bin/dracut --no-hostonly --force /boot/initramfs-6.17.4-arch2-1.img 6.17.4-arch2-1
dracut[I]: *** Including module: bash ***
dracut[I]: *** Including module: systemd ***
dracut[I]: *** Including module: systemd-ask-password ***
dracut[I]: *** Including module: systemd-battery-check ***
dracut[I]: *** Including module: systemd-cryptsetup ***
dracut[I]: *** Including module: systemd-initrd ***
dracut[I]: *** Including module: systemd-journald ***
dracut[I]: *** Including module: systemd-modules-load ***
dracut[I]: *** Including module: systemd-pcrphase ***
dracut[I]: *** Including module: systemd-sysctl ***
dracut[I]: *** Including module: systemd-tmpfiles ***
dracut[I]: *** Including module: systemd-udevd ***
dracut[I]: *** Including module: modsign ***
dracut[I]: *** Including module: i18n ***
dracut[I]: *** Including module: systemd-sysusers ***
dracut[I]: *** Including module: btrfs ***
dracut[I]: *** Including module: crypt ***
dracut[I]: *** Including module: dm ***
dracut[I]: *** Including module: fs-lib ***
dracut[I]: *** Including module: kernel-modules ***
dracut[I]: *** Including module: kernel-modules-extra ***
dracut[I]: *** Including module: lvm ***
dracut[I]: *** Including module: mdraid ***
dracut[I]: *** Including module: nvdimm ***
dracut[I]: *** Including module: qemu ***
dracut[I]: *** Including module: qemu-net ***
dracut[I]: *** Including module: fido2 ***
dracut[I]: *** Including module: pkcs11 ***
dracut[I]: *** Including module: hwdb ***
dracut[I]: *** Including module: lunmask ***
dracut[I]: *** Including module: resume ***
dracut[I]: *** Including module: rootfs-block ***
dracut[I]: *** Including module: terminfo ***
dracut[I]: *** Including module: udev-rules ***
dracut[I]: *** Including module: virtiofs ***
dracut[I]: *** Including module: dracut-systemd ***
dracut[I]: *** Including module: initqueue ***
dracut[I]: *** Including module: usrmount ***
dracut[I]: *** Including module: base ***
dracut[I]: *** Including module: shell-interpreter ***
dracut[I]: *** Including module: shutdown ***
dracut[I]: *** Including modules done ***
dracut[I]: *** Installing kernel module dependencies ***
dracut[I]: *** Installing kernel module dependencies done ***
dracut[I]: *** Resolving executable dependencies ***
dracut[I]: *** Resolving executable dependencies done ***
dracut[I]: *** Generating early-microcode cpio image ***
dracut[I]: *** Constructing GenuineIntel.bin ***
dracut[I]: *** Store current command line parameters ***
dracut[I]: *** Stripping files ***
dracut[I]: *** Stripping files done ***
dracut[I]: *** Creating image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' ***
dracut[I]: *** Hardlinking files ***
dracut[I]: *** Hardlinking files done ***
dracut[I]: *** Creating initramfs image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' done ***
dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' ***
dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' done ***
dracut[I]: Detected container-other container.
dracut[I]: Executing: /usr/bin/dracut --hostonly --no-hostonly-cmdline -f /boot/initramfs-6.17.4-arch2-1.img 6.17.4-arch2-1
dracut[I]: *** Including module: bash ***
dracut[I]: *** Including module: systemd ***
dracut[I]: *** Including module: systemd-ask-password ***
dracut[I]: *** Including module: systemd-battery-check ***
dracut[I]: *** Including module: systemd-cryptsetup ***
dracut[I]: *** Including module: systemd-initrd ***
dracut[I]: *** Including module: systemd-journald ***
dracut[I]: *** Including module: systemd-modules-load ***
dracut[I]: *** Including module: systemd-pcrphase ***
dracut[I]: *** Including module: systemd-sysctl ***
dracut[I]: *** Including module: systemd-tmpfiles ***
dracut[I]: *** Including module: systemd-udevd ***
dracut[I]: *** Including module: i18n ***
dracut[I]: *** Including module: systemd-sysusers ***
dracut[I]: *** Including module: btrfs ***
dracut[I]: *** Including module: crypt ***
dracut[I]: *** Including module: dm ***
dracut[I]: *** Including module: fs-lib ***
dracut[I]: *** Including module: kernel-modules ***
dracut[I]: *** Including module: kernel-modules-extra ***
dracut[I]: *** Including module: lvm ***
dracut[I]: *** Including module: mdraid ***
dracut[I]: *** Including module: qemu ***
dracut[I]: *** Including module: qemu-net ***
dracut[I]: *** Including module: hwdb ***
dracut[I]: *** Including module: lunmask ***
dracut[I]: *** Including module: resume ***
dracut[I]: *** Including module: rootfs-block ***
dracut[I]: *** Including module: terminfo ***
dracut[I]: *** Including module: udev-rules ***
dracut[I]: *** Including module: virtiofs ***
dracut[I]: *** Including module: dracut-systemd ***
dracut[I]: *** Including module: initqueue ***
dracut[I]: *** Including module: usrmount ***
dracut[I]: *** Including module: base ***
dracut[I]: *** Including module: shell-interpreter ***
dracut[I]: *** Including module: shutdown ***
dracut[I]: *** Including modules done ***
dracut[I]: *** Installing kernel module dependencies ***
dracut[I]: *** Installing kernel module dependencies done ***
dracut[I]: *** Resolving executable dependencies ***
dracut[I]: *** Resolving executable dependencies done ***
dracut[I]: *** Generating early-microcode cpio image ***
dracut[I]: *** Constructing GenuineIntel.bin ***
dracut[I]: *** Store current command line parameters ***
dracut[I]: *** Stripping files ***
dracut[I]: *** Stripping files done ***
dracut[I]: *** Creating image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' ***
dracut[I]: *** Hardlinking files ***
dracut[I]: *** Hardlinking files done ***
dracut[I]: *** Creating initramfs image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' done ***
dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' ***
dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' done ***

So, to be clear, the kernels don’t get written to /efi, they get written to the ESP. If you mount the ESP somewhere else, they will get written there instead.

Okay, that’s what I thought—but that output ends with

dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' ***
dracut[I]: *** Moving image file '/boot/initramfs-6.17.4-arch2-1.img.tmp' to '/boot/initramfs-6.17.4-arch2-1.img' done ***

which seems to say that they’re being installed in /boot rather than the ESP, no?

Additionally, I just reinstalled Endeavour with systemd-boot selected as the bootloader and the same thing happened: the bootloader installed on the ESP, but the kernel images, etc. installed in /boot.

Can you share the output of findmnt --real

Output of findmnt --real:

/            /dev/sda2[/@]      btrfs  rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=256,subvol=/@
├─/home      /dev/sda2[/@home]  btrfs  rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=257,subvol=/@home
├─/var/cache /dev/sda2[/@cache] btrfs  rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=258,subvol=/@cache
├─/var/log   /dev/sda2[/@log]   btrfs  rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=259,subvol=/@log
└─/efi       /dev/sda1          vfat   rw,relatime,fmask=0137,dmask=0027,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro

Interestingly, on my last pacman -Syu, which included a kernel update, the initrds were built in the ESP (mounted at /efi) like they were supposed to.
However, there have been no microcode updates since install, and intel-ucode.img is still located in /boot rather than /efi. This must mean that the ESP was not mounted to /boot during the original install, since if it was, then intel-ucode.img would be on the ESP.

We don’t mount the ESP to /boot. It would have been at /efi at the time of install.