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>
This commit is contained in:
parent
af1f77a1eb
commit
4ebaeb281b
|
@ -58,8 +58,8 @@ inherit ${PCBIOS_CLASS}
|
||||||
inherit ${EFI_CLASS}
|
inherit ${EFI_CLASS}
|
||||||
|
|
||||||
DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
|
DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
|
||||||
SYSLINUX_ROOT_VM ?= "root=/dev/sda2"
|
ROOT_VM ?= "root=/dev/sda2"
|
||||||
SYSLINUX_CFG_VM ?= "${S}/syslinux_hdd.cfg"
|
SYSLINUX_CFG_VM ?= "${S}/syslinux_vm.cfg"
|
||||||
|
|
||||||
boot_direct_populate() {
|
boot_direct_populate() {
|
||||||
dest=$1
|
dest=$1
|
||||||
|
@ -160,8 +160,8 @@ build_boot_dd() {
|
||||||
|
|
||||||
python do_bootdirectdisk() {
|
python do_bootdirectdisk() {
|
||||||
validate_disk_signature(d)
|
validate_disk_signature(d)
|
||||||
|
set_live_vm_vars(d, 'VM')
|
||||||
if d.getVar("PCBIOS", True) == "1":
|
if d.getVar("PCBIOS", True) == "1":
|
||||||
syslinux_set_vars(d, 'VM')
|
|
||||||
bb.build.exec_func('build_syslinux_cfg', d)
|
bb.build.exec_func('build_syslinux_cfg', d)
|
||||||
if d.getVar("EFI", True) == "1":
|
if d.getVar("EFI", True) == "1":
|
||||||
bb.build.exec_func('build_efi_cfg', d)
|
bb.build.exec_func('build_efi_cfg', d)
|
||||||
|
|
|
@ -49,8 +49,6 @@ EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}",
|
||||||
|
|
||||||
KERNEL_IMAGETYPE ??= "bzImage"
|
KERNEL_IMAGETYPE ??= "bzImage"
|
||||||
|
|
||||||
LABELS ?= "boot install"
|
|
||||||
|
|
||||||
# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
|
# 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
|
# contain "efi". This way legacy is supported by default if neither is
|
||||||
# specified, maintaining the original behavior.
|
# specified, maintaining the original behavior.
|
||||||
|
@ -282,8 +280,8 @@ build_hddimg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
python do_bootimg() {
|
python do_bootimg() {
|
||||||
|
set_live_vm_vars(d, 'LIVE')
|
||||||
if d.getVar("PCBIOS", True) == "1":
|
if d.getVar("PCBIOS", True) == "1":
|
||||||
syslinux_set_vars(d, 'LIVE')
|
|
||||||
bb.build.exec_func('build_syslinux_cfg', d)
|
bb.build.exec_func('build_syslinux_cfg', d)
|
||||||
if d.getVar("EFI", True) == "1":
|
if d.getVar("EFI", True) == "1":
|
||||||
bb.build.exec_func('build_efi_cfg', d)
|
bb.build.exec_func('build_efi_cfg', d)
|
||||||
|
|
|
@ -25,6 +25,7 @@ GRUB_TIMEOUT ?= "10"
|
||||||
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
|
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
|
||||||
|
|
||||||
EFIDIR = "/EFI/BOOT"
|
EFIDIR = "/EFI/BOOT"
|
||||||
|
APPEND_prepend = " ${ROOT} "
|
||||||
|
|
||||||
# Need UUID utility code.
|
# Need UUID utility code.
|
||||||
inherit fs-uuid
|
inherit fs-uuid
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs"
|
INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs"
|
||||||
INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz"
|
INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz"
|
||||||
SYSLINUX_ROOT_LIVE ?= "root=/dev/ram0"
|
ROOT_LIVE ?= "root=/dev/ram0"
|
||||||
SYSLINUX_LABELS_LIVE ?= "boot install"
|
LABELS_LIVE ?= "boot install"
|
||||||
LABELS_LIVE ?= "${SYSLINUX_LABELS_LIVE}"
|
|
||||||
SYSLINUX_CFG_LIVE ?= "${S}/syslinux_live.cfg"
|
SYSLINUX_CFG_LIVE ?= "${S}/syslinux_live.cfg"
|
||||||
|
|
||||||
ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4"
|
ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
SYSLINUX_LABELS_VM ?= "boot"
|
LABELS_VM ?= "boot"
|
||||||
LABELS_VM ?= "${SYSLINUX_LABELS_VM}"
|
|
||||||
|
|
||||||
# Using an initramfs is optional. Enable it by setting INITRD_IMAGE_VM.
|
# Using an initramfs is optional. Enable it by setting INITRD_IMAGE_VM.
|
||||||
INITRD_IMAGE_VM ?= ""
|
INITRD_IMAGE_VM ?= ""
|
||||||
|
|
|
@ -539,3 +539,16 @@ do_bundle_initramfs () {
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
addtask bundle_initramfs after do_image_complete
|
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))
|
||||||
|
|
||||||
|
|
|
@ -33,23 +33,12 @@ AUTO_SYSLINUXMENU ?= "1"
|
||||||
ISO_BOOTIMG = "isolinux/isolinux.bin"
|
ISO_BOOTIMG = "isolinux/isolinux.bin"
|
||||||
ISO_BOOTCAT = "isolinux/boot.cat"
|
ISO_BOOTCAT = "isolinux/boot.cat"
|
||||||
MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
|
MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
|
||||||
|
SYSLINUX_ROOT ?= "${ROOT}"
|
||||||
APPEND_prepend = " ${SYSLINUX_ROOT} "
|
APPEND_prepend = " ${SYSLINUX_ROOT} "
|
||||||
|
|
||||||
# Need UUID utility code.
|
# Need UUID utility code.
|
||||||
inherit fs-uuid
|
inherit fs-uuid
|
||||||
|
|
||||||
# Some of the vars for vm and live image are conflicted, this function
|
|
||||||
# is used for fixing the problem.
|
|
||||||
def syslinux_set_vars(d, suffix):
|
|
||||||
vars = ['SYSLINUX_ROOT', 'SYSLINUX_CFG', '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))
|
|
||||||
|
|
||||||
syslinux_populate() {
|
syslinux_populate() {
|
||||||
DEST=$1
|
DEST=$1
|
||||||
BOOTDIR=$2
|
BOOTDIR=$2
|
||||||
|
|
Loading…
Reference in New Issue