| Andrew Jeffery | 8a9ff14 | 2024-01-04 11:39:18 +1030 | [diff] [blame] | 1 | systemd = dependency('systemd') | 
 | 2 | systemd_system_unit_dir = systemd.get_variable( | 
| Patrick Williams | a499a16 | 2025-07-09 11:27:02 -0400 | [diff] [blame] | 3 |     'systemd_system_unit_dir', | 
| Andrew Jeffery | 8a9ff14 | 2024-01-04 11:39:18 +1030 | [diff] [blame] | 4 |     pkgconfig_define: ['prefix', get_option('prefix')], | 
 | 5 | ) | 
 | 6 |  | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 7 | unit_files = [ | 
 | 8 |     ['adc', 'xyz.openbmc_project.adcsensor.service'], | 
| Jagpal Singh Gill | ca8c7e9 | 2024-11-02 16:51:48 -0700 | [diff] [blame] | 9 |     ['cable-monitor', 'xyz.openbmc_project.cablemonitor.service'], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 10 |     ['exit-air', 'xyz.openbmc_project.exitairsensor.service'], | 
| Ed Tanous | 1bb4df0 | 2025-05-27 11:03:30 -0700 | [diff] [blame] | 11 |     ['external', 'xyz.openbmc_project.externalsensor.service'], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 12 |     ['fan', 'xyz.openbmc_project.fansensor.service'], | 
 | 13 |     ['hwmon-temp', 'xyz.openbmc_project.hwmontempsensor.service'], | 
| Ed Tanous | 1bb4df0 | 2025-05-27 11:03:30 -0700 | [diff] [blame] | 14 |     ['intel-cpu', 'xyz.openbmc_project.intelcpusensor.service'], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 15 |     ['intrusion', 'xyz.openbmc_project.intrusionsensor.service'], | 
| Ed Tanous | 1bb4df0 | 2025-05-27 11:03:30 -0700 | [diff] [blame] | 16 |     ['ipmb', 'xyz.openbmc_project.ipmbsensor.service'], | 
 | 17 |     ['leakdetector', 'xyz.openbmc_project.leakdetector.service'], | 
| Andrew Jeffery | 275f7c3 | 2024-01-31 12:41:14 +1030 | [diff] [blame] | 18 |     ['mctp', 'xyz.openbmc_project.mctpreactor.service'], | 
| Ed Tanous | 49d12d8 | 2021-02-11 13:44:15 -0800 | [diff] [blame] | 19 |     ['mcu', 'xyz.openbmc_project.mcutempsensor.service'], | 
| Deepak Kodihalli | 78ecfc4 | 2025-05-09 20:50:36 +0530 | [diff] [blame] | 20 |     ['nvidia-gpu', 'xyz.openbmc_project.nvidiagpusensor.service'], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 21 |     ['nvme', 'xyz.openbmc_project.nvmesensor.service'], | 
| Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 22 |     ['psu', 'xyz.openbmc_project.psusensor.service'], | 
| Aushim Nagarkatti | 021261c | 2024-12-12 10:12:16 -0800 | [diff] [blame] | 23 |     ['smbpbi', 'xyz.openbmc_project.smbpbisensor.service'], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 24 | ] | 
 | 25 |  | 
| Andrew Jeffery | 8eb514a | 2024-01-04 10:30:10 +1030 | [diff] [blame] | 26 | fs = import('fs') | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 27 | foreach tuple : unit_files | 
| Patrick Williams | 5bc307f | 2023-11-29 06:44:23 -0600 | [diff] [blame] | 28 |     if get_option(tuple[0]).allowed() | 
| Andrew Jeffery | 8eb514a | 2024-01-04 10:30:10 +1030 | [diff] [blame] | 29 |         fs.copyfile( | 
 | 30 |             tuple[1], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 31 |             install: true, | 
 | 32 |             install_dir: systemd_system_unit_dir, | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 33 |         ) | 
 | 34 |     endif | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 35 | endforeach |