Patchwork [2/4] module.bbclass: sync pkg_post{inst, rm} with kernel.bbclass

login
register
mail settings
Submitter Andreas Oberritter
Date March 23, 2012, 4:37 p.m.
Message ID <1332520659-12233-2-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/24325/
State New
Headers show

Comments

Andreas Oberritter - March 23, 2012, 4:37 p.m.
* Run depmod when the rootfs gets generated.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/module.bbclass |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Koen Kooi - March 23, 2012, 5:20 p.m.
Op 23 mrt. 2012, om 17:37 heeft Andreas Oberritter het volgende geschreven:

> * Run depmod when the rootfs gets generated.
> 
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
> meta/classes/module.bbclass |    9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
> index 53c16b7..e370b24 100644
> --- a/meta/classes/module.bbclass
> +++ b/meta/classes/module.bbclass
> @@ -37,15 +37,16 @@ module_do_install() {
> }
> 
> pkg_postinst_append () {
> -	if [ -n "$D" ]; then
> -		exit 1
> -	fi
> +if [ -n "$D" ]; then
> +	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
> +else
> 	depmod -a
> 	update-modules || true
> +fi

That encodes host system paths into the package, which is not a good thing for tools like narcissus and hob.

regards,

Koen
Richard Purdie - March 23, 2012, 5:39 p.m.
On Fri, 2012-03-23 at 17:37 +0100, Andreas Oberritter wrote:
> * Run depmod when the rootfs gets generated.
> 
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
>  meta/classes/module.bbclass |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)

The post install from kernel.bbclass should take care of this at rootfs
time so we don't need to duplicate it?

Cheers,

Richard
Andreas Oberritter - March 23, 2012, 5:58 p.m.
On 23.03.2012 18:20, Koen Kooi wrote:
> 
> Op 23 mrt. 2012, om 17:37 heeft Andreas Oberritter het volgende geschreven:
> 
>> * Run depmod when the rootfs gets generated.
>>
>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>> ---
>> meta/classes/module.bbclass |    9 +++++----
>> 1 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
>> index 53c16b7..e370b24 100644
>> --- a/meta/classes/module.bbclass
>> +++ b/meta/classes/module.bbclass
>> @@ -37,15 +37,16 @@ module_do_install() {
>> }
>>
>> pkg_postinst_append () {
>> -	if [ -n "$D" ]; then
>> -		exit 1
>> -	fi
>> +if [ -n "$D" ]; then
>> +	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>> +else
>> 	depmod -a
>> 	update-modules || true
>> +fi
> 
> That encodes host system paths into the package, which is not a good thing for tools like narcissus and hob.

So should we remove the same lines from kernel.bbclass?

Regards,
Andreas
Andreas Oberritter - March 23, 2012, 6 p.m.
On 23.03.2012 18:39, Richard Purdie wrote:
> On Fri, 2012-03-23 at 17:37 +0100, Andreas Oberritter wrote:
>> * Run depmod when the rootfs gets generated.
>>
>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>> ---
>>  meta/classes/module.bbclass |    9 +++++----
>>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> The post install from kernel.bbclass should take care of this at rootfs
> time so we don't need to duplicate it?

Would exit 0 be OK then? Should kernel.bbclass changed likewise in
pkg_postinst_modules?

Regards,
Andreas
Koen Kooi - March 23, 2012, 6:20 p.m.
Op 23 mrt. 2012, om 18:58 heeft Andreas Oberritter het volgende geschreven:

> On 23.03.2012 18:20, Koen Kooi wrote:
>> 
>> Op 23 mrt. 2012, om 17:37 heeft Andreas Oberritter het volgende geschreven:
>> 
>>> * Run depmod when the rootfs gets generated.
>>> 
>>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>>> ---
>>> meta/classes/module.bbclass |    9 +++++----
>>> 1 files changed, 5 insertions(+), 4 deletions(-)
>>> 
>>> diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
>>> index 53c16b7..e370b24 100644
>>> --- a/meta/classes/module.bbclass
>>> +++ b/meta/classes/module.bbclass
>>> @@ -37,15 +37,16 @@ module_do_install() {
>>> }
>>> 
>>> pkg_postinst_append () {
>>> -	if [ -n "$D" ]; then
>>> -		exit 1
>>> -	fi
>>> +if [ -n "$D" ]; then
>>> +	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>>> +else
>>> 	depmod -a
>>> 	update-modules || true
>>> +fi
>> 
>> That encodes host system paths into the package, which is not a good thing for tools like narcissus and hob.
> 
> So should we remove the same lines from kernel.bbclass?

I think so, I don't think we want to hand out binaries with scripts that say things like:

foo-linux-depmod -F /storage/openembedded-is-a-poopyhead/something

regards,

Koen
Richard Purdie - March 23, 2012, 6:32 p.m.
On Fri, 2012-03-23 at 19:20 +0100, Koen Kooi wrote:
> Op 23 mrt. 2012, om 18:58 heeft Andreas Oberritter het volgende geschreven:
> 
> > On 23.03.2012 18:20, Koen Kooi wrote:
> >> 
> >> Op 23 mrt. 2012, om 17:37 heeft Andreas Oberritter het volgende geschreven:
> >> 
> >>> * Run depmod when the rootfs gets generated.
> >>> 
> >>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> >>> ---
> >>> meta/classes/module.bbclass |    9 +++++----
> >>> 1 files changed, 5 insertions(+), 4 deletions(-)
> >>> 
> >>> diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
> >>> index 53c16b7..e370b24 100644
> >>> --- a/meta/classes/module.bbclass
> >>> +++ b/meta/classes/module.bbclass
> >>> @@ -37,15 +37,16 @@ module_do_install() {
> >>> }
> >>> 
> >>> pkg_postinst_append () {
> >>> -	if [ -n "$D" ]; then
> >>> -		exit 1
> >>> -	fi
> >>> +if [ -n "$D" ]; then
> >>> +	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
> >>> +else
> >>> 	depmod -a
> >>> 	update-modules || true
> >>> +fi
> >> 
> >> That encodes host system paths into the package, which is not a good thing for tools like narcissus and hob.
> > 
> > So should we remove the same lines from kernel.bbclass?
> 
> I think so, I don't think we want to hand out binaries with scripts that say things like:
> 
> foo-linux-depmod -F /storage/openembedded-is-a-poopyhead/something

However note that the command is only run on the build system, not on
the target and avoids running postinstalls. I'm not taking a patch to
remove this unless there is some equivalent functionality added.

Cheers,

Richard

Patch

diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index 53c16b7..e370b24 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -37,15 +37,16 @@  module_do_install() {
 }
 
 pkg_postinst_append () {
-	if [ -n "$D" ]; then
-		exit 1
-	fi
+if [ -n "$D" ]; then
+	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+else
 	depmod -a
 	update-modules || true
+fi
 }
 
 pkg_postrm_append () {
-	update-modules || true
+update-modules || true
 }
 
 EXPORT_FUNCTIONS do_compile do_install