diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-01-12 23:59:42 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 00:52:34 +0000 |
commit | 78484bf45e8052373cbf25f10c380b6e674ef5db (patch) | |
tree | 2b7e56ef5053b1268bd9ffc30ebffdb72c5a8aeb | |
parent | 8b576acb215b091bd3836aa4fc6022e7e408c420 (diff) | |
download | poky-78484bf45e8052373cbf25f10c380b6e674ef5db.tar.gz |
run-postinsts: remove the init script after a clean start-up
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]
(From OE-Core rev: 08a2f48cb95256c6d44c8574949fabafe1466969)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts index c94c3e92ec..11141ec71f 100755 --- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | |||
@@ -16,7 +16,16 @@ for pm in rpm deb ipk; do | |||
16 | fi | 16 | fi |
17 | done | 17 | done |
18 | 18 | ||
19 | [ -z "$pi_dir" ] && exit 0 | 19 | remove_rcsd_link () { |
20 | if [ -n "`which update-rc.d`" ]; then | ||
21 | update-rc.d -f run-postinsts remove | ||
22 | fi | ||
23 | } | ||
24 | |||
25 | if [ -z "$pi_dir" ]; then | ||
26 | remove_rcsd_link | ||
27 | exit 0 | ||
28 | fi | ||
20 | 29 | ||
21 | [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst | 30 | [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst |
22 | 31 | ||
@@ -43,7 +52,5 @@ done | |||
43 | # and the rcS.d link | 52 | # and the rcS.d link |
44 | if [ $remove_pi_dir = 1 ]; then | 53 | if [ $remove_pi_dir = 1 ]; then |
45 | rm -rf $pi_dir | 54 | rm -rf $pi_dir |
46 | if [ -n "`which update-rc.d`" ]; then | 55 | remove_rcsd_link |
47 | update-rc.d -f run-postinsts remove | ||
48 | fi | ||
49 | fi | 56 | fi |