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