summaryrefslogtreecommitdiff
path: root/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bbappend
blob: e72df3114bb81049884333da39ff59ed8ff6d350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# enable gadget serial console for supported hardware
SUMMARY_${PN}-start-open = "Open debug console for development only"
SUMMARY_${PN}-start = "Production console"
SERIAL_CONSOLES_append_mtcdt = " 115200;ttyGS0"
PACKAGES =+ "${PN}-start ${PN}-start-open"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://start_getty_open \
            file://bootlogd \
            "
PKGR_${PN}-start-open = "${PR}a"
FILES_${PN} = "${sysconfdir}/inittab ${sysconfdir}/default/bootlogd"
FILES_${PN}-start = "${base_bindir}/start_getty"
FILES_${PN}-start-open = "${base_bindir}/start_getty_open"
RCONFLICTS_${PN}-start = "${PN}-start-open"
RCONFLICTS_${PN}-start-open = "${PN}-start"
RDEPENDS_${PN}-start-open = "${PN}"

do_install_append() {
	install -m 0755 ${WORKDIR}/start_getty_open ${D}${base_bindir}/start_getty_open
    install -d ${D}{sysconfdir}/default
    install -m 0644 ${WORKDIR}/bootlogd ${D}{sysconfdir}/default/
}
pkg_postinst_${PN}-start-open() {
	sed -i 's?^S0:.*?S0:12345:respawn:/bin/start_getty_open 115200 ttyS0?' $D/etc/inittab
	sed -i 's?^S1:.*?S1:12345:respawn:/bin/start_getty_open 115200 ttyS1?' $D/etc/inittab
	sed -i 's?^GS0:.*?GS0:12345:respawn:/bin/start_getty_open 115200 ttyGS0 vt102?' $D/etc/inittab
}

pkg_prerm_${PN}-start-open() {
	sed -i 's?^S0:.*?S0:12345:respawn:/bin/start_getty 115200 ttyS0?' $D/etc/inittab
	sed -i 's?^S1:.*?S1:12345:respawn:/bin/start_getty 115200 ttyS1?' $D/etc/inittab
	sed -i 's?^GS0:.*?GS0:12345:respawn:/bin/start_getty 115200 ttyGS0 vt102?' $D/etc/inittab
}