All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic/bootimg-efi: Add option for only installing the bootloader
@ 2021-09-08 10:36 Kristian Klausen
  2021-09-09 18:35 ` Kristian Klausen
  0 siblings, 1 reply; 2+ messages in thread
From: Kristian Klausen @ 2021-09-08 10:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Kristian Klausen

systemd-boot supports automatic detection of Unified Kernel Images[1] if
the are installed into $BOOT/EFI/Linux/ with a .efi extension. In that
case a boot entry isn't needed nor is the normal kernel as the Unified
Kernel Image would likely be installed with IMAGE_EFI_BOOT_FILES.

[1] https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images

Signed-off-by: Kristian Klausen <kristian@klausen.dk>
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index cdc72543c2..f8aace823d 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -38,6 +38,9 @@ class BootimgEFIPlugin(SourcePlugin):
         """
         Create loader-specific (grub-efi) config
         """
+        if source_params.get('bootloader-only') == "true":
+            return
+
         configfile = creator.ks.bootloader.configfile
         custom_cfg = None
         if configfile:
@@ -110,6 +113,9 @@ class BootimgEFIPlugin(SourcePlugin):
         """
         Create loader-specific systemd-boot/gummiboot config
         """
+        if source_params.get('bootloader-only') == "true":
+            return
+
         install_cmd = "install -d %s/loader" % hdddir
         exec_cmd(install_cmd)
 
@@ -288,9 +294,10 @@ class BootimgEFIPlugin(SourcePlugin):
                 kernel = "%s-%s.bin" % \
                     (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
 
-        install_cmd = "install -m 0644 %s/%s %s/%s" % \
-            (staging_kernel_dir, kernel, hdddir, kernel)
-        exec_cmd(install_cmd)
+        if not source_params.get('bootloader-only') == "true":
+            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] 2+ messages in thread

* Re: [PATCH] wic/bootimg-efi: Add option for only installing the bootloader
  2021-09-08 10:36 [PATCH] wic/bootimg-efi: Add option for only installing the bootloader Kristian Klausen
@ 2021-09-09 18:35 ` Kristian Klausen
  0 siblings, 0 replies; 2+ messages in thread
From: Kristian Klausen @ 2021-09-09 18:35 UTC (permalink / raw)
  To: openembedded-core; +Cc: Kristian Klausen

On Wed, Sep 08, 2021 at 12:36:04PM +0200, Kristian Klausen wrote:
> systemd-boot supports automatic detection of Unified Kernel Images[1] if
> the are installed into $BOOT/EFI/Linux/ with a .efi extension. In that
> case a boot entry isn't needed nor is the normal kernel as the Unified
> Kernel Image would likely be installed with IMAGE_EFI_BOOT_FILES.
> 
> [1] https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images

This patch is no longer needed for using a Unified Kernel Image with
systemd-boot with this new patch I sent:
"[PATCH] wic/bootimg-efi: Add Unified Kernel Image option"[1]

It is perhaps still useful tho.

[1] https://lists.openembedded.org/g/openembedded-core/topic/patch_wic_bootimg_efi_add/85490739

> 
> Signed-off-by: Kristian Klausen <kristian@klausen.dk>
> ---
>  scripts/lib/wic/plugins/source/bootimg-efi.py | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
> index cdc72543c2..f8aace823d 100644
> --- a/scripts/lib/wic/plugins/source/bootimg-efi.py
> +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
> @@ -38,6 +38,9 @@ class BootimgEFIPlugin(SourcePlugin):
>          """
>          Create loader-specific (grub-efi) config
>          """
> +        if source_params.get('bootloader-only') == "true":
> +            return
> +
>          configfile = creator.ks.bootloader.configfile
>          custom_cfg = None
>          if configfile:
> @@ -110,6 +113,9 @@ class BootimgEFIPlugin(SourcePlugin):
>          """
>          Create loader-specific systemd-boot/gummiboot config
>          """
> +        if source_params.get('bootloader-only') == "true":
> +            return
> +
>          install_cmd = "install -d %s/loader" % hdddir
>          exec_cmd(install_cmd)
>  
> @@ -288,9 +294,10 @@ class BootimgEFIPlugin(SourcePlugin):
>                  kernel = "%s-%s.bin" % \
>                      (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
>  
> -        install_cmd = "install -m 0644 %s/%s %s/%s" % \
> -            (staging_kernel_dir, kernel, hdddir, kernel)
> -        exec_cmd(install_cmd)
> +        if not source_params.get('bootloader-only') == "true":
> +            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	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-09 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 10:36 [PATCH] wic/bootimg-efi: Add option for only installing the bootloader Kristian Klausen
2021-09-09 18:35 ` Kristian Klausen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.