diff mbox series

[kirkstone+,1/2] conf: machine: include: k3: Select correct WKS file

Message ID 20230504123736.1475746-1-d.schultz@phytec.de
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [kirkstone+,1/2] conf: machine: include: k3: Select correct WKS file | expand

Commit Message

Daniel Schultz May 4, 2023, 12:37 p.m. UTC
Select the correct WKS file according to the MACHINE_FEATURE efi.

Right now, the sdimage-2part-efi.wks is set by default. Switch to the
sdimage-2part.wks file, if efi was removed from MACHINE_FEATURES to allow
non-efi boot methods.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
 meta-ti-bsp/conf/machine/include/k3.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Denys Dmytriyenko May 6, 2023, 1:47 a.m. UTC | #1
On Thu, May 04, 2023 at 05:37:35AM -0700, Daniel Schultz wrote:
> Select the correct WKS file according to the MACHINE_FEATURE efi.
> 
> Right now, the sdimage-2part-efi.wks is set by default. Switch to the
> sdimage-2part.wks file, if efi was removed from MACHINE_FEATURES to allow
> non-efi boot methods.
> 
> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
>  meta-ti-bsp/conf/machine/include/k3.inc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
> index 31da2ca9..fff15505 100644
> --- a/meta-ti-bsp/conf/machine/include/k3.inc
> +++ b/meta-ti-bsp/conf/machine/include/k3.inc
> @@ -50,7 +50,8 @@ IMAGE_EFI_BOOT_FILES ?= "${IMAGE_BOOT_FILES}"
>  EFI_PROVIDER ?= "grub-efi"
>  MACHINE_FEATURES += "efi"
>  
> -WKS_FILE ?= "sdimage-2part-efi.wks"
> +WKS_FILE ?= "${@bb.utils.contains("MACHINE_FEATURES", "efi", "sdimage-2part-efi.wks", "sdimage-2part.wks", d)}"

Well, "efi" gets added to MACHINE_FEATURES just one line above. So, in order 
to disable it, you'd have to modify MACHINE_FEATURES in your configuration, at 
which point it is even more easier to set WKS_FILE there too, as it's weakly 
assigned here anyway...

But I guess I don't mind a little bit more automation either, even if it gets 
the code more complicated.


>  do_image_wic[depends] += "virtual/bootloader:do_deploy"
>  do_image_complete[mcdepends] += "mc::k3r5:ti-sci-fw:do_deploy"
>  
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
index 31da2ca9..fff15505 100644
--- a/meta-ti-bsp/conf/machine/include/k3.inc
+++ b/meta-ti-bsp/conf/machine/include/k3.inc
@@ -50,7 +50,8 @@  IMAGE_EFI_BOOT_FILES ?= "${IMAGE_BOOT_FILES}"
 EFI_PROVIDER ?= "grub-efi"
 MACHINE_FEATURES += "efi"
 
-WKS_FILE ?= "sdimage-2part-efi.wks"
+WKS_FILE ?= "${@bb.utils.contains("MACHINE_FEATURES", "efi", "sdimage-2part-efi.wks", "sdimage-2part.wks", d)}"
+
 do_image_wic[depends] += "virtual/bootloader:do_deploy"
 do_image_complete[mcdepends] += "mc::k3r5:ti-sci-fw:do_deploy"