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