Patchwork [1/1] opkg: create run-scripts file conditionally

login
register
mail settings
Submitter Kang Kai
Date March 25, 2013, 7:22 a.m.
Message ID <47ae8648840c30e4a9f5dab2b9cb09db905747be.1364196012.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/46813/
State New
Headers show

Comments

Kang Kai - March 25, 2013, 7:22 a.m.
When build sato sdk image, opkg will be installed to image even the
image package type is set to RPM. This causes the script file
run-postinsts installed by rpm will be overwrited by opkg.

Judge the image package type and don't create run-scripts file when
package type is not ipk.

[YOCTO #3223]

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 meta/recipes-devtools/opkg/opkg.inc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Richard Purdie - March 25, 2013, 2:32 p.m.
On Mon, 2013-03-25 at 15:22 +0800, Kang Kai wrote:
> When build sato sdk image, opkg will be installed to image even the
> image package type is set to RPM. This causes the script file
> run-postinsts installed by rpm will be overwrited by opkg.
> 
> Judge the image package type and don't create run-scripts file when
> package type is not ipk.
> 
> [YOCTO #3223]
> 
> Signed-off-by: Kang Kai <kai.kang@windriver.com>
> ---
>  meta/recipes-devtools/opkg/opkg.inc |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
> index f9c1202..bc80cb0 100644
> --- a/meta/recipes-devtools/opkg/opkg.inc
> +++ b/meta/recipes-devtools/opkg/opkg.inc
> @@ -59,10 +59,16 @@ do_install_append_class-native() {
>  
>  POSTLOG ?= "/var/log/postinstall.log"
>  REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
> +PKGTYPE = "${@d.getVar('IMAGE_PKGTYPE', True)}"
>  
>  pkg_postinst_${PN} () {
>  #!/bin/sh
>  if [ "x$D" != "x" ]; then
> +	# if installed to a rpm/deb based image, don't create run-postinsts file
> +	if [ "x${PKGTYPE}" != "xipk" ]; then
> +		exit 0
> +	fi
> +
>  	install -d $D${sysconfdir}/rcS.d
>  	# this happens at S98 where our good 'ole packages script used to run
>  	echo "#!/bin/sh

Why are you trying to install opkg into an non-opkg rootfs in the first
place? This looks like it will create subtle package differences
depending on configuration and I'm wary of this...

Cheers,

Richard
Kang Kai - March 26, 2013, 2:16 a.m.
On 2013?03?25? 22:32, Richard Purdie wrote:
> On Mon, 2013-03-25 at 15:22 +0800, Kang Kai wrote:
>> When build sato sdk image, opkg will be installed to image even the
>> image package type is set to RPM. This causes the script file
>> run-postinsts installed by rpm will be overwrited by opkg.
>>
>> Judge the image package type and don't create run-scripts file when
>> package type is not ipk.
>>
>> [YOCTO #3223]
>>
>> Signed-off-by: Kang Kai<kai.kang@windriver.com>
>> ---
>>   meta/recipes-devtools/opkg/opkg.inc |    6 ++++++
>>   1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
>> index f9c1202..bc80cb0 100644
>> --- a/meta/recipes-devtools/opkg/opkg.inc
>> +++ b/meta/recipes-devtools/opkg/opkg.inc
>> @@ -59,10 +59,16 @@ do_install_append_class-native() {
>>
>>   POSTLOG ?= "/var/log/postinstall.log"
>>   REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
>> +PKGTYPE = "${@d.getVar('IMAGE_PKGTYPE', True)}"
>>
>>   pkg_postinst_${PN} () {
>>   #!/bin/sh
>>   if [ "x$D" != "x" ]; then
>> +	# if installed to a rpm/deb based image, don't create run-postinsts file
>> +	if [ "x${PKGTYPE}" != "xipk" ]; then
>> +		exit 0
>> +	fi
>> +
>>   	install -d $D${sysconfdir}/rcS.d
>>   	# this happens at S98 where our good 'ole packages script used to run
>>   	echo "#!/bin/sh
> Why are you trying to install opkg into an non-opkg rootfs in the first
> place? This looks like it will create subtle package differences
> depending on configuration and I'm wary of this...

This just happens on sdk image.

update-alternatives-cworth is default installed into sato image. And for 
sato-sdk image, it installs every related -dev package.  
update-alternatives-cworth is from opkg,
so opkg-dev is installed then it requires opkg, then opkg is installed 
into sato-sdk image.

This patch is try to fix this issue. I'll send V2 to update commit comments.

Regards,
Kai

>
> Cheers,
>
> Richard
>
>
>
>

Patch

diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
index f9c1202..bc80cb0 100644
--- a/meta/recipes-devtools/opkg/opkg.inc
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -59,10 +59,16 @@  do_install_append_class-native() {
 
 POSTLOG ?= "/var/log/postinstall.log"
 REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
+PKGTYPE = "${@d.getVar('IMAGE_PKGTYPE', True)}"
 
 pkg_postinst_${PN} () {
 #!/bin/sh
 if [ "x$D" != "x" ]; then
+	# if installed to a rpm/deb based image, don't create run-postinsts file
+	if [ "x${PKGTYPE}" != "xipk" ]; then
+		exit 0
+	fi
+
 	install -d $D${sysconfdir}/rcS.d
 	# this happens at S98 where our good 'ole packages script used to run
 	echo "#!/bin/sh