summaryrefslogtreecommitdiff
path: root/meta/classes/grub-efi.bbclass
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-02-01 16:15:04 -0800
committerSaul Wold <sgw@linux.intel.com>2012-02-07 14:37:12 -0800
commit5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8 (patch)
tree6c06141b9168d956f190500040896c9aeaeba5c7 /meta/classes/grub-efi.bbclass
parent26630a9f37b04e215eff9b8e63414b6b2066d6fa (diff)
downloadopenembedded-core-5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8.tar.gz
openembedded-core-5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8.tar.bz2
openembedded-core-5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8.zip
bootimg: Use the same OS files for each boot method
Fixes [YOCTO #1951] The do_bootimg code can generate hybrid efi+pcbios images (syslinux and grub-efi) to boot on platforms with both EFI and legacy BIOS options. The current implementation copies the kernel, initrd, and rootfs twice, unnecessarily bloating the image size. This is an especially egregious bug on -sato images. Update the classes to use a common install of the kernel, initrd, and rootfs to the root of the boot media. Grub-efi, syslinux, and isolinux can all reference this location explicitly with a leading slash. Tested with an EFI+PCBIOS image in both EFI and PCBIOS boot modes on two platforms. No ISO image testing was performed. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'meta/classes/grub-efi.bbclass')
-rw-r--r--meta/classes/grub-efi.bbclass28
1 files changed, 9 insertions, 19 deletions
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 762322b28e..1efb43b805 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -22,39 +22,29 @@ GRUB_TIMEOUT ?= "10"
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
EFIDIR = "/EFI/BOOT"
-GRUB_HDDDIR = "${HDDDIR}${EFIDIR}"
-GRUB_ISODIR = "${ISODIR}${EFIDIR}"
grubefi_populate() {
+ # DEST must be the root of the image so that EFIDIR is not
+ # nested under a top level directory.
DEST=$1
- install -d ${DEST}
-
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
-
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
- install -m 0644 ${INITRD} ${DEST}/initrd
- fi
-
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
- fi
+ install -d ${DEST}${EFIDIR}
GRUB_IMAGE="bootia32.efi"
if [ "${TARGET_ARCH}" = "x86_64" ]; then
GRUB_IMAGE="bootx64.efi"
fi
- install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
- install -m 0644 ${GRUBCFG} ${DEST}
+ install -m 0644 ${GRUBCFG} ${DEST}${EFIDIR}
}
grubefi_iso_populate() {
- grubefi_populate ${GRUB_ISODIR}
+ grubefi_populate ${ISODIR}
}
grubefi_hddimg_populate() {
- grubefi_populate ${GRUB_HDDDIR}
+ grubefi_populate ${HDDDIR}
}
python build_grub_cfg() {
@@ -109,7 +99,7 @@ python build_grub_cfg() {
bb.data.update_data(localdata)
cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
- cfgfile.write('linux ${EFIDIR}/vmlinuz LABEL=%s' % (label))
+ cfgfile.write('linux /vmlinuz LABEL=%s' % (label))
append = localdata.getVar('APPEND', True)
initrd = localdata.getVar('INITRD', True)
@@ -119,7 +109,7 @@ python build_grub_cfg() {
cfgfile.write('\n')
if initrd:
- cfgfile.write('initrd ${EFIDIR}/initrd')
+ cfgfile.write('initrd /initrd')
cfgfile.write('\n}\n')
cfgfile.close()