Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] wic/plugins/source/bootimg-efi: Configure installation of
@ 2023-02-07 19:03 Kareem Zarka
  2023-02-07 19:03 ` [PATCH] meta/lib/oeqa/selftest/cases/wic: Add tests for kernel Kareem Zarka
  2023-02-08 22:20 ` [OE-core] [PATCH] wic/plugins/source/bootimg-efi: Configure installation of Luca Ceresoli
  0 siblings, 2 replies; 3+ messages in thread
From: Kareem Zarka @ 2023-02-07 19:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: Kareem Zarka, Stefan Schmidt, Kareem Zarka

The issue with installing the kernel image to both rootfs
and boot partition is that some systems rely on the kernel image in
rootfs and not in the boot partition.
This leads to duplication of the kernel image, which can cause
unnecessary storage usage.

This patch provides a solution to the problem by adding a new parameter
"install-kernel-into-boot-dir" to the wic kickstart file.
If this parameter is set to 'true', the plugin will install the
kernel image to the boot partition. If the parameter is set to 'false',
the plugin will skip installing the kernel image, avoiding duplication.

Tests for this functionality will be added in the next patch.

Signed-off-by: Kareem Zarka <kareem.zarka@huawei.com>
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 4b00913a70..4e99d37f26 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -363,9 +363,10 @@ class BootimgEFIPlugin(SourcePlugin):
                 objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir)
                 exec_native_cmd(objcopy_cmd, native_sysroot)
         else:
-            install_cmd = "install -m 0644 %s/%s %s/%s" % \
-                (staging_kernel_dir, kernel, hdddir, kernel)
-            exec_cmd(install_cmd)
+            if source_params.get('install-kernel-into-boot-dir') != 'false':
+                install_cmd = "install -m 0644 %s/%s %s/%s" % \
+                    (staging_kernel_dir, kernel, hdddir, kernel)
+                exec_cmd(install_cmd)
 
         if get_bitbake_var("IMAGE_EFI_BOOT_FILES"):
             for src_path, dst_path in cls.install_task:
-- 
2.25.1



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

end of thread, other threads:[~2023-02-08 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 19:03 [PATCH] wic/plugins/source/bootimg-efi: Configure installation of Kareem Zarka
2023-02-07 19:03 ` [PATCH] meta/lib/oeqa/selftest/cases/wic: Add tests for kernel Kareem Zarka
2023-02-08 22:20 ` [OE-core] [PATCH] wic/plugins/source/bootimg-efi: Configure installation of Luca Ceresoli

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