Openembedded Core Discussions
 help / color / mirror / Atom feed
From: dbaryshkov@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
Subject: [PATCH v3 4/5] systemd-boot: replace anonymous function with static configuration
Date: Tue, 15 Oct 2019 00:50:13 +0300	[thread overview]
Message-ID: <20191014215014.9656-4-dbaryshkov@gmail.com> (raw)
In-Reply-To: <20191014215014.9656-1-dbaryshkov@gmail.com>

From: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>

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

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
 meta/recipes-core/systemd/systemd-boot_243.bb | 23 +++++++------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd-boot_243.bb b/meta/recipes-core/systemd/systemd-boot_243.bb
index 515abc289bef..5d07177a335c 100644
--- a/meta/recipes-core/systemd/systemd-boot_243.bb
+++ b/meta/recipes-core/systemd/systemd-boot_243.bb
@@ -28,20 +28,9 @@ EXTRA_OEMESON += "-Defi=true \
                   -Defi-objcopy='${OBJCOPY}' \
                   "
 
-# 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') == "systemd-boot" else "systemd-"
-    systemdimage = prefix + d.getVar("EFI_BOOT_IMAGE")
-    d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
-    prefix = "systemd-" if prefix == "" else ""
-    d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
-}
+SYSTEMD_BOOT_IMAGE = "systemd-${EFI_BOOT_IMAGE}"
 
-FILES_${PN} = "${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}"
+FILES_${PN} = "${EFI_FILES_PATH}"
 
 RDEPENDS_${PN} += "virtual/systemd-bootconf"
 
@@ -56,12 +45,16 @@ do_compile() {
 		SYSTEMD_BOOT_EFI_ARCH="x64"
 	fi
 
-	ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
+	ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE}
 }
 
 do_install() {
 	install -d ${D}${EFI_FILES_PATH}
-	install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}
+	if [ "${EFI_PROVIDER}" = "${BPN}" ] ; then
+		install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${EFI_BOOT_IMAGE}
+	else
+		install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}
+	fi
 }
 
 do_deploy () {
-- 
2.23.0



  parent reply	other threads:[~2019-10-14 21:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 21:50 [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case dbaryshkov
2019-10-14 21:50 ` [PATCH v3 2/5] multilib.conf: add systemd-boot to non-multilib recipes list dbaryshkov
2019-10-14 21:50 ` [PATCH v3 3/5] grub-efi: replace anonymous function with static configuration dbaryshkov
2019-10-14 21:50 ` dbaryshkov [this message]
2019-10-14 21:50 ` [PATCH v3 5/5] image-uefi.conf: define generic EFI_COMPATIBLE_HOST dbaryshkov
2019-10-22 19:24 ` [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case Dmitry Eremin-Solenikov

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=20191014215014.9656-4-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=dmitry_eremin-solenikov@mentor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox