[oe-commits] [openembedded-core] 10/11: wic/bootimg-efi: allow multiple initrd

git at git.openembedded.org git at git.openembedded.org
Mon Jun 17 15:59:46 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 21386ce48c79aa590d65f34fb21c99bd166bc009
Author: Chee Yang Lee <chee.yang.lee at intel.com>
AuthorDate: Thu Jun 13 14:21:36 2019 +0800

    wic/bootimg-efi: allow multiple initrd
    
    Allow plugin bootimg-efi to configure with multiple initrd
    through source parameter.
    
    Uses ; to separate each initrd.
    
    e.g:
    --sourceparams="loader=${EFI_PROVIDER},initrd=initrd1;initrd2"
    
    Signed-off-by: Chee Yang Lee <chee.yang.lee at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index d87db1f..f3440fb 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -55,8 +55,10 @@ class BootimgEFIPlugin(SourcePlugin):
             if not bootimg_dir:
                 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
 
-            cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
-            exec_cmd(cp_cmd, True)
+            initrds = initrd.split(';')
+            for rd in initrds:
+                cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
+                exec_cmd(cp_cmd, True)
         else:
             logger.debug("Ignoring missing initrd")
 
@@ -83,8 +85,11 @@ class BootimgEFIPlugin(SourcePlugin):
             grubefi_conf += "linux /%s %s rootwait %s\n" \
                 % (kernel, label_conf, bootloader.append)
 
-            if initrd:
-               grubefi_conf += "initrd /%s\n" % initrd
+            if initrds:
+                grubefi_conf += "initrd"
+                for rd in initrds:
+                    grubefi_conf += " /%s" % rd
+                grubefi_conf += "\n"
 
             grubefi_conf += "}\n"
 
@@ -119,8 +124,10 @@ class BootimgEFIPlugin(SourcePlugin):
             if not bootimg_dir:
                 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
 
-            cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
-            exec_cmd(cp_cmd, True)
+            initrds = initrd.split(';')
+            for rd in initrds:
+                cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
+                exec_cmd(cp_cmd, True)
         else:
             logger.debug("Ignoring missing initrd")
 
@@ -163,8 +170,9 @@ class BootimgEFIPlugin(SourcePlugin):
             boot_conf += "options %s %s\n" % \
                              (label_conf, bootloader.append)
 
-            if initrd:
-                boot_conf += "initrd /%s\n" % initrd
+            if initrds:
+                for rd in initrds:
+                    boot_conf += "initrd /%s\n" % rd
 
         logger.debug("Writing systemd-boot config "
                      "%s/hdd/boot/loader/entries/boot.conf", cr_workdir)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list