From 12de1b3a387b53e577aef885ea766cd9f2d36238 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Fri, 9 Feb 2024 12:38:29 +0100 Subject: [PATCH] fwupd: 1.9.12 -> 1.9.13 Changelog: https://github.com/fwupd/fwupd/releases/tag/1.9.13 --- nixos/modules/services/hardware/fwupd.nix | 23 ++++++++++--------- nixos/tests/installed-tests/fwupd.nix | 9 ++++---- ...d-option-for-installation-sysconfdir.patch | 2 +- .../fw/fwupd/installed-tests-path.patch | 2 +- pkgs/by-name/fw/fwupd/package.nix | 18 +++------------ 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/nixos/modules/services/hardware/fwupd.nix b/nixos/modules/services/hardware/fwupd.nix index 6fbcbe676460..ebb6fa09aadb 100644 --- a/nixos/modules/services/hardware/fwupd.nix +++ b/nixos/modules/services/hardware/fwupd.nix @@ -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; }; diff --git a/nixos/tests/installed-tests/fwupd.nix b/nixos/tests/installed-tests/fwupd.nix index c095a50dc836..fe4f443d7004 100644 --- a/nixos/tests/installed-tests/fwupd.nix +++ b/nixos/tests/installed-tests/fwupd.nix @@ -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; + }; }; } diff --git a/pkgs/by-name/fw/fwupd/add-option-for-installation-sysconfdir.patch b/pkgs/by-name/fw/fwupd/add-option-for-installation-sysconfdir.patch index 4e95ccea8dc1..062532244d3d 100644 --- a/pkgs/by-name/fw/fwupd/add-option-for-installation-sysconfdir.patch +++ b/pkgs/by-name/fw/fwupd/add-option-for-installation-sysconfdir.patch @@ -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'), ) diff --git a/pkgs/by-name/fw/fwupd/installed-tests-path.patch b/pkgs/by-name/fw/fwupd/installed-tests-path.patch index 2954f89e14c3..6186ca230535 100644 --- a/pkgs/by-name/fw/fwupd/installed-tests-path.patch +++ b/pkgs/by-name/fw/fwupd/installed-tests-path.patch @@ -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 diff --git a/pkgs/by-name/fw/fwupd/package.nix b/pkgs/by-name/fw/fwupd/package.nix index 45b3ed333c6a..532ba9bb2537 100644 --- a/pkgs/by-name/fw/fwupd/package.nix +++ b/pkgs/by-name/fw/fwupd/package.nix @@ -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() ''; };