diff options
author | Darren Hart <dvhart@linux.intel.com> | 2011-11-23 17:56:12 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-30 22:11:27 +0000 |
commit | be95f54495bf9e03062f86b929c66cab6e385a03 (patch) | |
tree | 0610528a42c8e811f5221eec532c8fd5e2a79b7a /meta/classes/bootimg.bbclass | |
parent | 1915293688d348a765aa0bcdf01168c9fecd9842 (diff) | |
download | openembedded-core-be95f54495bf9e03062f86b929c66cab6e385a03.tar.gz openembedded-core-be95f54495bf9e03062f86b929c66cab6e385a03.tar.bz2 openembedded-core-be95f54495bf9e03062f86b929c66cab6e385a03.zip |
bootimg: Add grub-efi support
Create a new grub-efi.bbclass and integrate it into bootimg alongside the
syslinux support. This new class uses the output from the grub-efi-native
recipe. Thanks goes to Josef Ahmad <josef.ahmad@intel.com> for the original
build_grub_cfg() routine.
The EFI features are only added to the image if MACHINE_FEATURES contains
"efi". The resulting images are therefor either legacy boot only (like they
were originally) or legacy boot and EFI boot.
A new "dummy.bbclass" was added to allow for the conditional include
of grub-efi. This makes it so if efi support is not to be built in, we
don't spend time building grub-efi-native just because the include adds
the dependency.
There is a bug in the mkdosfs tool from the dosfstools package which causes
it to crash when the directory passed with the -d parameter contains
sub-directories. An /EFI/BOOT directory is required for a proper EFI
installation. Until it is fixed, we install to the top level directory
for the hddimg.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r-- | meta/classes/bootimg.bbclass | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index 0554ffa00a..ce95801bff 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -35,7 +35,12 @@ ISODIR = "${S}/cd" BOOTIMG_VOLUME_ID ?= "boot" BOOTIMG_EXTRA_SPACE ?= "512" +EFI = ${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)} +EFI_CLASS = ${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)} + inherit syslinux +inherit ${EFI_CLASS} + build_iso() { # Only create an ISO if we have an INITRD and NOISO was not set @@ -47,6 +52,9 @@ build_iso() { install -d ${ISODIR} syslinux_iso_populate + if [ "${EFI}" = "1" ]; then + grubefi_iso_populate + fi mkisofs -V ${BOOTIMG_VOLUME_ID} \ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ @@ -63,6 +71,9 @@ build_hddimg() { if [ "${NOHDD}" != "1" ] ; then install -d ${HDDDIR} syslinux_hddimg_populate + if [ "${EFI}" = "1" ]; then + grubefi_hddimg_populate + fi # Determine the block count for the final image BLOCKS=`du -bks ${HDDDIR} | cut -f 1` @@ -83,6 +94,8 @@ build_hddimg() { python do_bootimg() { bb.build.exec_func('build_syslinux_cfg', d) + if d.getVar("EFI", True) == "1": + bb.build.exec_func('build_grub_cfg', d) bb.build.exec_func('build_hddimg', d) bb.build.exec_func('build_iso', d) } |