Re: [OE-core] [PATCH 1/5] grub-efi: replace anonymous function with static configuration

2019-10-13 Thread Richard Purdie
On Sun, 2019-09-29 at 13:15 +0300, dbarysh...@gmail.com wrote:
> From: Dmitry Eremin-Solenikov 
> 
> Replace anonymous function setting GRUB_* variables with static
> configuration, since grub-efi.bbclass will use fixed names for grub
> bootloader.
> 
> Signed-off-by: Dmitry Eremin-Solenikov <
> dmitry_eremin-soleni...@mentor.com>
> ---
>  meta/recipes-bsp/grub/grub-efi_2.04.bb | 40 --
> 
>  1 file changed, 18 insertions(+), 22 deletions(-)

This series failed in testing. There were two selftest failures:

2019-10-12 16:27:33,173 - oe-selftest - INFO - RESULTS - 
efibootpartition.GenericEFITest.test_boot_efi: ERROR (2101.45s)
2019-10-12 16:27:33,173 - oe-selftest - INFO - RESULTS - 
distrodata.Distrodata.test_maintainers: FAILED (106.07s)

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/430
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/430
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/430
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/426

Also shim appears to have build issues during deployment:

https://autobuilder.yoctoproject.org/typhoon/#/builders/52/builds/1114
https://autobuilder.yoctoproject.org/typhoon/#/builders/108/builds/23

Cheers,

Richard


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/5] grub-efi: replace anonymous function with static configuration

2019-09-29 Thread dbaryshkov
From: Dmitry Eremin-Solenikov 

Replace anonymous function setting GRUB_* variables with static
configuration, since grub-efi.bbclass will use fixed names for grub
bootloader.

Signed-off-by: Dmitry Eremin-Solenikov 
---
 meta/recipes-bsp/grub/grub-efi_2.04.bb | 40 --
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi_2.04.bb 
b/meta/recipes-bsp/grub/grub-efi_2.04.bb
index b9d6225d2774..419f25c014b9 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.04.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.04.bb
@@ -13,26 +13,22 @@ SRC_URI += " \
 
 S = "${WORKDIR}/grub-${PV}"
 
-# Determine the target arch for the grub modules
+GRUB_TARGET = "UNSUPPORTED"
+GRUB_TARGET_x86-64 = "x86_64"
+GRUB_TARGET_x86 = "i386"
+GRUB_TARGET_aarch64 = "arm64"
+GRUB_TARGET_arm = "arm"
+
+GRUB_IMAGE = "grub-efi-${EFI_BOOT_IMAGE}"
+
+# install to the image as boot*.efi if its the EFI_PROVIDER,
+# otherwise install as the full name.
+# This allows multiple bootloaders to coexist in a single image.
 python __anonymous () {
-import re
-target = d.getVar('TARGET_ARCH')
-prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
-if target == "x86_64":
-grubtarget = 'x86_64'
-elif re.match('i.86', target):
-grubtarget = 'i386'
-elif re.match('aarch64', target):
-grubtarget = 'arm64'
-elif re.match('arm', target):
-grubtarget = 'arm'
+if d.getVar('EFI_PROVIDER') == "grub-efi":
+d.setVar("GRUB_EFI_BOOT_IMAGE", d.getVar("EFI_BOOT_IMAGE"))
 else:
-raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % 
target)
-grubimage = prefix + d.getVar("EFI_BOOT_IMAGE")
-d.setVar("GRUB_TARGET", grubtarget)
-d.setVar("GRUB_IMAGE", grubimage)
-prefix = "grub-efi-" if prefix == "" else ""
-d.setVar("GRUB_IMAGE_PREFIX", prefix)
+d.setVar("GRUB_EFI_BOOT_IMAGE", d.getVar("GRUB_IMAGE"))
 }
 
 inherit deploy
@@ -45,7 +41,7 @@ do_mkimage() {
# Search for the grub.cfg on the local boot media by using the
# built in cfg file provided via this recipe
grub-mkimage -c ../cfg -p ${EFIDIR} -d ./grub-core/ \
-  -O ${GRUB_TARGET}-efi -o 
./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
+  -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
   ${GRUB_BUILDIN}
 }
 
@@ -57,7 +53,7 @@ do_mkimage_class-native() {
 
 do_install_append_class-target() {
install -d ${D}${EFI_FILES_PATH}
-   install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} 
${D}${EFI_FILES_PATH}/${GRUB_IMAGE}
+   install -m 644 ${B}/${GRUB_IMAGE} 
${D}${EFI_FILES_PATH}/${GRUB_EFI_BOOT_IMAGE}
 }
 
 do_install_class-native() {
@@ -86,7 +82,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos 
part_gpt normal \
  efi_gop iso9660 configfile search loadenv test"
 
 do_deploy() {
-   install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
+   install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
 }
 
 do_deploy_class-native() {
@@ -97,7 +93,7 @@ addtask deploy after do_install before do_build
 
 FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
${datadir}/grub \
-   ${EFI_FILES_PATH}/${GRUB_IMAGE} \
+   ${EFI_FILES_PATH}/${GRUB_EFI_BOOT_IMAGE} \
"
 
 FILES_${PN}_remove_aarch64 = "${libdir}/grub/${GRUB_TARGET}-efi"
-- 
2.23.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core