summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-15 18:33:05 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 12:04:40 +0100
commitb607fa765826becd7d3d80b2eb57dbb1ef6725e2 (patch)
treeb6d27dcc58c6bc5c0380571dc06da62e2b81f40f /meta/recipes-core
parentb630ee12585610ad4b8d9eabcf2dd6d472d18c3d (diff)
downloadpoky-b607fa765826becd7d3d80b2eb57dbb1ef6725e2.tar.gz
sysvinit: use new update-alternatives
Also remove postinst and prerm which were not being used. (From OE-Core rev: 60fd9974e5c9a0576059ebded6de7b599f9574e5) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/sysvinit/sysvinit/postinst17
-rw-r--r--meta/recipes-core/sysvinit/sysvinit/prerm9
-rw-r--r--meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb65
3 files changed, 17 insertions, 74 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit/postinst b/meta/recipes-core/sysvinit/sysvinit/postinst
deleted file mode 100644
index b6fe547fa4..0000000000
--- a/meta/recipes-core/sysvinit/sysvinit/postinst
+++ /dev/null
@@ -1,17 +0,0 @@
1#!/bin/busybox ash
2
3action="$1"
4oldversion="$2"
5
6umask 022
7
8if [ "$action" != configure ]
9then
10 exit 0
11fi
12
13update-alternatives --install /sbin/init init /sbin/sysvinit 25
14update-alternatives --install /sbin/need need /sbin/need.sysvinit 25
15update-alternatives --install /sbin/provide provide /sbin/provide.sysvinit 25
16
17exit 0
diff --git a/meta/recipes-core/sysvinit/sysvinit/prerm b/meta/recipes-core/sysvinit/sysvinit/prerm
deleted file mode 100644
index 704a29ffd5..0000000000
--- a/meta/recipes-core/sysvinit/sysvinit/prerm
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/sh
2
3if [ "$1" != "upgrade" ]; then
4 update-alternatives --remove need /sbin/need.sysvinit
5 update-alternatives --remove provide /sbin/provide.sysvinit
6 update-alternatives --remove init /sbin/sysvinit
7fi
8
9exit 0
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
index d3e430c76a..63333b06f4 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -5,7 +5,7 @@ SECTION = "base"
5LICENSE = "GPLv2+" 5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ 6LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
7 file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4" 7 file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
8PR = "r6" 8PR = "r7"
9 9
10RDEPENDS_${PN} = "${PN}-inittab" 10RDEPENDS_${PN} = "${PN}-inittab"
11 11
@@ -27,10 +27,22 @@ B = "${S}/src"
27 27
28inherit update-alternatives 28inherit update-alternatives
29 29
30ALTERNATIVE_NAME = "init" 30ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg wall"
31ALTERNATIVE_LINK = "${base_sbindir}/init" 31
32ALTERNATIVE_PATH = "${base_sbindir}/init.sysvinit" 32ALTERNATIVE_PRIORITY = "200"
33ALTERNATIVE_PRIORITY = "50" 33
34ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
35ALTERNATIVE_PRIORITY[init] = "50"
36
37ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
38ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
39ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
40ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
41ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
42ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
43
44ALTERNATIVE_${PN}-pidof = "pidof"
45ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
34 46
35PACKAGES =+ "sysvinit-pidof sysvinit-sulogin" 47PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
36FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*" 48FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
@@ -65,47 +77,4 @@ do_install () {
65 install -d ${D}${sysconfdir}/rc$level.d 77 install -d ${D}${sysconfdir}/rc$level.d
66 ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd 78 ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
67 done 79 done
68 mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${BPN}
69 mv ${D}${base_bindir}/mountpoint ${D}${base_bindir}/mountpoint.${BPN}
70 mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${BPN}
71 mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${BPN}
72 mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${BPN}
73 mv ${D}${base_sbindir}/runlevel ${D}${base_sbindir}/runlevel.${BPN}
74 mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${BPN}
75 mv ${D}${base_sbindir}/poweroff ${D}${base_sbindir}/poweroff.${BPN}
76 mv ${D}${bindir}/last ${D}${bindir}/last.${BPN}
77 mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${BPN}
78 mv ${D}${bindir}/wall ${D}${bindir}/wall.${BPN}
79}
80
81pkg_postinst_${PN} () {
82 update-alternatives --install ${base_bindir}/mountpoint mountpoint mountpoint.${BPN} 200
83 update-alternatives --install ${base_sbindir}/halt halt halt.${BPN} 200
84 update-alternatives --install ${base_sbindir}/reboot reboot reboot.${BPN} 200
85 update-alternatives --install ${base_sbindir}/runlevel runlevel runlevel.${BPN} 200
86 update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${BPN} 200
87 update-alternatives --install ${base_sbindir}/poweroff poweroff poweroff.${BPN} 200
88 update-alternatives --install ${bindir}/last last last.${BPN} 200
89 update-alternatives --install ${bindir}/mesg mesg mesg.${BPN} 200
90 update-alternatives --install ${bindir}/wall wall wall.${BPN} 200
91}
92
93pkg_prerm_${PN} () {
94 update-alternatives --remove mountpoint mountpoint.${BPN}
95 update-alternatives --remove halt halt.${BPN}
96 update-alternatives --remove reboot reboot.${BPN}
97 update-alternatives --remove runlevel runlevel.${BPN}
98 update-alternatives --remove shutdown shutdown.${BPN}
99 update-alternatives --remove poweroff poweroff.${BPN}
100 update-alternatives --remove last last.${BPN}
101 update-alternatives --remove mesg mesg.${BPN}
102 update-alternatives --remove wall wall.${BPN}
103}
104
105pkg_postinst_sysvinit-pidof () {
106 update-alternatives --install ${base_bindir}/pidof pidof pidof.${BPN} 200
107}
108
109pkg_prerm_sysvinit-pidof () {
110 update-alternatives --remove pidof pidof.${BPN}
111} 80}