From bcbd57aae576fa262c83f435bccf3bc3184e5506 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Wed, 23 Nov 2011 16:41:32 -0800 Subject: bootimg: Pull syslinux specific bits into syslinux.bbclass Working towards a more generic bootimg.bbclass, pull out all syslinux specific bits and let syslinux.bbclass manage them directly. This introduces no functional changes to the images constructed and the behavior remains unchanged. (From OE-Core rev: 1915293688d348a765aa0bcdf01168c9fecd9842) Signed-off-by: Darren Hart Signed-off-by: Richard Purdie --- meta/classes/bootimg.bbclass | 71 ++++++++++---------------------------------- 1 file changed, 16 insertions(+), 55 deletions(-) (limited to 'meta/classes/bootimg.bbclass') diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index dbaa677600..0554ffa00a 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -17,36 +17,26 @@ # in syslinux. Actions based on the label are then performed (e.g. installing to # an hdd) -# External variables +# External variables (also used by syslinux.bbclass) # ${INITRD} - indicates a filesystem image to use as an initrd (optional) +# ${NOISO} - skip building the ISO image if set to 1 # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional) -# ${AUTO_SYSLINUXCFG} - set this to 1 to enable creating an automatic config -# ${LABELS} - a list of targets for the automatic config -# ${APPEND} - an override list of append strings for each label -# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ - syslinux:do_populate_sysroot \ - syslinux-native:do_populate_sysroot \ - mtools-native:do_populate_sysroot \ - cdrtools-native:do_populate_sysroot" + mtools-native:do_populate_sysroot \ + cdrtools-native:do_populate_sysroot" PACKAGES = " " EXCLUDE_FROM_WORLD = "1" HDDDIR = "${S}/hdd/boot" -ISODIR = "${S}/cd/isolinux" +ISODIR = "${S}/cd" BOOTIMG_VOLUME_ID ?= "boot" BOOTIMG_EXTRA_SPACE ?= "512" -# Get the build_syslinux_cfg() function from the syslinux class - -SYSLINUXCFG = "${HDDDIR}/syslinux.cfg" -SYSLINUXMENU = "${HDDDIR}/menu" - inherit syslinux - + build_iso() { # Only create an ISO if we have an INITRD and NOISO was not set if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then @@ -56,31 +46,12 @@ build_iso() { install -d ${ISODIR} - # Install the kernel - install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \ - ${ISODIR}/vmlinuz - - # Install the configuration files - cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg - - if [ -f ${SYSLINUXMENU} ]; then - cp ${SYSLINUXMENU} ${ISODIR} - fi - - install -m 0644 ${INITRD} ${ISODIR}/initrd - - if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then - install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img - fi - - # And install the syslinux stuff - cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR} + syslinux_iso_populate mkisofs -V ${BOOTIMG_VOLUME_ID} \ - -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ - -b isolinux/isolinux.bin -c isolinux/boot.cat -r \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - ${S}/cd/ + -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ + -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ + ${MKISOFS_OPTIONS} ${ISODIR} cd ${DEPLOY_DIR_IMAGE} rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso @@ -91,34 +62,24 @@ build_hddimg() { # Create an HDD image if [ "${NOHDD}" != "1" ] ; then install -d ${HDDDIR} - install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \ - ${HDDDIR}/vmlinuz - - if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then - install -m 0644 ${INITRD} ${HDDDIR}/initrd - fi - - if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then - install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img - fi + syslinux_hddimg_populate - install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys - - # Do a little math, bash style + # Determine the block count for the final image BLOCKS=`du -bks ${HDDDIR} | cut -f 1` SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}` mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \ - -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE + -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE + + syslinux_hddimg_install - syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg cd ${DEPLOY_DIR_IMAGE} rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg fi -} +} python do_bootimg() { bb.build.exec_func('build_syslinux_cfg', d) -- cgit v1.2.3-54-g00ecf