Merge pull request #287512 from r-vdp/fwupd_1_9_13

fwupd: 1.9.12 -> 1.9.13
This commit is contained in:
maxine 2024-02-10 11:05:51 +01:00 committed by GitHub
commit 53f6fedd04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 32 deletions

View File

@ -51,7 +51,9 @@ let
# to install it because it would create a cyclic dependency between
# the outputs. We also need to enable the remote,
# which should not be done by default.
lib.optionalAttrs cfg.enableTestRemote (enableRemote cfg.package.installedTests "fwupd-tests")
lib.optionalAttrs
(cfg.daemonSettings.TestDevices or false)
(enableRemote cfg.package.installedTests "fwupd-tests")
);
in {
@ -86,15 +88,6 @@ in {
'';
};
enableTestRemote = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable test remote. This is used by
[installed tests](https://github.com/fwupd/fwupd/blob/master/data/installed-tests/README.md).
'';
};
package = mkPackageOption pkgs "fwupd" { };
daemonSettings = mkOption {
@ -128,6 +121,15 @@ in {
or if this partition is not mounted at /boot/efi, /boot, or /efi
'';
};
TestDevices = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Create virtual test devices and remote for validating daemon flows.
This is only intended for CI testing and development purposes.
'';
};
};
};
default = {};
@ -159,7 +161,6 @@ in {
config = mkIf cfg.enable {
# Disable test related plug-ins implicitly so that users do not have to care about them.
services.fwupd.daemonSettings = {
DisabledPlugins = cfg.package.defaultDisabledPlugins;
EspLocation = config.boot.loader.efi.efiSysMountPoint;
};

View File

@ -1,11 +1,12 @@
{ pkgs, lib, makeInstalledTest, ... }:
{ pkgs, makeInstalledTest, ... }:
makeInstalledTest {
tested = pkgs.fwupd;
testConfig = {
services.fwupd.enable = true;
services.fwupd.daemonSettings.DisabledPlugins = lib.mkForce [ ]; # don't disable test plugin
services.fwupd.enableTestRemote = true;
services.fwupd = {
enable = true;
daemonSettings.TestDevices = true;
};
};
}

View File

@ -80,7 +80,7 @@ index c20a1a05e..5354bac7f 100644
@@ -56,12 +56,12 @@ configure_file(
output: 'vendor.conf',
configuration: con2,
install: true,
install: get_option('vendor_metadata'),
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
)

View File

@ -6,7 +6,7 @@ index dfce86b1c..5e34c4fa6 100644
output: 'fwupd-tests.conf',
configuration: con2,
install: true,
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
- install_dir: join_paths(datadir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
)
diff --git a/meson.build b/meson.build

View File

@ -11,7 +11,6 @@
, libdrm
, polkit
, libxmlb
, glib
, gusb
, sqlite
, libarchive
@ -121,7 +120,7 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "fwupd";
version = "1.9.12";
version = "1.9.13";
# libfwupd goes to lib
# daemon, plug-ins and libfwupdplugin go to out
@ -132,7 +131,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "fwupd";
repo = "fwupd";
rev = finalAttrs.version;
hash = "sha256-hPRp61m/XTXFacYkBOb4SsG4fcFvWrdMfc+sxLk5/sQ=";
hash = "sha256-h2e9MFTb777xbNRlzKWXc5GUdu/BHSkJTaogEE5byjo=";
};
patches = [
@ -214,6 +213,7 @@ stdenv.mkDerivation (finalAttrs: {
"-Dsysconfdir_install=${placeholder "out"}/etc"
"-Defi_os_dir=nixos"
"-Dplugin_modem_manager=enabled"
"-Dvendor_metadata=true"
# We do not want to place the daemon into lib (cyclic reference)
"--libexecdir=${placeholder "out"}/libexec"
] ++ lib.optionals (!enablePassim) [
@ -341,12 +341,6 @@ stdenv.mkDerivation (finalAttrs: {
"grub.d/35_fwupd"
];
# DisabledPlugins key in fwupd/daemon.conf
defaultDisabledPlugins = [
"test"
"test_ble"
];
# For updating.
inherit test-firmware;
@ -372,12 +366,6 @@ stdenv.mkDerivation (finalAttrs: {
assert len(package_etc - passthru_etc) == 0, f'fwupd package contains the following paths in /etc that are not listed in passthru.filesInstalledToEtc: {package_etc - passthru_etc}'
assert len(passthru_etc - package_etc) == 0, f'fwupd package lists the following paths in passthru.filesInstalledToEtc that are not contained in /etc: {passthru_etc - package_etc}'
config = configparser.RawConfigParser()
config.read('${finalAttrs.finalPackage}/etc/fwupd/fwupd.conf')
package_disabled_plugins = config.get('fwupd', 'DisabledPlugins').rstrip(';').split(';')
passthru_disabled_plugins = ${listToPy finalAttrs.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()
'';
};