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