Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Inittab configuration for SysVinit" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 2 | LICENSE = "GPL-2.0-only" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 6 | SRC_URI = "file://inittab \ |
| 7 | file://start_getty" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | |
| 9 | S = "${WORKDIR}" |
| 10 | |
| 11 | INHIBIT_DEFAULT_DEPS = "1" |
| 12 | |
| 13 | do_compile() { |
| 14 | : |
| 15 | } |
| 16 | |
| 17 | do_install() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 18 | install -d ${D}${sysconfdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | install -d ${D}${base_bindir} |
| 21 | install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 24 | CONSOLES="${SERIAL_CONSOLES}" |
| 25 | for s in $CONSOLES |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | do |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 27 | speed=$(echo $s | cut -d\; -f 1) |
| 28 | device=$(echo $s | cut -d\; -f 2) |
| 29 | label=$(echo $device | sed -e 's/tty//' | tail --bytes=5) |
| 30 | |
| 31 | echo "$label:12345:respawn:${sbindir}/ttyrun $device ${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | done |
| 33 | |
| 34 | if [ "${USE_VT}" = "1" ]; then |
| 35 | cat <<EOF >>${D}${sysconfdir}/inittab |
| 36 | # ${base_sbindir}/getty invocations for the runlevels. |
| 37 | # |
| 38 | # The "id" field MUST be the same as the last |
| 39 | # characters of the device (after "tty"). |
| 40 | # |
| 41 | # Format: |
| 42 | # <id>:<runlevels>:<action>:<process> |
| 43 | # |
| 44 | |
| 45 | EOF |
| 46 | |
| 47 | for n in ${SYSVINIT_ENABLED_GETTYS} |
| 48 | do |
| 49 | echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab |
| 50 | done |
| 51 | echo "" >> ${D}${sysconfdir}/inittab |
| 52 | fi |
| 53 | } |
| 54 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | # USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. |
| 56 | # Set PACKAGE_ARCH appropriately. |
| 57 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 58 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | FILES:${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty" |
| 60 | CONFFILES:${PN} = "${sysconfdir}/inittab" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | |
| 62 | USE_VT ?= "1" |
| 63 | SYSVINIT_ENABLED_GETTYS ?= "1" |
| 64 | |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 65 | RDEPENDS:${PN} = "ttyrun" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 66 | RCONFLICTS:${PN} = "busybox-inittab" |