Patchwork [1/1] image.bbclass: do not automatically remove update-rc.d

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Sept. 13, 2013, 2:09 a.m.
Message ID <5623d6e9d394f968e15d165d65ce3748008be05d.1379038097.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/57917/
State New
Headers show

Comments

Qi.Chen@windriver.com - Sept. 13, 2013, 2:09 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

In rootfs_uninstall_unneeded function, the update-rc.d package would
be removed if no 'package-management' and no delayed postinsts.

However, in update-rc.d.bbclass, the update-rc.d package is only
recommended. Thus, if NO_RECOMMENDATIONS is enabled or 'update-rc.d'
is added to BAD_RECOMMENDATIONS, the update-rc.d package will not
be installed at the first place. Tring to remove it will result in an
error.

Also this function assumes that update-rc.d is only used by postinsts.
This assumption isn't always true. Users may want to write their own
init scripts and use the update-rc.d tool to manage them.

[YOCTO #5169]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/image.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Richard Purdie - Sept. 17, 2013, 1:25 p.m.
On Fri, 2013-09-13 at 10:09 +0800, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> In rootfs_uninstall_unneeded function, the update-rc.d package would
> be removed if no 'package-management' and no delayed postinsts.
> 
> However, in update-rc.d.bbclass, the update-rc.d package is only
> recommended. Thus, if NO_RECOMMENDATIONS is enabled or 'update-rc.d'
> is added to BAD_RECOMMENDATIONS, the update-rc.d package will not
> be installed at the first place. Tring to remove it will result in an
> error.
> 
> Also this function assumes that update-rc.d is only used by postinsts.
> This assumption isn't always true. Users may want to write their own
> init scripts and use the update-rc.d tool to manage them.
> 
> [YOCTO #5169]
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/classes/image.bbclass |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

This is not correct. The correct behaviour here is to uninstall these
packages *if* they are installed. Just removing it from the list is not
the real fix.

Cheers,

Richard

> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index f1e62f14..f37cd90 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -505,12 +505,12 @@ rootfs_uninstall_unneeded () {
>  	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
>  		if [ -z "$(delayed_postinsts)" ]; then
>  			# All packages were successfully configured.
> -			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now
> +			# base-passwd, run-postinsts are no further use, remove them now
>  			remove_run_postinsts=false
>  			if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
>  				remove_run_postinsts=true
>  			fi
> -			rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
> +			rootfs_uninstall_packages base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
>  
>  			# Need to remove rc.d files for run-postinsts by hand since opkg won't
>  			# call postrm scripts in offline root mode.
Qi.Chen@windriver.com - Sept. 22, 2013, 3:13 a.m.
ping

On 09/13/2013 10:09 AM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> In rootfs_uninstall_unneeded function, the update-rc.d package would
> be removed if no 'package-management' and no delayed postinsts.
>
> However, in update-rc.d.bbclass, the update-rc.d package is only
> recommended. Thus, if NO_RECOMMENDATIONS is enabled or 'update-rc.d'
> is added to BAD_RECOMMENDATIONS, the update-rc.d package will not
> be installed at the first place. Tring to remove it will result in an
> error.
>
> Also this function assumes that update-rc.d is only used by postinsts.
> This assumption isn't always true. Users may want to write their own
> init scripts and use the update-rc.d tool to manage them.
>
> [YOCTO #5169]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/classes/image.bbclass |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index f1e62f14..f37cd90 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -505,12 +505,12 @@ rootfs_uninstall_unneeded () {
>   	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
>   		if [ -z "$(delayed_postinsts)" ]; then
>   			# All packages were successfully configured.
> -			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now
> +			# base-passwd, run-postinsts are no further use, remove them now
>   			remove_run_postinsts=false
>   			if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
>   				remove_run_postinsts=true
>   			fi
> -			rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
> +			rootfs_uninstall_packages base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
>   
>   			# Need to remove rc.d files for run-postinsts by hand since opkg won't
>   			# call postrm scripts in offline root mode.
Richard Purdie - Sept. 22, 2013, 8:44 a.m.
On Sun, 2013-09-22 at 11:13 +0800, ChenQi wrote:
> ping

I replied to this:

"""
This is not correct. The correct behaviour here is to uninstall these
packages *if* they are installed. Just removing it from the list is not
the real fix.
"""

and I stand by that feedback.

Cheers,

Richard
Qi.Chen@windriver.com - Sept. 22, 2013, 9:23 a.m.
On 09/22/2013 04:44 PM, Richard Purdie wrote:
> On Sun, 2013-09-22 at 11:13 +0800, ChenQi wrote:
>> ping
> I replied to this:
>
> """
> This is not correct. The correct behaviour here is to uninstall these
> packages *if* they are installed. Just removing it from the list is not
> the real fix.
> """
>
> and I stand by that feedback.
>
> Cheers,
>
> Richard
>
>
>

Thanks.
I'll send out a new patch.

Best Regards,
Chen Qi

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index f1e62f14..f37cd90 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -505,12 +505,12 @@  rootfs_uninstall_unneeded () {
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
 		if [ -z "$(delayed_postinsts)" ]; then
 			# All packages were successfully configured.
-			# update-rc.d, base-passwd, run-postinsts are no further use, remove them now
+			# base-passwd, run-postinsts are no further use, remove them now
 			remove_run_postinsts=false
 			if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
 				remove_run_postinsts=true
 			fi
-			rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
+			rootfs_uninstall_packages base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
 
 			# Need to remove rc.d files for run-postinsts by hand since opkg won't
 			# call postrm scripts in offline root mode.