Merge openembedded@openembedded.bkbits.net:packages-devel
[vuplus_openembedded] / sysvinit / sysvinit_2.86.oe
1 SECTION = "base"
2 DESCRIPTION = "System-V like init."
3 LICENSE = "GPL"
4 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
5 FILES_${PN} += "/sbin /bin"
6 PR = "r0"
7
8 python () {
9         mach = oe.data.getVar('MACHINE', d, 1)
10         if mach:
11                 oe.data.setVar('PACKAGE_ARCH', oe.data.getVar('MACHINE_ARCH', d, 1), d)
12 }
13
14 USE_VT ?= "1"
15
16 SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.85.tar.gz \
17            file://sysvinit-2.86.patch;patch=1 \
18            file://install.patch;patch=1 \
19            file://need \
20            file://provide \
21            file://inittab \
22            file://rcS-default \
23            file://rc \
24            file://rcS"
25 S = "${WORKDIR}/sysvinit-2.85"
26 B = "${S}/src"
27
28 CFLAGS_prepend = "-D_GNU_SOURCE "
29 export LCRYPT = "-lcrypt"
30 EXTRA_OEMAKE += "'INSTALL=install' \
31                  'bindir=/bin' \
32                  'sbindir=/sbin' \
33                  'usrbindir=${bindir}' \
34                  'usrsbindir=${sbindir}' \
35                  'includedir=${includedir}' \
36                  'mandir=${mandir}'"
37
38 do_install () {
39         oe_runmake 'ROOT=${D}' install
40         install -d ${D}/${sysconfdir} \
41                    ${D}/${sysconfdir}/default \
42                    ${D}/${sysconfdir}/init.d
43         install -m 0644 ${WORKDIR}/inittab ${D}/${sysconfdir}/inittab
44         if [ ! -z "${SERIAL_CONSOLE}" ]; then
45                 echo "S:2345:respawn:/sbin/getty ${SERIAL_CONSOLE}" >> ${D}/etc/inittab
46         fi
47         if [ "${USE_VT}" == "1" ]; then
48                 cat <<EOF >>${D}/etc/inittab
49 # /sbin/getty invocations for the runlevels.
50 #
51 # The "id" field MUST be the same as the last
52 # characters of the device (after "tty").
53 #
54 # Format:
55 #  <id>:<runlevels>:<action>:<process>
56 #
57 1:2345:respawn:/sbin/getty 38400 tty1
58 # 2:23:respawn:/sbin/getty 38400 tty2
59 # 3:23:respawn:/sbin/getty 38400 tty3
60 # 4:23:respawn:/sbin/getty 38400 tty4
61 EOF
62         fi
63         install -m 0644    ${WORKDIR}/rcS-default       ${D}/etc/default/rcS
64         install -m 0755    ${WORKDIR}/rc                ${D}/etc/init.d
65         install -m 0755    ${WORKDIR}/rcS               ${D}/etc/init.d
66 }
67
68
69 do_install_append_ramses () {
70         cat <<EOF >>${D}/etc/inittab
71 # Bluetooth
72 #1:2345:respawn:/sbin/getty -L 115200 tts/1
73 # External serial port
74 4:2345:respawn:/sbin/getty -L 115200 tts/4
75 # Framebuffer
76 v1:2345:respawn:/sbin/getty -L 115200 vc/1
77 EOF
78 }