summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorChee Yang Lee <chee.yang.lee@intel.com>2019-06-19 16:41:09 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-19 22:13:39 +0100
commitfc0c36a647cb11a66ba3681c0c580af5dc95641f (patch)
treebef71f74eb674eb7c67c534ca541775205f8d586 /scripts/lib/wic
parentad636b506181b9b1a69df5877778a035ebb8e11e (diff)
downloadpoky-fc0c36a647cb11a66ba3681c0c580af5dc95641f.tar.gz
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" (From OE-Core rev: c7b0823f9ab6a9959aaa809b8c3f70d199feb64d) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index d87db1f1b0..5cc5c8a6b8 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):
55 if not bootimg_dir: 55 if not bootimg_dir:
56 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") 56 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
57 57
58 cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir) 58 initrds = initrd.split(';')
59 exec_cmd(cp_cmd, True) 59 for rd in initrds:
60 cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
61 exec_cmd(cp_cmd, True)
60 else: 62 else:
61 logger.debug("Ignoring missing initrd") 63 logger.debug("Ignoring missing initrd")
62 64
@@ -84,7 +86,11 @@ class BootimgEFIPlugin(SourcePlugin):
84 % (kernel, label_conf, bootloader.append) 86 % (kernel, label_conf, bootloader.append)
85 87
86 if initrd: 88 if initrd:
87 grubefi_conf += "initrd /%s\n" % initrd 89 initrds = initrd.split(';')
90 grubefi_conf += "initrd"
91 for rd in initrds:
92 grubefi_conf += " /%s" % rd
93 grubefi_conf += "\n"
88 94
89 grubefi_conf += "}\n" 95 grubefi_conf += "}\n"
90 96
@@ -119,8 +125,10 @@ class BootimgEFIPlugin(SourcePlugin):
119 if not bootimg_dir: 125 if not bootimg_dir:
120 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") 126 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
121 127
122 cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir) 128 initrds = initrd.split(';')
123 exec_cmd(cp_cmd, True) 129 for rd in initrds:
130 cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
131 exec_cmd(cp_cmd, True)
124 else: 132 else:
125 logger.debug("Ignoring missing initrd") 133 logger.debug("Ignoring missing initrd")
126 134
@@ -164,7 +172,9 @@ class BootimgEFIPlugin(SourcePlugin):
164 (label_conf, bootloader.append) 172 (label_conf, bootloader.append)
165 173
166 if initrd: 174 if initrd:
167 boot_conf += "initrd /%s\n" % initrd 175 initrds = initrd.split(';')
176 for rd in initrds:
177 boot_conf += "initrd /%s\n" % rd
168 178
169 logger.debug("Writing systemd-boot config " 179 logger.debug("Writing systemd-boot config "
170 "%s/hdd/boot/loader/entries/boot.conf", cr_workdir) 180 "%s/hdd/boot/loader/entries/boot.conf", cr_workdir)