fwupd: 1.4.6 → 1.5.1

* https://github.com/fwupd/fwupd/releases/tag/1.5.0
* https://github.com/fwupd/fwupd/releases/tag/1.5.1

* The changelog mentions removed dependency on efivar but we still need the package because it also contains efiboot required dependency. https://github.com/fwupd/fwupd/pull/2485
* Blacklist options were renamed.
* Test firmware was moved to a separate repo. We need to install it or some tests will be skipped. https://github.com/fwupd/fwupd/pull/2330
* Initially, there was an option to configure dbx but in the end, it was removed in favour of bespoke dbxtool. https://github.com/fwupd/fwupd/pull/2061, https://github.com/fwupd/fwupd/pull/2318, https://github.com/fwupd/fwupd/pull/2329
* Fwupd now checks hashes of plug-ins and will complain loudly that it is tainted when “invalid” plug-in is loaded (during testing).
* Installed tests complain about not being able to access cdn, even though we are not setting CI_NETWORK env var. We need a patch to fix that.
This commit is contained in:
Jan Tojnar 2020-10-27 07:29:44 +01:00
parent 30b932e46b
commit 3a5ba30c13
5 changed files with 75 additions and 34 deletions

View File

@ -11,8 +11,8 @@ let
"fwupd/daemon.conf" = {
source = pkgs.writeText "daemon.conf" ''
[fwupd]
BlacklistDevices=${lib.concatStringsSep ";" cfg.blacklistDevices}
BlacklistPlugins=${lib.concatStringsSep ";" cfg.blacklistPlugins}
DisabledDevices=${lib.concatStringsSep ";" cfg.disabledDevices}
DisabledPlugins=${lib.concatStringsSep ";" cfg.disabledPlugins}
'';
};
"fwupd/uefi.conf" = {
@ -59,21 +59,21 @@ in {
'';
};
blacklistDevices = mkOption {
disabledDevices = mkOption {
type = types.listOf types.str;
default = [];
example = [ "2082b5e0-7a64-478a-b1b2-e3404fab6dad" ];
description = ''
Allow blacklisting specific devices by their GUID
Allow disabling specific devices by their GUID
'';
};
blacklistPlugins = mkOption {
disabledPlugins = mkOption {
type = types.listOf types.str;
default = [];
example = [ "udev" ];
description = ''
Allow blacklisting specific plugins
Allow disabling specific plugins
'';
};
@ -105,11 +105,15 @@ in {
};
};
imports = [
(mkRenamedOptionModule [ "services" "fwupd" "blacklistDevices"] [ "services" "fwupd" "disabledDevices" ])
(mkRenamedOptionModule [ "services" "fwupd" "blacklistPlugins"] [ "services" "fwupd" "disabledPlugins" ])
];
###### implementation
config = mkIf cfg.enable {
# Disable test related plug-ins implicitly so that users do not have to care about them.
services.fwupd.blacklistPlugins = cfg.package.defaultBlacklistedPlugins;
services.fwupd.disabledPlugins = cfg.package.defaultDisabledPlugins;
environment.systemPackages = [ cfg.package ];

View File

@ -5,7 +5,7 @@ makeInstalledTest {
testConfig = {
services.fwupd.enable = true;
services.fwupd.blacklistPlugins = lib.mkForce []; # don't blacklist test plugin
services.fwupd.disabledPlugins = lib.mkForce []; # don't disable test plugin
services.fwupd.enableTestRemote = true;
virtualisation.memorySize = 768;
};

View File

@ -93,14 +93,11 @@ diff --git a/meson_options.txt b/meson_options.txt
index 3da9b6c4..6c80275b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable
option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
option('systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units')
option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
@@ -1,3 +1,4 @@
+option('sysconfdir_install', type: 'string', value: '', description: 'sysconfdir to use during installation')
option('tests', type : 'boolean', value : true, description : 'enable tests')
option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type')
option('agent', type : 'boolean', value : true, description : 'enable the fwupd agent')
option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support')
diff --git a/plugins/ata/meson.build b/plugins/ata/meson.build
index 8444bb8a..fa4a8ad1 100644
--- a/plugins/ata/meson.build

View File

@ -3,6 +3,7 @@
{ stdenv
, fetchurl
, fetchpatch
, fetchFromGitHub
, substituteAll
, gtk-doc
, pkg-config
@ -88,7 +89,7 @@ let
self = stdenv.mkDerivation rec {
pname = "fwupd";
version = "1.4.6";
version = "1.5.1";
# libfwupd goes to lib
# daemon, plug-ins and libfwupdplugin go to out
@ -97,7 +98,7 @@ let
src = fetchurl {
url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
sha256 = "AKG5stioIveQc7ooYb/2UoOaBzbPUFzYk8tZK0rzvK0=";
sha256 = "0fpxcl6bighiipyl4qspjhi0lwisrgq8jdahm68mk34rmrx50sgf";
};
patches = [
@ -118,6 +119,12 @@ let
# Needs a different set of modules than po/make-images.
inherit installedTestsPython;
})
# Skip tests requiring network.
(fetchpatch {
url = "https://github.com/fwupd/fwupd/commit/db15442c7c217610954786bd40779c14ed0e034b.patch";
sha256 = "/jzpGMJcqLisjecKpSUfA8ZCU53n7BOPR6tMgEX/qL8=";
})
];
nativeBuildInputs = [
@ -229,6 +236,19 @@ let
addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share"
'';
postInstall =
let
testFw = fetchFromGitHub {
owner = "fwupd";
repo = "fwupd-test-firmware";
rev = "42b62c62dc85ecfb8e38099fe5de0625af87a722";
sha256 = "XUpxE003DZSeLJMtyV5UN5CNHH89/nEVKpCbMStm91Q=";
};
in ''
# These files have weird licenses so they are shipped separately.
cp --recursive --dereference "${testFw}/installed-tests/tests" "$installedTests/libexec/installed-tests/fwupd"
'';
preFixup = let
binPath = [
efibootmgr
@ -254,6 +274,8 @@ let
done
'';
separateDebugInfo = true;
passthru = {
filesInstalledToEtc = [
"fwupd/ata.conf"
@ -277,8 +299,8 @@ let
"fwupd/remotes.d/dell-esrt.conf"
];
# BlacklistPlugins key in fwupd/daemon.conf
defaultBlacklistedPlugins = [
# DisabledPlugins key in fwupd/daemon.conf
defaultDisabledPlugins = [
"test"
"invalid"
];
@ -302,9 +324,9 @@ let
config = configparser.RawConfigParser()
config.read('${self}/etc/fwupd/daemon.conf')
package_blacklisted_plugins = config.get('fwupd', 'BlacklistPlugins').rstrip(';').split(';')
passthru_blacklisted_plugins = ${listToPy passthru.defaultBlacklistedPlugins}
assert package_blacklisted_plugins == passthru_blacklisted_plugins, f'Default blacklisted plug-ins in the package {package_blacklisted_plugins} do not match those listed in passthru.defaultBlacklistedPlugins {passthru_blacklisted_plugins}'
package_disabled_plugins = config.get('fwupd', 'DisabledPlugins').rstrip(';').split(';')
passthru_disabled_plugins = ${listToPy passthru.defaultDisabledPlugins}
assert package_disabled_plugins == passthru_disabled_plugins, f'Default disabled plug-ins in the package {package_disabled_plugins} do not match those listed in passthru.defaultDisabledPlugins {passthru_disabled_plugins}'
pathlib.Path(os.getenv('out')).touch()
'';

View File

@ -1,3 +1,5 @@
diff --git a/data/device-tests/hardware.py b/data/device-tests/hardware.py
index 7f1e1907..10fee1b8 100755
--- a/data/device-tests/hardware.py
+++ b/data/device-tests/hardware.py
@@ -1,4 +1,4 @@
@ -6,25 +8,41 @@
# pylint: disable=wrong-import-position,too-many-locals,unused-argument,wrong-import-order
#
# Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
index adadbcdd..1b51bb9c 100644
--- a/data/installed-tests/meson.build
+++ b/data/installed-tests/meson.build
@@ -1,4 +1,4 @@
-installed_test_datadir = join_paths(datadir, 'installed-tests', 'fwupd')
+installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'fwupd')
con2 = configuration_data()
con2.set('installedtestsdir', installed_test_datadir)
@@ -52,5 +52,5 @@ configure_file(
@@ -65,5 +65,5 @@ configure_file(
output : 'fwupd-tests.conf',
configuration : con2,
install: true,
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
)
diff --git a/meson.build b/meson.build
index 772b7bbe..f59302cd 100644
--- a/meson.build
+++ b/meson.build
@@ -177,8 +177,8 @@ else
datadir = join_paths(prefix, get_option('datadir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
localstatedir = join_paths(prefix, get_option('localstatedir'))
- installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
- installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
+ installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
+ installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
endif
mandir = join_paths(prefix, get_option('mandir'))
localedir = join_paths(prefix, get_option('localedir'))
diff --git a/meson_options.txt b/meson_options.txt
index 0a0e2853..5f68d78b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type')
option('agent', type : 'boolean', value : true, description : 'enable the fwupd agent')
option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support')
@@ -25,6 +26,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable
option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemds installation directories on')
option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
+option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
option('tests', type : 'boolean', value : true, description : 'enable tests')
option('tpm', type : 'boolean', value : true, description : 'enable TPM support')
option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')