libgcrypt: restore BBCLASSEXTEND
[openembedded.git] / recipes / initscripts / initscripts-slugos_1.0.bb
1 # SlugOS specific stuff for the init scripts.
2 #
3 # This is, in effect, an extended patch to fix various problems
4 # in the initscripts on SlugOS.  The problems mostly come down
5 # to the order in which the scripts are executed.
6
7 include initscripts_${PV}.bb
8
9 RCONFLICTS = "initscripts"
10
11 # SlugOS uses the busybox makedevs, so until that dependency gets virtualized
12 # the below lines serve to remove the dependency on the full makedevs package,
13 # as well as adding the dependency for the update-rc.d package.
14 DEPENDS = "update-rc.d-native"
15 RDEPENDS = "update-rc.d"
16
17 # All other standard definitions inherited from initscripts
18 # Except the PR which is hacked here.  The format used is
19 # a suffix
20 PR := "${PR}.22"
21
22 # We wish to search the same file paths as does the initscripts recipe.
23 FILESPATHPKG = "initscripts-${PV}:initscripts:files"
24
25 PACKAGES = "${PN}-dbg ${PN}"
26
27 SRC_URI += "file://alignment.sh"
28 SRC_URI += "file://domainname.sh"
29 SRC_URI += "file://bootclean.sh"
30
31 # Without this it is not possible to patch checkroot
32 S = "${WORKDIR}"
33
34 do_install_append() {
35         # devfs is not used with SlugOS - remove all traces of it.
36         rm      ${D}${sysconfdir}/init.d/devices
37         rm      ${D}${sysconfdir}/rcS.d/S05devices
38
39         # slugos specific scripts
40         install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
41         install -m 0755 ${WORKDIR}/domainname.sh ${D}${sysconfdir}/init.d
42         install -m 0755 ${WORKDIR}/bootclean.sh ${D}${sysconfdir}/init.d
43         install -m 0755 ${WORKDIR}/checkroot ${D}${sysconfdir}/init.d
44
45         # Remove the do install links (this detects a change to the
46         # initscripts .bb file - it will cause a build failure here.)
47         # This is a copy of the ln -sf lines from the initscripts
48         # do_install.
49         rm      ${D}${sysconfdir}/rc2.d/S99rmnologin
50         rm      ${D}${sysconfdir}/rc3.d/S99rmnologin
51         rm      ${D}${sysconfdir}/rc4.d/S99rmnologin
52         rm      ${D}${sysconfdir}/rc5.d/S99rmnologin
53         rm      ${D}${sysconfdir}/rc6.d/S20sendsigs
54 #       rm      ${D}${sysconfdir}/rc6.d/S30urandom
55         rm      ${D}${sysconfdir}/rc6.d/S31umountnfs.sh
56         rm      ${D}${sysconfdir}/rc6.d/S40umountfs
57         rm      ${D}${sysconfdir}/rcS.d/S30ramdisk
58         rm      ${D}${sysconfdir}/rc6.d/S90reboot
59         rm      ${D}${sysconfdir}/rc0.d/S20sendsigs
60 #       rm      ${D}${sysconfdir}/rc0.d/S30urandom
61         rm      ${D}${sysconfdir}/rc0.d/S31umountnfs.sh
62         rm      ${D}${sysconfdir}/rc0.d/S40umountfs
63         rm      ${D}${sysconfdir}/rc0.d/S90halt
64         rm      ${D}${sysconfdir}/rcS.d/S02banner
65         rm      ${D}${sysconfdir}/rcS.d/S10checkroot
66 #       rm      ${D}${sysconfdir}/rcS.d/S30checkfs.sh
67         rm      ${D}${sysconfdir}/rcS.d/S35mountall.sh
68         rm      ${D}${sysconfdir}/rcS.d/S39hostname.sh
69         rm      ${D}${sysconfdir}/rcS.d/S45mountnfs.sh
70         rm      ${D}${sysconfdir}/rcS.d/S55bootmisc.sh
71 #       rm      ${D}${sysconfdir}/rcS.d/S55urandom
72         rm      ${D}${sysconfdir}/rcS.d/S99finish.sh
73         # udev will run at S04 if installed
74         rm      ${D}${sysconfdir}/rcS.d/S03sysfs
75         rm      ${D}${sysconfdir}/rcS.d/S38devpts.sh
76         rm -f   ${D}${sysconfdir}/rcS.d/S06alignment
77         rm      ${D}${sysconfdir}/rcS.d/S37populate-volatile.sh
78         rm      ${D}${sysconfdir}/rc0.d/S25save-rtc.sh
79         rm      ${D}${sysconfdir}/rc6.d/S25save-rtc.sh
80
81
82
83         # Check the result
84         find ${D}${sysconfdir}/rc?.d ! -type d -print | {
85                 status=0
86                 while read d
87                 do
88                         oenote "initscripts-slugos: unexpected link $d"
89                         status=1
90                 done
91                 test $status -eq 0 ||
92                         oefatal "initscripts-slugos: new links break do_install"
93         }
94
95         # Set the run-level links
96         #
97         # Startup (S) links - UNCHANGED
98         #
99         # Keep these in order of startup - S, then 1, 2-5, 0,6
100         # according to the level in which the script starts (or stops) first.
101         update-rc.d -r ${D} banner              start  2 S .
102         update-rc.d -r ${D} sysfs.sh            start  3 S .
103         # udev runs at S 04 .
104         update-rc.d -r ${D} alignment.sh        start  7 S .
105         # busybox hwclock.sh (slugos-init) starts here (08)
106         # slugos-init umountinitrd runs here (09)
107
108         update-rc.d -r ${D} checkroot           start 10 S .
109         # slugos buffer syslog starts here (11)
110         # sysconfsetup runs at S 12
111         # modutils.sh runs at S 20
112         # checkfs.sh is currently disabled from S 30 (and won't work on SlugOS)
113         # ramdisk is not used on SlugOS, would run at S 30
114         update-rc.d -r ${D} mountall.sh         start 35 S .
115         # bootclean must run after mountall but before populate-volatile
116         update-rc.d -r ${D} bootclean.sh        start 36 S .
117         # base-files populate-volatile.sh runs at S37
118         update-rc.d -r ${D} devpts.sh           start 38 S .
119         # slugos file syslog starts here (39)
120         update-rc.d -r ${D} populate-volatile.sh        start 37 S .
121
122         # set hostname and domainname before the network script works (by
123         # entering them at level 40), networking may reset them.
124         update-rc.d -r ${D} domainname.sh       start 40 S .
125         update-rc.d -r ${D} hostname.sh         start 40 S .
126         # network runs at S 40
127         # slugos network syslog starts here (44)
128         update-rc.d -r ${D} mountnfs.sh         start 45 S .
129
130         update-rc.d -r ${D} bootmisc.sh         start 55 S .
131         # urandom is currently disabled from S 55 (and won't work with tmpfs /var)
132
133         # ipkg-cl configure runs at S 98
134         update-rc.d -r ${D} finish.sh           start 99 S .
135
136         #
137         # User (2-5) links - UNCHANGED
138         # rmnologin is the only thing added to user levels
139         update-rc.d -r ${D} rmnologin           start 99 2 3 4 5 .
140
141         #
142         # Shutdown (0,6) links - !!!CHANGED!!!
143         #
144         # The problem here is that netbase installs K40networking but portmap
145         # installs S32portmap.  One of these has to change!  The safe change
146         # is to make the networking stop at S40, so all network related shutdown
147         # must be in a K script or <S40.
148         #
149         # S20sendsigs is a disaster.  It needs to happen before the umounts
150         # but after the portmapper (which it would otherwise kill).
151         #
152         # urandom would stop at (S)30
153
154         # This is the special, correct, slugos umountnfs.sh (it looks in
155         # the /proc/mounts information, not /etc/fstab)
156         update-rc.d -r ${D} umountnfs.sh        start 31 0 6 .
157         update-rc.d -r ${D} save-rtc.sh         start 25 0 6 .
158         # portmap stops at 32
159         # slugos network syslog stops here (39)
160         # networking stops at 40 (nothing else does, believe me.)
161
162         # busybox hwclock.sh (slugos-init) stops here (45)
163         # slugos file syslog stops here (47)
164         # slugos buffer syslog stops here (49)
165         # udev stops here (55)
166         # Remove any errant processes
167         update-rc.d -r ${D} sendsigs            start 60 0 6 .
168
169         # This is the special, correct, slugos umountfs, it will umount
170         # any network file systems which failed to umount before.
171         update-rc.d -r ${D} umountfs            start 70 0 6 .
172
173         update-rc.d -r ${D} halt                start 90 0 .
174         update-rc.d -r ${D} reboot              start 90 6 .
175 }