Skip to contentSkip to conversation

image.bbclass: do not automatically remove update-rc.d

PATCH In review [email protected] 2 participants 6 messages Sep 13, 2013 – Sep 22, 2013

lore
Share & tools
lore
#0 lore raw

cover image.bbclass: do not automatically remove update-rc.d

From: Chen Qi <[email protected]>

The following changes since commit bd76847d867f9f76f76f033439cfb834cf59380f:

libnewt-python: Don't write a whiptail package (2013-09-12 08:23:42 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/do-not-remove-updatercd
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/do-not-remove-updatercd

Chen Qi (1):
image.bbclass: do not automatically remove update-rc.d

 meta/classes/image.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 image.bbclass: do not automatically remove update-rc.d

From: Chen Qi <[email protected]>

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]

---
 meta/classes/image.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/image.bbclass +2 -2
index f1e62f14..f37cd90 100644
@@ -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.
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 15 lines · On Fri, 2013-09-13 at 10:09 +0800, [email protected] wrote:

From: Chen Qi <[email protected]>

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.

Quoted 6 lines

[YOCTO #5169]

---
 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

Quoted 19 lines
meta/classes/image.bbclass +2 -2
index f1e62f14..f37cd90 100644
@@ -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.
author
#3 lore raw
In reply to [email protected]

ping

Quoted 41 lines · On 09/13/2013 10:09 AM, [email protected] wrote:

From: Chen Qi <[email protected]>

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]

---
  meta/classes/image.bbclass |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/image.bbclass +2 -2
index f1e62f14..f37cd90 100644
@@ -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.
#4 lore raw
Quoted 1 line · ChenQi

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

author
#5 lore raw
Quoted 10 lines · Richard Purdie
Quoted 1 line · ChenQi

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.
"""

Quoted 8 lines

and I stand by that feedback.

Cheers,

Richard

Thanks.
I'll send out a new patch.

Best Regards,
Chen Qi