[oe-commits] Ricardo Neri : bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs

git at git.openembedded.org git at git.openembedded.org
Fri Aug 7 11:34:56 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: cb41d5ddc8f6b719730ce2b16106d02a46bce6f9
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=cb41d5ddc8f6b719730ce2b16106d02a46bce6f9

Author: Ricardo Neri <ricardo.neri-calderon at linux.intel.com>
Date:   Fri Jul 10 17:41:03 2015 -0700

bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs

It may be possible that some bootable images do not use a rootfs; this
may be the case if the bootable image utilize only an initrd for all its
needs.

If there is not rootfs, the size calculation will fail. Furthermore, given
that the iso9660 conformance level is determined using the size of rootfs,
it makes sense to not make the calculation if there is not such rootfs.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/bootimg.bbclass | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index ebc927e..5adcacc 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -142,11 +142,14 @@ build_iso() {
 	# 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"
+
+        if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+		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
 	fi
 
 	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then



More information about the Openembedded-commits mailing list