[OE-core] [PATCH] grub/grub-efi: fix conflict for aach64

changqing.li at windriver.com changqing.li at windriver.com
Thu Aug 8 05:51:22 UTC 2019


From: Changqing Li <changqing.li at windriver.com>

MACHINE = qemuarm64
IMAGE_INSTALL_append = ' grub grub-efi'

do_rootfs failed with error:
file /usr/lib64/grub/arm64-efi/acpi.module conflicts between attempted installs of grub-2.02-r0.aarch64 and grub-efi-2.02-r0.aarch64
file /usr/lib64/grub/arm64-efi/adler32.module conflicts between attempted installs of grub-2.02-r0.aarch64 and grub-efi-2.02-r0.aarch64
...
file /usr/lib64/grub/arm64-efi/zfsinfo.module conflicts between attempted installs of grub-2.02-r0.aarch64 and grub-efi-2.02-r0.aarch64

For arm64, grub and grub-efi both compiled GRUBD2 with platform
arm64-efi, arm64 only support platform efi. So both packages have
almost same folder and content /usr/lib64/grub/arm64-efi/*

if Machine set to qemux86_64, do_rootfs will not have this problem,
since for grub, it compiled with platform i386-pc, for grub-efi,
compiled with platform x86-64-efi.

>From commit:
commit 4e9bb03238af48c70075037a77094a8c1bddf284
Author: Hongxu Jia <hongxu.jia at windriver.com>
Date:   Wed Jan 17 03:25:58 2018 -0500

    grub/grub-efi: fix conflict

    While installing grub and grub-efi, there are conflict files
    in ${sysconfdir} ${datadir} ${bindir} ${sbindir}.

    - Since all of the conflicted files are tools which is
      common for grub and grub-efi, we split them (except
      grub-editenv) to grub-common in grub.

common tools for grub and grub-efi are installed into grub-common,
for aarch64, also shipped libdir into this common packages.
in this way, for qemuarm64, package grub is empty, and package grub-efi
use lib in package grub-common

Signed-off-by: Changqing Li <changqing.li at windriver.com>
---
 meta/recipes-bsp/grub/grub-efi_2.04.bb | 5 +++++
 meta/recipes-bsp/grub/grub_2.04.bb     | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/meta/recipes-bsp/grub/grub-efi_2.04.bb b/meta/recipes-bsp/grub/grub-efi_2.04.bb
index 0028a9b..104a1c0 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.04.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.04.bb
@@ -81,6 +81,10 @@ do_install_class-target() {
         {} +
 }
 
+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"
 
@@ -99,6 +103,7 @@ FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
                /boot/EFI/BOOT/${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"
diff --git a/meta/recipes-bsp/grub/grub_2.04.bb b/meta/recipes-bsp/grub/grub_2.04.bb
index e097375..1d1a456 100644
--- a/meta/recipes-bsp/grub/grub_2.04.bb
+++ b/meta/recipes-bsp/grub/grub_2.04.bb
@@ -14,6 +14,10 @@ FILES_${PN}-common = " \
     ${datadir}/grub \
 "
 
+FILES_${PN}-common_append_aarch64 = " \
+    ${libdir}/${BPN} \
+"
+
 do_install_append () {
     install -d ${D}${sysconfdir}/grub.d
     # Remove build host references...
-- 
2.7.4



More information about the Openembedded-core mailing list