[oe-commits] [openembedded-core] 09/31: image-live: fix check for rootfs size with hddimg images

git at git.openembedded.org git at git.openembedded.org
Fri Jul 13 15:35:09 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 16956dacd4be2c64e5816ccb2b222b5b128838c9
Author: Anuj Mittal <anuj.mittal at intel.com>
AuthorDate: Tue Jul 10 16:41:41 2018 +0800

    image-live: fix check for rootfs size with hddimg images
    
    Currently we check if the rootfs.img size is greater than 4 GB and use
    mcopy to copy it over to a hddimg, a FAT32 volume.
    
    This results in problems when IMAGE_ROOTFS_SIZE is set to be exact 4 GB
    (4294967296 bytes). mcopy uses the max offset/file size to be 4294967295
    and as a result, it errors out without any warning to the user.
    
    Change the 4 GB check to '-ge' to catch these cases. Since we allow
    IMAGE_ROOTFS_SIZE to be in KBs, the maximum allowed is 4194303 KB. Also,
    tweaked the error message to refer to wic too.
    
    Fixes [YOCTO #12776]
    
    Signed-off-by: Anuj Mittal <anuj.mittal at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/image-live.bbclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
index 942298a..af71be5 100644
--- a/meta/classes/image-live.bbclass
+++ b/meta/classes/image-live.bbclass
@@ -230,11 +230,11 @@ build_hddimg() {
 		if [ -f ${HDDDIR}/rootfs.img ]; then
 			rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img`
 			max_size=`expr 4 \* 1024 \* 1024 \* 1024`
-			if [ $rootfs_img_size -gt $max_size ]; then
-				bberror "${HDDDIR}/rootfs.img execeeds 4GB,"
-				bberror "this doesn't work on FAT filesystem, you can try either of:"
-				bberror "1) Reduce the size of rootfs.img"
-				bbfatal "2) Use iso, vmdk or vdi to instead of hddimg\n"
+			if [ $rootfs_img_size -ge $max_size ]; then
+				bberror "${HDDDIR}/rootfs.img rootfs size is greather than or equal to 4GB,"
+				bberror "and this doesn't work on a FAT filesystem. You can either:"
+				bberror "1) Reduce the size of rootfs.img, or,"
+				bbfatal "2) Use wic, vmdk or vdi instead of hddimg\n"
 			fi
 		fi
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list