diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2018-07-10 16:41:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-15 16:16:16 +0100 |
commit | ebbd1e4a94c675c1669860d7cd554d18f010e5b5 (patch) | |
tree | f97b1fe481415ddcfecc1577b052aa74f8ea75d4 /meta/classes | |
parent | a9b91031ec7d4dfd2e2dc1ab7d9f1a207526538b (diff) | |
download | poky-ebbd1e4a94c675c1669860d7cd554d18f010e5b5.tar.gz |
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]
(From OE-Core rev: 16956dacd4be2c64e5816ccb2b222b5b128838c9)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image-live.bbclass | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass index 942298a7ce..af71be5093 100644 --- a/meta/classes/image-live.bbclass +++ b/meta/classes/image-live.bbclass | |||
@@ -230,11 +230,11 @@ build_hddimg() { | |||
230 | if [ -f ${HDDDIR}/rootfs.img ]; then | 230 | if [ -f ${HDDDIR}/rootfs.img ]; then |
231 | rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img` | 231 | rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img` |
232 | max_size=`expr 4 \* 1024 \* 1024 \* 1024` | 232 | max_size=`expr 4 \* 1024 \* 1024 \* 1024` |
233 | if [ $rootfs_img_size -gt $max_size ]; then | 233 | if [ $rootfs_img_size -ge $max_size ]; then |
234 | bberror "${HDDDIR}/rootfs.img execeeds 4GB," | 234 | bberror "${HDDDIR}/rootfs.img rootfs size is greather than or equal to 4GB," |
235 | bberror "this doesn't work on FAT filesystem, you can try either of:" | 235 | bberror "and this doesn't work on a FAT filesystem. You can either:" |
236 | bberror "1) Reduce the size of rootfs.img" | 236 | bberror "1) Reduce the size of rootfs.img, or," |
237 | bbfatal "2) Use iso, vmdk or vdi to instead of hddimg\n" | 237 | bbfatal "2) Use wic, vmdk or vdi instead of hddimg\n" |
238 | fi | 238 | fi |
239 | fi | 239 | fi |
240 | 240 | ||