From: Alex Franco <alejandro.franco@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH 3/3] Empty image: filesystem allocation
Date: Wed, 26 Aug 2015 16:57:35 -0500 [thread overview]
Message-ID: <1440626255-29614-4-git-send-email-alejandro.franco@linux.intel.com> (raw)
In-Reply-To: <1440626255-29614-1-git-send-email-alejandro.franco@linux.intel.com>
Increase sparse image block size when ROOTFS_SIZE is smaller than
the minimum needed for ext4 to fit into it.
[YOCTO #7664]
Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
meta/classes/image_types.bbclass | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 35ceb7b..61ce222 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -49,8 +49,16 @@ oe_mkext234fs () {
extra_imagecmd=$@
fi
+ # If generating an empty image the size of the sparse block should be large
+ # enough to allocate an ext4 filesystem using 4096 bytes per inode, this is
+ # about 60K, so dd needs a minimum count of 60, with bs=1024 (bytes per IO)
+ eval local COUNT=\"0\"
+ eval local MIN_COUNT=\"60\"
+ if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then
+ eval COUNT=\"$MIN_COUNT\"
+ fi
# Create a sparse image block
- dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=0 bs=1k
+ dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS}
}
--
2.5.0
next prev parent reply other threads:[~2015-08-26 21:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 21:57 [PATCH 0/3] Empty-image functionality Alex Franco
2015-08-26 21:57 ` [PATCH 1/3] Empty image: core-image-empty recipe, Rootfs fix Alex Franco
2015-08-29 11:18 ` Paul Eggleton
2015-09-08 23:20 ` Alex Franco
2015-08-26 21:57 ` [PATCH 2/3] Empty image: package list splitting and iteration Alex Franco
2015-08-26 21:57 ` Alex Franco [this message]
2015-09-11 17:26 ` [PATCH 3/3] Empty image: filesystem allocation Benjamin Esquivel
2015-09-11 22:32 ` Richard Purdie
2015-08-28 18:23 ` [PATCH 0/3] Empty-image functionality Aníbal Limón
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=1440626255-29614-4-git-send-email-alejandro.franco@linux.intel.com \
--to=alejandro.franco@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/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.