summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorChee Yang Lee <chee.yang.lee@intel.com>2019-07-17 10:02:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-17 19:23:20 +0100
commitbac984fbb2d5ad5d13ba3275c8a3e878d8753c58 (patch)
tree99c521d6773872547168dff12f608af2fe9f4ea0 /scripts/lib/wic/plugins
parent4a46516256c24cb30bc9629371816f893693b488 (diff)
downloadopenembedded-core-contrib-bac984fbb2d5ad5d13ba3275c8a3e878d8753c58.tar.gz
wic: add support for kernel with initramfs bundled
when INITRAMFS_IMAGE_BUNDLE and INITRAMFS_IMAGE are set, wic should look for kernel with initramfs image bundled. Include required variable MACHINE, INITRAMFS_IMAGE_BUNDLE, INITRAMFS_IMAGE, INITRAMFS_LINK_NAME and KERNEL_IMAGETYPE in WICVARS. No longer require default value for variable kernel as KERNEL_IMAGETYPE is not optional variable and included in WICVARS. image_types_wic to inherit kernel-artifact-names to obtain default INITRAMFS_LINK_NAME when INITRAMFS_IMAGE_BUNDLE are set. update wic.Wic2.test_image_env test case to filter optional variable INITRAMFS_LINK_NAME, INITRAMFS_IMAGE and INITRAMFS_IMAGE_BUNDLE. 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/plugins')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py18
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py6
-rw-r--r--scripts/lib/wic/plugins/source/isoimage-isohybrid.py19
3 files changed, 29 insertions, 14 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 5cc5c8a6b8..2cfdc10ecd 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -74,8 +74,10 @@ class BootimgEFIPlugin(SourcePlugin):
grubefi_conf += "menuentry '%s'{\n" % (title if title else "boot")
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
label = source_params.get('label')
label_conf = "root=%s" % creator.rootdev
@@ -154,8 +156,10 @@ class BootimgEFIPlugin(SourcePlugin):
if not custom_cfg:
# Create systemd-boot configuration using parameters from wks file
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
title = source_params.get('title')
@@ -225,8 +229,10 @@ class BootimgEFIPlugin(SourcePlugin):
hdddir = "%s/hdd/boot" % cr_workdir
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
install_cmd = "install -m 0644 %s/%s %s/%s" % \
(staging_kernel_dir, kernel, hdddir, kernel)
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 670d347747..f2639e7004 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -150,8 +150,10 @@ class BootimgPcbiosPlugin(SourcePlugin):
hdddir = "%s/hdd/boot" % cr_workdir
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
cmds = ("install -m 0644 %s/%s %s/vmlinuz" %
(staging_kernel_dir, kernel, hdddir),
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 74d6f14519..24299c1ece 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -71,8 +71,11 @@ class IsoImagePlugin(SourcePlugin):
syslinux_conf += "LABEL boot\n"
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
+
syslinux_conf += "KERNEL /" + kernel + "\n"
syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" \
% bootloader.append
@@ -117,8 +120,10 @@ class IsoImagePlugin(SourcePlugin):
grubefi_conf += "menuentry 'boot'{\n"
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
grubefi_conf += "linux /%s rootwait %s\n" \
% (kernel, bootloader.append)
@@ -273,8 +278,10 @@ class IsoImagePlugin(SourcePlugin):
os.remove("%s/initrd.cpio.gz" % cr_workdir)
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1":
+ if get_bitbake_var("INITRAMFS_IMAGE"):
+ kernel = "%s-%s.bin" % \
+ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))
install_cmd = "install -m 0644 %s/%s %s/%s" % \
(kernel_dir, kernel, isodir, kernel)