busybox-inittab_1.37.0.bb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. SRC_URI = "file://inittab"
  5. S = "${UNPACKDIR}"
  6. INHIBIT_DEFAULT_DEPS = "1"
  7. do_compile() {
  8. :
  9. }
  10. do_install() {
  11. install -d ${D}${sysconfdir}
  12. install -D -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab
  13. CONSOLES="${SERIAL_CONSOLES}"
  14. for s in $CONSOLES
  15. do
  16. speed=$(echo $s | cut -d\; -f 1)
  17. device=$(echo $s | cut -d\; -f 2)
  18. label=$(echo $device | sed -e 's/tty//' | tail --bytes=5)
  19. echo "$device::respawn:${sbindir}/ttyrun $device ${base_sbindir}/getty $speed $device" >> ${D}${sysconfdir}/inittab
  20. done
  21. if [ "${USE_VT}" = "1" ]; then
  22. cat <<EOF >>${D}${sysconfdir}/inittab
  23. # ${base_sbindir}/getty invocations for the runlevels.
  24. #
  25. # The "id" field MUST be the same as the last
  26. # characters of the device (after "tty").
  27. #
  28. # Format:
  29. # <id>:<runlevels>:<action>:<process>
  30. #
  31. EOF
  32. for n in ${SYSVINIT_ENABLED_GETTYS}
  33. do
  34. echo "tty$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
  35. done
  36. echo "" >> ${D}${sysconfdir}/inittab
  37. fi
  38. }
  39. # SERIAL_CONSOLES is generally defined by the MACHINE .conf.
  40. # Set PACKAGE_ARCH appropriately.
  41. PACKAGE_ARCH = "${MACHINE_ARCH}"
  42. FILES:${PN} = "${sysconfdir}/inittab"
  43. CONFFILES:${PN} = "${sysconfdir}/inittab"
  44. RDEPENDS:${PN} = "ttyrun"
  45. RCONFLICTS:${PN} = "sysvinit-inittab"
  46. USE_VT ?= "1"
  47. SYSVINIT_ENABLED_GETTYS ?= "1"