summaryrefslogtreecommitdiffstats
path: root/yocto-poky/meta/classes/grub-efi.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/classes/grub-efi.bbclass')
-rw-r--r--yocto-poky/meta/classes/grub-efi.bbclass18
1 files changed, 14 insertions, 4 deletions
diff --git a/yocto-poky/meta/classes/grub-efi.bbclass b/yocto-poky/meta/classes/grub-efi.bbclass
index 9a4220abd..4ce3d2844 100644
--- a/yocto-poky/meta/classes/grub-efi.bbclass
+++ b/yocto-poky/meta/classes/grub-efi.bbclass
@@ -14,17 +14,21 @@
# ${APPEND} - an override list of append strings for each label
# ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
+# ${GRUB_ROOT} - grub's root device.
do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy"
GRUB_SERIAL ?= "console=ttyS0,115200"
-GRUBCFG = "${S}/grub.cfg"
+GRUB_CFG_VM = "${S}/grub_vm.cfg"
+GRUB_CFG_LIVE = "${S}/grub_live.cfg"
GRUB_TIMEOUT ?= "10"
#FIXME: build this from the machine config
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
EFIDIR = "/EFI/BOOT"
+GRUB_ROOT ?= "${ROOT}"
+APPEND ?= ""
# Need UUID utility code.
inherit fs-uuid
@@ -42,7 +46,7 @@ efi_populate() {
fi
install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
- install -m 0644 ${GRUBCFG} ${DEST}${EFIDIR}/grub.cfg
+ install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg
}
efi_iso_populate() {
@@ -82,9 +86,9 @@ python build_efi_cfg() {
bb.debug(1, "No labels, nothing to do")
return
- cfile = d.getVar('GRUBCFG', True)
+ cfile = d.getVar('GRUB_CFG', True)
if not cfile:
- raise bb.build.FuncFailed('Unable to read GRUBCFG')
+ raise bb.build.FuncFailed('Unable to read GRUB_CFG')
try:
cfgfile = file(cfile, 'w')
@@ -106,6 +110,10 @@ python build_efi_cfg() {
else:
cfgfile.write('timeout=50\n')
+ root = d.getVar('GRUB_ROOT', True)
+ if not root:
+ raise bb.build.FuncFailed('GRUB_ROOT not defined')
+
if gfxserial == "1":
btypes = [ [ " graphics console", "" ],
[ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
@@ -129,6 +137,8 @@ python build_efi_cfg() {
lb = "install-efi"
cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
+ cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
+
append = localdata.getVar('APPEND', True)
initrd = localdata.getVar('INITRD', True)
OpenPOWER on IntegriCloud