xref: /openbmc/openbmc/meta-google/recipes-phosphor/console/obmc-console_%.bbappend (revision 91a1cec28e08f949b120fe8885e87ef256ca4d93)
1dc43764aSBrandon KimFILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:"
2dc43764aSBrandon Kim
3dc43764aSBrandon KimSRC_URI:append:gbmc = " \
4dc43764aSBrandon Kim  file://serial-to-bmc@.service \
5dc43764aSBrandon Kim  file://serial-to-host@.service.in \
6dc43764aSBrandon Kim  file://host-console-journal.service.in \
7dc43764aSBrandon Kim  file://host-console-filtered.sh \
8dc43764aSBrandon Kim  "
9dc43764aSBrandon Kim
10dc43764aSBrandon KimSYSTEMD_SERVICE:${PN}:append:gbmc = " serial-to-bmc@.service"
11dc43764aSBrandon KimSYSTEMD_SERVICE:${PN}:append:gbmc= " serial-to-host@.service"
12dc43764aSBrandon Kim
13cd9c539fSWilly Tu# Remove the default ssh package config
14cd9c539fSWilly TuPACKAGECONFIG:remove:gbmc = "ssh"
15cd9c539fSWilly Tu
16dc43764aSBrandon KimOBMC_CONSOLE_FRONT_TTY ?= ""
17dc43764aSBrandon Kim
18dc43764aSBrandon KimRDEPENDS:${PN}:append:gbmc = " bash"
19dc43764aSBrandon Kim
20dc43764aSBrandon KimFILES:${PN}:append:gbmc = " ${systemd_system_unitdir}/host-console-journal.service"
21dc43764aSBrandon Kim
22dc43764aSBrandon Kimdo_install:append:gbmc() {
23dc43764aSBrandon Kim  install -d ${D}${systemd_system_unitdir}
24*91a1cec2SAndrew Geissler  install -m 0644 ${UNPACKDIR}/serial-to-bmc@.service \
25dc43764aSBrandon Kim    ${D}${systemd_system_unitdir}
26dc43764aSBrandon Kim
27dc43764aSBrandon Kim  sed "s,@HOST_TTY@,${OBMC_CONSOLE_HOST_TTY}," \
28*91a1cec2SAndrew Geissler    ${UNPACKDIR}/serial-to-host@.service.in \
29dc43764aSBrandon Kim    >${D}${systemd_system_unitdir}/serial-to-host@.service
30dc43764aSBrandon Kim
31dc43764aSBrandon Kim  sed 's,@HOST_TTY@,${OBMC_CONSOLE_HOST_TTY},' \
32*91a1cec2SAndrew Geissler    ${UNPACKDIR}/host-console-journal.service.in \
33dc43764aSBrandon Kim    >${D}${systemd_system_unitdir}/host-console-journal.service
34dc43764aSBrandon Kim
35dc43764aSBrandon Kim  install -d ${D}${bindir}
36*91a1cec2SAndrew Geissler  install -m0755 ${UNPACKDIR}/host-console-filtered.sh ${D}${bindir}/
37dc43764aSBrandon Kim}
38dc43764aSBrandon Kim
39dc43764aSBrandon Kimpkg_postinst:${PN}:append:gbmc () {
40dc43764aSBrandon Kim  if [ -n "${OBMC_CONSOLE_FRONT_TTY}" ]; then
41dc43764aSBrandon Kim    systemctl --root=$D enable serial-to-host@${OBMC_CONSOLE_FRONT_TTY}.service
42dc43764aSBrandon Kim  fi
43dc43764aSBrandon Kim}
44