All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] runqemu: Fix running qemu when build without gl
@ 2012-07-10 17:07 Khem Raj
  2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
  2012-07-17 16:03 ` [PATCH 1/2] runqemu: Fix running qemu when build without gl Saul Wold
  0 siblings, 2 replies; 11+ messages in thread
From: Khem Raj @ 2012-07-10 17:07 UTC (permalink / raw)
  To: openembedded-core

When gl is disabled in PACKAGECONFIG then we dont need
to check for supporting libs to be present before running
qemu.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/runqemu          |   14 --------------
 scripts/runqemu-internal |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 8d149a2..0b547f2 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -384,20 +384,6 @@ echo "FSTYPE: [$FSTYPE]"
 setup_sysroot
 # OECORE_NATIVE_SYSROOT is now set for all cases
 
-# We can't run without a libGL.so
-libgl='no'
-
-[ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
-[ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
-[ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
-
-if [ "$libgl" != 'yes' ]; then
-    echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
-    Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.
-    Fedora package names are: mesa-libGL-devel mesa-libGLU-devel."
-    exit 1;
-fi
-
 INTERNAL_SCRIPT="$0-internal"
 if [ ! -f "$INTERNAL_SCRIPT" -o ! -r "$INTERNAL_SCRIPT" ]; then
 INTERNAL_SCRIPT=`which runqemu-internal`
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 041464d..2598800 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -467,6 +467,23 @@ if [ ! -x "$QEMUBIN" ]; then
     return
 fi
 
+NEED_GL=`ldd $QEMUBIN/$QEMU 2>&1 | grep libGLU`
+# We can't run without a libGL.so
+if [ "$NEED_GL" != "" ]; then
+    libgl='no'
+
+    [ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
+    [ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
+    [ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
+
+    if [ "$libgl" != 'yes' ]; then
+        echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
+        Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.
+        Fedora package names are: mesa-libGL-devel mesa-libGLU-devel."
+        exit 1;
+    fi
+fi
+
 do_quit() {
     if [ -n "$PIDFILE" ]; then
         #echo kill `cat $PIDFILE`
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-10 17:07 [PATCH 1/2] runqemu: Fix running qemu when build without gl Khem Raj
@ 2012-07-10 17:07 ` Khem Raj
  2012-07-10 17:13   ` Phil Blundell
                     ` (2 more replies)
  2012-07-17 16:03 ` [PATCH 1/2] runqemu: Fix running qemu when build without gl Saul Wold
  1 sibling, 3 replies; 11+ messages in thread
From: Khem Raj @ 2012-07-10 17:07 UTC (permalink / raw)
  To: openembedded-core

We shave too much from kernel sources for making it work
for on device external kernel module development that cross
development of external modules wont work from same tree
anymore. This patch makes a copy of tree which will eventually
be staged for building external modules

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/kernel.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 81c334b..b2b6fcd 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -80,6 +80,7 @@ KERNEL_ALT_IMAGETYPE ??= ""
 # Define where the kernel headers are installed on the target as well as where
 # they are staged.
 KERNEL_SRC_PATH = "/usr/src/kernel"
+UNPRUNED_KERNEL_SRC_PATH = "/usr/src/kernel-unpruned"
 
 KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
 
@@ -135,7 +136,9 @@ kernel_do_install() {
 	# kernel source tree.
 	#
 	kerneldir=${D}${KERNEL_SRC_PATH}
+	unrprunedkerneldir=${D}${UNPRUNED_KERNEL_SRC_PATH}
 	install -d $kerneldir
+	install -d $unrprunedkerneldir
 
 	#
 	# Store the kernel version in sysroots for module-base.bbclass
@@ -176,7 +179,6 @@ kernel_do_install() {
 	# and include files.
 	#
 	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
-	make -C $kerneldir _mrproper_scripts
 	find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
 	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
 
@@ -186,6 +188,9 @@ kernel_do_install() {
 	if [ ${ARCH} = "powerpc" ]; then
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
+	# make a copy of unpruned kernel tree
+	cp -fR $kerneldir/* $unrprunedkerneldir
+	make -C $kerneldir _mrproper_scripts
 
 	# Remove the following binaries which cause strip or arch QA errors
 	# during do_package for cross-compiled platforms
@@ -197,8 +202,14 @@ kernel_do_install() {
 	done
 }
 
+PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
+
+kernel_package_preprocess () {
+	rm -rf ${PKGD}/${UNPRUNED_KERNEL_SRC_PATH}
+}
+
 sysroot_stage_all_append() {
-	sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
+	sysroot_stage_dir ${D}${UNPRUNED_KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
 }
 
 kernel_do_configure() {
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
@ 2012-07-10 17:13   ` Phil Blundell
  2012-07-10 17:21     ` Bruce Ashfield
  2012-07-11 10:30   ` Richard Purdie
  2012-07-19  7:51   ` Martin Jansa
  2 siblings, 1 reply; 11+ messages in thread
From: Phil Blundell @ 2012-07-10 17:13 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
> We shave too much from kernel sources for making it work
> for on device external kernel module development that cross
> development of external modules wont work from same tree
> anymore. This patch makes a copy of tree which will eventually
> be staged for building external modules

Why does cross development require more of the kernel tree than
on-device compilation?

p.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-10 17:13   ` Phil Blundell
@ 2012-07-10 17:21     ` Bruce Ashfield
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Ashfield @ 2012-07-10 17:21 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, Jul 10, 2012 at 1:13 PM, Phil Blundell <philb@gnu.org> wrote:
> On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
>> We shave too much from kernel sources for making it work
>> for on device external kernel module development that cross
>> development of external modules wont work from same tree
>> anymore. This patch makes a copy of tree which will eventually
>> be staged for building external modules
>
> Why does cross development require more of the kernel tree than
> on-device compilation?

From what we were discussing on IRC yesterday it is the binary tools that
are being stripped (and then regenerated) on the on-target builds. We can't
package them up, since they are in a -dev package.

Cheers,

Bruce

>
> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
  2012-07-10 17:13   ` Phil Blundell
