diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-03-22 02:48:19 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-25 10:29:16 +0000 |
commit | 4ebaeb281bc70a9962ab9f4c49c0a2587fe3487a (patch) | |
tree | 9505154827b8f99b1f8279310f8719f145740012 /meta/classes | |
parent | af1f77a1eb9d1dc3de17c9b0a2b74d76ada40544 (diff) | |
download | poky-4ebaeb281bc70a9962ab9f4c49c0a2587fe3487a.tar.gz |
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.
(From OE-Core rev: d7d1e0193c94abb1cd2daf1c298c8c1788f3616d)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/boot-directdisk.bbclass | 6 | ||||
-rw-r--r-- | meta/classes/bootimg.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/grub-efi.bbclass | 1 | ||||
-rw-r--r-- | meta/classes/image-live.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/image-vm.bbclass | 3 | ||||
-rw-r--r-- | meta/classes/image.bbclass | 13 | ||||
-rw-r--r-- | meta/classes/syslinux.bbclass | 13 |
7 files changed, 22 insertions, 23 deletions
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass index fcdef26fd8..c6ada47479 100644 --- a/meta/classes/boot-directdisk.bbclass +++ b/meta/classes/boot-directdisk.bbclass | |||
@@ -58,8 +58,8 @@ inherit ${PCBIOS_CLASS} | |||
58 | inherit ${EFI_CLASS} | 58 | inherit ${EFI_CLASS} |
59 | 59 | ||
60 | DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}" | 60 | DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}" |
61 | SYSLINUX_ROOT_VM ?= "root=/dev/sda2" | 61 | ROOT_VM ?= "root=/dev/sda2" |
62 | SYSLINUX_CFG_VM ?= "${S}/syslinux_hdd.cfg" | 62 | SYSLINUX_CFG_VM ?= "${S}/syslinux_vm.cfg" |
63 | 63 | ||
64 | boot_direct_populate() { | 64 | boot_direct_populate() { |
65 | dest=$1 | 65 | dest=$1 |
@@ -160,8 +160,8 @@ build_boot_dd() { | |||
160 | 160 | ||
161 | python do_bootdirectdisk() { | 161 | python do_bootdirectdisk() { |
162 | validate_disk_signature(d) | 162 | validate_disk_signature(d) |
163 | set_live_vm_vars(d, 'VM') | ||
163 | if d.getVar("PCBIOS", True) == "1": | 164 | if d.getVar("PCBIOS", True) == "1": |
164 | syslinux_set_vars(d, 'VM') | ||
165 | bb.build.exec_func('build_syslinux_cfg', d) | 165 | bb.build.exec_func('build_syslinux_cfg', d) |
166 | if d.getVar("EFI", True) == "1": | 166 | if d.getVar("EFI", True) == "1": |
167 | bb.build.exec_func('build_efi_cfg', d) | 167 | bb.build.exec_func('build_efi_cfg', d) |
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index 0249a9dcf7..70ce07032b 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass | |||
@@ -49,8 +49,6 @@ EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", | |||
49 | 49 | ||
50 | KERNEL_IMAGETYPE ??= "bzImage" | 50 | KERNEL_IMAGETYPE ??= "bzImage" |
51 | 51 | ||
52 | LABELS ?= "boot install" | ||
53 | |||
54 | # Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not | 52 | # Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not |
55 | # contain "efi". This way legacy is supported by default if neither is | 53 | # contain "efi". This way legacy is supported by default if neither is |
56 | # specified, maintaining the original behavior. | 54 | # specified, maintaining the original behavior. |
@@ -282,8 +280,8 @@ build_hddimg() { | |||
282 | } | 280 | } |
283 | 281 | ||
284 | python do_bootimg() { | 282 | python do_bootimg() { |
283 | set_live_vm_vars(d, 'LIVE') | ||
285 | if d.getVar("PCBIOS", True) == "1": | 284 | if d.getVar("PCBIOS", True) == "1": |
286 | syslinux_set_vars(d, 'LIVE') | ||
287 | bb.build.exec_func('build_syslinux_cfg', d) | 285 | bb.build.exec_func('build_syslinux_cfg', d) |
288 | if d.getVar("EFI", True) == "1": | 286 | if d.getVar("EFI", True) == "1": |
289 | bb.build.exec_func('build_efi_cfg', d) | 287 | bb.build.exec_func('build_efi_cfg', d) |
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass index 9a4220abdc..331581d78d 100644 --- a/meta/classes/grub-efi.bbclass +++ b/meta/classes/grub-efi.bbclass | |||
@@ -25,6 +25,7 @@ GRUB_TIMEOUT ?= "10" | |||
25 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" | 25 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" |
26 | 26 | ||
27 | EFIDIR = "/EFI/BOOT" | 27 | EFIDIR = "/EFI/BOOT" |
28 | APPEND_prepend = " ${ROOT} " | ||
28 | 29 | ||
29 | # Need UUID utility code. | 30 | # Need UUID utility code. |
30 | inherit fs-uuid | 31 | inherit fs-uuid |
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass index b8f21cb7a5..504725d266 100644 --- a/meta/classes/image-live.bbclass +++ b/meta/classes/image-live.bbclass | |||
@@ -1,9 +1,8 @@ | |||
1 | 1 | ||
2 | INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs" | 2 | INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs" |
3 | INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz" | 3 | INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz" |
4 | SYSLINUX_ROOT_LIVE ?= "root=/dev/ram0" | 4 | ROOT_LIVE ?= "root=/dev/ram0" |
5 | SYSLINUX_LABELS_LIVE ?= "boot install" | 5 | LABELS_LIVE ?= "boot install" |
6 | LABELS_LIVE ?= "${SYSLINUX_LABELS_LIVE}" | ||
7 | SYSLINUX_CFG_LIVE ?= "${S}/syslinux_live.cfg" | 6 | SYSLINUX_CFG_LIVE ?= "${S}/syslinux_live.cfg" |
8 | 7 | ||
9 | ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4" | 8 | ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4" |
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass index 17e87a5a87..8608ec0c11 100644 --- a/meta/classes/image-vm.bbclass +++ b/meta/classes/image-vm.bbclass | |||
@@ -1,6 +1,5 @@ | |||
1 | 1 | ||
2 | SYSLINUX_LABELS_VM ?= "boot" | 2 | LABELS_VM ?= "boot" |
3 | LABELS_VM ?= "${SYSLINUX_LABELS_VM}" | ||
4 | 3 | ||
5 | # Using an initramfs is optional. Enable it by setting INITRD_IMAGE_VM. | 4 | # Using an initramfs is optional. Enable it by setting INITRD_IMAGE_VM. |
6 | INITRD_IMAGE_VM ?= "" | 5 | INITRD_IMAGE_VM ?= "" |
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 () { | |||
539 | : | 539 | : |
540 | } | 540 | } |
541 | addtask bundle_initramfs after do_image_complete | 541 | addtask bundle_initramfs after do_image_complete |
542 | |||
543 | # Some of the vars for vm and live image are conflicted, this function | ||
544 | # is used for fixing the problem. | ||
545 | def set_live_vm_vars(d, suffix): | ||
546 | vars = ['SYSLINUX_CFG', 'ROOT', 'LABELS', 'INITRD'] | ||
547 | for var in vars: | ||
548 | var_with_suffix = var + '_' + suffix | ||
549 | if d.getVar(var, True): | ||
550 | bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \ | ||
551 | (var, var_with_suffix, var)) | ||
552 | elif d.getVar(var_with_suffix, True): | ||
553 | d.setVar(var, d.getVar(var_with_suffix, True)) | ||
554 | |||
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass index 1b644b2561..6de656bc13 100644 --- a/meta/classes/syslinux.bbclass +++ b/meta/classes/syslinux.bbclass | |||
@@ -33,23 +33,12 @@ AUTO_SYSLINUXMENU ?= "1" | |||
33 | ISO_BOOTIMG = "isolinux/isolinux.bin" | 33 | ISO_BOOTIMG = "isolinux/isolinux.bin" |
34 | ISO_BOOTCAT = "isolinux/boot.cat" | 34 | ISO_BOOTCAT = "isolinux/boot.cat" |
35 | MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" | 35 | MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" |
36 | SYSLINUX_ROOT ?= "${ROOT}" | ||
36 | APPEND_prepend = " ${SYSLINUX_ROOT} " | 37 | APPEND_prepend = " ${SYSLINUX_ROOT} " |
37 | 38 | ||
38 | # Need UUID utility code. | 39 | # Need UUID utility code. |
39 | inherit fs-uuid | 40 | inherit fs-uuid |
40 | 41 | ||
41 | # Some of the vars for vm and live image are conflicted, this function | ||
42 | # is used for fixing the problem. | ||
43 | def syslinux_set_vars(d, suffix): | ||
44 | vars = ['SYSLINUX_ROOT', 'SYSLINUX_CFG', 'LABELS', 'INITRD'] | ||
45 | for var in vars: | ||
46 | var_with_suffix = var + '_' + suffix | ||
47 | if d.getVar(var, True): | ||
48 | bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \ | ||
49 | (var, var_with_suffix, var)) | ||
50 | elif d.getVar(var_with_suffix, True): | ||
51 | d.setVar(var, d.getVar(var_with_suffix, True)) | ||
52 | |||
53 | syslinux_populate() { | 42 | syslinux_populate() { |
54 | DEST=$1 | 43 | DEST=$1 |
55 | BOOTDIR=$2 | 44 | BOOTDIR=$2 |