summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts_1.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts_1.0.bb')
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb169
1 files changed, 169 insertions, 0 deletions
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 0000000000..775816a37f
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,169 @@
1SUMMARY = "SysV init scripts"
2DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
3SECTION = "base"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6PR = "r155"
7
8INHIBIT_DEFAULT_DEPS = "1"
9
10SRC_URI = "file://functions \
11 file://halt \
12 file://umountfs \
13 file://devpts.sh \
14 file://devpts \
15 file://hostname.sh \
16 file://mountall.sh \
17 file://banner.sh \
18 file://bootmisc.sh \
19 file://mountnfs.sh \
20 file://reboot \
21 file://checkfs.sh \
22 file://single \
23 file://sendsigs \
24 file://urandom \
25 file://rmnologin.sh \
26 file://checkroot.sh \
27 file://umountnfs.sh \
28 file://sysfs.sh \
29 file://populate-volatile.sh \
30 file://read-only-rootfs-hook.sh \
31 file://volatiles \
32 file://save-rtc.sh \
33 file://GPLv2.patch \
34 file://dmesg.sh \
35 file://logrotate-dmesg.conf \
36"
37
38SRC_URI_append_arm = " file://alignment.sh"
39
40KERNEL_VERSION = ""
41
42inherit update-alternatives
43DEPENDS_append = " update-rc.d-native"
44DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
45
46PACKAGES =+ "${PN}-functions"
47RDEPENDS_${PN} = "${PN}-functions"
48FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
49
50ALTERNATIVE_PRIORITY_${PN}-functions = "90"
51ALTERNATIVE_${PN}-functions = "functions"
52ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
53
54HALTARGS ?= "-d -f"
55
56do_configure() {
57 sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
58 sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
59}
60
61do_install () {
62#
63# Create directories and install device independent scripts
64#
65 install -d ${D}${sysconfdir}/init.d
66 install -d ${D}${sysconfdir}/rcS.d
67 install -d ${D}${sysconfdir}/rc0.d
68 install -d ${D}${sysconfdir}/rc1.d
69 install -d ${D}${sysconfdir}/rc2.d
70 install -d ${D}${sysconfdir}/rc3.d
71 install -d ${D}${sysconfdir}/rc4.d
72 install -d ${D}${sysconfdir}/rc5.d
73 install -d ${D}${sysconfdir}/rc6.d
74 install -d ${D}${sysconfdir}/default
75 install -d ${D}${sysconfdir}/default/volatiles
76 # Holds state information pertaining to urandom
77 install -d ${D}/var/lib/urandom
78
79 install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d
80 install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d
81 install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d
82 install -m 0755 ${WORKDIR}/halt ${D}${sysconfdir}/init.d
83 install -m 0755 ${WORKDIR}/hostname.sh ${D}${sysconfdir}/init.d
84 install -m 0755 ${WORKDIR}/mountall.sh ${D}${sysconfdir}/init.d
85 install -m 0755 ${WORKDIR}/mountnfs.sh ${D}${sysconfdir}/init.d
86 install -m 0755 ${WORKDIR}/reboot ${D}${sysconfdir}/init.d
87 install -m 0755 ${WORKDIR}/rmnologin.sh ${D}${sysconfdir}/init.d
88 install -m 0755 ${WORKDIR}/sendsigs ${D}${sysconfdir}/init.d
89 install -m 0755 ${WORKDIR}/single ${D}${sysconfdir}/init.d
90 install -m 0755 ${WORKDIR}/umountnfs.sh ${D}${sysconfdir}/init.d
91 install -m 0755 ${WORKDIR}/urandom ${D}${sysconfdir}/init.d
92 install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d
93 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
94 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
95 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
96 install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
97 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
98 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
99 install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
100 install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
101
102 if [ "${TARGET_ARCH}" = "arm" ]; then
103 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
104 fi
105#
106# Install device dependent scripts
107#
108 install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh
109 install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs
110#
111# Create runlevel links
112#
113 update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
114 update-rc.d -r ${D} sendsigs start 20 0 6 .
115 update-rc.d -r ${D} urandom start 30 S 0 6 .
116 update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
117 update-rc.d -r ${D} umountfs start 40 0 6 .
118 update-rc.d -r ${D} reboot start 90 6 .
119 update-rc.d -r ${D} halt start 90 0 .
120 update-rc.d -r ${D} save-rtc.sh start 25 0 6 .
121 update-rc.d -r ${D} banner.sh start 02 S .
122 update-rc.d -r ${D} checkroot.sh start 06 S .
123 update-rc.d -r ${D} mountall.sh start 03 S .
124 update-rc.d -r ${D} hostname.sh start 39 S .
125 update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 .
126 update-rc.d -r ${D} bootmisc.sh start 55 S .
127 update-rc.d -r ${D} sysfs.sh start 02 S .
128 update-rc.d -r ${D} populate-volatile.sh start 37 S .
129 update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
130 update-rc.d -r ${D} devpts.sh start 38 S .
131 if [ "${TARGET_ARCH}" = "arm" ]; then
132 update-rc.d -r ${D} alignment.sh start 06 S .
133 fi
134 # We wish to have /var/log ready at this stage so execute this after
135 # populate-volatile.sh
136 update-rc.d -r ${D} dmesg.sh start 38 S .
137}
138
139MASKED_SCRIPTS = " \
140 banner \
141 bootmisc \
142 checkfs \
143 checkroot \
144 devpts \
145 dmesg \
146 hostname \
147 mountall \
148 mountnfs \
149 populate-volatile \
150 read-only-rootfs-hook \
151 rmnologin \
152 sysfs \
153 urandom"
154
155pkg_postinst_${PN} () {
156 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
157 if [ -n "$D" ]; then
158 OPTS="--root=$D"
159 fi
160 for SERVICE in ${MASKED_SCRIPTS}; do
161 systemctl $OPTS mask $SERVICE.service
162 done
163 fi
164
165 # Delete any old volatile cache script, as directories may have moved
166 if [ -z "$D" ]; then
167 rm -f "/etc/volatile.cache"
168 fi
169}