* [PATCH V3 0/1] Round up ROOTFS_SIZE after base_size check
@ 2012-09-13 17:18 Andrei Gherzan
2012-09-13 17:18 ` [PATCH V3 1/1] image_types.bbclass: " Andrei Gherzan
2012-09-14 15:44 ` [PATCH V3 0/1] " Saul Wold
0 siblings, 2 replies; 3+ messages in thread
From: Andrei Gherzan @ 2012-09-13 17:18 UTC (permalink / raw)
To: openembedded-core
V3:
Do the whole thing in the same awk
The following changes since commit 0f55a5868457300a3defc7fa7451ef191d19e018:
adt-installer: Allow changing YOCTOADT_REPO (2012-09-05 23:28:10 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ag/rootfs_size
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/rootfs_size
Andrei Gherzan (1):
image_types.bbclass: Round up ROOTFS_SIZE after base_size check
meta/classes/image_types.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH V3 1/1] image_types.bbclass: Round up ROOTFS_SIZE after base_size check
2012-09-13 17:18 [PATCH V3 0/1] Round up ROOTFS_SIZE after base_size check Andrei Gherzan
@ 2012-09-13 17:18 ` Andrei Gherzan
2012-09-14 15:44 ` [PATCH V3 0/1] " Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: Andrei Gherzan @ 2012-09-13 17:18 UTC (permalink / raw)
To: openembedded-core
If we round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT before checking if
base_size is greater then IMAGE_ROOTFS_SIZE, we can end up adding an
unaligned value to IMAGE_ROOTFS_SIZE. Obviously, if
IMAGE_ROOTFS_EXTRA_SPACE was overwritten with an unaligned value. So
let's add the round up code after the base_size calculus and it's
comparison.
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
meta/classes/image_types.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index d286eea..aa1a785 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -82,9 +82,9 @@ runimagecmd () {
# The base_size gets calculated:
# - initial size determined by `du -ks` of the IMAGE_ROOTFS
# - then multiplied by the IMAGE_OVERHEAD_FACTOR
- # - then rounded up to IMAGE_ROOTFS_ALIGNMENT
- # - finally tested against IMAGE_ROOTFS_SIZE
- ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{base_size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_ALIGNMENT} - 1; base_size -= base_size % ${IMAGE_ROOTFS_ALIGNMENT}; print ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}) }'`
+ # - tested against IMAGE_ROOTFS_SIZE
+ # - round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT
+ ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS} | awk '{base_size = $1 * ${IMAGE_OVERHEAD_FACTOR}; base_size = ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}); if (base_size != int(base_size)) base_size = int(base_size + 1); base_size = base_size + ${IMAGE_ROOTFS_ALIGNMENT} - 1; base_size -= base_size % ${IMAGE_ROOTFS_ALIGNMENT}; print base_size }'`
${cmd}
# Now create the needed compressed versions
cd ${DEPLOY_DIR_IMAGE}/
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH V3 0/1] Round up ROOTFS_SIZE after base_size check
2012-09-13 17:18 [PATCH V3 0/1] Round up ROOTFS_SIZE after base_size check Andrei Gherzan
2012-09-13 17:18 ` [PATCH V3 1/1] image_types.bbclass: " Andrei Gherzan
@ 2012-09-14 15:44 ` Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2012-09-14 15:44 UTC (permalink / raw)
To: Andrei Gherzan; +Cc: openembedded-core
On 09/13/2012 10:18 AM, Andrei Gherzan wrote:
> V3:
> Do the whole thing in the same awk
>
> The following changes since commit 0f55a5868457300a3defc7fa7451ef191d19e018:
>
> adt-installer: Allow changing YOCTOADT_REPO (2012-09-05 23:28:10 +0100)
>
> are available in the git repository at:
>
> git://git.yoctoproject.org/poky-contrib ag/rootfs_size
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/rootfs_size
>
> Andrei Gherzan (1):
> image_types.bbclass: Round up ROOTFS_SIZE after base_size check
>
> meta/classes/image_types.bbclass | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
Merged into OE-Core
Thanks
Sau!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-14 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13 17:18 [PATCH V3 0/1] Round up ROOTFS_SIZE after base_size check Andrei Gherzan
2012-09-13 17:18 ` [PATCH V3 1/1] image_types.bbclass: " Andrei Gherzan
2012-09-14 15:44 ` [PATCH V3 0/1] " Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox