[poky] [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
Andrea Adami
andrea.adami at gmail.com
Mon Apr 1 14:38:33 PDT 2013
On Thu, Mar 28, 2013 at 8:32 PM, <michel.thebeau at windriver.com> wrote:
> From: Michel Thebeau <michel.thebeau at windriver.com>
>
> do_sizecheck has been around for a while but looks to have been unused.
>
FYI in meta-handheld [1] we are building for challenged devices allowing
max 1,2 or even 1,0 MB kernel size and the check has always be done
properly.
So any improvement is allowed but please don't break the things ;)
Cheers
Andrea
[1]
http://cgit.openembedded.org/meta-handheld/tree/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.2.bbappend
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 at windriver.com>
> Signed-off-by: Michel Thebeau <michel.thebeau at 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
> }
> --
> 1.7.9.7
>
> _______________________________________________
> poky mailing list
> poky at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/poky/attachments/20130401/5c53ec6c/attachment.html>
More information about the poky
mailing list