From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: michel.thebeau@windriver.com
Cc: poky@yoctoproject.org
Subject: Re: [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
Date: Fri, 29 Mar 2013 10:56:00 +0000 [thread overview]
Message-ID: <1364554560.28471.188.camel@ted> (raw)
In-Reply-To: <1364499172-28976-3-git-send-email-michel.thebeau@windriver.com>
On Thu, 2013-03-28 at 15:32 -0400, michel.thebeau@windriver.com wrote:
> From: Michel Thebeau <michel.thebeau@windriver.com>
>
> do_sizecheck has been around for a while but looks to have been unused.
> There are a few issues.
>
> It breaks because KERNEL_OUTPUT is a path relative to ${B}, and
> resolves to a soft link to ${B}/${KERNEL_IMAGETYPE}. When
> do_sizecheck runs it does not find the file (because the working
> directory is elsewhere) and does not fail.
>
> Also, when do_sizecheck deletes the oversized kernel image it leaves
> the previously run do_compile task with inaccurate status.
>
> So, do the following:
> - keep the oversized image file so the status of do_compile is valid
> - specify the full path with ${B} to break the dependency on working
> directory
> - test for the image file in two typical locations and print a
> "not supported" warning when it is not found
> - finally, print a note that the size check was run successfully
>
> [YOCTO #3514]
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
> ---
> meta/classes/kernel.bbclass | 25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 6f988e7..d25d98a 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -300,10 +300,27 @@ python split_kernel_packages () {
> # with a fixed length or there is a limit in transferring the kernel to memory
> do_sizecheck() {
> if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
> - size=`ls -l ${KERNEL_OUTPUT} | awk '{ print $5}'`
> - if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
> - rm ${KERNEL_OUTPUT}
> - die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
> + if [ -f ${B}/${KERNEL_OUTPUT} ]; then
> + # vmlinux.bin is usually found here
> + koutf="${B}/${KERNEL_OUTPUT}"
> + elif [ -f ${B}/${KERNEL_IMAGETYPE} ]; then
> + # vmlinux is usually found here
> + koutf="${B}/${KERNEL_IMAGETYPE}"
> + else
> + # if we're lucky we'll catch some other image
> + # types in the previous conditions; otherwise:
> + koutf=""
> + fi
> +
> + if [ -z "$koutf" ]; then
> + bbwarn "KERNEL_IMAGE_MAXSIZE enabled but" \
> + "${KERNEL_IMAGETYPE} not supported (or not found)"
> + else
> + size=`ls -l $koutf | awk '{ print $5}'`
> + if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
> + die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
> + fi
> + bbnote "kernel image size check... done"
> fi
> fi
> }
Sorry but this is a bit crazy. We should be pretty clear about which
file is the output kernel and this is the file that we should test
(resolving links if need be). If we don't know which file is the correct
kernel, we have bigger issues.
kernel_do_deploy says its KERNEL_OUTPUT:
"""
install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
"""
I'd note we have:
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
so perhaps we need a:
do_sizecheck[dirs] = "${B}"
to ensure we run in the correct place?
Cheers,
Richard
next prev parent reply other threads:[~2013-03-29 10:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 19:32 [OE-core] [PATCH 0/2] Routerstationpro: The size of the kernel image is too big michel.thebeau
2013-03-28 19:32 ` [OE-core] [PATCH 1/2] kernel.bbclass: omit vmlinux from rpm file when it is the alternative image michel.thebeau
2013-03-28 19:32 ` [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete michel.thebeau
2013-03-29 10:56 ` Richard Purdie [this message]
2013-04-01 21:38 ` Andrea Adami
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=1364554560.28471.188.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=michel.thebeau@windriver.com \
--cc=poky@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.