public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot
@ 2022-09-15 15:04 Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 1/4] fix: do not overwrite kernel_dir in efi-isar wic Felix Moessbauer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Felix Moessbauer @ 2022-09-15 15:04 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, jan.kiszka, henning.schild, Felix Moessbauer

Changes since v1:

- fix overwrite of kernel_dir in bootimg-efi-isar in a non-intrusive way (p1)
- implement systemd-boot logic in a way without having inline-changes to the wic plugin

Best regards,
Felix

Felix Moessbauer (4):
  fix: do not overwrite kernel_dir in efi-isar wic
  wic: locate systemd-boot efi files in buildchroot
  Rework imager support for systemd-boot
  Install systemd-boot into buildchroot for qemuarm

 meta-isar/conf/multiconfig/qemuarm-bookworm.conf        | 2 +-
 meta/conf/distro/debian-common.conf                     | 6 +++---
 meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py | 7 ++++++-
 3 files changed, 10 insertions(+), 5 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] fix: do not overwrite kernel_dir in efi-isar wic
  2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
@ 2022-09-15 15:04 ` Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 2/4] wic: locate systemd-boot efi files in buildchroot Felix Moessbauer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Felix Moessbauer @ 2022-09-15 15:04 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, jan.kiszka, henning.schild, Felix Moessbauer

This fixes the overwrite of the kernel_dir in bootimg-efi-isar
without having in-line changes.
The change is written in a way that makes it easy to update the
plugin without having to resolve merge conflicts.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
index 6e6cd6ec..bdc04547 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
@@ -436,10 +436,15 @@ class BootimgEFIPlugin(SourcePlugin):
                     grub_cmd += "reiserfs regexp " + grub_modules
                     exec_cmd(grub_cmd)
             elif source_params['loader'] == 'systemd-boot':
+                # backup kernel dir before overwriting
+                kernel_dir_orig = kernel_dir
                 kernel_dir = os.path.join(rootfs_dir['ROOTFS_DIR'], "usr/lib/systemd/boot/efi/")
+
                 for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]:
                     cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
                     exec_cmd(cp_cmd, True)
+
+                kernel_dir = kernel_dir_orig
             else:
                 raise WicError("unrecognized bootimg-efi-isar loader: %s" %
                                source_params['loader'])
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] wic: locate systemd-boot efi files in buildchroot
  2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 1/4] fix: do not overwrite kernel_dir in efi-isar wic Felix Moessbauer
@ 2022-09-15 15:04 ` Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 3/4] Rework imager support for systemd-boot Felix Moessbauer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Felix Moessbauer @ 2022-09-15 15:04 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, jan.kiszka, henning.schild, Felix Moessbauer

This patch locates the systemd-boot efi files in the
buildchroot and not the target chroot.
By that, no imager-specifc dependencies have to be installed
in the target rootfs.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
index bdc04547..006c8bc2 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
@@ -438,7 +438,7 @@ class BootimgEFIPlugin(SourcePlugin):
             elif source_params['loader'] == 'systemd-boot':
                 # backup kernel dir before overwriting
                 kernel_dir_orig = kernel_dir
-                kernel_dir = os.path.join(rootfs_dir['ROOTFS_DIR'], "usr/lib/systemd/boot/efi/")
+                kernel_dir = "/usr/lib/systemd/boot/efi/"
 
                 for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]:
                     cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] Rework imager support for systemd-boot
  2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 1/4] fix: do not overwrite kernel_dir in efi-isar wic Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 2/4] wic: locate systemd-boot efi files in buildchroot Felix Moessbauer
