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 | |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 5 | # Unpack to ${S}/orig |
| 6 | # |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 7 | SRC_URI = "\ |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 8 | file://inittab;subdir=${BP}/orig \ |
| 9 | file://rcK;subdir=${BP}/orig \ |
| 10 | file://rcS;subdir=${BP}/orig \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 11 | " |
| 12 | |
| 13 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 14 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 15 | RCONFLICTS:${PN} = "\ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 16 | busybox-inittab \ |
| 17 | sysvinit-inittab \ |
| 18 | " |
| 19 | |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 20 | # Just being sure. |
| 21 | B = "${S}" |
| 22 | |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 23 | # most users may want to have getty enabled by default |
| 24 | PACKAGECONFIG ??= "getty" |
| 25 | |
| 26 | PACKAGECONFIG[getty] = "\ |
| 27 | enable_getty \ |
| 28 | " |
| 29 | |
| 30 | do_patch[noexec] = "1" |
| 31 | |
| 32 | do_configure() { |
| 33 | # copy over files now to have a fresh start on each config |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 34 | cp orig/* . |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 35 | |
| 36 | for config in ${PACKAGECONFIG_CONFARGS}; do |
| 37 | if [[ ${config} == "enable_getty" ]]; then |
| 38 | echo "# generated by bitbake recipe ${PN}" >> ${S}/inittab |
| 39 | for console in "${SERIAL_CONSOLES}"; do |
| 40 | param=$(echo ${console} | sed s/\;/\ /g) |
| 41 | name=$(echo ${param} | cut -d' ' -f2) |
| 42 | echo "$name::respawn:${base_sbindir}/getty ${param}" >> ${S}/inittab |
| 43 | done |
| 44 | fi |
| 45 | done |
| 46 | } |
| 47 | |
| 48 | do_compile[noexec] = "1" |
| 49 | |
| 50 | do_install() { |
| 51 | install -d ${D}${sysconfdir} |
| 52 | install -D -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab |
| 53 | |
| 54 | install -d ${D}${sysconfdir}/init.d |
| 55 | install -D -m 0744 ${S}/rcK ${D}${sysconfdir}/init.d/rcK |
| 56 | install -D -m 0744 ${S}/rcS ${D}${sysconfdir}/init.d/rcS |
| 57 | } |
| 58 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 59 | FILES:${PN} = "\ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 60 | ${sysconfdir}/inittab \ |
| 61 | ${sysconfdir}/init.d/rcK \ |
| 62 | ${sysconfdir}/init.d/rcS \ |
| 63 | " |
| 64 | |