Issues with /boot/efi directory on manjaro-arm-tools generic-efi profile

I am having issues building some images based on generic-efi profile. Kernel is installed as local package with a mkinitcpio hook to build a UKI file that needs to be placed in the esp partition. For that to work files on /boot/efi need to be copied to esp partition in create_img function.

This patch fixes this issue:

From ce5c8fc32cc647655b2d07ff45d737ffe2d83ee5 Mon Sep 17 00:00:00 2001
From: rodriguezst <2828844+rodriguezst@users.noreply.github.com>
Date: Tue, 3 Sep 2024 21:39:18 +0200
Subject: [PATCH] [generic-efi] Move files on /boot/efi from root to esp partition
 partition

Files added to /boot/efi inside chroot were not being copied to esp partition
---
 lib/functions.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/functions.sh b/lib/functions.sh
index d9f704f..5f37105 100755
--- a/lib/functions.sh
+++ b/lib/functions.sh
@@ -918,6 +918,7 @@ create_img() {
                     # Copy the rootfs contents over to the filesystem
                     info "Copying files to image..."
                     cp -a $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root
+		    mv $TMPDIR/root/boot/efi/* $TMPDIR/boot/efi
                     ;;
 
                 quartz64-bsp)
@@ -1047,6 +1048,7 @@ create_img() {
                     mount ${LDEV}p1 $TMPDIR/boot/efi
                     mount ${LDEV}p2 $TMPDIR/root
                     cp -a $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root
+		    mv $TMPDIR/root/boot/efi/* $TMPDIR/boot/efi
                     ;;
 
                 quartz64-bsp)

/boot/efi is not a directory; it’s a mount point.

If you need to use an accessible path to reach directories on the $ESP you will need to use something like:

/boot/efi/EFI/...

Maybe this helps.

Beyond that, I have no knowledge of the create_img function.

Good luck.

Yes, it’s a mount point. The issue is that currently, files are copied to /boot/efi within the root partition instead of being copied to the mount point.

I was about to say that the script seems fine; however, I had initially missed the “This patch fixes this issue” somehow. :facepalm:

I’ll try to attract some attention to this. Let’s see what @Yochanan might have to add.

Cheers.

I’m just the packager. As far as upstream issues, @spikerguy, @Darksky or @linux-aarhus might be able to help.

I don’t know why efi images exist at all. I think of them as experimental at best - but I am no arm expert.

I do remember at some point the Raspberry Pi vendor banned Manjaro because they do not support efi boot but the Manjaro lead developer (which since left) created images for rpi supporting efi boot - that created some gruntle with rpi. I speculate if thatt is one of the reasons you can no longer download a manjaro arm image directly in rpi-imager.

I know the Calamares installer mounts in /boo/efi but that is more related to grub bootloader than anything else.

If a change is needed - for some reason - I would recommend mounting the efi partition to /efi as this is the correct mountpoint.

But we should also carefully consider the path ahead and slimming down the amount of hardware supported as - for the time being - arm architecture maintainers are burdened to their necks.

A packager who knows who to nudge when needed. :+1: