OpenPOWER: Clear system and resource dump entries while powering off

The dumps like system and resource dumps are stored in host memory
and that will be lost during a power off, so the entries in BMC
dump-manager for those dumps will be stale after a power off.
This commit adds a service to call deleteAll to clear the entries
for system and resource dumps during system power off.

Tests:
   1 - Created a resource dump and system dump
       and activated the service
       Result: Both dump entries are cleared

   2 - Created a resource dump and system dump
       powered off the system
       Result: Both dump entries are cleared

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I4e6a59ae852c86f5edbab767fb6a0ff2a4635289
diff --git a/meson.build b/meson.build
index d7b5714..3566a89 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,11 @@
 
 cpp = meson.get_compiler('cpp')
 
+# list of unit files, the path as input and service name
+# as output
+# eg: unit_file += {'input:'<path>, 'output':<service name>}
+unit_files = []
+
 # Checking dependency external library
 
 libsystemd = dependency('libsystemd', version : '>=221')
@@ -251,6 +256,21 @@
                        )
 endforeach
 
+unit_subs = configuration_data()
+unit_subs.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
+systemd_system_unit_dir = dependency('systemd').get_pkgconfig_variable(
+    'systemdsystemunitdir',
+    define_variable: ['prefix', get_option('prefix')])
+foreach u : unit_files
+    configure_file(
+        configuration: unit_subs,
+        input: u.get('input'),
+        install: true,
+        install_dir: systemd_system_unit_dir,
+        output: u.get('output')
+    )
+endforeach
+
 if get_option('tests').enabled()
   subdir('test')
 endif