From: Chris Hallinan <challinan@gmail.com>
To: yocto@yoctoproject.org
Subject: [PATCH] Gracefully abort if rootfs.img gets to big
Date: Mon, 30 Mar 2015 16:50:53 -0400 [thread overview]
Message-ID: <1427748653-20274-1-git-send-email-challinan@gmail.com> (raw)
See https://bugzilla.yoctoproject.org/show_bug.cgi?id=7541
Current implementation of live image type cannot support image size
greater than 4GB. If the image gets too large, the build simply
hangs silently, without any clues or debug output to indicate why.
This patch prevents the build hanging on rootfs.img getting too big.
---
meta/classes/bootimg.bbclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index b1c03ba..e143e24 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -84,6 +84,13 @@ populate() {
fi
if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ ROOTFS_FILE_SIZE=`stat -L -c "%s" ${ROOTFS}`
+ bbnote "do_bootimg(): rootfs.img size = ${ROOTFS_FILE_SIZE}"
+ # Actual limit is difficult to determine
+ # This leaves ~128MiB headroom for initrd and boot files
+ if [ ${ROOTFS_FILE_SIZE} -gt 4160800000 ]; then
+ bbfatal "Root fs (rootfs.img) is too big for live image"
+ fi
install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
fi
--
1.9.1
next reply other threads:[~2015-03-30 20:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 20:50 Chris Hallinan [this message]
2015-03-30 22:51 ` [PATCH] Gracefully abort if rootfs.img gets to big akuster808
2015-03-30 23:17 ` Chris Hallinan
2015-03-31 13:17 ` Paul Eggleton
2015-03-31 14:16 ` Chris Hallinan
2015-03-31 14:21 ` Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427748653-20274-1-git-send-email-challinan@gmail.com \
--to=challinan@gmail.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.