aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/syslinux.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/syslinux.bbclass
parent26630a9f37b04e215eff9b8e63414b6b2066d6fa (diff)
downloadopenembedded-core-contrib-5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8.tar.gz
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/syslinux.bbclass')
-rw-r--r--meta/classes/syslinux.bbclass34
1 files changed, 13 insertions, 21 deletions
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 91c4275747..1569074b21 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -18,42 +18,34 @@ do_bootimg[depends] += "syslinux:do_populate_sysroot \
SYSLINUXCFG = "${S}/syslinux.cfg"
SYSLINUXMENU = "${S}/menu"
-SYSLINUX_ISODIR = "${ISODIR}/isolinux"
-SYSLINUX_HDDDIR = "${HDDDIR}"
+ISOLINUXDIR = "/isolinux"
+SYSLINUXDIR = "/"
ISO_BOOTIMG = "isolinux/isolinux.bin"
ISO_BOOTCAT = "isolinux/boot.cat"
MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
syslinux_populate() {
DEST=$1
- CFGNAME=$2
+ BOOTDIR=$2
+ CFGNAME=$3
- install -d ${DEST}
-
- # Install the kernel, initrd, and rootfs
- 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}${BOOTDIR}
# Install the config files
- install -m 0644 ${SYSLINUXCFG} ${DEST}/${CFGNAME}
+ install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME}
if [ -f ${SYSLINUXMENU} ]; then
- install -m 0644 ${SYSLINUXMENU} ${DEST}
+ install -m 0644 ${SYSLINUXMENU} ${DEST}${BOOTDIR}
fi
}
syslinux_iso_populate() {
- syslinux_populate ${SYSLINUX_ISODIR} isolinux.cfg
- install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${SYSLINUX_ISODIR}
+ syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg
+ install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
}
syslinux_hddimg_populate() {
- syslinux_populate ${SYSLINUX_HDDDIR} syslinux.cfg
- install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${SYSLINUX_HDDDIR}/ldlinux.sys
+ syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
+ install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
}
syslinux_hddimg_install() {
@@ -187,7 +179,7 @@ python build_syslinux_cfg () {
localdata.setVar('OVERRIDES', label + ':' + overrides)
bb.data.update_data(localdata)
- cfgfile.write('LABEL %s\nKERNEL vmlinuz\n' % (label))
+ cfgfile.write('LABEL %s\nKERNEL /vmlinuz\n' % (label))
append = localdata.getVar('APPEND', 1)
initrd = localdata.getVar('INITRD', 1)
@@ -196,7 +188,7 @@ python build_syslinux_cfg () {
cfgfile.write('APPEND ')
if initrd:
- cfgfile.write('initrd=initrd ')
+ cfgfile.write('initrd=/initrd ')
cfgfile.write('LABEL=%s '% (label))