obmc-console-ssh: Add feature behind an option flag
Allow us to disable obmc-console-ssh if it is not needed. Default to be
enabled so there are no functional changes.
Change-Id: I3c83a3102626c5a511cae14c18ed284af6078edd
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/meson.build b/meson.build
index 8a570a1..e1fc5f0 100644
--- a/meson.build
+++ b/meson.build
@@ -15,11 +15,9 @@
systemdsystemunitdir = dependency('systemd').get_variable('systemdsystemunitdir')
install_data('conf/obmc-console@.service.in',
'conf/obmc-console@.socket.in',
- 'conf/obmc-console-ssh@.service.in',
rename: [
'obmc-console@.service',
'obmc-console@.socket',
- 'obmc-console-ssh@.service'
],
install_dir: systemdsystemunitdir,
)
@@ -29,12 +27,21 @@
rename: [ 'client.2200.conf' ],
install_dir: systemdsystemunitdir)
else
- install_data('conf/obmc-console-ssh.socket.in',
- rename: [ 'obmc-console-ssh.socket' ],
- install_dir: systemdsystemunitdir)
- install_data('conf/obmc-console-ssh@.service.d/use-socket.conf.in',
- rename: [ 'use-socket.conf' ],
- install_dir: systemdsystemunitdir / 'obmc-console-ssh@.service.d')
+ if get_option('ssh').allowed()
+ install_data('conf/obmc-console-ssh@.service.in',
+ rename: [
+ 'obmc-console-ssh@.service'
+ ],
+ install_dir: systemdsystemunitdir,
+ )
+
+ install_data('conf/obmc-console-ssh.socket.in',
+ rename: [ 'obmc-console-ssh.socket' ],
+ install_dir: systemdsystemunitdir)
+ install_data('conf/obmc-console-ssh@.service.d/use-socket.conf.in',
+ rename: [ 'use-socket.conf' ],
+ install_dir: systemdsystemunitdir / 'obmc-console-ssh@.service.d')
+ endif
endif
udev = dependency('udev', required: get_option('udev'))
diff --git a/meson_options.txt b/meson_options.txt
index 5ebc9f4..838b5ef 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
option('udev', type: 'feature', description: 'Install console udev rules')
option('concurrent-servers', type: 'boolean', value: 'false', description: 'Support multiple concurrent obmc-console instances')
+option('ssh', type: 'feature', description: 'Support obmc-console-ssh and obmc-console-ssh-socket')
option('tests', type: 'boolean', description: 'Enable the test suite')