All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs
@ 2015-07-11  0:41 Ricardo Neri
  2015-08-05 18:51 ` Ricardo Neri
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Neri @ 2015-07-11  0:41 UTC (permalink / raw)
  To: openembedded-core

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@linux.intel.com>
---
 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 2fd3efb..0a4546e 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -154,11 +154,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
-- 
1.9.1



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

* Re: [PATCH] bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs
  2015-07-11  0:41 [PATCH] bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs Ricardo Neri
@ 2015-08-05 18:51 ` Ricardo Neri
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Neri @ 2015-08-05 18:51 UTC (permalink / raw)
  To: openembedded-core

Hi,

On Fri, 2015-07-10 at 17:41 -0700, Ricardo Neri wrote:
> 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.

I wanted to know if there is any comments or feedback for this patch.

Thanks and BR,
Ricardo




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

end of thread, other threads:[~2015-08-05 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-11  0:41 [PATCH] bootimg.bbclass:iso: determine the -iso-level only if there is a rootfs Ricardo Neri
2015-08-05 18:51 ` Ricardo Neri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.