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