diff mbox series

[1/2] uboot-extlinux-config.bbclass: simplify FDT/FDTDIR logic

Message ID 20241219-extlinux-overlays-v1-1-9a2eb81c1efa@cherry.de
State New
Headers show
Series uboot-extlinux-config.bbclass: add support for DTBOs | expand

Commit Message

Quentin Schulz Dec. 19, 2024, 3:25 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

The three blocks share the same LABEL and KERNEL content, so let's
factor that part out.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 meta/classes-recipe/uboot-extlinux-config.bbclass | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/uboot-extlinux-config.bbclass b/meta/classes-recipe/uboot-extlinux-config.bbclass
index 0413e760bd1392df5c4cec5b8888d350c5044647..a6938ab0631ac0d0a06828a721d5da4d0a77199a 100644
--- a/meta/classes-recipe/uboot-extlinux-config.bbclass
+++ b/meta/classes-recipe/uboot-extlinux-config.bbclass
@@ -137,14 +137,12 @@  python do_create_extlinux_config() {
 
                 fdt = localdata.getVar('UBOOT_EXTLINUX_FDT')
 
+                cfgfile.write('LABEL %s\n\tKERNEL %s\n' % (menu_description, kernel_image))
+
                 if fdt:
-                    cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDT %s\n' %
-                                 (menu_description, kernel_image, fdt))
+                    cfgfile.write('\tFDT %s\n' % (fdt))
                 elif fdtdir:
-                    cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
-                                 (menu_description, kernel_image, fdtdir))
-                else:
-                    cfgfile.write('LABEL %s\n\tKERNEL %s\n' % (menu_description, kernel_image))
+                    cfgfile.write('\tFDTDIR %s\n' % (fdtdir))
 
                 kernel_args = localdata.getVar('UBOOT_EXTLINUX_KERNEL_ARGS')