All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ross Burton" <ross@burtonini.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] grub: shuffle packaging for aarch64 builds
Date: Mon, 22 Feb 2021 18:06:37 +0000	[thread overview]
Message-ID: <20210222180637.2337318-1-ross.burton@arm.com> (raw)

Even in grub-efi platforms we need to build grub for the the common
tools. On x86 this isn't a problem because grub builds legacy boot and
grub-efi builds EFI, but on aarch64 there is no legacy boot supported by
grub.

To ensure that the common tools are built the grub recipe also builds
EFI binaries, but this now means that grub and grub-efi ship the same
binaries.

oe-core 933286 fixed this conflict by deleting the binaries from
grub-efi and putting the aarch64 modules into grub-common (relying on
dependencies to pull grub-common in).  This seems backwards: grub-efi no
longer contains the binaries and they're in different packages on arm or
x86.  Also, SDK generation is broken as the grub package itself is now
empty as the binaries are in grub-common.

Resolve all of these issues by reversing the logic:  grub-efi is the
package which holds the EFI binaries on all platforms. grub only builds
for EFI on aarch64 as a way to build the common binaries, so delete them
in that recipe to avoid conflicts.  And finally as the grub recipe is
empty on aarch64 but needed by dependencies, set ALLOW_EMPTY.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-bsp/grub/grub-efi_2.04.bb |  6 ------
 meta/recipes-bsp/grub/grub_2.04.bb     | 11 +++++++----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi_2.04.bb b/meta/recipes-bsp/grub/grub-efi_2.04.bb
index f80afd95cb..287845c507 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.04.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.04.bb
@@ -70,10 +70,6 @@ do_install() {
     install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE}
 }
 
-do_install_append_aarch64() {
-    rm -rf  ${D}/${prefix}/
-}
-
 GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
                  efi_gop iso9660 configfile search loadenv test"
 
@@ -88,8 +84,6 @@ FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
                ${EFI_FILES_PATH}/${GRUB_IMAGE} \
                "
 
-FILES_${PN}_remove_aarch64 = "${libdir}/grub/${GRUB_TARGET}-efi"
-
 # 64-bit binaries are expected for the bootloader with an x32 userland
 INSANE_SKIP_${PN}_append_linux-gnux32 = " arch"
 INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch"
diff --git a/meta/recipes-bsp/grub/grub_2.04.bb b/meta/recipes-bsp/grub/grub_2.04.bb
index f2942b9e37..d4e09faa40 100644
--- a/meta/recipes-bsp/grub/grub_2.04.bb
+++ b/meta/recipes-bsp/grub/grub_2.04.bb
@@ -16,12 +16,15 @@ FILES_${PN}-common = " \
     ${sbindir} \
     ${datadir}/grub \
 "
-
-FILES_${PN}-common_append_aarch64 = " \
-    ${libdir}/${BPN} \
-"
+ALLOW_EMPTY_${PN} = "1"
 
 do_install_append () {
+    # Avoid conflicts with the EFI package for systems such as arm64 where we
+    # need to build grub and grub-efi but only EFI is supported by removing EFI
+    # from this package.
+    rm -rf ${D}${libdir}/grub/*-efi/
+    rmdir --ignore-fail-on-non-empty ${D}${libdir}/grub ${D}${libdir}
+
     install -d ${D}${sysconfdir}/grub.d
     # Remove build host references...
     find "${D}" -name modinfo.sh -type f -exec \
-- 
2.25.1


                 reply	other threads:[~2021-02-22 18:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210222180637.2337318-1-ross.burton@arm.com \
    --to=ross@burtonini.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.