Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame^] | 1 | SUMMARY = "Toybox Inittab Configuration" |
| 2 | LICENSE = "BSD-0-Clause" |
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-0-Clause;md5=81eeb0083e31f11ab1e33ded846d521c" |
| 4 | |
| 5 | SRC_URI = "\ |
| 6 | file://inittab \ |
| 7 | file://rcK \ |
| 8 | file://rcS \ |
| 9 | " |
| 10 | |
| 11 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 12 | |
| 13 | RCONFLICTS_${PN} = "\ |
| 14 | busybox-inittab \ |
| 15 | sysvinit-inittab \ |
| 16 | " |
| 17 | |
| 18 | # most users may want to have getty enabled by default |
| 19 | PACKAGECONFIG ??= "getty" |
| 20 | |
| 21 | PACKAGECONFIG[getty] = "\ |
| 22 | enable_getty \ |
| 23 | " |
| 24 | |
| 25 | do_patch[noexec] = "1" |
| 26 | |
| 27 | do_configure() { |
| 28 | # copy over files now to have a fresh start on each config |
| 29 | for f in inittab rcK rcS; do |
| 30 | cp ${WORKDIR}/$f ${S} |
| 31 | done |
| 32 | |
| 33 | for config in ${PACKAGECONFIG_CONFARGS}; do |
| 34 | if [[ ${config} == "enable_getty" ]]; then |
| 35 | echo "# generated by bitbake recipe ${PN}" >> ${S}/inittab |
| 36 | for console in "${SERIAL_CONSOLES}"; do |
| 37 | param=$(echo ${console} | sed s/\;/\ /g) |
| 38 | name=$(echo ${param} | cut -d' ' -f2) |
| 39 | echo "$name::respawn:${base_sbindir}/getty ${param}" >> ${S}/inittab |
| 40 | done |
| 41 | fi |
| 42 | done |
| 43 | } |
| 44 | |
| 45 | do_compile[noexec] = "1" |
| 46 | |
| 47 | do_install() { |
| 48 | install -d ${D}${sysconfdir} |
| 49 | install -D -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab |
| 50 | |
| 51 | install -d ${D}${sysconfdir}/init.d |
| 52 | install -D -m 0744 ${S}/rcK ${D}${sysconfdir}/init.d/rcK |
| 53 | install -D -m 0744 ${S}/rcS ${D}${sysconfdir}/init.d/rcS |
| 54 | } |
| 55 | |
| 56 | FILES_${PN} = "\ |
| 57 | ${sysconfdir}/inittab \ |
| 58 | ${sysconfdir}/init.d/rcK \ |
| 59 | ${sysconfdir}/init.d/rcS \ |
| 60 | " |
| 61 | |