Kumar Thangavel | 651d8c4 | 2022-06-07 11:09:49 +0530 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
Patrick Williams | db12671 | 2023-10-24 03:20:31 -0500 | [diff] [blame] | 2 | |
| 3 | # Disable obmc-console ssh ports. |
| 4 | PACKAGECONFIG:remove = "ssh" |
| 5 | |
Vijay Khemka | 84ca328 | 2019-10-11 18:12:40 -0700 | [diff] [blame] | 6 | OBMC_CONSOLE_HOST_TTY = "ttyS2" |
Delphine CC Chiu | 4072bb4 | 2023-07-26 13:38:58 +0800 | [diff] [blame^] | 7 | OBMC_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)])}" |
| 8 | OBMC_BMC_TTY = "ttyS4" |
| 9 | |
| 10 | OBMC_CONSOLE_INST = "${@d.getVar('OBMC_HOST_INSTANCES', True)}" |
| 11 | OBMC_CONSOLE_INST_CNT = "${@sum([1 for item in d.getVar('OBMC_CONSOLE_INST', True).split() if item.isdigit()])}" |
| 12 | SERVER_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 Khemka | 1de5d0f | 2020-04-13 13:51:18 -0700 | [diff] [blame] | 13 | |
Kumar Thangavel | 651d8c4 | 2022-06-07 11:09:49 +0530 | [diff] [blame] | 14 | SRC_URI:append:fb-compute-singlehost = " file://server.ttyS2.conf" |
| 15 | |
Delphine CC Chiu | 4072bb4 | 2023-07-26 13:38:58 +0800 | [diff] [blame^] | 16 | SRC_URI:append:fb-compute-multihost = " ${SERVER_CONFS} \ |
Kumar Thangavel | 651d8c4 | 2022-06-07 11:09:49 +0530 | [diff] [blame] | 17 | file://client.2200.conf \ |
| 18 | file://client.2201.conf \ |
| 19 | file://client.2202.conf \ |
| 20 | file://client.2203.conf" |
Vijay Khemka | ddc2dfd | 2020-09-24 11:25:17 -0700 | [diff] [blame] | 21 | |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 22 | CLIENT_SERVICE_FILES_FMT = "file://${BPN}-{0}-ssh-host@.service \ |
Delphine CC Chiu | 4072bb4 | 2023-07-26 13:38:58 +0800 | [diff] [blame^] | 23 | file://${BPN}-{0}-ssh-bic@.service" |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 24 | |
| 25 | SRC_URI:append:fb-compute-multihost = " \ |
| 26 | ${@compose_list(d, 'CLIENT_SERVICE_FILES_FMT', 'OBMC_CONSOLE_TTYS')}" |
| 27 | |
| 28 | CLIENT_SERVICE_FMT = "${PN}-{0}-ssh-host@.service \ |
Delphine CC Chiu | 4072bb4 | 2023-07-26 13:38:58 +0800 | [diff] [blame^] | 29 | ${PN}-{0}-ssh-bic@.service" |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 30 | |
| 31 | SYSTEMD_SERVICE:${PN}:append:fb-compute-multihost = " \ |
| 32 | ${@compose_list(d, 'CLIENT_SERVICE_FMT', 'OBMC_CONSOLE_TTYS')} \ |
| 33 | " |
| 34 | |
Patrick Williams | 6f74664 | 2021-08-06 07:40:55 -0500 | [diff] [blame] | 35 | SRC_URI:remove = "file://${BPN}.conf" |
Vijay Khemka | 1de5d0f | 2020-04-13 13:51:18 -0700 | [diff] [blame] | 36 | |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 37 | SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh@.service" |
| 38 | |
Andrew Jeffery | 08413f2 | 2023-04-21 11:45:51 +0930 | [diff] [blame] | 39 | PACKAGECONFIG:append:fb-compute-multihost = " concurrent-servers" |
Vijay Khemka | 923b248 | 2020-04-13 15:46:36 -0700 | [diff] [blame] | 40 | |
Patrick Williams | 6f74664 | 2021-08-06 07:40:55 -0500 | [diff] [blame] | 41 | do_install:append() { |
Vijay Khemka | 1de5d0f | 2020-04-13 13:51:18 -0700 | [diff] [blame] | 42 | # 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 Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 48 | |
| 49 | do_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 Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 53 | install -m 0644 ${WORKDIR}/${BPN}-*-ssh-host@.service ${D}${systemd_system_unitdir} |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 54 | |
| 55 | rm -rf ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/ |
| 56 | rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh@.service |
Delphine CC Chiu | a576a59 | 2022-12-21 09:25:28 +0800 | [diff] [blame] | 57 | } |