blob: 6904a91930f94b85e88c4984fac1cc27f24ef327 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "inittab configuration for BusyBox"
2LICENSE = "GPL-2.0-only"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
4
5SRC_URI = "file://inittab"
6
7S = "${WORKDIR}"
8
9INHIBIT_DEFAULT_DEPS = "1"
10
11do_compile() {
12 :
13}
14
15do_install() {
16 install -d ${D}${sysconfdir}
17 install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
Andrew Geissler20137392023-10-12 04:59:14 -060018
19 CONSOLES="${SERIAL_CONSOLES}"
20 for s in $CONSOLES
21 do
22 speed=$(echo $s | cut -d\; -f 1)
23 device=$(echo $s | cut -d\; -f 2)
24 label=$(echo $device | sed -e 's/tty//' | tail --bytes=5)
25
Patrick Williams73bd93f2024-02-20 08:07:48 -060026 echo "$device::respawn:${sbindir}/ttyrun $device ${base_sbindir}/getty $speed $device" >> ${D}${sysconfdir}/inittab
Andrew Geissler20137392023-10-12 04:59:14 -060027 done
28
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000029 if [ "${USE_VT}" = "1" ]; then
30 cat <<EOF >>${D}${sysconfdir}/inittab
31# ${base_sbindir}/getty invocations for the runlevels.
32#
33# The "id" field MUST be the same as the last
34# characters of the device (after "tty").
35#
36# Format:
37# <id>:<runlevels>:<action>:<process>
38#
39
40EOF
41
42 for n in ${SYSVINIT_ENABLED_GETTYS}
43 do
44 echo "tty$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
45 done
46 echo "" >> ${D}${sysconfdir}/inittab
47 fi
48
49}
50
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000051
52# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
53# Set PACKAGE_ARCH appropriately.
54PACKAGE_ARCH = "${MACHINE_ARCH}"
55
56FILES:${PN} = "${sysconfdir}/inittab"
57CONFFILES:${PN} = "${sysconfdir}/inittab"
58
Andrew Geissler20137392023-10-12 04:59:14 -060059RDEPENDS:${PN} = "ttyrun"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000060RCONFLICTS:${PN} = "sysvinit-inittab"
61
62USE_VT ?= "1"
63SYSVINIT_ENABLED_GETTYS ?= "1"