]> code.ossystems Code Review - openembedded-core.git/commitdiff
run-postinsts: remove the init script after a clean start-up
authorChen Qi <Qi.Chen@windriver.com>
Mon, 13 Jan 2014 04:59:42 +0000 (23:59 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Jan 2014 00:48:26 +0000 (00:48 +0000)
If we enable ipk/deb package back-end, and we have 'package-management'
in our IMAGE_FEATURES, then the /etc/rcS.d/S99run-postinsts would
still exist in our system after a clean start-up.

The initial design for run-postinsts requires the related init script
to be removed if there's no more post-install script left in the system.

This patch fixes this problem.

[YOCTO #5718]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts

index c94c3e92ece0000a8510c10da73f2d17ff474203..11141ec71ff966a1917feaf48e70eb8fad2c1e19 100755 (executable)
@@ -16,7 +16,16 @@ for pm in rpm deb ipk; do
        fi
 done
 
-[ -z "$pi_dir" ] && exit 0
+remove_rcsd_link () {
+       if [ -n "`which update-rc.d`" ]; then
+               update-rc.d -f run-postinsts remove
+       fi
+}
+
+if [ -z "$pi_dir" ]; then
+       remove_rcsd_link
+       exit 0
+fi
 
 [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
 
@@ -43,7 +52,5 @@ done
 # and the rcS.d link
 if [ $remove_pi_dir = 1 ]; then
        rm -rf $pi_dir
-       if [ -n "`which update-rc.d`" ]; then
-               update-rc.d -f run-postinsts remove
-       fi
+       remove_rcsd_link
 fi