Andrew Jeffery | 8a9ff14 | 2024-01-04 11:39:18 +1030 | [diff] [blame] | 1 | systemd = dependency('systemd') |
| 2 | systemd_system_unit_dir = systemd.get_variable( |
| 3 | 'systemdsystemunitdir', |
| 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'], |
Thu Nguyen | 255da6b | 2022-07-29 10:05:52 +0700 | [diff] [blame] | 9 | ['intel-cpu', 'xyz.openbmc_project.intelcpusensor.service'], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 10 | ['exit-air', 'xyz.openbmc_project.exitairsensor.service'], |
| 11 | ['fan', 'xyz.openbmc_project.fansensor.service'], |
| 12 | ['hwmon-temp', 'xyz.openbmc_project.hwmontempsensor.service'], |
| 13 | ['ipmb', 'xyz.openbmc_project.ipmbsensor.service'], |
| 14 | ['intrusion', 'xyz.openbmc_project.intrusionsensor.service'], |
Andrew Jeffery | 275f7c3 | 2024-01-31 12:41:14 +1030 | [diff] [blame] | 15 | ['mctp', 'xyz.openbmc_project.mctpreactor.service'], |
Ed Tanous | 49d12d8 | 2021-02-11 13:44:15 -0800 | [diff] [blame] | 16 | ['mcu', 'xyz.openbmc_project.mcutempsensor.service'], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 17 | ['nvme', 'xyz.openbmc_project.nvmesensor.service'], |
Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 18 | ['psu', 'xyz.openbmc_project.psusensor.service'], |
Jeff Lin | a62c069 | 2021-02-18 16:22:14 +0800 | [diff] [blame] | 19 | ['external', 'xyz.openbmc_project.externalsensor.service'], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 20 | ] |
| 21 | |
Andrew Jeffery | 8eb514a | 2024-01-04 10:30:10 +1030 | [diff] [blame] | 22 | fs = import('fs') |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 23 | foreach tuple : unit_files |
Patrick Williams | 5bc307f | 2023-11-29 06:44:23 -0600 | [diff] [blame] | 24 | if get_option(tuple[0]).allowed() |
Andrew Jeffery | 8eb514a | 2024-01-04 10:30:10 +1030 | [diff] [blame] | 25 | fs.copyfile( |
| 26 | tuple[1], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 27 | install: true, |
| 28 | install_dir: systemd_system_unit_dir, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 29 | ) |
| 30 | endif |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 31 | endforeach |