[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/18] meson: Add U2F key to meson
From: |
Gerd Hoffmann |
Subject: |
[PULL 11/18] meson: Add U2F key to meson |
Date: |
Wed, 26 Aug 2020 16:52:32 +0200 |
From: César Belley <cesar.belley@lse.epita.fr>
Signed-off-by: César Belley <cesar.belley@lse.epita.fr>
Message-id: 20200826114209.28821-8-cesar.belley@lse.epita.fr
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 8 +++++++-
meson_options.txt | 1 +
hw/usb/Kconfig | 5 +++++
hw/usb/meson.build | 7 +++++++
meson.build | 7 +++++++
5 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index b1e11397a827..24137d49d6f4 100755
--- a/configure
+++ b/configure
@@ -495,6 +495,7 @@ trace_file="trace"
spice=""
rbd=""
smartcard=""
+u2f="auto"
libusb=""
usb_redir=""
opengl=""
@@ -1411,6 +1412,10 @@ for opt do
;;
--enable-smartcard) smartcard="yes"
;;
+ --disable-u2f) u2f="disabled"
+ ;;
+ --enable-u2f) u2f="enabled"
+ ;;
--disable-libusb) libusb="no"
;;
--enable-libusb) libusb="yes"
@@ -1940,6 +1945,7 @@ disabled with --disable-FEATURE, default is enabled if
available:
libiscsi iscsi support
libnfs nfs support
smartcard smartcard support (libcacard)
+ u2f U2F support (u2f-emu)
libusb libusb (for usb passthrough)
live-block-migration Block migration in the main migration stream
usb-redir usb network redirection support
@@ -8230,7 +8236,7 @@ NINJA=$PWD/ninjatool $meson setup \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false;
fi) \
-Dsdl=$sdl -Dsdl_image=$sdl_image \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png
\
- -Dgettext=$gettext -Dxkbcommon=$xkbcommon \
+ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\
$cross_arg \
"$PWD" "$source_path"
diff --git a/meson_options.txt b/meson_options.txt
index c55f9cd94cb2..aef2de652332 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,7 @@
option('gettext', type : 'boolean', value : true)
option('sdl', type : 'feature', value : 'auto')
option('sdl_image', type : 'feature', value : 'auto')
+option('u2f', type : 'feature', value : 'auto')
option('vnc', type : 'feature', value : 'enabled')
option('vnc_jpeg', type : 'feature', value : 'auto')
option('vnc_png', type : 'feature', value : 'auto')
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 5e63dc75f815..3fc8fbe3c74c 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -96,6 +96,11 @@ config USB_STORAGE_MTP
default y
depends on USB
+config USB_U2F
+ bool
+ default y
+ depends on USB
+
config IMX_USBPHY
bool
default y
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 3c44a1b06954..a25109b88c91 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -50,6 +50,13 @@ if config_host.has_key('CONFIG_SMARTCARD')
hw_usb_modules += {'smartcard': usbsmartcard_ss}
endif
+# U2F
+softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
+softmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true:
files('u2f-passthru.c'))
+if u2f.found()
+ softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f,
files('u2f-emulated.c')])
+endif
+
# usb redirect
if config_host.has_key('CONFIG_USB_REDIR')
usbredir_ss = ss.source_set()
diff --git a/meson.build b/meson.build
index f0fe5f8799e0..ae90fdbfe306 100644
--- a/meson.build
+++ b/meson.build
@@ -360,6 +360,11 @@ if 'CONFIG_SMARTCARD' in config_host
cacard = declare_dependency(compile_args:
config_host['SMARTCARD_CFLAGS'].split(),
link_args: config_host['SMARTCARD_LIBS'].split())
endif
+u2f = dependency('u2f-emu', required: get_option('u2f'), static: enable_static,
+ include_type: 'system')
+if u2f.found()
+ u2f = declare_dependency(dependencies: u2f)
+endif
usbredir = not_found
if 'CONFIG_USB_REDIR' in config_host
usbredir = declare_dependency(compile_args:
config_host['USB_REDIR_CFLAGS'].split(),
@@ -385,6 +390,7 @@ endif
config_host_data.set('CONFIG_SDL', sdl.found())
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
+config_host_data.set('CONFIG_U2F', u2f.found())
config_host_data.set('CONFIG_VNC', vnc.found())
config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
config_host_data.set('CONFIG_VNC_PNG', png.found())
@@ -1365,6 +1371,7 @@ summary_info += {'spice support':
config_host.has_key('CONFIG_SPICE')}
summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
+summary_info += {'U2F support': u2f.found()}
summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
--
2.27.0
- [PULL 12/18] docs/system: Add U2F key to the USB devices examples, (continued)
- [PULL 12/18] docs/system: Add U2F key to the USB devices examples, Gerd Hoffmann, 2020/08/26
- [PULL 01/18] hw: xhci: check return value of 'usb_packet_map', Gerd Hoffmann, 2020/08/26
- [PULL 08/18] hw/usb: Add U2F key base class implementation, Gerd Hoffmann, 2020/08/26
- [PULL 13/18] docs/qdev-device-use.txt: Add USB U2F key to the QDEV devices examples, Gerd Hoffmann, 2020/08/26
- [PULL 06/18] docs: Add USB U2F key device documentation, Gerd Hoffmann, 2020/08/26
- [PULL 09/18] hw/usb: Add U2F key passthru mode, Gerd Hoffmann, 2020/08/26
- [PULL 10/18] hw/usb: Add U2F key emulated mode, Gerd Hoffmann, 2020/08/26
- [PULL 18/18] usb: fix setup_len init (CVE-2020-14364), Gerd Hoffmann, 2020/08/26
- [PULL 17/18] usb-host: workaround libusb bug, Gerd Hoffmann, 2020/08/26
- [PULL 14/18] scripts: Add u2f-setup-gen script, Gerd Hoffmann, 2020/08/26
- [PULL 11/18] meson: Add U2F key to meson,
Gerd Hoffmann <=
- [PULL 07/18] hw/usb: Add U2F key base class, Gerd Hoffmann, 2020/08/26
- [PULL 15/18] hw/usb: Add U2F device check to passthru mode, Gerd Hoffmann, 2020/08/26
- [PULL 16/18] hw/usb: Add U2F device autoscan to passthru mode, Gerd Hoffmann, 2020/08/26
- Re: [PULL 00/18] Usb 20200826 patches, Peter Maydell, 2020/08/26