blob: 81c2526c0077eef6cc4124835297abb07aea3ef9 [file] [log] [blame]
Kumar Thangavel651d8c42022-06-07 11:09:49 +05301FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
Patrick Williamsdb126712023-10-24 03:20:31 -05002
Patrick Williams58cf3be2023-10-26 02:38:04 -05003require conf/recipes/fb-consoles.inc
4
Patrick Williamsdb126712023-10-24 03:20:31 -05005# Disable obmc-console ssh ports.
6PACKAGECONFIG:remove = "ssh"
7
Delphine CC Chiu4072bb42023-07-26 13:38:58 +08008OBMC_BMC_TTY = "ttyS4"
Patrick Williams58cf3be2023-10-26 02:38:04 -05009SERVER_CONFS = "${@ ' '.join([ f'file://server.{i}.conf' for i in d.getVar('OBMC_CONSOLE_TTYS', True).split() ])}"
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080010
Patrick Williams58cf3be2023-10-26 02:38:04 -050011SRC_URI:append:fb-compute-singlehost = " ${SERVER_CONFS}"
Kumar Thangavel651d8c42022-06-07 11:09:49 +053012
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080013SRC_URI:append:fb-compute-multihost = " ${SERVER_CONFS} \
Kumar Thangavel651d8c42022-06-07 11:09:49 +053014 file://client.2200.conf \
15 file://client.2201.conf \
16 file://client.2202.conf \
17 file://client.2203.conf"
Vijay Khemkaddc2dfd2020-09-24 11:25:17 -070018
Delphine CC Chiua576a592022-12-21 09:25:28 +080019CLIENT_SERVICE_FILES_FMT = "file://${BPN}-{0}-ssh-host@.service \
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080020 file://${BPN}-{0}-ssh-bic@.service"
Delphine CC Chiua576a592022-12-21 09:25:28 +080021
22SRC_URI:append:fb-compute-multihost = " \
23 ${@compose_list(d, 'CLIENT_SERVICE_FILES_FMT', 'OBMC_CONSOLE_TTYS')}"
24
25CLIENT_SERVICE_FMT = "${PN}-{0}-ssh-host@.service \
Delphine CC Chiu4072bb42023-07-26 13:38:58 +080026 ${PN}-{0}-ssh-bic@.service"
Delphine CC Chiua576a592022-12-21 09:25:28 +080027
28SYSTEMD_SERVICE:${PN}:append:fb-compute-multihost = " \
29 ${@compose_list(d, 'CLIENT_SERVICE_FMT', 'OBMC_CONSOLE_TTYS')} \
30 "
31
Patrick Williams6f746642021-08-06 07:40:55 -050032SRC_URI:remove = "file://${BPN}.conf"
Vijay Khemka1de5d0f2020-04-13 13:51:18 -070033
Delphine CC Chiua576a592022-12-21 09:25:28 +080034SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh@.service"
35
Andrew Jeffery08413f22023-04-21 11:45:51 +093036PACKAGECONFIG:append:fb-compute-multihost = " concurrent-servers"
Vijay Khemka923b2482020-04-13 15:46:36 -070037
Patrick Williams6f746642021-08-06 07:40:55 -050038do_install:append() {
Vijay Khemka1de5d0f2020-04-13 13:51:18 -070039 # Install the server configuration
40 install -m 0755 -d ${D}${sysconfdir}/${BPN}
41 install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}/${BPN}/
42 # Remove upstream-provided server configuration
43 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
44}
Delphine CC Chiua576a592022-12-21 09:25:28 +080045
46do_install:append:fb-compute-multihost() {
47 # Implement a script called "select-uart-mux" in project layer and follow the interface below:
48 # Usage: select-uart-mux <slot1|slot2|slot3|slot4> <host|bic>
49 install -m 0644 ${WORKDIR}/${BPN}-*-ssh-bic@.service ${D}${systemd_system_unitdir}
Delphine CC Chiua576a592022-12-21 09:25:28 +080050 install -m 0644 ${WORKDIR}/${BPN}-*-ssh-host@.service ${D}${systemd_system_unitdir}
Delphine CC Chiua576a592022-12-21 09:25:28 +080051
52 rm -rf ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/
53 rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh@.service
Delphine CC Chiua576a592022-12-21 09:25:28 +080054}