summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-06-29 20:06:37 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-01 15:38:23 +0100
commit40cdf918dc2507a1270a4d933b2c2f46a514d6e2 (patch)
tree5751ca665842d2f553fc12dcdfc755d4056ffca4
parente322019d9fb820187263b242e10e750a46dd1bfd (diff)
downloadopenembedded-core-contrib-40cdf918dc2507a1270a4d933b2c2f46a514d6e2.tar.gz
openembedded-core-contrib-40cdf918dc2507a1270a4d933b2c2f46a514d6e2.tar.bz2
openembedded-core-contrib-40cdf918dc2507a1270a4d933b2c2f46a514d6e2.zip
bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso
There will be problems when rootfs.img is larger than 4GB: mkisofs: Value too large for defined data type. File /path/to/iso/rootfs.img is too large for current mkisofs settings - ignoring And will get a wrong iso. Check the size of ${ISODIR}/rootfs.img, use mkisofs -iso-level 3 when it exceeds 3.8GB, the specification is 4G - 1 bytes, we need leave a few space for other files. [YOCTO #6449] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/bootimg.bbclass15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 4abe00e944..605edc911e 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -136,19 +136,30 @@ build_iso() {
mkisofs_compress_opts="-r"
fi
+ # Check the size of ${ISODIR}/rootfs.img, use mkisofs -iso-level 3
+ # when it exceeds 3.8GB, the specification is 4G - 1 bytes, we need
+ # leave a few space for other files.
+ mkisofs_iso_level=""
+ rootfs_img_size=`stat -c '%s' ${ISODIR}/rootfs.img`
+ # 4080218931 = 3.8 * 1024 * 1024 * 1024
+ if [ $rootfs_img_size -gt 4080218931 ]; then
+ bbnote "${ISODIR}/rootfs.img execeeds 3.8GB, using '-iso-level 3' for mkisofs"
+ mkisofs_iso_level="-iso-level 3"
+ fi
+
if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
# PCBIOS only media
mkisofs -V ${BOOTIMG_VOLUME_ID} \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
$mkisofs_compress_opts \
- ${MKISOFS_OPTIONS} ${ISODIR}
+ ${MKISOFS_OPTIONS} $mkisofs_iso_level ${ISODIR}
else
# EFI only OR EFI+PCBIOS
mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
- $mkisofs_compress_opts ${MKISOFS_OPTIONS} \
+ $mkisofs_compress_opts ${MKISOFS_OPTIONS} $mkisofs_iso_level \
-eltorito-alt-boot -eltorito-platform efi \
-b efi.img -no-emul-boot \
${ISODIR}