1systemd = dependency('systemd') 2systemd_system_unit_dir = systemd.get_variable( 3 'systemdsystemunitdir', 4 pkgconfig_define: ['prefix', get_option('prefix')], 5) 6 7unit_files = [ 8 ['adc', 'xyz.openbmc_project.adcsensor.service'], 9 ['intel-cpu', 'xyz.openbmc_project.intelcpusensor.service'], 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'], 15 ['mcu', 'xyz.openbmc_project.mcutempsensor.service'], 16 ['nvme', 'xyz.openbmc_project.nvmesensor.service'], 17 ['psu', 'xyz.openbmc_project.psusensor.service'], 18 ['external', 'xyz.openbmc_project.externalsensor.service'], 19] 20 21fs = import('fs') 22foreach tuple : unit_files 23 if get_option(tuple[0]).allowed() 24 fs.copyfile( 25 tuple[1], 26 install: true, 27 install_dir: systemd_system_unit_dir, 28 ) 29 endif 30endforeach 31