diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/classes/live-vm-common.bbclass | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/classes/live-vm-common.bbclass')
-rw-r--r-- | poky/meta/classes/live-vm-common.bbclass | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/poky/meta/classes/live-vm-common.bbclass b/poky/meta/classes/live-vm-common.bbclass new file mode 100644 index 000000000..68105d9b8 --- /dev/null +++ b/poky/meta/classes/live-vm-common.bbclass @@ -0,0 +1,61 @@ +# Some of the vars for vm and live image are conflicted, this function +# is used for fixing the problem. +def set_live_vm_vars(d, suffix): + vars = ['GRUB_CFG', 'SYSLINUX_CFG', 'ROOT', 'LABELS', 'INITRD'] + for var in vars: + var_with_suffix = var + '_' + suffix + if d.getVar(var): + bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \ + (var, var_with_suffix, var)) + elif d.getVar(var_with_suffix): + d.setVar(var, d.getVar(var_with_suffix)) + + +EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}" +EFI_PROVIDER ?= "grub-efi" +EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}" + +MKDOSFS_EXTRAOPTS ??= "-S 512" + +# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not +# contain "efi". This way legacy is supported by default if neither is +# specified, maintaining the original behavior. +def pcbios(d): + pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d) + if pcbios == "0": + pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d) + return pcbios + +PCBIOS = "${@pcbios(d)}" +PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS') == '1']}" + +inherit ${EFI_CLASS} +inherit ${PCBIOS_CLASS} + +populate_kernel() { + dest=$1 + install -d $dest + + # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use. + bbnote "Trying to install ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} as $dest/${KERNEL_IMAGETYPE}" + if [ -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ]; then + install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} $dest/${KERNEL_IMAGETYPE} + else + bbwarn "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} doesn't exist" + fi + + # initrd is made of concatenation of multiple filesystem images + if [ -n "${INITRD}" ]; then + rm -f $dest/initrd + for fs in ${INITRD} + do + if [ -s "$fs" ]; then + cat $fs >> $dest/initrd + else + bbfatal "$fs is invalid. initrd image creation failed." + fi + done + chmod 0644 $dest/initrd + fi +} + |