* [OE-core] [PATCH 0/2] Routerstationpro: The size of the kernel image is too big
@ 2013-03-28 19:32 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
0 siblings, 2 replies; 5+ messages in thread
From: michel.thebeau @ 2013-03-28 19:32 UTC (permalink / raw)
To: richard.purdie, bruce.ashfield; +Cc: poky
Hi Bruce, et al,
I'd previously sent a patch to the poky list which Richard Purdie
has merged, commit 83716e40edacfd20dec8ef41f415ad5828d4643b:
"routerstationpro: use KERNEL_IMAGE_MAXSIZE to test the image"
The two patches here are for yocto #3515 and #3514.
I am sending a fourth patch (second?) to the poky list:
"routerstationpro: swap KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE"
I recommend that these three patches be applied in this order:
#3515
1. [OE-core] [PATCH 1/2] kernel.bbclass: omit vmlinux from rpm file when it is the alternative image
2. [poky] [PATCH 1/1] routerstationpro: swap KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE
#3514
3. [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
When these three are merged then I would consider #3514 and #3515 closed.
Michel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [OE-core] [PATCH 1/2] kernel.bbclass: omit vmlinux from rpm file when it is the alternative image
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 ` 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
1 sibling, 0 replies; 5+ messages in thread
From: michel.thebeau @ 2013-03-28 19:32 UTC (permalink / raw)
To: richard.purdie, bruce.ashfield; +Cc: poky
From: Michel Thebeau <michel.thebeau@windriver.com>
For routerstationpro, setting vmlinux as KERNEL_ALT_IMAGETYPE would
cause both the default KERNEL_IMAGETYPE and the alternate to be
inserted into the kernel rpm file. This is because copying "vmlinux"
is hardcoded.
RSP is presently the only board that specifies vmlinux as the alternate
image.
Testing KERNEL_ALT_IMAGETYPE to disable this install of vmlinux will
cause the vmlinux output to not appear in the kernel rpm file.
[YOCTO #3515]
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
---
meta/classes/kernel.bbclass | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index d57d1f5..6f988e7 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -111,7 +111,14 @@ kernel_do_install() {
install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
- install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
+
+ # if vmlinux is the alternate image type, then do not install it
+ # in the deployed rpm. The default will install instead, above
+ # via the variable KERNEL_OUTPUT (KERNEL_IMAGETYPE)
+ if [ ! ${KERNEL_ALT_IMAGETYPE} == "vmlinux" ]; then
+ install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
+ fi
+
[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
install -d ${D}${sysconfdir}/modules-load.d
install -d ${D}${sysconfdir}/modprobe.d
--
1.7.9.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
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 ` michel.thebeau
2013-03-29 10:56 ` Richard Purdie
2013-04-01 21:38 ` Andrea Adami
1 sibling, 2 replies; 5+ messages in thread
From: michel.thebeau @ 2013-03-28 19:32 UTC (permalink / raw)
To: richard.purdie, bruce.ashfield; +Cc: poky
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
}
--
1.7.9.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
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
2013-04-01 21:38 ` Andrea Adami
1 sibling, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2013-03-29 10:56 UTC (permalink / raw)
To: michel.thebeau; +Cc: poky
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OE-core] [PATCH 2/2] kernel.bbclass: do_sizecheck: update path to build image and do not delete
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
@ 2013-04-01 21:38 ` Andrea Adami
1 sibling, 0 replies; 5+ messages in thread
From: Andrea Adami @ 2013-04-01 21:38 UTC (permalink / raw)
Cc: Poky Project
[-- Attachment #1: Type: text/plain, Size: 3873 bytes --]
On Thu, Mar 28, 2013 at 8:32 PM, <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.
>
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@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
> }
> --
> 1.7.9.7
>
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
>
[-- Attachment #2: Type: text/html, Size: 5420 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-01 21:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-04-01 21:38 ` Andrea Adami
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.