xf86-video-omapfb: pandora: handle cycle/forcer events better
[openembedded.git] / recipes / slugos-init / slugos-init_5.0.bb
1 DESCRIPTION = "SlugOS initial network config via sysconf"
2 SECTION = "base"
3 PRIORITY = "required"
4 LICENSE = "GPL"
5 DEPENDS = "base-files devio"
6 RDEPENDS = "busybox devio"
7 PR = "r11"
8
9 SRC_URI = "file://boot/flash \
10            file://boot/disk \
11            file://boot/nfs \
12            file://boot/ram \
13            file://boot/network \
14            file://boot/udhcpc.script \
15            file://initscripts/fixfstab \
16            file://initscripts/syslog.buffer \
17            file://initscripts/syslog.file \
18            file://initscripts/syslog.network \
19            file://initscripts/zleds \
20            file://initscripts/leds_startup \
21            file://initscripts/rmrecovery \
22            file://initscripts/sysconfsetup \
23            file://initscripts/umountinitrd.sh \
24            file://initscripts/loadmodules.sh \
25            file://functions \
26            file://modulefunctions \
27            file://conffiles \
28            file://sysconf \
29            file://leds \
30            file://setup-optware.sh \
31            file://turnup \
32            file://reflash \
33            file://usb \
34            "
35
36 SBINPROGS = ""
37 USRSBINPROGS = ""
38 CPROGS = "${USRSBINPROGS} ${SBINPROGS}"
39 SCRIPTS = "turnup leds sysconf setup-optware.sh"
40 BOOTSCRIPTS = "flash disk nfs ram network udhcpc.script"
41 INITSCRIPTS = "syslog.buffer syslog.file syslog.network zleds\
42         leds_startup rmrecovery sysconfsetup umountinitrd.sh\
43         fixfstab loadmodules.sh"
44
45 # This just makes things easier...
46 S="${WORKDIR}"
47
48 do_compile() {
49         set -ex
50         for p in ${CPROGS}
51         do
52                 ${CC} ${CFLAGS} -o $p $p.c
53         done
54         set +ex
55 }
56
57 do_install() {
58         set -ex
59
60         # Directories
61         install -d ${D}${sysconfdir} \
62                    ${D}${sysconfdir}/default \
63                    ${D}${sysconfdir}/init.d \
64                    ${D}${sysconfdir}/modutils \
65                    ${D}${sysconfdir}/modprobe.d \
66                    ${D}${sysconfdir}/udev \
67                    ${D}${sbindir} \
68                    ${D}${base_sbindir} \
69                    ${D}/initrd \
70                    ${D}/boot
71
72         # linuxrc
73         rm -f ${D}/linuxrc
74         ln -s boot/flash ${D}/linuxrc
75
76         # C programs
77         for p in ${USRSBINPROGS}
78         do
79                 install -m 0755 $p ${D}${sbindir}/$p
80         done
81         for p in ${SBINPROGS}
82         do
83                 install -m 0755 $p ${D}${base_sbindir}/$p
84         done
85
86         # Shell scripts
87         for p in ${SCRIPTS}
88         do
89                 install -m 0755 $p ${D}${base_sbindir}/$p
90         done
91
92         #
93         # Init scripts
94         install -m 0644 functions ${D}${sysconfdir}/default
95         install -m 0644 modulefunctions ${D}${sysconfdir}/default
96         for s in ${INITSCRIPTS}
97         do
98                 install -m 0755 initscripts/$s ${D}${sysconfdir}/init.d/
99         done
100
101         #
102         # Boot scripts
103         for p in ${BOOTSCRIPTS}
104         do
105                 install -m 0755 boot/$p ${D}/boot
106         done
107
108         # Configuration files
109         install -m 0644 conffiles ${D}${sysconfdir}/default
110
111         # Developer-only tools, tucked away
112         install -m 0755 reflash ${D}${sysconfdir}/default
113
114         # Modprobe configuration files
115         install -m 0644 usb ${D}${sysconfdir}/modprobe.d
116
117         set +ex
118 }
119
120 # If the package is installed on an NSLU2 $D will be empty, in that
121 # case it is normal to run 'start' and 'stop', but because the conf
122 # files installed don't actually start or stop anything this is
123 # unnecessary, so the package postfoo handling is simplified here.
124 #NB: do not use '08' (etc) for the first argument after start/stop,
125 # the value is interpreted as an octal number if there is a leading
126 # zero.
127 pkg_postinst_slugos-init() {
128         opt=
129         test -n "$D" && opt="-r $D"
130         update-rc.d $opt hwclock.sh             start  8 S . start 45 0 6 .
131         update-rc.d $opt umountinitrd.sh        start  9 S .
132         update-rc.d $opt fixfstab               start 10 S .
133         update-rc.d $opt syslog.buffer          start 11 S . start 49 0 6 .
134         update-rc.d $opt sysconfsetup           start 12 S .
135         update-rc.d $opt loadmodules.sh         start 21 S .
136         update-rc.d $opt syslog.file            start 39 S . start 47 0 6 .
137         update-rc.d $opt syslog.network         start 44 S . start 39 0 6 .
138         update-rc.d $opt zleds                  start 99 S 1 2 3 4 5 . start 89 0 6 . stop  5 0 1 2 3 4 5 6 .
139         update-rc.d $opt rmrecovery             start 99 1 2 3 4 5 .
140         # bug fix for startup
141         update-rc.d $opt leds_startup           start  1 1 2 3 4 5 .
142 }
143
144 pkg_postrm_slugos-init() {
145         opt=
146         test -n "$D" && opt="-r $D"
147         for s in ${INITSCRIPTS}
148         do
149                 update-rc.d $opt "$s" remove
150         done
151 }
152
153 FILES_${PN} = "/"
154
155 # It is bad to overwrite /linuxrc as it puts the system back to
156 # a flash boot (and the flash has potentially not been upgraded!)
157 CONFFILES_${PN} = "/linuxrc ${sysconfdir}/default/conffiles"