Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] bootimg.bbclass: fixes for iso and hddimg
@ 2015-06-30  3:06 Robert Yang
  2015-06-30  3:06 ` [PATCH 1/2] bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso Robert Yang
  2015-06-30  3:06 ` [PATCH 2/2] bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg Robert Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2015-06-30  3:06 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 592a1d94a7b0e80059016adb59c4c61e256206f0:

  oeqa/parselogs: Whitelist qemumips64 runtime error (2015-06-27 22:49:49 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/boot
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/boot

Robert Yang (2):
  bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso
  bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg

 meta/classes/bootimg.bbclass |   28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso
  2015-06-30  3:06 [PATCH 0/2] bootimg.bbclass: fixes for iso and hddimg Robert Yang
@ 2015-06-30  3:06 ` Robert Yang
  2015-06-30  3:06 ` [PATCH 2/2] bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2015-06-30  3:06 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/classes/bootimg.bbclass |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 4abe00e..605edc9 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}
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg
  2015-06-30  3:06 [PATCH 0/2] bootimg.bbclass: fixes for iso and hddimg Robert Yang
  2015-06-30  3:06 ` [PATCH 1/2] bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso Robert Yang
@ 2015-06-30  3:06 ` Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2015-06-30  3:06 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/bootimg.bbclass |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 605edc9..ab1d1bd 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -249,6 +249,19 @@ build_hddimg() {
 			efi_hddimg_populate ${HDDDIR}
 		fi
 
+		# Check the size of ${HDDDIR}/rootfs.img, error out if it
+		# exceeds 4GB, it is the single file's max size of FAT fs.
+		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"
+			fi
+		fi
+
 		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 
 		if [ "${PCBIOS}" = "1" ]; then
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-30  3:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30  3:06 [PATCH 0/2] bootimg.bbclass: fixes for iso and hddimg Robert Yang
2015-06-30  3:06 ` [PATCH 1/2] bootimg.bbclass:iso: use mkisofs -iso-level 3 for large iso Robert Yang
2015-06-30  3:06 ` [PATCH 2/2] bootimg.bbclass:hddimg: check the size of rootfs.img for hddimg Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox