Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "inittab configuration for BusyBox" |
| 2 | LICENSE = "GPL-2.0-only" |
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" |
| 4 | |
| 5 | SRC_URI = "file://inittab" |
| 6 | |
| 7 | S = "${WORKDIR}" |
| 8 | |
| 9 | INHIBIT_DEFAULT_DEPS = "1" |
| 10 | |
| 11 | do_compile() { |
| 12 | : |
| 13 | } |
| 14 | |
| 15 | do_install() { |
| 16 | install -d ${D}${sysconfdir} |
| 17 | install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 18 | |
| 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 Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 26 | echo "$device::respawn:${sbindir}/ttyrun $device ${base_sbindir}/getty $speed $device" >> ${D}${sysconfdir}/inittab |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 27 | done |
| 28 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 29 | 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 | |
| 40 | EOF |
| 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 Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 51 | |
| 52 | # SERIAL_CONSOLES is generally defined by the MACHINE .conf. |
| 53 | # Set PACKAGE_ARCH appropriately. |
| 54 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 55 | |
| 56 | FILES:${PN} = "${sysconfdir}/inittab" |
| 57 | CONFFILES:${PN} = "${sysconfdir}/inittab" |
| 58 | |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 59 | RDEPENDS:${PN} = "ttyrun" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 60 | RCONFLICTS:${PN} = "sysvinit-inittab" |
| 61 | |
| 62 | USE_VT ?= "1" |
| 63 | SYSVINIT_ENABLED_GETTYS ?= "1" |