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


Jan Kiszka
 

From: Jan Kiszka <jan.kiszka@...>

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@...>
---
scripts/lib/wic/plugins/source/efibootguard-boot.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

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
)
--
2.34.1

Join cip-dev@lists.cip-project.org to automatically receive all group messages.