Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] wic/plugins/source/bootimg-efi: Skip installing kernel-image into boot.
@ 2023-02-06 19:16 Kareem Zarka
  2023-02-06 19:16 ` [PATCH] meta/lib/oeqa/selftest/cases/wic: Add tests for kernel installation and skip-kernel-install in wic plugin Kareem Zarka
  2023-02-07 10:49 ` [OE-core] [PATCH] wic/plugins/source/bootimg-efi: Skip installing kernel-image into boot Luca Ceresoli
  0 siblings, 2 replies; 7+ messages in thread
From: Kareem Zarka @ 2023-02-06 19:16 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 and potential compatibility issues.

This patch provides a solution to this problem by adding a new
parameter "skip-kernel-install" to the wic kickstart file, which can
be passed to the plugin.
If the parameter is provided, the plugin will skip installing the
kernel-image to the boot partition, avoiding duplication and potential
issues.

By adding this new parameter, we give the users the option to install
the kernel-image only in rootfs, or to install it in both rootfs and
boot partition, depending on their needs and preferences.
This will help to improve the system's storage usage and compatibility.

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 | 10 +++++++---
 1 file changed, 7 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..363b9f5242 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -363,9 +363,13 @@ 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)
+            # skip-kernal-install was added to source_params to conifgure installing the kernel-image.
+            # set skip_kernal_install in the kickstart file to skip installing it into hdddir.
+            # if not set then the kernel-image will be installed.
+            if not  source_params.get('skip-kernal-install'):
+                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] 7+ messages in thread

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-06 19:16 [PATCH] wic/plugins/source/bootimg-efi: Skip installing kernel-image into boot Kareem Zarka
2023-02-06 19:16 ` [PATCH] meta/lib/oeqa/selftest/cases/wic: Add tests for kernel installation and skip-kernel-install in wic plugin Kareem Zarka
2023-02-07 10:49 ` [OE-core] [PATCH] wic/plugins/source/bootimg-efi: Skip installing kernel-image into boot Luca Ceresoli
2023-02-07 12:32   ` Richard Purdie
2023-02-07 14:53     ` Kareem Zarka
2023-02-08  8:31     ` [OE-core] " Luca Ceresoli
2023-02-08 12:39       ` Kareem Zarka

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