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