Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Andrei Gherzan <andrei@gherzan.ro>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] image_types.bbclass: Round up ROOTFS_SIZE after base_size check
Date: Tue, 11 Sep 2012 09:09:14 -0700	[thread overview]
Message-ID: <504F622A.8020309@linux.intel.com> (raw)
In-Reply-To: <5d91c62217814247b57453bf6b6d97bc049caa1b.1347300913.git.andrei@gherzan.ro>

On 09/10/2012 11:18 AM, Andrei Gherzan wrote:
> 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 |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index d286eea..0bd7a6f 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -82,9 +82,13 @@ 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}) }'`
> +	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{base_size = $1 * ${IMAGE_OVERHEAD_FACTOR}; print ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}) }'`
> +
> +	# Round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT
> +	ROOTFS_SIZE=`expr ${ROOTFS_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1`
> +	ROOTFS_SIZE=`expr ${ROOTFS_SIZE} - ${ROOTFS_SIZE} % ${IMAGE_ROOTFS_ALIGNMENT}`
> +
I saw a new expr failure on rootfs this morning testing with this patch, 
I have to dig into it to figure out what went wrong.

Sau!

>   	${cmd}
>   	# Now create the needed compressed versions
>   	cd ${DEPLOY_DIR_IMAGE}/
>



      reply	other threads:[~2012-09-11 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 18:17 [PATCH 0/1] Align final ROOTFS_SIZE after checking if base_size Andrei Gherzan
2012-09-10 18:18 ` [PATCH 1/1] image_types.bbclass: Round up ROOTFS_SIZE after base_size check Andrei Gherzan
2012-09-11 16:09   ` Saul Wold [this message]

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=504F622A.8020309@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=andrei@gherzan.ro \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox