debug-trigger: Do what we can to debug unresponsive systems
debug-trigger is a small daemon which translates an external signal that
the system is unresponsive into a system crash for debug data
collection.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ic04f1a95aaf651d56b75f5261d8a6f76d34477a7
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e60bd8b
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,29 @@
+project('debug-trigger', 'c', license: 'Apache-2.0', version: '0.1')
+executable('debug-trigger', 'main.c', install: true)
+
+if get_option('systemd')
+ systemd = dependency('systemd')
+ unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ configure_file(input: 'systemd/system/debug-trigger@.service',
+ output: 'debug-trigger@.service',
+ copy: true,
+ install_dir: unitdir)
+endif
+
+udev = dependency('udev')
+udevdir = udev.get_pkgconfig_variable('udevdir')
+udevrules = [
+ 'p10bmc-debug-trigger-kcs1',
+ 'p10bmc-debug-trigger-kcs2',
+ 'p10bmc-debug-trigger-kcs3',
+ 'p10bmc-debug-trigger-kcs4',
+]
+
+foreach rule : udevrules
+ if get_option(rule)
+ src = 'udev/rules.d/' + rule + '.rules'
+ dst = rule + '.rules'
+ rulesdir = udevdir + '/rules.d'
+ configure_file(input: src, output: dst, copy: true, install_dir: rulesdir)
+ endif
+endforeach