optionally allow to pass 'initrd' from .wks(.in) via sourceparams
Signed-off-by: Robert Berger <[email protected]>
---
.../lib/wic/plugins/source/bootimg-pcbios.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index a207a83530..c31851b56a 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -169,6 +169,25 @@ class BootimgPcbiosPlugin(SourcePlugin):
for install_cmd in cmds:
exec_cmd(install_cmd)
+ # this is hardcoded to where the cpio.gz is deployed to
+ deploy_dir_image = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ # this can be passed from the .wks.in file via sourceparams
+ initrd = source_params.get('initrd')
+ # for convenience added together
+ initrd_dir_and_file = os.path.join(deploy_dir_image, initrd)
+
+ # in case we have a separate cpio.gz let's copy it to
+ # the boot partition
+ if os.path.isfile(initrd_dir_and_file):
+ logger.debug("Found %s", initrd_dir_and_file)
+ else:
+ logger.debug("Did not find %s", initrd_dir_and_file)
+
+ new_cmd = ("install -m 444 %s %s" %
+ (initrd_dir_and_file, hdddir))
+
+ exec_cmd(new_cmd)
+
du_cmd = "du -bks %s" % hdddir
out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
--
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208432):
https://lists.openembedded.org/g/openembedded-core/message/208432
Mute This Topic: https://lists.openembedded.org/mt/109961018/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-