]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: bootimg-efi: add label source parameter
authorChee Yang Lee <chee.yang.lee@intel.com>
Thu, 30 May 2019 07:30:49 +0000 (15:30 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 May 2019 11:34:56 +0000 (12:34 +0100)
Add new source parameter label to allow custom boot.conf/grub.cfg label,
so far it's hardcoded to "Boot".

Default label to "Boot" for systemd-boot and blank for grub-efi when source
parameter label are not set.

Signed-off-by: Chee Yang Lee <chee.yang.lee at intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/bootimg-efi.py

index 652323fa77b2247b6f39fcaa2d334469624cd905..70cc1b01bc9b1c2f321e0ab8cc82d52be6f56862 100644 (file)
@@ -73,8 +73,13 @@ class BootimgEFIPlugin(SourcePlugin):
 
             kernel = "/bzImage"
 
-            grubefi_conf += "linux %s root=%s rootwait %s\n" \
-                % (kernel, creator.rootdev, bootloader.append)
+            label = source_params.get('label')
+            label_conf = "root=%s" % creator.rootdev
+            if label:
+                label_conf = "LABEL=%s" % label
+
+            grubefi_conf += "linux %s %s rootwait %s\n" \
+                % (kernel, label_conf, bootloader.append)
 
             if initrd:
                grubefi_conf += "initrd /%s\n" % initrd
@@ -144,8 +149,14 @@ class BootimgEFIPlugin(SourcePlugin):
             boot_conf = ""
             boot_conf += "title %s\n" % (title if title else "boot")
             boot_conf += "linux %s\n" % kernel
-            boot_conf += "options LABEL=Boot root=%s %s\n" % \
-                             (creator.rootdev, bootloader.append)
+
+            label = source_params.get('label')
+            label_conf = "LABEL=Boot root=%s" % creator.rootdev
+            if label:
+                label_conf = "LABEL=%s" % label
+
+            boot_conf += "options %s %s\n" % \
+                             (label_conf, bootloader.append)
 
             if initrd:
                 boot_conf += "initrd /%s\n" % initrd