summaryrefslogtreecommitdiff
path: root/meta/classes/bootimg.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/bootimg.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/bootimg.bbclass')
-rw-r--r--meta/classes/bootimg.bbclass31
1 files changed, 24 insertions, 7 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index a717600cf9..1d1a3d04af 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -8,13 +8,13 @@
# End result is two things:
#
# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
-# an initrd and a rootfs image. These can be written to harddisks directly and
+# an initrd and a rootfs image. These can be written to harddisks directly and
# also booted on USB flash disks (write them there with dd).
#
# 2. A CD .iso image
-# Boot process is that the initrd will boot and process which label was selected
-# in syslinux. Actions based on the label are then performed (e.g. installing to
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
# an hdd)
# External variables (also used by syslinux.bbclass)
@@ -29,8 +29,8 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
PACKAGES = " "
EXCLUDE_FROM_WORLD = "1"
-HDDDIR = "${S}/hdd/boot"
-ISODIR = "${S}/cd"
+HDDDIR = "${S}/hddimg"
+ISODIR = "${S}/iso"
BOOTIMG_VOLUME_ID ?= "boot"
BOOTIMG_EXTRA_SPACE ?= "512"
@@ -58,6 +58,22 @@ PCBIOS_CLASS = ${@pcbios_class(d)}
inherit ${PCBIOS_CLASS}
inherit ${EFI_CLASS}
+populate() {
+ DEST=$1
+ install -d ${DEST}
+
+ # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
+ 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
+
+}
build_iso() {
# Only create an ISO if we have an INITRD and NOISO was not set
@@ -66,7 +82,7 @@ build_iso() {
return
fi
- install -d ${ISODIR}
+ populate ${ISODIR}
if [ "${PCBIOS}" = "1" ]; then
syslinux_iso_populate
@@ -95,7 +111,8 @@ build_iso() {
build_hddimg() {
# Create an HDD image
if [ "${NOHDD}" != "1" ] ; then
- install -d ${HDDDIR}
+ populate ${HDDDIR}
+
if [ "${PCBIOS}" = "1" ]; then
syslinux_hddimg_populate
fi