Skip to contentSkip to conversation

rootfs_ipk: Avoid leaving run-postinsts around if online package management is disabled

PATCH Applied Phil Blundell 2 participants 2 messages Sep 21, 2012 – Sep 24, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rootfs_ipk: Avoid leaving run-postinsts around if online package management is disabled

If all postinsts have already been run during rootfs construction then there's no point in having run-postinsts in the installed system. Clean it up at the same time that update-rc.d and suchlike are being removed.

---
v2: per suggestion from Paul Eggleton, don't refer to O_P_M in subject line since oe-core doesn't use it anymore

 meta/classes/rootfs_ipk.bbclass |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
meta/classes/rootfs_ipk.bbclass +12 -2
index 6cdd8f6..46e8d60 100644
@@ -97,8 +97,18 @@ fakeroot rootfs_ipk_do_rootfs () {
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
 		if ! grep Status:.install.ok.unpacked ${STATUS}; then
 			# All packages were successfully configured.
-			# update-rc.d, base-passwd are no further use, remove them now
-			opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd || true
+			# update-rc.d, 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
+			opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} || true
+
+			# Need to remove rc.d files for run-postinsts by hand since opkg won't
+			# call postrm scripts in offline root mode.
+			if $remove_run_postinsts; then
+				update-rc.d -f -r ${IMAGE_ROOTFS} run-postinsts remove
+			fi
 
 			# Also delete the status files
 			rm -rf ${IMAGE_ROOTFS}${opkglibdir}
Signature · 1 line
1.7.9
#1 lore raw
Quoted 5 lines · Phil Blundell

If all postinsts have already been run during rootfs construction then there's no point in having run-postinsts in the installed system. Clean it up at the same time that update-rc.d and suchlike are being removed.

Quoted 7 lines

---
v2: per suggestion from Paul Eggleton, don't refer to O_P_M in subject line since oe-core doesn't use it anymore

 meta/classes/rootfs_ipk.bbclass |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

Merged to master, thanks.

Richard