summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-10-19 18:36:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-24 14:28:17 +0100
commit23c5a83e877efe6d86618898dd181bb75f44aa71 (patch)
tree206dfe3526f68ea29879737fd4e63400dc0aedeb
parent8dc5f118832a4aca906239ffed82f72497c37f8e (diff)
downloadopenembedded-core-23c5a83e877efe6d86618898dd181bb75f44aa71.tar.gz
openembedded-core-23c5a83e877efe6d86618898dd181bb75f44aa71.tar.bz2
openembedded-core-23c5a83e877efe6d86618898dd181bb75f44aa71.tar.xz
openembedded-core-23c5a83e877efe6d86618898dd181bb75f44aa71.zip
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 <otavio@ossystems.com.br>
-rw-r--r--meta/classes/bootimg.bbclass44
1 files 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