summaryrefslogtreecommitdiffstats
path: root/meta/classes/bootimg.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-06-29 20:06:38 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-01 15:40:00 +0100
commit5c71337cd79b03322f39e56c22c3e7634a2d9abd (patch)
treef45b8ad0c0295ef4bd8472466c9eb866e057be43 /meta/classes/bootimg.bbclass
parentb3c79c4d0f1aaed5b2901ce6d87bd3348ca3435d (diff)
downloadpoky-5c71337cd79b03322f39e56c22c3e7634a2d9abd.tar.gz
bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg
The hddimg uses FAT, so the single file size should be less than 4GB, otherwise errors, check that and error out. Another way might be use ext2/3/4 rather than FAT, but EFI only supports FAT, if we make EFI use FAT, and non-EFI use extX, that would the code very different, which seems not worth. [YOCTO #6449] (From OE-Core rev: a82f62627f79761e1b09b8f54896a9f85a591443) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r--meta/classes/bootimg.bbclass13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 605edc911e..ab1d1bdd33 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -249,6 +249,19 @@ build_hddimg() {
249 efi_hddimg_populate ${HDDDIR} 249 efi_hddimg_populate ${HDDDIR}
250 fi 250 fi
251 251
252 # Check the size of ${HDDDIR}/rootfs.img, error out if it
253 # exceeds 4GB, it is the single file's max size of FAT fs.
254 if [ -f ${HDDDIR}/rootfs.img ]; then
255 rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img`
256 max_size=`expr 4 \* 1024 \* 1024 \* 1024`
257 if [ $rootfs_img_size -gt $max_size ]; then
258 bberror "${HDDDIR}/rootfs.img execeeds 4GB,"
259 bberror "this doesn't work on FAT filesystem, you can try either of:"
260 bberror "1) Reduce the size of rootfs.img"
261 bbfatal "2) Use iso, vmdk or vdi to instead of hddimg\n"
262 fi
263 fi
264
252 build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg 265 build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
253 266
254 if [ "${PCBIOS}" = "1" ]; then 267 if [ "${PCBIOS}" = "1" ]; then