aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/grub-efi.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-04-01 00:32:55 -0700
committerRobert Yang <liezhi.yang@windriver.com>2016-04-01 23:13:57 -0700
commit4d56b6768748368a1a792c0d9e29ddfa2f87d2aa (patch)
tree6008c54ceab3f9757b5f909edd1bb3a083cd21be /meta/classes/grub-efi.bbclass
parent1831ad4009390bec7442328bf4873d3ff33c6402 (diff)
downloadopenembedded-core-contrib-rbt/efi.tar.gz
grub-efi.bbclass: use GRUB_ROOT rather than APPEND for root devicerbt/efi
Use APPEND for grub's root device may cause confusion, for example, when building efi + pcbios, there maybe be two root=/dev/ram0, one of them would be carried to the installed target, and the target would fail to boot. Use GRUB_ROOT to fix the problem, and remove SYSLINUX_ROOT from APPEND will fix the problem. [YOCTO #9354] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta/classes/grub-efi.bbclass')
-rw-r--r--meta/classes/grub-efi.bbclass10
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 3d8ff11ee8..4ce3d2844a 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -14,6 +14,7 @@
# ${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"
@@ -26,7 +27,8 @@ GRUB_TIMEOUT ?= "10"
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
EFIDIR = "/EFI/BOOT"
-APPEND_prepend = " ${ROOT} "
+GRUB_ROOT ?= "${ROOT}"
+APPEND ?= ""
# Need UUID utility code.
inherit fs-uuid
@@ -108,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 "" ] ]
@@ -131,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)