Make snoop port optional for the daemon
- In the current state, the daemon only works on the bmc
systems that has the snooping port enabled, but for IBM
systems, we communicate the progress codes aka post codes
via pldm.
- In addition to the host, we also have couple of bmc
applications that can post these codes during the early
boot sequence.
- The intent behind this commit is to make the snooping port
argument optional for the snooping service, so that the
daemon can still host the raw interface & the Raw value
property for pldm to write into, even when the snooping
device is not present.
- This commit would try to address the following mailing list
proposal.
https://lore.kernel.org/openbmc/4795347F-477D-45EF-A145-0C7B163FE01B@getmailspring.com/
TestedBy:
- meson builddir
- ninja -C builddir
- copy the snoopd daemon into a witherspoon system and make sure
it hosts the dbus interface.
- meson builddir
- ninja -C builddir -Dsnoop-device=/dev/aspeed-lpc-snoop0
- copy the snoopd daemon into witherspoon and it fails to start
beacause it could not find the snoop port.
root@witherspoon:/tmp# Unable to open: /dev/aspeed-lpc-snoop0
[1]+ Done(255) ./snoopd
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I941897a7aea795f418494087ac8aa1fbc6ecf633
diff --git a/meson.build b/meson.build
index 8bda862..8e659ed 100644
--- a/meson.build
+++ b/meson.build
@@ -21,10 +21,14 @@
conf_data = configuration_data()
conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
-conf_data.set('SNOOP_DEVICE', get_option('snoop-device'))
-conf_data.set('POST_CODE_BYTES', get_option('post-code-bytes'))
conf_data.set('SYSTEMD_TARGET', get_option('systemd-target'))
+snoopd_args = '-b ' + get_option('post-code-bytes').to_string()
+if get_option('snoop-device') != ''
+ snoopd_args += ' -d /dev/' + get_option('snoop-device')
+endif
+conf_data.set('SNOOPD_ARGS', snoopd_args)
+
configure_file(
input: 'lpcsnoop.service.in',
output: 'lpcsnoop.service',