From 23c5a83e877efe6d86618898dd181bb75f44aa71 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 19 Oct 2011 18:36:49 +0000 Subject: bootimg.bbclass: add support to disable HDD image building If an image sets NOHDD = "1" the HDD image won't be build. Signed-off-by: Otavio Salvador --- meta/classes/bootimg.bbclass | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index a5ba3cf40..eecc2bf7e 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu" inherit syslinux build_boot_bin() { - install -d ${HDDDIR} - install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \ - ${HDDDIR}/vmlinuz + # 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 "${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 + if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then + install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img + fi - install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys + install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys - # Do a little math, bash style - #BLOCKS=`du -s ${HDDDIR} | cut -f 1` - BLOCKS=`du -bks ${HDDDIR} | cut -f 1` - SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}` + # Do a little math, bash style + 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 + mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \ + -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE - syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg - chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg + 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 + 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 #Create an ISO if we have an INITRD if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then -- cgit v1.2.3