blob: baac30fb41fcd3abb6ff5fe54e270aff4f28f1e9 [file] [log] [blame]
Andrew Jeffery8a9ff142024-01-04 11:39:18 +10301systemd = dependency('systemd')
2systemd_system_unit_dir = systemd.get_variable(
3 'systemdsystemunitdir',
4 pkgconfig_define: ['prefix', get_option('prefix')],
5)
6
Brad Bishopfeb19ef2019-11-07 18:02:16 -05007unit_files = [
8 ['adc', 'xyz.openbmc_project.adcsensor.service'],
Jagpal Singh Gillca8c7e92024-11-02 16:51:48 -07009 ['cable-monitor', 'xyz.openbmc_project.cablemonitor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050010 ['exit-air', 'xyz.openbmc_project.exitairsensor.service'],
Ed Tanous1bb4df02025-05-27 11:03:30 -070011 ['external', 'xyz.openbmc_project.externalsensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050012 ['fan', 'xyz.openbmc_project.fansensor.service'],
13 ['hwmon-temp', 'xyz.openbmc_project.hwmontempsensor.service'],
Ed Tanous1bb4df02025-05-27 11:03:30 -070014 ['intel-cpu', 'xyz.openbmc_project.intelcpusensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050015 ['intrusion', 'xyz.openbmc_project.intrusionsensor.service'],
Ed Tanous1bb4df02025-05-27 11:03:30 -070016 ['ipmb', 'xyz.openbmc_project.ipmbsensor.service'],
17 ['leakdetector', 'xyz.openbmc_project.leakdetector.service'],
Andrew Jeffery275f7c32024-01-31 12:41:14 +103018 ['mctp', 'xyz.openbmc_project.mctpreactor.service'],
Ed Tanous49d12d82021-02-11 13:44:15 -080019 ['mcu', 'xyz.openbmc_project.mcutempsensor.service'],
Deepak Kodihalli78ecfc42025-05-09 20:50:36 +053020 ['nvidia-gpu', 'xyz.openbmc_project.nvidiagpusensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050021 ['nvme', 'xyz.openbmc_project.nvmesensor.service'],
Lei YU3a18b862021-02-05 13:55:08 +080022 ['psu', 'xyz.openbmc_project.psusensor.service'],
Aushim Nagarkatti021261c2024-12-12 10:12:16 -080023 ['smbpbi', 'xyz.openbmc_project.smbpbisensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050024]
25
Andrew Jeffery8eb514a2024-01-04 10:30:10 +103026fs = import('fs')
Brad Bishopfeb19ef2019-11-07 18:02:16 -050027foreach tuple : unit_files
Patrick Williams5bc307f2023-11-29 06:44:23 -060028 if get_option(tuple[0]).allowed()
Andrew Jeffery8eb514a2024-01-04 10:30:10 +103029 fs.copyfile(
30 tuple[1],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050031 install: true,
32 install_dir: systemd_system_unit_dir,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050033 )
34 endif
Brad Bishopfeb19ef2019-11-07 18:02:16 -050035endforeach