blob: 679d3222c160a4c51c15d928dd0e979df4325b1f [file] [log] [blame]
Brandon Kimdc437642022-04-13 10:00:14 -07001FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:"
2
3SRC_URI:append:gbmc = " \
4 file://serial-to-bmc@.service \
5 file://serial-to-host@.service.in \
6 file://host-console-journal.service.in \
7 file://host-console-filtered.sh \
8 "
9
10SYSTEMD_SERVICE:${PN}:append:gbmc = " serial-to-bmc@.service"
11SYSTEMD_SERVICE:${PN}:append:gbmc= " serial-to-host@.service"
12
13OBMC_CONSOLE_FRONT_TTY ?= ""
14
15RDEPENDS:${PN}:append:gbmc = " bash"
16
17FILES:${PN}:append:gbmc = " ${systemd_system_unitdir}/host-console-journal.service"
18
19do_install:append:gbmc() {
20 install -d ${D}${systemd_system_unitdir}
21 install -m 0644 ${WORKDIR}/serial-to-bmc@.service \
22 ${D}${systemd_system_unitdir}
23
24 sed "s,@HOST_TTY@,${OBMC_CONSOLE_HOST_TTY}," \
25 ${WORKDIR}/serial-to-host@.service.in \
26 >${D}${systemd_system_unitdir}/serial-to-host@.service
27
28 sed 's,@HOST_TTY@,${OBMC_CONSOLE_HOST_TTY},' \
29 ${WORKDIR}/host-console-journal.service.in \
30 >${D}${systemd_system_unitdir}/host-console-journal.service
31
32 install -d ${D}${bindir}
33 install -m0755 ${WORKDIR}/host-console-filtered.sh ${D}${bindir}/
34}
35
36pkg_postinst:${PN}:append:gbmc () {
37 if [ -n "${OBMC_CONSOLE_FRONT_TTY}" ]; then
38 systemctl --root=$D enable serial-to-host@${OBMC_CONSOLE_FRONT_TTY}.service
39 fi
40}