diff mbox series

[isar-cip-core,v2,08/13] efibootguard: Fix empty command line case

Message ID 9e8df37239f072c7cc8e832cb0beccc8025a1f2d.1651769009.git.jan.kiszka@siemens.com (mailing list archive)
State New
Headers show
Series Fixes and improvements for SWUpdate images, kernel/config update | expand

Commit Message

Jan Kiszka May 5, 2022, 4:43 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

We crash in case of an empty command line with non-unified kernel images
right now. Just avoid cmdline==None, will also make upcoming changes
simpler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 scripts/lib/wic/plugins/source/efibootguard-boot.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/efibootguard-boot.py b/scripts/lib/wic/plugins/source/efibootguard-boot.py
index 909e629..9267033 100644
--- a/scripts/lib/wic/plugins/source/efibootguard-boot.py
+++ b/scripts/lib/wic/plugins/source/efibootguard-boot.py
@@ -80,7 +80,7 @@  class EfibootguardBootPlugin(SourcePlugin):
 
         boot_files = source_params.get("files", "").split(' ')
         unified_kernel = source_params.get("unified-kernel") or 'y'
-        cmdline = bootloader.append
+        cmdline = bootloader.append or ''
         if unified_kernel == 'y':
             boot_image = cls._create_unified_kernel_image(rootfs_dir,
                                                           cr_workdir,
@@ -113,7 +113,7 @@  class EfibootguardBootPlugin(SourcePlugin):
             % (
                 part.label.upper(),
                 boot_image,
-                '-a "%s"' % cmdline if cmdline else "",
+                '-a "%s"' % cmdline,
                 source_params.get("revision", 1),
                 wdog_timeout
             )