@ 2012-07-11 10:30   ` Richard Purdie
  2012-07-11 14:25     ` Khem Raj
  2012-07-19  7:51   ` Martin Jansa
  2 siblings, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2012-07-11 10:30 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
> We shave too much from kernel sources for making it work
> for on device external kernel module development that cross
> development of external modules wont work from same tree
> anymore. This patch makes a copy of tree which will eventually
> be staged for building external modules

It sounds from the further discussion that there is more to the patch
than just this. Firstly, a change like this needs a more precise
description.

Secondly, we're copying around *way* to much data in this approach. I'd
like to suggest an improvement but can't since the description above is
lacking, I can't even understand what the problem is you're trying to
fix.

So more discussion is needed.

I have a suspicion that this fix only "happens" to work when SDKMACHINE
== NATIVEMACHINE.

Cheers,

Richard


> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |   15 +++++++++++++--
>  1 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 81c334b..b2b6fcd 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -80,6 +80,7 @@ KERNEL_ALT_IMAGETYPE ??= ""
>  # Define where the kernel headers are installed on the target as well as where
>  # they are staged.
>  KERNEL_SRC_PATH = "/usr/src/kernel"
> +UNPRUNED_KERNEL_SRC_PATH = "/usr/src/kernel-unpruned"
>  
>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>  
> @@ -135,7 +136,9 @@ kernel_do_install() {
>  	# kernel source tree.
>  	#
>  	kerneldir=${D}${KERNEL_SRC_PATH}
> +	unrprunedkerneldir=${D}${UNPRUNED_KERNEL_SRC_PATH}
>  	install -d $kerneldir
> +	install -d $unrprunedkerneldir
>  
>  	#
>  	# Store the kernel version in sysroots for module-base.bbclass
> @@ -176,7 +179,6 @@ kernel_do_install() {
>  	# and include files.
>  	#
>  	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
> -	make -C $kerneldir _mrproper_scripts
>  	find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
>  	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
>  
> @@ -186,6 +188,9 @@ kernel_do_install() {
>  	if [ ${ARCH} = "powerpc" ]; then
>  		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>  	fi
> +	# make a copy of unpruned kernel tree
> +	cp -fR $kerneldir/* $unrprunedkerneldir
> +	make -C $kerneldir _mrproper_scripts
>  
>  	# Remove the following binaries which cause strip or arch QA errors
>  	# during do_package for cross-compiled platforms
> @@ -197,8 +202,14 @@ kernel_do_install() {
>  	done
>  }
>  
> +PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
> +
> +kernel_package_preprocess () {
> +	rm -rf ${PKGD}/${UNPRUNED_KERNEL_SRC_PATH}
> +}
> +
>  sysroot_stage_all_append() {
> -	sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
> +	sysroot_stage_dir ${D}${UNPRUNED_KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>  }
>  
>  kernel_do_configure() {





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-11 10:30   ` Richard Purdie
@ 2012-07-11 14:25     ` Khem Raj
  2012-07-11 14:48       ` Richard Purdie
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2012-07-11 14:25 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Wed, Jul 11, 2012 at 3:30 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
>> We shave too much from kernel sources for making it work
>> for on device external kernel module development that cross
>> development of external modules wont work from same tree
>> anymore. This patch makes a copy of tree which will eventually
>> be staged for building external modules
>
> It sounds from the further discussion that there is more to the patch
> than just this. Firstly, a change like this needs a more precise
> description.
>
> Secondly, we're copying around *way* to much data in this approach. I'd
> like to suggest an improvement but can't since the description above is
> lacking, I can't even understand what the problem is you're trying to
> fix.

