Upstream pldm-hypervisor services under OEM

 - The intent behind this commit is to create a folder
   for all the pldm services(including the oem services)
   & installs the respective services based on the meson
   configuration.
 - This commit would also remove a redundant systemd dependency
   which was missed in earlier cleanup.

Tested By:
1. meson buiddir -Doem-ibm=enabled/disabled
2. ninja -C builddir
3. ninja install

Post the install step, was able to see the respective systemd
unit files in the systemd_unit_dir (lib/systemd/system)

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I4d9e093be25ac7a8a94bcccc9f8c1e7d3de1c68c
diff --git a/meson.build b/meson.build
index 93ca718..122323a 100644
--- a/meson.build
+++ b/meson.build
@@ -89,18 +89,22 @@
   install: true,
   install_dir: get_option('bindir'))
 
-systemd = dependency('systemd')
 systemd_system_unit_dir = systemd.get_pkgconfig_variable(
     'systemdsystemunitdir',
     define_variable: ['prefix', get_option('prefix')])
+
 configure_file(
   copy: true,
-  input: 'pldmd/pldmd.service',
+  input: 'pldmd/service_files/pldmd.service',
   install: true,
   install_dir: systemd_system_unit_dir,
   output: 'pldmd.service',
 )
 
+if get_option('oem-ibm').enabled()
+  subdir('oem/ibm/service_files')
+endif
+
 subdir('pldmtool')
 
 subdir('configurations')
diff --git a/oem/ibm/service_files/meson.build b/oem/ibm/service_files/meson.build
new file mode 100644
index 0000000..2b3d856
--- /dev/null
+++ b/oem/ibm/service_files/meson.build
@@ -0,0 +1,15 @@
+configure_file(
+  copy: true,
+  input: 'pldm-create-phyp-nvram.service',
+  install: true,
+  install_dir: systemd_system_unit_dir,
+  output: 'pldm-create-phyp-nvram.service',
+)
+  configure_file(
+  copy: true,
+  input: 'pldm-create-phyp-nvram-cksum.service',
+  install: true,
+  install_dir: systemd_system_unit_dir,
+  output: 'pldm-create-phyp-nvram-cksum.service',
+)
+
diff --git a/oem/ibm/service_files/pldm-create-phyp-nvram-cksum.service b/oem/ibm/service_files/pldm-create-phyp-nvram-cksum.service
new file mode 100644
index 0000000..9e0100d
--- /dev/null
+++ b/oem/ibm/service_files/pldm-create-phyp-nvram-cksum.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Create empty PHYP-NVRAM-CKSUM file
+ConditionPathExists=!/var/lib/pldm/PHYP-NVRAM-CKSUM
+
+[Service]
+ExecStart=/bin/mkdir -p /var/lib/pldm/
+ExecStart=/bin/dd if=/dev/zero of=/var/lib/pldm/PHYP-NVRAM-CKSUM bs=16 count=1
+Type=oneshot
+RemainAfterExit=no
+
+[Install]
+WantedBy=pldmd.service
diff --git a/oem/ibm/service_files/pldm-create-phyp-nvram.service b/oem/ibm/service_files/pldm-create-phyp-nvram.service
new file mode 100644
index 0000000..f0d5632
--- /dev/null
+++ b/oem/ibm/service_files/pldm-create-phyp-nvram.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Create empty PHYP-NVRAM file
+ConditionPathExists=!/var/lib/pldm/PHYP-NVRAM
+
+[Service]
+ExecStart=/bin/mkdir -p /var/lib/pldm/
+ExecStart=/bin/dd if=/dev/zero of=/var/lib/pldm/PHYP-NVRAM bs=1024 count=17452
+Type=oneshot
+RemainAfterExit=no
+
+[Install]
+WantedBy=pldmd.service
diff --git a/pldmd/pldmd.service b/pldmd/service_files/pldmd.service
similarity index 100%
rename from pldmd/pldmd.service
rename to pldmd/service_files/pldmd.service