From 29886aa676481deb594c17af3dca6a8aef7c0059 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. (From OE-Core rev: 23c5a83e877efe6d86618898dd181bb75f44aa71) Signed-off-by: Otavio Salvador Signed-off-by: Richard Purdie --- 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 a5ba3cf..eecc2bf 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.1