@ 2022-09-15 15:04 ` Felix Moessbauer
  2022-09-15 15:04 ` [PATCH v2 4/4] Install systemd-boot into buildchroot for qemuarm Felix Moessbauer
  2022-09-23 10:28 ` [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Felix Moessbauer @ 2022-09-15 15:04 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, jan.kiszka, henning.schild, Felix Moessbauer

This is an addendum to a1e441.

As the imager now reads the systemd-boot files from the
buildchroot, we install the systemd-boot deps there (instead of
installing into the target image).
By that, use SYSTEMD_BOOTLOADER_INSTALL together with
IMAGER_INSTALL in configs.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/conf/distro/debian-common.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/conf/distro/debian-common.conf b/meta/conf/distro/debian-common.conf
index 9203b34b..a2c23cb4 100644
--- a/meta/conf/distro/debian-common.conf
+++ b/meta/conf/distro/debian-common.conf
@@ -28,9 +28,9 @@ GRUB_BOOTLOADER_INSTALL_arm64 = "grub-efi-arm64-bin"
 
 SYSLINUX_BOOTLOADER_INSTALL = "syslinux syslinux-common"
 
-SYSTEMD_BOOTLOADER_PREINSTALL = "systemd"
-SYSTEMD_BOOTLOADER_PREINSTALL_debian-bookworm = "systemd-boot"
-SYSTEMD_BOOTLOADER_PREINSTALL_debian-sid-ports = "systemd-boot"
+SYSTEMD_BOOTLOADER_INSTALL = "systemd"
+SYSTEMD_BOOTLOADER_INSTALL_debian-bookworm = "systemd-boot"
+SYSTEMD_BOOTLOADER_INSTALL_debian-sid-ports = "systemd-boot"
 
 COMPAT_DISTRO_ARCH_amd64 = "i386"
 COMPAT_DISTRO_ARCH_arm64 = "armhf"
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] Install systemd-boot into buildchroot for qemuarm
  2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
                   ` (2 preceding siblings ...)
  2022-09-15 15:04 ` [PATCH v2 3/4] Rework imager support for systemd-boot Felix Moessbauer
@ 2022-09-15 15:04 ` Felix Moessbauer
  2022-09-23 10:28 ` [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Felix Moessbauer @ 2022-09-15 15:04 UTC (permalink / raw)
  To: isar-users; +Cc: amikan, jan.kiszka, henning.schild, Felix Moessbauer

This patch reworks the qemuarm target and installs
the systemd-boot dependency into the buildchroot
rather than the target chroot.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta-isar/conf/multiconfig/qemuarm-bookworm.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/conf/multiconfig/qemuarm-bookworm.conf b/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
index c82abf30..126935b0 100644
--- a/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
@@ -6,4 +6,4 @@ DISTRO ?= "debian-bookworm"
 IMAGE_FSTYPES_append = " wic"
 WKS_FILE ?= "sdimage-efi-sd"
 
-IMAGE_PREINSTALL += "${SYSTEMD_BOOTLOADER_PREINSTALL}"
+IMAGER_INSTALL += "${SYSTEMD_BOOTLOADER_INSTALL}"
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot
  2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
                   ` (3 preceding siblings ...)
  2022-09-15 15:04 ` [PATCH v2 4/4] Install systemd-boot into buildchroot for qemuarm Felix Moessbauer
@ 2022-09-23 10:28 ` Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2022-09-23 10:28 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users; +Cc: jan.kiszka, henning.schild

15.09.2022 18:04, Felix Moessbauer wrote:
> Changes since v1:
>
> - fix overwrite of kernel_dir in bootimg-efi-isar in a non-intrusive way (p1)
> - implement systemd-boot logic in a way without having inline-changes to the wic plugin
>
> Best regards,
> Felix
>
> Felix Moessbauer (4):
>    fix: do not overwrite kernel_dir in efi-isar wic
>    wic: locate systemd-boot efi files in buildchroot
>    Rework imager support for systemd-boot
>    Install systemd-boot into buildchroot for qemuarm
>
>   meta-isar/conf/multiconfig/qemuarm-bookworm.conf        | 2 +-
>   meta/conf/distro/debian-common.conf                     | 6 +++---
>   meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py | 7 ++++++-
>   3 files changed, 10 insertions(+), 5 deletions(-)
>
Hello Felix,

This patchset fails on mc:qemuamd64-focal:isar-image-base with:
| FileNotFoundError: [Errno 2] No such file or directory: 
'/usr/lib/systemd/boot/efi/'


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-23 10:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 15:04 [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Felix Moessbauer
2022-09-15 15:04 ` [PATCH v2 1/4] fix: do not overwrite kernel_dir in efi-isar wic Felix Moessbauer
2022-09-15 15:04 ` [PATCH v2 2/4] wic: locate systemd-boot efi files in buildchroot Felix Moessbauer
2022-09-15 15:04 ` [PATCH v2 3/4] Rework imager support for systemd-boot Felix Moessbauer
2022-09-15 15:04 ` [PATCH v2 4/4] Install systemd-boot into buildchroot for qemuarm Felix Moessbauer
2022-09-23 10:28 ` [PATCH v2 0/4] systemd-boot: Locate imager deps in buildchroot Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox