diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-01-22 15:02:42 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-28 12:29:30 +0000 |
commit | 43c2c5b42693b94d3e4fdde2c859df743572eda1 (patch) | |
tree | 0354441a67085b7a9a28b1519909fe26fa2c0740 /meta | |
parent | 77eaad86d17c6ee5acddc15ce7d9884b4c73de21 (diff) | |
download | poky-43c2c5b42693b94d3e4fdde2c859df743572eda1.tar.gz |
sysvinit & initscripts: use update-rc.d
Update-rc.d provides a cleaner interface for creating links for init scripts.
So we use update-rc.d to replace the redundant 'ln -sf xxx' statements.
[YOCTO #3708]
(From OE-Core rev: 66f3e3c15faedc9ee78532b4c59fa5d7148ddace)
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/initscripts/initscripts_1.0.bb | 57 | ||||
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 15 |
2 files changed, 32 insertions, 40 deletions
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb index 6e15f884fe..69b9bfbe32 100644 --- a/meta/recipes-core/initscripts/initscripts_1.0.bb +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb | |||
@@ -37,6 +37,7 @@ SRC_URI_append_arm = " file://alignment.sh" | |||
37 | KERNEL_VERSION = "" | 37 | KERNEL_VERSION = "" |
38 | 38 | ||
39 | inherit update-alternatives | 39 | inherit update-alternatives |
40 | DEPENDS_append = " update-rc.d-native" | ||
40 | 41 | ||
41 | ALTERNATIVE_PRIORITY = "90" | 42 | ALTERNATIVE_PRIORITY = "90" |
42 | ALTERNATIVE_${PN} = "functions" | 43 | ALTERNATIVE_${PN} = "functions" |
@@ -64,6 +65,8 @@ do_install () { | |||
64 | install -d ${D}${sysconfdir}/rc6.d | 65 | install -d ${D}${sysconfdir}/rc6.d |
65 | install -d ${D}${sysconfdir}/default | 66 | install -d ${D}${sysconfdir}/default |
66 | install -d ${D}${sysconfdir}/default/volatiles | 67 | install -d ${D}${sysconfdir}/default/volatiles |
68 | # Holds state information pertaining to urandom | ||
69 | install -d ${D}/var/lib/urandom | ||
67 | 70 | ||
68 | install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d | 71 | install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d |
69 | install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d | 72 | install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d |
@@ -84,6 +87,7 @@ do_install () { | |||
84 | install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d | 87 | install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d |
85 | install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d | 88 | install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d |
86 | install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core | 89 | install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core |
90 | |||
87 | if [ "${TARGET_ARCH}" = "arm" ]; then | 91 | if [ "${TARGET_ARCH}" = "arm" ]; then |
88 | install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d | 92 | install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d |
89 | fi | 93 | fi |
@@ -92,44 +96,29 @@ do_install () { | |||
92 | # | 96 | # |
93 | install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh | 97 | install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh |
94 | install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs | 98 | install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs |
99 | install -m 0755 ${WORKDIR}/device_table.txt ${D}${sysconfdir}/device_table | ||
95 | # | 100 | # |
96 | # Create runlevel links | 101 | # Create runlevel links |
97 | # | 102 | # |
98 | ln -sf ../init.d/rmnologin.sh ${D}${sysconfdir}/rc2.d/S99rmnologin.sh | 103 | update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 . |
99 | ln -sf ../init.d/rmnologin.sh ${D}${sysconfdir}/rc3.d/S99rmnologin.sh | 104 | update-rc.d -r ${D} sendsigs start 20 0 6 . |
100 | ln -sf ../init.d/rmnologin.sh ${D}${sysconfdir}/rc4.d/S99rmnologin.sh | 105 | update-rc.d -r ${D} urandom start 30 S 0 6 . |
101 | ln -sf ../init.d/rmnologin.sh ${D}${sysconfdir}/rc5.d/S99rmnologin.sh | 106 | update-rc.d -r ${D} umountnfs.sh start 31 0 6 . |
102 | ln -sf ../init.d/sendsigs ${D}${sysconfdir}/rc6.d/S20sendsigs | 107 | update-rc.d -r ${D} umountfs start 40 0 6 . |
103 | # ln -sf ../init.d/urandom ${D}${sysconfdir}/rc6.d/S30urandom | 108 | update-rc.d -r ${D} reboot start 90 6 . |
104 | ln -sf ../init.d/umountnfs.sh ${D}${sysconfdir}/rc6.d/S31umountnfs.sh | 109 | update-rc.d -r ${D} halt start 90 0 . |
105 | ln -sf ../init.d/umountfs ${D}${sysconfdir}/rc6.d/S40umountfs | 110 | update-rc.d -r ${D} save-rtc.sh start 25 0 6 . |
106 | # udev will run at S55 if installed | 111 | update-rc.d -r ${D} banner.sh start 02 S . |
107 | ln -sf ../init.d/reboot ${D}${sysconfdir}/rc6.d/S90reboot | 112 | update-rc.d -r ${D} checkroot.sh start 10 S . |
108 | ln -sf ../init.d/sendsigs ${D}${sysconfdir}/rc0.d/S20sendsigs | 113 | update-rc.d -r ${D} mountall.sh start 35 S . |
109 | # ln -sf ../init.d/urandom ${D}${sysconfdir}/rc0.d/S30urandom | 114 | update-rc.d -r ${D} hostname.sh start 39 S . |
110 | ln -sf ../init.d/umountnfs.sh ${D}${sysconfdir}/rc0.d/S31umountnfs.sh | 115 | update-rc.d -r ${D} mountnfs.sh start 45 S . |
111 | ln -sf ../init.d/umountfs ${D}${sysconfdir}/rc0.d/S40umountfs | 116 | update-rc.d -r ${D} bootmisc.sh start 55 S . |
112 | # udev will run at S55 if installed | 117 | update-rc.d -r ${D} sysfs.sh start 02 S . |
113 | ln -sf ../init.d/halt ${D}${sysconfdir}/rc0.d/S90halt | 118 | update-rc.d -r ${D} populate-volatile.sh start 37 S . |
114 | ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc0.d/S25save-rtc.sh | 119 | update-rc.d -r ${D} devpts.sh start 38 S . |
115 | ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc6.d/S25save-rtc.sh | ||
116 | ln -sf ../init.d/banner.sh ${D}${sysconfdir}/rcS.d/S02banner.sh | ||
117 | ln -sf ../init.d/checkroot.sh ${D}${sysconfdir}/rcS.d/S10checkroot.sh | ||
118 | # ln -sf ../init.d/checkfs.sh ${D}${sysconfdir}/rcS.d/S30checkfs.sh | ||
119 | ln -sf ../init.d/mountall.sh ${D}${sysconfdir}/rcS.d/S35mountall.sh | ||
120 | ln -sf ../init.d/hostname.sh ${D}${sysconfdir}/rcS.d/S39hostname.sh | ||
121 | ln -sf ../init.d/mountnfs.sh ${D}${sysconfdir}/rcS.d/S45mountnfs.sh | ||
122 | ln -sf ../init.d/bootmisc.sh ${D}${sysconfdir}/rcS.d/S55bootmisc.sh | ||
123 | # ln -sf ../init.d/urandom ${D}${sysconfdir}/rcS.d/S55urandom | ||
124 | ln -sf ../init.d/sysfs.sh ${D}${sysconfdir}/rcS.d/S02sysfs.sh | ||
125 | # udev will run at S03 if installed | ||
126 | ln -sf ../init.d/populate-volatile.sh ${D}${sysconfdir}/rcS.d/S37populate-volatile.sh | ||
127 | ln -sf ../init.d/devpts.sh ${D}${sysconfdir}/rcS.d/S38devpts.sh | ||
128 | if [ "${TARGET_ARCH}" = "arm" ]; then | 120 | if [ "${TARGET_ARCH}" = "arm" ]; then |
129 | ln -sf ../init.d/alignment.sh ${D}${sysconfdir}/rcS.d/S06alignment.sh | 121 | update-rc.d -r ${D} alignment.sh start 06 S . |
130 | fi | 122 | fi |
131 | 123 | ||
132 | install -m 0755 ${WORKDIR}/device_table.txt ${D}${sysconfdir}/device_table | ||
133 | # Holds state information pertaining to urandom | ||
134 | install -d ${D}/var/lib/urandom | ||
135 | } | 124 | } |
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb index de073b8a4f..39c97ac431 100644 --- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | |||
@@ -26,6 +26,7 @@ S = "${WORKDIR}/sysvinit-${PV}" | |||
26 | B = "${S}/src" | 26 | B = "${S}/src" |
27 | 27 | ||
28 | inherit update-alternatives | 28 | inherit update-alternatives |
29 | DEPENDS_append = " update-rc.d-native" | ||
29 | 30 | ||
30 | ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall" | 31 | ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall" |
31 | 32 | ||
@@ -63,18 +64,20 @@ EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \ | |||
63 | 64 | ||
64 | do_install () { | 65 | do_install () { |
65 | oe_runmake 'ROOT=${D}' install | 66 | oe_runmake 'ROOT=${D}' install |
67 | |||
66 | install -d ${D}${sysconfdir} \ | 68 | install -d ${D}${sysconfdir} \ |
67 | ${D}${sysconfdir}/default \ | 69 | ${D}${sysconfdir}/default \ |
68 | ${D}${sysconfdir}/init.d | 70 | ${D}${sysconfdir}/init.d |
71 | for level in S 0 1 2 3 4 5 6; do | ||
72 | install -d ${D}${sysconfdir}/rc$level.d | ||
73 | done | ||
74 | |||
69 | install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS | 75 | install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS |
70 | install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d | 76 | install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d |
71 | install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d | 77 | install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d |
72 | install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd | 78 | install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd |
73 | ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd | 79 | ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd |
74 | install -d ${D}${sysconfdir}/rcS.d | 80 | |
75 | ln -sf ../init.d/bootlogd ${D}${sysconfdir}/rcS.d/S07bootlogd | 81 | update-rc.d -r ${D} bootlogd start 07 S . |
76 | for level in 2 3 4 5; do | 82 | update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 . |
77 | install -d ${D}${sysconfdir}/rc$level.d | ||
78 | ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd | ||
79 | done | ||
80 | } | 83 | } |