blob: 20bd84adb90a0e1a02d42c1e4007bd638cf62a41 [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'],
Thu Nguyen255da6b2022-07-29 10:05:52 +07009 ['intel-cpu', 'xyz.openbmc_project.intelcpusensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050010 ['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'],
Ed Tanous49d12d82021-02-11 13:44:15 -080015 ['mcu', 'xyz.openbmc_project.mcutempsensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050016 ['nvme', 'xyz.openbmc_project.nvmesensor.service'],
Lei YU3a18b862021-02-05 13:55:08 +080017 ['psu', 'xyz.openbmc_project.psusensor.service'],
Jeff Lina62c0692021-02-18 16:22:14 +080018 ['external', 'xyz.openbmc_project.externalsensor.service'],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050019]
20
Andrew Jeffery8eb514a2024-01-04 10:30:10 +103021fs = import('fs')
Brad Bishopfeb19ef2019-11-07 18:02:16 -050022foreach tuple : unit_files
Patrick Williams5bc307f2023-11-29 06:44:23 -060023 if get_option(tuple[0]).allowed()
Andrew Jeffery8eb514a2024-01-04 10:30:10 +103024 fs.copyfile(
25 tuple[1],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050026 install: true,
27 install_dir: systemd_system_unit_dir,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050028 )
29 endif
Brad Bishopfeb19ef2019-11-07 18:02:16 -050030endforeach