alright. There are tools (especially in scripts/) which are made for
buildhost when compiling the kernel irrespective of cross
or native. The tools like fixdep, recordmcount etc. which are needed
to run when you build kernel itself as well as external
modules. Now we do 'make _mproper_scripts' which cleans all those
binaries. We do this because we want to ship kernel-dev
and packaging binaries for different host wont be allowed in a target
package. So we chose to delete them and then on device
regenerate them ( ideally I would have preferred to generate them
cross candian when making for target)

Deleting these tools also renders the cross building of modules
useless. Since I want to ship the sources as reference only
meaning people may not have write access to the kernel sources they
can not run make inside the kernel sources to regenerate
those binaries before they start building their external modules.

>
> So more discussion is needed.
>
> I have a suspicion that this fix only "happens" to work when SDKMACHINE
> == NATIVEMACHINE.
>

yes, for a full solution we have to generate two versions of
kernel-tools 1 for target and 1 for SDKMACHINE
however this at least brings back what we had.

> Cheers,
>
> Richard
>
>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/classes/kernel.bbclass |   15 +++++++++++++--
>>  1 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 81c334b..b2b6fcd 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -80,6 +80,7 @@ KERNEL_ALT_IMAGETYPE ??= ""
>>  # Define where the kernel headers are installed on the target as well as where
>>  # they are staged.
>>  KERNEL_SRC_PATH = "/usr/src/kernel"
>> +UNPRUNED_KERNEL_SRC_PATH = "/usr/src/kernel-unpruned"
>>
>>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>
>> @@ -135,7 +136,9 @@ kernel_do_install() {
>>       # kernel source tree.
>>       #
>>       kerneldir=${D}${KERNEL_SRC_PATH}
>> +     unrprunedkerneldir=${D}${UNPRUNED_KERNEL_SRC_PATH}
>>       install -d $kerneldir
>> +     install -d $unrprunedkerneldir
>>
>>       #
>>       # Store the kernel version in sysroots for module-base.bbclass
>> @@ -176,7 +179,6 @@ kernel_do_install() {
>>       # and include files.
>>       #
>>       oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
>> -     make -C $kerneldir _mrproper_scripts
>>       find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
>>       find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
>>
>> @@ -186,6 +188,9 @@ kernel_do_install() {
>>       if [ ${ARCH} = "powerpc" ]; then
>>               cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>>       fi
>> +     # make a copy of unpruned kernel tree
>> +     cp -fR $kerneldir/* $unrprunedkerneldir
>> +     make -C $kerneldir _mrproper_scripts
>>
>>       # Remove the following binaries which cause strip or arch QA errors
>>       # during do_package for cross-compiled platforms
>> @@ -197,8 +202,14 @@ kernel_do_install() {
>>       done
>>  }
>>
>> +PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>> +
>> +kernel_package_preprocess () {
>> +     rm -rf ${PKGD}/${UNPRUNED_KERNEL_SRC_PATH}
>> +}
>> +
>>  sysroot_stage_all_append() {
>> -     sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>> +     sysroot_stage_dir ${D}${UNPRUNED_KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>  }
>>
>>  kernel_do_configure() {
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-11 14:25     ` Khem Raj
@ 2012-07-11 14:48       ` Richard Purdie
  2012-07-20  7:30         ` Darren Hart
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2012-07-11 14:48 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Wed, 2012-07-11 at 07:25 -0700, Khem Raj wrote:
> On Wed, Jul 11, 2012 at 3:30 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
> >> We shave too much from kernel sources for making it work
> >> for on device external kernel module development that cross
> >> development of external modules wont work from same tree
> >> anymore. This patch makes a copy of tree which will eventually
> >> be staged for building external modules
> >
> > It sounds from the further discussion that there is more to the patch
> > than just this. Firstly, a change like this needs a more precise
> > description.
> >
> > Secondly, we're copying around *way* to much data in this approach. I'd
> > like to suggest an improvement but can't since the description above is
> > lacking, I can't even understand what the problem is you're trying to
> > fix.
> 
> alright. There are tools (especially in scripts/) which are made for
> buildhost when compiling the kernel irrespective of cross
> or native. The tools like fixdep, recordmcount etc. which are needed
> to run when you build kernel itself as well as external
> modules. Now we do 'make _mproper_scripts' which cleans all those
> binaries. We do this because we want to ship kernel-dev
> and packaging binaries for different host wont be allowed in a target
> package. So we chose to delete them and then on device
> regenerate them ( ideally I would have preferred to generate them
> cross candian when making for target)
> 
> Deleting these tools also renders the cross building of modules
> useless. Since I want to ship the sources as reference only
> meaning people may not have write access to the kernel sources they
> can not run make inside the kernel sources to regenerate
> those binaries before they start building their external modules.
> 
> >
> > So more discussion is needed.
> >
> > I have a suspicion that this fix only "happens" to work when SDKMACHINE
> > == NATIVEMACHINE.
> >
> 
> yes, for a full solution we have to generate two versions of
> kernel-tools 1 for target and 1 for SDKMACHINE
> however this at least brings back what we had.

s/full/non-broken/

This patch adds something that is broken in several different cases and
kills off performance as an added bonus. I'd like to get this fixed
properly please rather than perpetuate the problem. We need to either do
something well and correctly, or not do it at all. We could document
"make _mproper_scripts" as a requirement for installing the kernel SDK
in the meantime.

I think we do need to make a kernel-tools package which correctly
generates the tools for a given target, be it nativesdk, or the target
device.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] runqemu: Fix running qemu when build without gl
  2012-07-10 17:07 [PATCH 1/2] runqemu: Fix running qemu when build without gl Khem Raj
  2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
@ 2012-07-17 16:03 ` Saul Wold
  1 sibling, 0 replies; 11+ messages in thread
From: Saul Wold @ 2012-07-17 16:03 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 07/10/2012 10:07 AM, Khem Raj wrote:
> When gl is disabled in PACKAGECONFIG then we dont need
> to check for supporting libs to be present before running
> qemu.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   scripts/runqemu          |   14 --------------
>   scripts/runqemu-internal |   17 +++++++++++++++++
>   2 files changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 8d149a2..0b547f2 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -384,20 +384,6 @@ echo "FSTYPE: [$FSTYPE]"
>   setup_sysroot
>   # OECORE_NATIVE_SYSROOT is now set for all cases
>
> -# We can't run without a libGL.so
> -libgl='no'
> -
> -[ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
> -[ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
> -[ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
> -
> -if [ "$libgl" != 'yes' ]; then
> -    echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
> -    Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.
> -    Fedora package names are: mesa-libGL-devel mesa-libGLU-devel."
> -    exit 1;
> -fi
> -
>   INTERNAL_SCRIPT="$0-internal"
>   if [ ! -f "$INTERNAL_SCRIPT" -o ! -r "$INTERNAL_SCRIPT" ]; then
>   INTERNAL_SCRIPT=`which runqemu-internal`
> diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
> index 041464d..2598800 100755
> --- a/scripts/runqemu-internal
> +++ b/scripts/runqemu-internal
> @@ -467,6 +467,23 @@ if [ ! -x "$QEMUBIN" ]; then
>       return
>   fi
>
> +NEED_GL=`ldd $QEMUBIN/$QEMU 2>&1 | grep libGLU`
> +# We can't run without a libGL.so
> +if [ "$NEED_GL" != "" ]; then
> +    libgl='no'
> +
> +    [ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
> +    [ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
> +    [ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
> +
> +    if [ "$libgl" != 'yes' ]; then
> +        echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
> +        Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.
> +        Fedora package names are: mesa-libGL-devel mesa-libGLU-devel."
> +        exit 1;
> +    fi
> +fi
> +
>   do_quit() {
>       if [ -n "$PIDFILE" ]; then
>           #echo kill `cat $PIDFILE`
>

Merged this patch into OE-Core

Thanks
	Sau!




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
  2012-07-10 17:13   ` Phil Blundell
  2012-07-11 10:30   ` Richard Purdie
@ 2012-07-19  7:51   ` Martin Jansa
  2 siblings, 0 replies; 11+ messages in thread
From: Martin Jansa @ 2012-07-19  7:51 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3137 bytes --]

On Tue, Jul 10, 2012 at 10:07:50AM -0700, Khem Raj wrote:
> We shave too much from kernel sources for making it work
> for on device external kernel module development that cross
> development of external modules wont work from same tree
> anymore. This patch makes a copy of tree which will eventually
> be staged for building external modules

Does this solve also this issue?
http://lists.linuxtogo.org/pipermail/openembedded-devel/2012-July/040584.html

Cheers,

> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |   15 +++++++++++++--
>  1 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 81c334b..b2b6fcd 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -80,6 +80,7 @@ KERNEL_ALT_IMAGETYPE ??= ""
>  # Define where the kernel headers are installed on the target as well as where
>  # they are staged.
>  KERNEL_SRC_PATH = "/usr/src/kernel"
> +UNPRUNED_KERNEL_SRC_PATH = "/usr/src/kernel-unpruned"
>  
>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>  
> @@ -135,7 +136,9 @@ kernel_do_install() {
>  	# kernel source tree.
>  	#
>  	kerneldir=${D}${KERNEL_SRC_PATH}
> +	unrprunedkerneldir=${D}${UNPRUNED_KERNEL_SRC_PATH}
>  	install -d $kerneldir
> +	install -d $unrprunedkerneldir
>  
>  	#
>  	# Store the kernel version in sysroots for module-base.bbclass
> @@ -176,7 +179,6 @@ kernel_do_install() {
>  	# and include files.
>  	#
>  	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
> -	make -C $kerneldir _mrproper_scripts
>  	find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
>  	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
>  
> @@ -186,6 +188,9 @@ kernel_do_install() {
>  	if [ ${ARCH} = "powerpc" ]; then
>  		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>  	fi
> +	# make a copy of unpruned kernel tree
> +	cp -fR $kerneldir/* $unrprunedkerneldir
> +	make -C $kerneldir _mrproper_scripts
>  
>  	# Remove the following binaries which cause strip or arch QA errors
>  	# during do_package for cross-compiled platforms
> @@ -197,8 +202,14 @@ kernel_do_install() {
>  	done
>  }
>  
> +PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
> +
> +kernel_package_preprocess () {
> +	rm -rf ${PKGD}/${UNPRUNED_KERNEL_SRC_PATH}
> +}
> +
>  sysroot_stage_all_append() {
> -	sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
> +	sysroot_stage_dir ${D}${UNPRUNED_KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>  }
>  
>  kernel_do_configure() {
> -- 
> 1.7.5.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-11 14:48       ` Richard Purdie
@ 2012-07-20  7:30         ` Darren Hart
  2012-07-20 23:05           ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Darren Hart @ 2012-07-20  7:30 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer



On 07/11/2012 07:48 AM, Richard Purdie wrote:
> On Wed, 2012-07-11 at 07:25 -0700, Khem Raj wrote:
>> On Wed, Jul 11, 2012 at 3:30 AM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>>> On Tue, 2012-07-10 at 10:07 -0700, Khem Raj wrote:
>>>> We shave too much from kernel sources for making it work
>>>> for on device external kernel module development that cross
>>>> development of external modules wont work from same tree
>>>> anymore. This patch makes a copy of tree which will eventually
>>>> be staged for building external modules
>>>
>>> It sounds from the further discussion that there is more to the patch
>>> than just this. Firstly, a change like this needs a more precise
>>> description.
>>>
>>> Secondly, we're copying around *way* to much data in this approach. I'd
>>> like to suggest an improvement but can't since the description above is
>>> lacking, I can't even understand what the problem is you're trying to
>>> fix.
>>
>> alright. There are tools (especially in scripts/) which are made for
>> buildhost when compiling the kernel irrespective of cross
>> or native. The tools like fixdep, recordmcount etc. which are needed
>> to run when you build kernel itself as well as external
>> modules. Now we do 'make _mproper_scripts' which cleans all those
>> binaries. We do this because we want to ship kernel-dev
>> and packaging binaries for different host wont be allowed in a target
>> package. So we chose to delete them and then on device
>> regenerate them ( ideally I would have preferred to generate them
>> cross candian when making for target)
>>
>> Deleting these tools also renders the cross building of modules
>> useless. Since I want to ship the sources as reference only
>> meaning people may not have write access to the kernel sources they
>> can not run make inside the kernel sources to regenerate
>> those binaries before they start building their external modules.
>>
>>>
>>> So more discussion is needed.
>>>
>>> I have a suspicion that this fix only "happens" to work when SDKMACHINE
>>> == NATIVEMACHINE.
>>>
>>
>> yes, for a full solution we have to generate two versions of
>> kernel-tools 1 for target and 1 for SDKMACHINE
>> however this at least brings back what we had.
> 
> s/full/non-broken/
> 
> This patch adds something that is broken in several different cases and
> kills off performance as an added bonus. I'd like to get this fixed
> properly please rather than perpetuate the problem. We need to either do
> something well and correctly, or not do it at all. We could document
> "make _mproper_scripts" as a requirement for installing the kernel SDK
> in the meantime.
> 
> I think we do need to make a kernel-tools package which correctly
> generates the tools for a given target, be it nativesdk, or the target
> device.

Khem, I take it we still have something left to do here in addition to
the bounds.h patch you sent a short while ago?

If so, this sounds like a big enough effort that a bug is warranted.
Would you consider writing up exactly what you're trying to accomplish
and opening a bug?

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules
  2012-07-20  7:30         ` Darren Hart
@ 2012-07-20 23:05           ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2012-07-20 23:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, Jul 20, 2012 at 12:30 AM, Darren Hart <dvhart@linux.intel.com> wrote:
> Khem, I take it we still have something left to do here in addition to
> the bounds.h patch you sent a short while ago?
>
> If so, this sounds like a big enough effort that a bug is warranted.
> Would you consider writing up exactly what you're trying to accomplish
> and opening a bug?

my problem is bigger. I am trying to provide a (enough) prebuilt kernel tree
so that external modules ( outside of build OE tree) can be built using SDK
in cross environment but "make -C $kerneldir _mrproper_scripts" has
bit me in the rear side since now it deletes considerable portion of kernel
bits that the resulting tree is unusable for building without modifying the
tree by running "make scripts" or so.

bounds.h was for syncing with OE-Core, since I am in process of getting rid
of copy of kernel.bbclass in meta-oe



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-20 23:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 17:07 [PATCH 1/2] runqemu: Fix running qemu when build without gl Khem Raj
2012-07-10 17:07 ` [PATCH 2/2] kernel.bbclass: Make tree available for cross building external modules Khem Raj
2012-07-10 17:13   ` Phil Blundell
2012-07-10 17:21     ` Bruce Ashfield
2012-07-11 10:30   ` Richard Purdie
2012-07-11 14:25     ` Khem Raj
2012-07-11 14:48       ` Richard Purdie
2012-07-20  7:30         ` Darren Hart
2012-07-20 23:05           ` Khem Raj
2012-07-19  7:51   ` Martin Jansa
2012-07-17 16:03 ` [PATCH 1/2] runqemu: Fix running qemu when build without gl Saul Wold

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.