slugos-init: Removed ixp4xx_mac module (now compiled into kernel)
[vuplus_openembedded] / packages / slugos-init / slugos-init_0.10.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 = "r72"
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://turnup \
31            file://reflash \
32            file://links.conf \
33            "
34
35 SBINPROGS = ""
36 USRSBINPROGS = ""
37 CPROGS = "${USRSBINPROGS} ${SBINPROGS}"
38 SCRIPTS = "turnup reflash leds sysconf"
39 BOOTSCRIPTS = "flash disk nfs ram network udhcpc.script"
40 INITSCRIPTS = "syslog.buffer syslog.file syslog.network zleds\
41         leds_startup rmrecovery sysconfsetup umountinitrd.sh\
42         fixfstab loadmodules.sh"
43
44 # This just makes things easier...
45 S="${WORKDIR}"
46
47 do_compile() {
48         set -ex
49         for p in ${CPROGS}
50         do
51                 ${CC} ${CFLAGS} -o $p $p.c
52         done
53         set +ex
54 }
55
56 do_install() {
57         set -ex
58
59         # Directories
60         install -d ${D}${sysconfdir} \
61                    ${D}${sysconfdir}/default \
62                    ${D}${sysconfdir}/init.d \
63                    ${D}${sysconfdir}/modutils \
64                    ${D}${sysconfdir}/udev \
65                    ${D}${sbindir} \
66                    ${D}${base_sbindir} \
67                    ${D}/initrd \
68                    ${D}/boot
69                   
70         # linuxrc
71         rm -f ${D}/linuxrc
72         ln -s boot/flash ${D}/linuxrc
73
74         # C programs
75         for p in ${USRSBINPROGS}
76         do
77                 install -m 0755 $p ${D}${sbindir}/$p
78         done
79         for p in ${SBINPROGS}
80         do
81                 install -m 0755 $p ${D}${base_sbindir}/$p
82         done
83
84         # Shell scripts
85         for p in ${SCRIPTS}
86         do
87                 install -m 0755 $p ${D}${base_sbindir}/$p
88         done
89
90         #
91         # Init scripts
92         install -m 0644 functions ${D}${sysconfdir}/default
93         install -m 0644 modulefunctions ${D}${sysconfdir}/default       
94         for s in ${INITSCRIPTS}
95         do
96                 install -m 0755 initscripts/$s ${D}${sysconfdir}/init.d/
97         done
98
99         #
100         # Udev configuration files
101         install -m 0644 links.conf ${D}${sysconfdir}/udev
102
103         #
104         # Boot scripts
105         for p in ${BOOTSCRIPTS}
106         do
107                 install -m 0755 boot/$p ${D}/boot
108         done
109
110         # Configuration files
111         install -m 0644 conffiles ${D}${sysconfdir}/default
112
113         set +ex
114 }
115
116 # If the package is installed on an NSLU2 $D will be empty, in that
117 # case it is normal to run 'start' and 'stop', but because the conf
118 # files installed don't actually start or stop anything this is
119 # unnecessary, so the package postfoo handling is simplified here.
120 #NB: do not use '08' (etc) for the first argument after start/stop,
121 # the value is interpreted as an octal number if there is a leading
122 # zero.
123 pkg_postinst_slugos-init() {
124         opt=
125         test -n "$D" && opt="-r $D"
126         update-rc.d $opt hwclock.sh             start  8 S . start 45 0 6 .
127         update-rc.d $opt umountinitrd.sh        start  9 S .
128         update-rc.d $opt fixfstab               start 10 S .
129         update-rc.d $opt syslog.buffer          start 11 S . start 49 0 6 .
130         update-rc.d $opt sysconfsetup           start 12 S .
131         update-rc.d $opt loadmodules.sh         start 21 S .
132         update-rc.d $opt syslog.file            start 39 S . start 47 0 6 .
133         update-rc.d $opt syslog.network         start 44 S . start 39 0 6 .
134         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 .
135         update-rc.d $opt rmrecovery             start 99 1 2 3 4 5 .
136         # bug fix for startup
137         update-rc.d $opt leds_startup           start  1 1 2 3 4 5 .
138 }
139
140 pkg_postrm_slugos-init() {
141         opt=
142         test -n "$D" && opt="-r $D"
143         for s in ${INITSCRIPTS}
144         do
145                 update-rc.d $opt "$s" remove
146         done
147 }
148
149 PACKAGES = "${PN}"
150 FILES_${PN} = "/"
151
152 # It is bad to overwrite /linuxrc as it puts the system back to
153 # a flash boot (and the flash has potentially not been upgraded!)
154 CONFFILES_${PN} = "/linuxrc ${sysconfdir}/default/conffiles"