Merge oe-devel@oe-devel.bkbits.net:packages
[openembedded.git] / 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 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
6
7 FILES_${PN} += "/sbin /bin"
8 PR = "r1"
9
10 # USE_VT and SERIAL_CONSLE are generally defined by the MACHINE .conf.
11 # Set PACKAGE_ARCH appropriately.
12 PACKAGE_ARCH := "${MACHINE_ARCH}"
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            file://bootlogd.init"
26 S = "${WORKDIR}/sysvinit-2.85"
27 B = "${S}/src"
28
29 CFLAGS_prepend = "-D_GNU_SOURCE "
30 export LCRYPT = "-lcrypt"
31 EXTRA_OEMAKE += "'INSTALL=install' \
32                  'bindir=/bin' \
33                  'sbindir=/sbin' \
34                  'usrbindir=${bindir}' \
35                  'usrsbindir=${sbindir}' \
36                  'includedir=${includedir}' \
37                  'mandir=${mandir}'"
38
39 do_install () {
40         oe_runmake 'ROOT=${D}' install
41         install -d ${D}/${sysconfdir} \
42                    ${D}/${sysconfdir}/default \
43                    ${D}/${sysconfdir}/init.d
44         install -m 0644 ${WORKDIR}/inittab ${D}/${sysconfdir}/inittab
45         if [ ! -z "${SERIAL_CONSOLE}" ]; then
46                 echo "S:2345:respawn:/sbin/getty ${SERIAL_CONSOLE}" >> ${D}/etc/inittab
47         fi
48         if [ "${USE_VT}" == "1" ]; then
49                 cat <<EOF >>${D}/etc/inittab
50 # /sbin/getty invocations for the runlevels.
51 #
52 # The "id" field MUST be the same as the last
53 # characters of the device (after "tty").
54 #
55 # Format:
56 #  <id>:<runlevels>:<action>:<process>
57 #
58 1:2345:respawn:/sbin/getty 38400 tty1
59 # 2:23:respawn:/sbin/getty 38400 tty2
60 # 3:23:respawn:/sbin/getty 38400 tty3
61 # 4:23:respawn:/sbin/getty 38400 tty4
62 EOF
63         fi
64         install -m 0644    ${WORKDIR}/rcS-default       ${D}/etc/default/rcS
65         install -m 0755    ${WORKDIR}/rc                ${D}/etc/init.d
66         install -m 0755    ${WORKDIR}/rcS               ${D}/etc/init.d
67         install -m 0755    ${WORKDIR}/bootlogd.init     ${D}/etc/init.d/bootlogd
68         ln -sf bootlogd ${D}/etc/init.d/stop-bootlogd
69         install -d ${D}/etc/rcS.d
70         ln -sf ../init.d/bootlogd ${D}/etc/rcS.d/S07bootlogd
71         for level in 2 3 4 5; do
72                 install -d ${D}/etc/rc$level.d
73                 ln -s ../init.d/stop-bootlogd ${D}/etc/rc$level.d/
74         done
75 }
76
77
78 do_install_append_ramses () {
79         cat <<EOF >>${D}/etc/inittab
80 # Bluetooth
81 #1:2345:respawn:/sbin/getty -L 115200 tts/1
82 # External serial port
83 4:2345:respawn:/sbin/getty -L 115200 tts/4
84 # Framebuffer
85 v1:2345:respawn:/sbin/getty -L 115200 vc/1
86 EOF
87 }