blob: 9daae7c8609b2f80f886969079ab5b67643d7a91 [file] [log] [blame]
Lancelot Kaodc456f92021-02-21 18:42:38 -06001FILESEXTRAPATHS_prepend_kudo := "${THISDIR}/${PN}:"
2RDEPENDS_${PN}_append_kudo = " bash"
3
4# Remove what installed by common recipe
5OBMC_CONSOLE_HOST_TTY = ""
6SYSTEMD_SUBSTITUTIONS_remove_kudo = " OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh@.service"
7SYSTEMD_SUBSTITUTIONS_remove_kudo = " OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh.socket"
8
9# Declare port spcific conf and service files
10HOST_CONSOLE_TTY = "ttyS1 ttyS3"
11
12CONSOLE_CONF_FMT = "file://server.{0}.conf"
13SRC_URI_append_kudo = " ${@compose_list(d, 'CONSOLE_CONF_FMT', 'HOST_CONSOLE_TTY')}"
14SRC_URI_append_kudo = " file://${BPN}@.service"
15SRC_URI_append_kudo = " file://kudo_uart_mux_ctrl.sh"
16
17SYSTEMD_SERVICE_${PN}_append_kudo = " \
18 ${PN}@.service \
19 "
20
21do_install_append() {
22 for i in ${HOST_CONSOLE_TTY}
23 do
24 install -m 0644 ${WORKDIR}/server.${i}.conf ${D}${sysconfdir}/${BPN}/server.${i}.conf
25 done
26
27 # Deal with files installed by the base package's .bb install function
28 rm -f ${D}${sysconfdir}/${BPN}.conf
29 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
30
31 # Overwrite base package's obmc-console@.service with our own
32 install -m 0644 ${WORKDIR}/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
33 install -d ${D}/usr/sbin
34 install -m 0755 ${WORKDIR}/kudo_uart_mux_ctrl.sh ${D}/${sbindir}/kudo_uart_mux_ctrl.sh
35
36}
37
38pkg_postinst_${PN}_append () {
39 systemctl --root=$D enable obmc-console@ttyS1.service
40 systemctl --root=$D enable obmc-console@ttyS3.service
41}