Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V1] kernel-devsrc: add 'make scripts' postinstall
@ 2015-11-23 21:58 Ming Liu
  2015-11-24 16:29 ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Liu @ 2015-11-23 21:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: bruce.ashfield, darren, Ming Liu, yue.tao

From: Ming Liu <peter.x.liu@external.atlascopco.com>

Run 'make scripts' inside qemu in order to create script binaries that
needed by external modules build on the target.

Add RDEPENDS on gcc, make, which are needed by the compilation.

[YOCTO #6630]

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 196c8c7..87826ad 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
 inherit linux-kernel-base
 
 # Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
-inherit module-base
+inherit module-base qemu
 
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
@@ -71,6 +71,16 @@ do_install() {
 # Ensure we don't race against "make scripts" during cpio
 do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
+pkg_postinst_${PN} () {
+	if [ -n "$D" ]; then
+		${@qemu_run_binary(d, '$D', '${bindir}/make')} \
+			-C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
+	else
+		make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
+	fi
+}
+
 PACKAGES = "kernel-devsrc"
 FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+DEPENDS = "qemu-native"
+RDEPENDS_${PN} = "bc gcc make"
-- 
1.9.1



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

* Re: [PATCH V1] kernel-devsrc: add 'make scripts' postinstall
  2015-11-23 21:58 [PATCH V1] kernel-devsrc: add 'make scripts' postinstall Ming Liu
@ 2015-11-24 16:29 ` Bruce Ashfield
  2015-11-24 21:32   ` Ming Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2015-11-24 16:29 UTC (permalink / raw)
  To: Ming Liu, openembedded-core; +Cc: darren, Ming Liu, yue.tao

On 15-11-23 04:58 PM, Ming Liu wrote:
> From: Ming Liu <peter.x.liu@external.atlascopco.com>
>
> Run 'make scripts' inside qemu in order to create script binaries that
> needed by external modules build on the target.
>
> Add RDEPENDS on gcc, make, which are needed by the compilation.

This version looks fine to me .. and by "fine", I mean that it probably
is still less than ideal, but with our current packaging and separation
it makes sense to make it work, with all dependencies being explicit.

As we (re)slim down the devsrc/headers split, we can revisit this as
necessary.

One question below though ..

>
> [YOCTO #6630]
>
> Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
> ---
>   meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 196c8c7..87826ad 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
>   inherit linux-kernel-base
>
>   # Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
> -inherit module-base
> +inherit module-base qemu

Shouldn't this be qemu-native ? Since it is running on the host ? Or
maybe I'm completely misunderstanding something :)

Bruce

>
>   # We need the kernel to be staged (unpacked, patched and configured) before
>   # we can grab the source and make the source package. We also need the bits from
> @@ -71,6 +71,16 @@ do_install() {
>   # Ensure we don't race against "make scripts" during cpio
>   do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
>
> +pkg_postinst_${PN} () {
> +	if [ -n "$D" ]; then
> +		${@qemu_run_binary(d, '$D', '${bindir}/make')} \
> +			-C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
> +	else
> +		make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
> +	fi
> +}
> +
>   PACKAGES = "kernel-devsrc"
>   FILES_${PN} = "${KERNEL_SRC_PATH}"
> -RDEPENDS_${PN} = "bc"
> +DEPENDS = "qemu-native"
> +RDEPENDS_${PN} = "bc gcc make"
>



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

* Re: [PATCH V1] kernel-devsrc: add 'make scripts' postinstall
  2015-11-24 16:29 ` Bruce Ashfield
@ 2015-11-24 21:32   ` Ming Liu
  2015-11-24 21:49     ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Liu @ 2015-11-24 21:32 UTC (permalink / raw)
  To: Bruce Ashfield, openembedded-core; +Cc: darren, Ming Liu, yue.tao



On 11/24/2015 05:29 PM, Bruce Ashfield wrote:
> On 15-11-23 04:58 PM, Ming Liu wrote:
>> From: Ming Liu <peter.x.liu@external.atlascopco.com>
>>
>> Run 'make scripts' inside qemu in order to create script binaries that
>> needed by external modules build on the target.
>>
>> Add RDEPENDS on gcc, make, which are needed by the compilation.
>
> This version looks fine to me .. and by "fine", I mean that it probably
> is still less than ideal, but with our current packaging and separation
> it makes sense to make it work, with all dependencies being explicit.
>
> As we (re)slim down the devsrc/headers split, we can revisit this as
> necessary.
>
> One question below though ..
>
>>
>> [YOCTO #6630]
>>
>> Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
>> ---
>>   meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
>>   1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb 
>> b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> index 196c8c7..87826ad 100644
>> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
>> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = 
>> "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
>>   inherit linux-kernel-base
>>
>>   # Whilst not a module, this ensures we don't get multilib extended 
>> (which would make no sense)
>> -inherit module-base
>> +inherit module-base qemu
>
> Shouldn't this be qemu-native ? Since it is running on the host ? Or
> maybe I'm completely misunderstanding something :)
Indeed it is calling qemu-native when inheriting this class, to make a 
certain postinstall scriptlet run at do_rootfs time through a 
architecture dependent qemu.
I am not sure if I had answered your question, maybe you mean the name 
is not proper? qemu-native.bbclass would make more sense?

//Ming Liu
>
> Bruce
>
>>
>>   # We need the kernel to be staged (unpacked, patched and 
>> configured) before
>>   # we can grab the source and make the source package. We also need 
>> the bits from
>> @@ -71,6 +71,16 @@ do_install() {
>>   # Ensure we don't race against "make scripts" during cpio
>>   do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
>>
>> +pkg_postinst_${PN} () {
>> +    if [ -n "$D" ]; then
>> +        ${@qemu_run_binary(d, '$D', '${bindir}/make')} \
>> +            -C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
>> +    else
>> +        make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
>> +    fi
>> +}
>> +
>>   PACKAGES = "kernel-devsrc"
>>   FILES_${PN} = "${KERNEL_SRC_PATH}"
>> -RDEPENDS_${PN} = "bc"
>> +DEPENDS = "qemu-native"
>> +RDEPENDS_${PN} = "bc gcc make"
>>
>



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

* Re: [PATCH V1] kernel-devsrc: add 'make scripts' postinstall
  2015-11-24 21:32   ` Ming Liu
@ 2015-11-24 21:49     ` Bruce Ashfield
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2015-11-24 21:49 UTC (permalink / raw)
  To: Ming Liu, openembedded-core; +Cc: darren, Ming Liu, yue.tao

On 15-11-24 04:32 PM, Ming Liu wrote:
>
>
> On 11/24/2015 05:29 PM, Bruce Ashfield wrote:
>> On 15-11-23 04:58 PM, Ming Liu wrote:
>>> From: Ming Liu <peter.x.liu@external.atlascopco.com>
>>>
>>> Run 'make scripts' inside qemu in order to create script binaries that
>>> needed by external modules build on the target.
>>>
>>> Add RDEPENDS on gcc, make, which are needed by the compilation.
>>
>> This version looks fine to me .. and by "fine", I mean that it probably
>> is still less than ideal, but with our current packaging and separation
>> it makes sense to make it work, with all dependencies being explicit.
>>
>> As we (re)slim down the devsrc/headers split, we can revisit this as
>> necessary.
>>
>> One question below though ..
>>
>>>
>>> [YOCTO #6630]
>>>
>>> Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
>>> ---
>>>   meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
>>>   1 file changed, 12 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb
>>> b/meta/recipes-kernel/linux/kernel-devsrc.bb
>>> index 196c8c7..87826ad 100644
>>> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
>>> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
>>> @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM =
>>> "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
>>>   inherit linux-kernel-base
>>>
>>>   # Whilst not a module, this ensures we don't get multilib extended
>>> (which would make no sense)
>>> -inherit module-base
>>> +inherit module-base qemu
>>
>> Shouldn't this be qemu-native ? Since it is running on the host ? Or
>> maybe I'm completely misunderstanding something :)
> Indeed it is calling qemu-native when inheriting this class, to make a

That is probably my misunderstanding .. I didn't go look at the inherit,
and I read this more as a RDEPENDS, which would be qemu for the target.

> certain postinstall scriptlet run at do_rootfs time through a
> architecture dependent qemu.
> I am not sure if I had answered your question, maybe you mean the name
> is not proper? qemu-native.bbclass would make more sense?

I think you have. If the class is called qemu .. then that's what
you should use.

Bruce

>
> //Ming Liu
>>
>> Bruce
>>
>>>
>>>   # We need the kernel to be staged (unpacked, patched and
>>> configured) before
>>>   # we can grab the source and make the source package. We also need
>>> the bits from
>>> @@ -71,6 +71,16 @@ do_install() {
>>>   # Ensure we don't race against "make scripts" during cpio
>>>   do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
>>>
>>> +pkg_postinst_${PN} () {
>>> +    if [ -n "$D" ]; then
>>> +        ${@qemu_run_binary(d, '$D', '${bindir}/make')} \
>>> +            -C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
>>> +    else
>>> +        make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
>>> +    fi
>>> +}
>>> +
>>>   PACKAGES = "kernel-devsrc"
>>>   FILES_${PN} = "${KERNEL_SRC_PATH}"
>>> -RDEPENDS_${PN} = "bc"
>>> +DEPENDS = "qemu-native"
>>> +RDEPENDS_${PN} = "bc gcc make"
>>>
>>
>



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

end of thread, other threads:[~2015-11-24 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 21:58 [PATCH V1] kernel-devsrc: add 'make scripts' postinstall Ming Liu
2015-11-24 16:29 ` Bruce Ashfield
2015-11-24 21:32   ` Ming Liu
2015-11-24 21:49     ` Bruce Ashfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox