Create a new Dbus interface for LED

A new Dbus API method is created in the phosphor-led-sysfs repository
under xyz.openbmc_project.Led.Sysfs.Internal interface name to add or
remove the LED, which will be coming from each udev LED event to
create the LED dbus path.

xyz.openbmc_project.Led.Sysfs.Internal interface
.AddLED                                method
.RemoveLED                             method

This Dbus API method is added to support the multihost physical
LEDs design.
https://gerrit.openbmc.org/c/openbmc/docs/+/55230

Also support a executable for LED DBUS API method

Added a new executable for LED DBUS API method to communicate
between udev and application.

Executable will call Dbus API method to pass LED name as argument from
udev, after the primary service started.

Tested : Tested the dbus method is invoked for each LED udev event
in Facebook YosemiteV2 platform.

Signed-off-by: Jayashree Dhanapal <jayashree-d@hcl.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I3fa6c3caa130b2b71ebc9fe8d69541c029f516ab
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.build b/meson.build
index 840f4ea..34f5c25 100644
--- a/meson.build
+++ b/meson.build
@@ -13,6 +13,7 @@
 sdbusplus_dep = dependency('sdbusplus')
 phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
 boost = dependency('boost', include_type: 'system')
+phosphor_logging_dep = dependency('phosphor-logging')
 
 cxx = meson.get_compiler('cpp')
 if cxx.has_header('CLI/CLI.hpp')
@@ -26,17 +27,27 @@
     sdbusplus_dep,
     phosphor_dbus_interfaces_dep,
     boost,
+    phosphor_logging_dep,
 ]
 
 udevdir = dependency('udev').get_variable('udevdir')
 install_data(['udev' / 'rules.d' / '70-leds.rules'], install_dir : udevdir / 'rules.d')
 
 systemd = dependency('systemd')
-install_data(['systemd' / 'system' / 'xyz.openbmc_project.led.controller@.service'],
-             install_dir: systemd.get_variable('systemdsystemunitdir')
+install_data(['systemd' / 'system' / 'phosphor-ledcontroller.service'],
+             install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
+)
+install_data(['systemd' / 'system' / 'sysfs-led@.service'],
+             install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
+)
+
+dbus = dependency('dbus-1')
+install_data(['dbus-1' / 'system-services' / 'xyz.openbmc_project.LED.Controller.service'],
+             install_dir: dbus.get_variable(pkgconfig: 'system_bus_services_dir')
 )
 
 sources = [
+    'interfaces/internal_interface.cpp',
     'controller.cpp',
     'physical.cpp',
     'sysfs.cpp',
@@ -51,6 +62,17 @@
     install_dir: '/usr/libexec/phosphor-led-sysfs'
 )
 
-if get_option('tests').allowed()
+executable(
+    'add-led-action',
+    'argument.cpp',
+    'add_led_action.cpp',
+    implicit_include_directories: true,
+    dependencies: deps,
+    install: true,
+    install_dir: '/usr/libexec/phosphor-led-sysfs'
+)
+
+build_tests = get_option('tests')
+if build_tests.enabled()
   subdir('test')
 endif