From d7d1e0193c94abb1cd2daf1c298c8c1788f3616d Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 22 Mar 2016 02:48:19 -0700 Subject: bootimg.bbclass: fix settings for grub-efi.bbclass Fixed: - Found potential conflicted var LABELS ... Set LABELS to "boot install" would build out broken images when build vm + live together, use set_live_vm_vars() to fix the problem. - Use ROOT and LABEL in boot-directdisk.bbclass and image-foo.bbclass, they are not only used by syslinux.bbclass, but also grub-efi.bbclass, add "SYSLINUX_" prefix would mislead users. Signed-off-by: Robert Yang Signed-off-by: Ross Burton --- meta/classes/image.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'meta/classes/image.bbclass') diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 3ab432e06c..560cc6d894 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -539,3 +539,16 @@ do_bundle_initramfs () { : } addtask bundle_initramfs after do_image_complete + +# 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 = ['SYSLINUX_CFG', 'ROOT', 'LABELS', 'INITRD'] + for var in vars: + var_with_suffix = var + '_' + suffix + if d.getVar(var, True): + bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \ + (var, var_with_suffix, var)) + elif d.getVar(var_with_suffix, True): + d.setVar(var, d.getVar(var_with_suffix, True)) + -- cgit v1.2.3