Patchwork [2/3] lsbinitscripts: Remove original /etc/init.d/functions when building an lsb image

login
register
mail settings
Submitter Xiaofeng Yan
Date June 15, 2012, 9:30 a.m.
Message ID <cf3611bc2fea78d0aa3d042e000edb0e86534297.1339751573.git.xiaofeng.yan@windriver.com>
Download mbox | patch
Permalink /patch/29951/
State New
Headers show

Comments

Xiaofeng Yan - June 15, 2012, 9:30 a.m.
From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

The linking will fail when an original functions exist. So remove the
original functions when building an lsb image and make functions linking to
functions.lsbinitscripts successfully.

[YOCTO #2133]

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Richard Purdie - June 15, 2012, 2:59 p.m.
On Fri, 2012-06-15 at 17:30 +0800, xiaofeng.yan@windriver.com wrote:
> From: Xiaofeng Yan <xiaofeng.yan@windriver.com>
> 
> The linking will fail when an original functions exist. So remove the
> original functions when building an lsb image and make functions linking to
> functions.lsbinitscripts successfully.
> 
> [YOCTO #2133]
> 
> Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
> ---
>  meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> index dd92a92..73bea2f 100644
> --- a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> +++ b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> @@ -2,7 +2,7 @@ DESCRIPTION = "SysV init scripts which only is used in an LSB image"
>  SECTION = "base"
>  LICENSE = "GPLv2"
>  DEPENDS = "popt"
> -PR = "r0"
> +PR = "r1"
>  
>  LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
>  
> @@ -25,3 +25,9 @@ do_install(){
>  	install -d ${D}/etc/init.d/
>  	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
>  }
> +
> +pkg_postinst_${PN} () {
> +	if [ -f "/etc/init.d/functions" ]; then
> +		rm -f /etc/init.d/functions
> +	fi
> +}

This looks highly suspicious to me. Shouldn't the other provider of this
be put under control for update-alternatives too or something?

Cheers,

Richard
Xiaofeng Yan - June 18, 2012, 2:57 a.m.
On 2012?06?15? 22:59, Richard Purdie wrote:
> On Fri, 2012-06-15 at 17:30 +0800, xiaofeng.yan@windriver.com wrote:
>> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>
>> The linking will fail when an original functions exist. So remove the
>> original functions when building an lsb image and make functions linking to
>> functions.lsbinitscripts successfully.
>>
>> [YOCTO #2133]
>>
>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>> ---
>>   meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |    8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>> index dd92a92..73bea2f 100644
>> --- a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>> +++ b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>> @@ -2,7 +2,7 @@ DESCRIPTION = "SysV init scripts which only is used in an LSB image"
>>   SECTION = "base"
>>   LICENSE = "GPLv2"
>>   DEPENDS = "popt"
>> -PR = "r0"
>> +PR = "r1"
>>
>>   LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
>>
>> @@ -25,3 +25,9 @@ do_install(){
>>   	install -d ${D}/etc/init.d/
>>   	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
>>   }
>> +
>> +pkg_postinst_${PN} () {
>> +	if [ -f "/etc/init.d/functions" ]; then
>> +		rm -f /etc/init.d/functions
>> +	fi
>> +}
> This looks highly suspicious to me. Shouldn't the other provider of this
> be put under control for update-alternatives too or something?
Thanks for your comments.
the other provider of this is from initscripts_1.0.bb, installing all of 
init-scripts in the stage of installing without using 
update-alternatives. So the functions is a file instead of linking mode. 
An error appear when lsbinicscritps replace initscripts if not removing 
file functions. So I remove the original functions for making the latter 
linking successfully. What is the purpose is for avoiding to modify the 
other non-lsb bb files. The changes of this will be only in lsb image.
Thanks
Yan
> Cheers,
>
> Richard
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Xiaofeng Yan - June 18, 2012, 3:08 a.m.
On 2012?06?18? 10:57, Xiaofeng Yan wrote:
> On 2012?06?15? 22:59, Richard Purdie wrote:
>> On Fri, 2012-06-15 at 17:30 +0800, xiaofeng.yan@windriver.com wrote:
>>> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>>
>>> The linking will fail when an original functions exist. So remove the
>>> original functions when building an lsb image and make functions 
>>> linking to
>>> functions.lsbinitscripts successfully.
>>>
>>> [YOCTO #2133]
>>>
>>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>> ---
>>>   meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |    8 +++++++-
>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb 
>>> b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>>> index dd92a92..73bea2f 100644
>>> --- a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>>> +++ b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
>>> @@ -2,7 +2,7 @@ DESCRIPTION = "SysV init scripts which only is used 
>>> in an LSB image"
>>>   SECTION = "base"
>>>   LICENSE = "GPLv2"
>>>   DEPENDS = "popt"
>>> -PR = "r0"
>>> +PR = "r1"
>>>
>>>   LIC_FILES_CHKSUM = 
>>> "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
>>>
>>> @@ -25,3 +25,9 @@ do_install(){
>>>       install -d ${D}/etc/init.d/
>>>       install -m 0755 ${S}/rc.d/init.d/functions 
>>> ${D}/etc/init.d/functions
>>>   }
>>> +
>>> +pkg_postinst_${PN} () {
>>> +    if [ -f "/etc/init.d/functions" ]; then
>>> +        rm -f /etc/init.d/functions
>>> +    fi
>>> +}
>> This looks highly suspicious to me. Shouldn't the other provider of this
>> be put under control for update-alternatives too or something?
> Thanks for your comments.
> the other provider of this is from initscripts_1.0.bb, installing all 
> of init-scripts in the stage of installing without using 
> update-alternatives. So the functions is a file instead of linking 
> mode. An error appear when lsbinicscritps replace initscripts if not 
> removing file functions. So I remove the original functions for making 
> the latter linking successfully. What is the purpose is for avoiding 
> to modify the other non-lsb bb files. The changes of this will be only 
> in lsb image.
Can we add the removing function if not a linking when using 
update-alternatives ?
> Thanks
> Yan
>> Cheers,
>>
>> Richard
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Richard Purdie - June 21, 2012, 3:38 p.m.
On Mon, 2012-06-18 at 10:57 +0800, Xiaofeng Yan wrote:
> On 2012?06?15? 22:59, Richard Purdie wrote:
> > On Fri, 2012-06-15 at 17:30 +0800, xiaofeng.yan@windriver.com wrote:
> >> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
> >>
> >> The linking will fail when an original functions exist. So remove the
> >> original functions when building an lsb image and make functions linking to
> >> functions.lsbinitscripts successfully.
> >>
> >> [YOCTO #2133]
> >>
> >> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
> >> ---
> >>   meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |    8 +++++++-
> >>   1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> >> index dd92a92..73bea2f 100644
> >> --- a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> >> +++ b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
> >> @@ -2,7 +2,7 @@ DESCRIPTION = "SysV init scripts which only is used in an LSB image"
> >>   SECTION = "base"
> >>   LICENSE = "GPLv2"
> >>   DEPENDS = "popt"
> >> -PR = "r0"
> >> +PR = "r1"
> >>
> >>   LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
> >>
> >> @@ -25,3 +25,9 @@ do_install(){
> >>   	install -d ${D}/etc/init.d/
> >>   	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
> >>   }
> >> +
> >> +pkg_postinst_${PN} () {
> >> +	if [ -f "/etc/init.d/functions" ]; then
> >> +		rm -f /etc/init.d/functions
> >> +	fi
> >> +}
> > This looks highly suspicious to me. Shouldn't the other provider of this
> > be put under control for update-alternatives too or something?
> Thanks for your comments.
> the other provider of this is from initscripts_1.0.bb, installing all of 
> init-scripts in the stage of installing without using 
> update-alternatives. So the functions is a file instead of linking mode. 
> An error appear when lsbinicscritps replace initscripts if not removing 
> file functions. So I remove the original functions for making the latter 
> linking successfully. What is the purpose is for avoiding to modify the 
> other non-lsb bb files. The changes of this will be only in lsb image.

Right, I understand there is a conflict here. Could we not add
update-alternatives support to the initscripts recipe for this file to,
so its a link in both packages and then update-alternatives will take
care of linking the correct one into place?

Cheers,

Richard

Patch

diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
index dd92a92..73bea2f 100644
--- a/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
+++ b/meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
@@ -2,7 +2,7 @@  DESCRIPTION = "SysV init scripts which only is used in an LSB image"
 SECTION = "base"
 LICENSE = "GPLv2"
 DEPENDS = "popt"
-PR = "r0"
+PR = "r1"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
 
@@ -25,3 +25,9 @@  do_install(){
 	install -d ${D}/etc/init.d/
 	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
 }
+
+pkg_postinst_${PN} () {
+	if [ -f "/etc/init.d/functions" ]; then
+		rm -f /etc/init.d/functions
+	fi
+}