blob: 197eb81c980c98029ecb9802379d5294afa3590a [file] [log] [blame]
Kumar Thangavel651d8c42022-06-07 11:09:49 +05301FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
Patrick Williamsdb126712023-10-24 03:20:31 -05002
3# Disable obmc-console ssh ports.
4PACKAGECONFIG:remove = "ssh"
5
Vijay Khemka84ca3282019-10-11 18:12:40 -07006OBMC_CONSOLE_HOST_TTY = "ttyS2"
Delphine CC Chiu4072bb42023-07-26 13:38:58 +08007OBMC_CONSOLE_TTYS = "${@' '.join(['ttyS{}'.format(i) for i in range(int(d.getVar('OBMC_CONSOLE_INST_CNT', True)) + 1) if 'ttyS{}'.format(i) != d.getVar('OBMC_BMC_TTY', True)])}"
8OBMC_BMC_TTY = "ttyS4"
9
10OBMC_CONSOLE_INST = "${@d.getVar('OBMC_HOST_INSTANCES', True)}"
11OBMC_CONSOLE_INST_CNT = "${@sum([1 for item in d.getVar('OBMC_CONSOLE_INST', True).split() if item.isdigit()])}"
12SERVER_CONFS = "${@' '.join(['file://server.ttyS{}.conf'.format(i) for i in range(int(d.getVar('OBMC_CONSOLE_INST_CNT', True)) + 1) if 'ttyS{}'.format(i) != d.getVar('OBMC_BMC_TTY', True)])}"
Vijay Khemka1de5d0f2020-04-13 13:51:18 -070013
Kumar Thangavel651d8c42022-06-07 11:09:49 +053014SRC_URI:append:fb-compute-singlehost = " file://server.ttyS2.conf"
15
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080016SRC_URI:append:fb-compute-multihost = " ${SERVER_CONFS} \
Kumar Thangavel651d8c42022-06-07 11:09:49 +053017 file://client.2200.conf \
18 file://client.2201.conf \
19 file://client.2202.conf \
20 file://client.2203.conf"
Vijay Khemkaddc2dfd2020-09-24 11:25:17 -070021
Delphine CC Chiua576a592022-12-21 09:25:28 +080022CLIENT_SERVICE_FILES_FMT = "file://${BPN}-{0}-ssh-host@.service \
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080023 file://${BPN}-{0}-ssh-bic@.service"
Delphine CC Chiua576a592022-12-21 09:25:28 +080024
25SRC_URI:append:fb-compute-multihost = " \
26 ${@compose_list(d, 'CLIENT_SERVICE_FILES_FMT', 'OBMC_CONSOLE_TTYS')}"
27
28CLIENT_SERVICE_FMT = "${PN}-{0}-ssh-host@.service \
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080029 ${PN}-{0}-ssh-bic@.service"
Delphine CC Chiua576a592022-12-21 09:25:28 +080030
31SYSTEMD_SERVICE:${PN}:append:fb-compute-multihost = " \
32 ${@compose_list(d, 'CLIENT_SERVICE_FMT', 'OBMC_CONSOLE_TTYS')} \
33 "
34
Patrick Williams6f746642021-08-06 07:40:55 -050035SRC_URI:remove = "file://${BPN}.conf"
Vijay Khemka1de5d0f2020-04-13 13:51:18 -070036
Delphine CC Chiua576a592022-12-21 09:25:28 +080037SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh@.service"
38
Andrew Jeffery08413f22023-04-21 11:45:51 +093039PACKAGECONFIG:append:fb-compute-multihost = " concurrent-servers"
Vijay Khemka923b2482020-04-13 15:46:36 -070040
Patrick Williams6f746642021-08-06 07:40:55 -050041do_install:append() {
Vijay Khemka1de5d0f2020-04-13 13:51:18 -070042 # Install the server configuration
43 install -m 0755 -d ${D}${sysconfdir}/${BPN}
44 install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}/${BPN}/
45 # Remove upstream-provided server configuration
46 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
47}
Delphine CC Chiua576a592022-12-21 09:25:28 +080048
49do_install:append:fb-compute-multihost() {
50 # Implement a script called "select-uart-mux" in project layer and follow the interface below:
51 # Usage: select-uart-mux <slot1|slot2|slot3|slot4> <host|bic>
52 install -m 0644 ${WORKDIR}/${BPN}-*-ssh-bic@.service ${D}${systemd_system_unitdir}
Delphine CC Chiua576a592022-12-21 09:25:28 +080053 install -m 0644 ${WORKDIR}/${BPN}-*-ssh-host@.service ${D}${systemd_system_unitdir}
Delphine CC Chiua576a592022-12-21 09:25:28 +080054
55 rm -rf ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/
56 rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh@.service
Delphine CC Chiua576a592022-12-21 09:25:28 +080057}