Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend:kudo := "${THISDIR}/${PN}:" |
| 2 | RDEPENDS:${PN}:append:kudo = " bash" |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 3 | |
| 4 | # Remove what installed by common recipe |
| 5 | OBMC_CONSOLE_HOST_TTY = "" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 6 | SYSTEMD_SUBSTITUTIONS:remove:kudo = " OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh@.service" |
| 7 | SYSTEMD_SUBSTITUTIONS:remove:kudo = " OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh.socket" |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 8 | |
| 9 | # Declare port spcific conf and service files |
| 10 | HOST_CONSOLE_TTY = "ttyS1 ttyS3" |
| 11 | |
| 12 | CONSOLE_CONF_FMT = "file://server.{0}.conf" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 13 | SRC_URI:append:kudo = " ${@compose_list(d, 'CONSOLE_CONF_FMT', 'HOST_CONSOLE_TTY')}" |
| 14 | SRC_URI:append:kudo = " file://${BPN}@.service" |
| 15 | SRC_URI:append:kudo = " file://kudo_uart_mux_ctrl.sh" |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 16 | |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 17 | SYSTEMD_SERVICE:${PN}:append:kudo = " \ |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 18 | ${PN}@.service \ |
| 19 | " |
| 20 | |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 21 | do_install:append() { |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 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 | |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 38 | pkg_postinst:${PN}:append () { |
Lancelot Kao | dc456f9 | 2021-02-21 18:42:38 -0600 | [diff] [blame] | 39 | systemctl --root=$D enable obmc-console@ttyS1.service |
| 40 | systemctl --root=$D enable obmc-console@ttyS3.service |
| 41 | } |