Use -Doffline=false to reduce the install size by over 100Kb

If there's no SuperIO chip then there's no need to support this.
This commit is contained in:
Richard Hughes 2021-11-12 16:31:12 +00:00
parent e840e9c23b
commit 5f01678daa
9 changed files with 31 additions and 9 deletions

View File

@ -36,6 +36,7 @@ meson .. \
-Dplugin_platform_integrity=false \
-Dplugin_tpm=false \
-Dsystemd=false \
-Doffline=false \
-Dplugin_emmc=false \
-Dplugin_amt=false \
-Dplugin_mtd=false \

View File

@ -16,5 +16,6 @@ meson build \
-Dgcab:docs=false \
-Dconsolekit=false \
-Dsystemd=false \
-Doffline=false \
-Delogind=true
ninja -C build test -v

View File

@ -56,6 +56,7 @@ MESON_ARGS= -Dgudev=false \
-Dplugin_tpm=false \
-Dpolkit=false \
-Dsystemd=false \
-Doffline=false \
-Dtests=false \
-Ddocs=gtkdoc \
-Defi_binary=false

View File

@ -91,13 +91,15 @@ if get_option('systemd') and build_daemon
con2.set('motd_dir', motd_dir)
# replace @bindir@
configure_file(
input : 'fwupd-offline-update.service.in',
output : 'fwupd-offline-update.service',
configuration : con2,
install: true,
install_dir: systemdunitdir,
)
if get_option('offline')
configure_file(
input : 'fwupd-offline-update.service.in',
output : 'fwupd-offline-update.service',
configuration : con2,
install: true,
install_dir: systemdunitdir,
)
endif
# replace @dynamic_options@
configure_file(

View File

@ -289,6 +289,13 @@ endif
if valgrind.found()
conf.set('HAVE_VALGRIND', '1')
endif
if get_option('offline')
if not get_option('systemd')
error('-Doffline=true requires -Dsystemd=true')
endif
conf.set('HAVE_FWUPDOFFLINE', '1')
endif
if build_standalone and get_option('plugin_altos')
libelf = dependency('libelf')

View File

@ -50,3 +50,4 @@ option('efi_binary', type: 'boolean', value : true, description : 'generate uefi
option('metainfo', type: 'boolean', value : true, description : 'install the project metainfo.xml information')
option('bash_completion', type: 'boolean', value : true, description : 'enable bash completion')
option('fish_completion', type: 'boolean', value : true, description : 'enable fish completion')
option('offline', type: 'boolean', value : true, description : 'enable installing firmware using a pre-boot systemd target')

View File

@ -2423,6 +2423,15 @@ fu_engine_schedule_update(FuEngine *self,
g_autoptr(FuHistory) history = NULL;
g_autoptr(GFile) file = NULL;
#ifndef HAVE_FWUPDOFFLINE
/* sanity check */
g_set_error(error,
FWUPD_ERROR,
FWUPD_ERROR_NOT_SUPPORTED,
"Not supported as compiled without offline support");
return FALSE;
#endif
/* id already exists */
history = fu_history_new();
if ((flags & FWUPD_INSTALL_FLAG_FORCE) == 0) {

View File

@ -2877,7 +2877,7 @@ fu_plugin_module_func(gconstpointer user_data)
g_assert_cmpstr(fu_device_get_name(device), ==, "Integrated Webcam™");
g_signal_handlers_disconnect_by_data(self->plugin, &device);
#ifdef _WIN32
#ifndef HAVE_FWUPDOFFLINE
g_test_skip("No offline update support on Windows");
return;
#endif

View File

@ -107,7 +107,7 @@ meson.add_install_script(
join_paths(get_option('prefix'), get_option('bindir'), 'fwupdagent')))
endif
if get_option('systemd')
if get_option('systemd') and get_option('offline')
fwupdoffline = executable(
'fwupdoffline',
sources : [