1 # OpenSlug specific stuff for the init scripts.
3 # This is, in effect, an extended patch to fix various
4 # problems in the initscripts on OpenSlug. The problems
5 # mostly come down to the order the scripts are executed
7 include initscripts_${PV}.bb
9 MAINTAINER = "John Bowler <jbowler@acm.org>"
10 RCONFLICTS = "initscripts"
11 # All other standard definitions inherited from initscripts
12 # Except the PR which is hacked here. The format used is
16 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/${P}', '${FILE_DIRNAME}/initscripts-${PV}', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
20 SRC_URI += "file://alignment.sh"
21 SRC_URI += "file://domainname.sh"
22 SRC_URI += "file://rootopts.patch;patch=1"
23 SRC_URI += "file://devices.patch;patch=1"
25 # Without this it is not possible to patch checkroot.sh
29 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
30 install -m 0755 ${WORKDIR}/domainname.sh ${D}${sysconfdir}/init.d
32 # Remove the do install links (this detects a change to the
33 # initscripts .bb file - it will cause a build failure here.)
34 # This is a copy of the ln -sf lines from the initscripts
36 rm ${D}${sysconfdir}/rc2.d/S99rmnologin
37 rm ${D}${sysconfdir}/rc3.d/S99rmnologin
38 rm ${D}${sysconfdir}/rc4.d/S99rmnologin
39 rm ${D}${sysconfdir}/rc5.d/S99rmnologin
40 rm ${D}${sysconfdir}/rc6.d/S20sendsigs
41 # rm ${D}${sysconfdir}/rc6.d/S30urandom
42 rm ${D}${sysconfdir}/rc6.d/S31umountnfs.sh
43 rm ${D}${sysconfdir}/rc6.d/S40umountfs
44 rm ${D}${sysconfdir}/rcS.d/S30ramdisk
45 rm ${D}${sysconfdir}/rc6.d/S90reboot
46 rm ${D}${sysconfdir}/rc0.d/S20sendsigs
47 # rm ${D}${sysconfdir}/rc0.d/S30urandom
48 rm ${D}${sysconfdir}/rc0.d/S31umountnfs.sh
49 rm ${D}${sysconfdir}/rc0.d/S40umountfs
50 rm ${D}${sysconfdir}/rc0.d/S90halt
51 rm ${D}${sysconfdir}/rcS.d/S02banner
52 rm ${D}${sysconfdir}/rcS.d/S10checkroot.sh
53 # rm ${D}${sysconfdir}/rcS.d/S30checkfs.sh
54 rm ${D}${sysconfdir}/rcS.d/S35mountall.sh
55 rm ${D}${sysconfdir}/rcS.d/S39hostname.sh
56 rm ${D}${sysconfdir}/rcS.d/S45mountnfs.sh
57 rm ${D}${sysconfdir}/rcS.d/S55bootmisc.sh
58 # rm ${D}${sysconfdir}/rcS.d/S55urandom
59 rm ${D}${sysconfdir}/rcS.d/S99finish
60 rm ${D}${sysconfdir}/rcS.d/S05devices
61 # udev will run at S04 if installed
62 rm ${D}${sysconfdir}/rcS.d/S03sysfs
63 rm ${D}${sysconfdir}/rcS.d/S38devpts.sh
64 # rm ${D}${sysconfdir}/rcS.d/S06alignment
67 find ${D}${sysconfdir}/rc?.d ! -type d -print | {
71 oenote "initscripts-openslug: unexpected link $f"
75 oefatal "initscripts-openslug: new links break do_install"
78 # Set the run-level links
80 # Startup (S) links - UNCHANGED
82 # Keep these in order of startup - S, then 1, 2-5, 0,6
83 # according to the level in which the script starts (or stops) first.
84 update-rc.d -r ${D} banner start 2 S .
85 update-rc.d -r ${D} sysfs.sh start 3 S .
87 update-rc.d -r ${D} devices start 5 S .
88 update-rc.d -r ${D} alignment.sh start 7 S .
89 # busybox hwclock.sh (openslug-init) starts here (08)
90 # openslug-init umountinitrd runs here (09)
92 update-rc.d -r ${D} checkroot.sh start 10 S .
93 # openslug buffer syslog starts here (11)
94 # sysconfsetup runs at S 12
95 # modutils.sh runs at S 20
96 # checkfs.sh is currently disabled from S 30 (and won't work on OpenSlug)
97 # ramdisk is not used on OpenSlug, would run at S 30
98 update-rc.d -r ${D} mountall.sh start 35 S .
99 # base-files populate-volatile.sh runs at S37
100 update-rc.d -r ${D} devpts.sh start 38 S .
101 # openslug file syslog starts here (39)
103 # set hostname and domainname before the network script works (by
104 # entering them at level 40), networking may reset them.
105 update-rc.d -r ${D} domainname.sh start 40 S .
106 update-rc.d -r ${D} hostname.sh start 40 S .
107 # network runs at S 40
108 # openslug network syslog starts here (44)
109 update-rc.d -r ${D} mountnfs.sh start 45 S .
111 update-rc.d -r ${D} bootmisc.sh start 55 S .
112 # urandom is currently disabled from S 55 (and won't work with tmpfs /var)
114 # ipkg-cl configure runs at S 98
115 update-rc.d -r ${D} finish start 99 S .
118 # User (2-5) links - UNCHANGED
119 # rmnologin is the only thing added to user levels
120 update-rc.d -r ${D} rmnologin start 99 2 3 4 5 .
123 # Shutdown (0,6) links - !!!CHANGED!!!
125 # The problem here is that netbase installs K40networking but portmap
126 # installs S32portmap. One of these has to change! The safe change
127 # is to make the networking stop at S40, so all network related shutdown
128 # must be in a K script or <S40.
130 # S20sendsigs is a disaster. It needs to happen before the umounts
131 # but after the portmapper (which it would otherwise kill).
133 # urandom would stop at (S)30
135 # This is the special, correct, openslug umountnfs.sh (it looks in
136 # the /proc/mounts information, not /etc/fstab)
137 update-rc.d -r ${D} umountnfs.sh start 31 0 6 .
138 # portmap stops at 32
139 # openslug network syslog stops here (39)
140 # networking stops at 40 (nothing else does, believe me.)
142 # busybox hwclock.sh (openslug-init) stops here (45)
143 # openslug file syslog stops here (47)
144 # openslug buffer syslog stops here (49)
145 # Remove any errant processes
146 update-rc.d -r ${D} sendsigs start 60 0 6 .
148 # This is the special, correct, openslug umountfs, it will umount
149 # any network file systems which failed to umount before.
150 update-rc.d -r ${D} umountfs start 70 0 6 .
152 update-rc.d -r ${D} halt start 90 0 .
153 update-rc.d -r ${D} reboot start 90 6 .