2

I am using ArchLinux on a machine using systemd-boot and UEFI to boot the system. When I receive a new kernel update, the new kernel get's created in my /boot , but the UEFI-Boot Partition is mounted unter /boot/efi with the files I tell my system to load being in /boot/efi/EFI/arch/ .

Where can I configure a hook that copies the .img files and vmlinuz-linux from my /boot into my /boot/efi/EFI/arch/ whenever I update my kernel?

1

Since the question isn't answered and I came by the same problem/question, I write my own approach, maybe it helps future searchers:

Note that I use Kali and I couldn't confirm that it works, since my kernel is already upgraded(I will update this answer, after I can finally confirm it)

create a file in /etc/kernel/postinst.d for example zz_systemd_boot (the grub-file start with zz so I assumed that the files are executed alphabetical) with something similar to this:

#!/bin/sh

echo Copy files for systemd-boot

cp /initrd.img /mnt/boot/kali/initrd.img
cp /vmlinuz /mnt/boot/kali/vmlinuz

and than make the file executeablechmod 755 zz_systemd_boot

0

using uefi over legacy does not change the location of the kernel images. I use uefi boot loader and my images are all in boot.

For comparison here is my boot partition;

$ find /boot/ -type d
/boot/
/boot/grub
/boot/grub/backup
/boot/grub/fonts
/boot/grub/x86_64-efi
/boot/grub/i386-pc
/boot/grub/locale
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/debian
/boot/efi/EFI/boot
/boot/efi/EFI/ubuntu
/boot/efi/EFI/ubuntu/fw
/boot/efi/EFI/grub

the directory /boot/efi/EFI contains the uefi boot images;

$ find /boot/efi/EFI/ -type f
/boot/efi/EFI/debian/grubx64.efi
/boot/efi/EFI/debian/grubx64.efi.bkup1
/boot/efi/EFI/boot/bootx64.efi
/boot/efi/EFI/boot/bootx64.efi.old
/boot/efi/EFI/boot/grubx64.efi
/boot/efi/EFI/ubuntu/fwupx64.efi
/boot/efi/EFI/ubuntu/grubx64.efi
/boot/efi/EFI/ubuntu/grub.cfg
/boot/efi/EFI/ubuntu/shimx64.efi
/boot/efi/EFI/ubuntu/MokManager.efi
/boot/efi/EFI/ubuntu/grubx64.efi.old
/boot/efi/EFI/grub/grubx64.efi

the directory "/boot/grub/x86_64-efi" contains all the uefi mod files

$ find /boot/grub/x86_64-efi -type f | head -10
/boot/grub/x86_64-efi/ufs2.mod
/boot/grub/x86_64-efi/minix3.mod
/boot/grub/x86_64-efi/date.mod
/boot/grub/x86_64-efi/odc.mod
/boot/grub/x86_64-efi/lvm.mod
/boot/grub/x86_64-efi/font.mod
/boot/grub/x86_64-efi/reboot.mod
/boot/grub/x86_64-efi/file.mod
/boot/grub/x86_64-efi/functional_test.mod
/boot/grub/x86_64-efi/ohci.mod

and my linux images are all stored in "/boot/"

$ find /boot -maxdepth 1 -type f -iname "vmlin*" | head -10
/boot/vmlinuz-4.4.8-M1.old
/boot/vmlinuz-4.8.5-MX1
/boot/vmlinuz-4.8.2-MX1.old
/boot/vmlinuz-4.8.5-MXC2.old
/boot/vmlinuz-4.3.0-1-amd64
/boot/vmlinuz-4.4.8-M1
/boot/vmlinuz-4.8.2-MX1
/boot/vmlinuz-4.8.5-MX1.old
/boot/vmlinuz-4.4.8-M3
/boot/vmlinuz-4.4.5-M1
  • 3
    The location does make a difference if you are using a simple boot manager like systemd-boot instead of Grub. – Johan Myréen Nov 21 '16 at 12:20
  • 1
    The Archwiki recommends simply mounting the UEFI Boot Partition to /boot upon system start, though since in /boot there are already files before configuring stuff, they will be hidden behind the mounted partition and things would propably get wierd. Therefore I mounted in /boot/efi but new images are (obviously) not copied to their relevant locations on their own. – salbeira Nov 21 '16 at 12:59
  • An alternative is to use a bind mount, as described under "Using bind mount" on Archwiki. It's not without drawbacks, but may work for you. – Johan Myréen Nov 21 '16 at 13:08
  • The main question would be: Can I delete everything in my /boot directory and just mount my /dev/sda1 to /boot , change a thing here and there in the boot config and be fine with it. I would need to call mkinitcpio once again and the new images would be created on the now mounted partition in /boot ; change the location the bootloader looks up the images and done – salbeira Nov 21 '16 at 15:16
  • Depends on what you have in there. I'm using systemd-boot with an efistub kernel and have mounted the ESP on /boot. I have a total of eight files in /boot, four of which are installed by pacman -S linux, two belong to systemd-boot, and two are configuration files: /boot/loader/loader.conf and /boot/loader/entries/arch.conf. – Johan Myréen Nov 21 '16 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.