blob: b08aab399ee88fc4f1728519b8d580a69aca473b [file] [log] [blame]
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -05001FILESEXTRAPATHS:prepend:kudo := "${THISDIR}/${PN}:"
2RDEPENDS:${PN}:append:kudo = " bash"
Lancelot Kaodc456f92021-02-21 18:42:38 -06003
4# Remove what installed by common recipe
5OBMC_CONSOLE_HOST_TTY = ""
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -05006SYSTEMD_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"
Lancelot Kaodc456f92021-02-21 18:42:38 -06008
9# Declare port spcific conf and service files
10HOST_CONSOLE_TTY = "ttyS1 ttyS3"
11
12CONSOLE_CONF_FMT = "file://server.{0}.conf"
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050013SRC_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"
Lancelot Kaodc456f92021-02-21 18:42:38 -060016
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050017SYSTEMD_SERVICE:${PN}:append:kudo = " \
Lancelot Kaodc456f92021-02-21 18:42:38 -060018 ${PN}@.service \
19 "
20
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050021do_install:append() {
Lancelot Kaodc456f92021-02-21 18:42:38 -060022 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
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050038pkg_postinst:${PN}:append () {
Lancelot Kaodc456f92021-02-21 18:42:38 -060039 systemctl --root=$D enable obmc-console@ttyS1.service
40 systemctl --root=$D enable obmc-console@ttyS3.service
41}