Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fwupd: Fix daemon config not being found #48427

Closed
wants to merge 1 commit into from

Conversation

infinisil
Copy link
Member

Motivation for this change

Fixes #48425
Fix by @dtzWill mentioned in #47057

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@@ -46,6 +46,11 @@ in stdenv.mkDerivation {

patchShebangs .
substituteInPlace data/installed-tests/fwupdmgr.test.in --subst-var-by installedtestsdir "$installedTests/share/installed-tests/fwupd"

# /etc/daemon.conf
substituteInPlace meson.build --replace \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use a patch file instead? It will be more clear when the pattern no longer matches.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also just realized that there's a patch touching the config file already:

-install_data(['daemon.conf'],
- install_dir : join_paths(sysconfdir, 'fwupd')
-)
-
install_data(['org.freedesktop.fwupd.metainfo.xml'],

I'll investigate further later

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: fwupd

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/x279l2i7j004sqk94lpkpv32rsjzkrg6-fwupd-1.1.1-installedTests
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/x279l2i7j004sqk94lpkpv32rsjzkrg6-fwupd-1.1.1-installedTests
checking for references to /build in /nix/store/x279l2i7j004sqk94lpkpv32rsjzkrg6-fwupd-1.1.1-installedTests...
Wrapping program /nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1/bin/fwupdmgr
Wrapping program /nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1/bin/dfu-tool
Wrapping program /nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1/libexec/fwupd/fwupd
Wrapping program /nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1/libexec/fwupd/fwupdate
Wrapping program /nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1/libexec/fwupd/fwupdtool
/nix/store/1x7m5bwdjld3brv09qqmwx4a50ca5w33-fwupd-1.1.1

@jtojnar
Copy link
Contributor

jtojnar commented Oct 15, 2018

Something like this ought to do it:

diff --git a/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch b/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
index 1cd9eb0e8f1..212f30147c2 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
@@ -1,89 +1,49 @@
+diff --git a/data/builder/meson.build b/data/builder/meson.build
+index c7a430c0..e69de29b 100644
 --- a/data/builder/meson.build
 +++ b/data/builder/meson.build
 @@ -1,3 +0,0 @@
 -install_data('README.md',
 -  install_dir : join_paths(localstatedir, 'lib', 'fwupd', 'builder')
 -)
---- a/data/meson.build
-+++ b/data/meson.build
-@@ -8,16 +8,12 @@
-   subdir('installed-tests')
- endif
+diff --git a/meson.build b/meson.build
+index 96d752ae..fc5cb4dd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -294,11 +294,17 @@
  
--install_data(['daemon.conf'],
--  install_dir : join_paths(sysconfdir, 'fwupd')
--)
--
- install_data(['org.freedesktop.fwupd.metainfo.xml'],
-   install_dir: join_paths(datadir, 'metainfo')
- )
- 
- install_data(['org.freedesktop.fwupd.conf'],
--  install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d')
-+  install_dir : join_paths(get_option('prefix'), 'etc', 'dbus-1', 'system.d')
- )
+ plugin_dir = join_paths(libdir, 'fwupd-plugins-3')
  
- install_data(['metadata.xml'],
---- a/data/pki/meson.build
-+++ b/data/pki/meson.build
-@@ -4,14 +4,14 @@
-       'GPG-KEY-Linux-Foundation-Firmware',
-       'GPG-KEY-Linux-Vendor-Firmware-Service',
-     ],
--    install_dir : join_paths(sysconfdir, 'pki', 'fwupd')
-+    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd')
-   )
++default_sysconfdir = get_option('sysconfdir')
++if default_sysconfdir == 'etc'
++  message('sysconfdir of etc makes no sense, using /etc')
++  default_sysconfdir = '/etc'
++endif
++
+ conf.set_quoted('BINDIR', bindir)
+ conf.set_quoted('LIBEXECDIR', libexecdir)
+ conf.set_quoted('DATADIR', datadir)
+ conf.set_quoted('LOCALSTATEDIR', localstatedir)
+-conf.set_quoted('SYSCONFDIR', sysconfdir)
++conf.set_quoted('SYSCONFDIR', default_sysconfdir)
+ conf.set_quoted('PLUGINDIR', plugin_dir)
  
-   install_data([
-       'GPG-KEY-Linux-Foundation-Metadata',
-       'GPG-KEY-Linux-Vendor-Firmware-Service',
-     ],
--    install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata')
-+    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata')
-   )
- endif
- 
-@@ -19,12 +19,12 @@
-   install_data([
-       'LVFS-CA.pem',
-     ],
--    install_dir : join_paths(sysconfdir, 'pki', 'fwupd')
-+    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd')
-   )
-   install_data([
-       'LVFS-CA.pem',
-     ],
--    install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata')
-+    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata')
-   )
- endif
- 
---- a/data/remotes.d/meson.build
-+++ b/data/remotes.d/meson.build
-@@ -3,7 +3,7 @@
-       'lvfs.conf',
-       'lvfs-testing.conf',
-     ],
--    install_dir : join_paths(sysconfdir, 'fwupd', 'remotes.d')
-+    install_dir : join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d')
-   )
-   i18n.merge_file(
-     input: 'lvfs.metainfo.xml',
-@@ -37,12 +37,12 @@
-   output : 'fwupd.conf',
-   configuration : con2,
-   install: true,
--  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
-+  install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'),
- )
- configure_file(
-   input : 'vendor.conf',
-   output : 'vendor.conf',
-   configuration : con2,
-   install: true,
--  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
-+  install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'),
+ conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+@@ -310,12 +316,6 @@
+   configuration : conf
  )
+ 
+-default_sysconfdir = get_option('sysconfdir')
+-if default_sysconfdir == 'etc'
+-  message('sysconfdir of etc makes no sense, using /etc')
+-  default_sysconfdir = '/etc'
+-endif
+-
+ plugin_deps = []
+ plugin_deps += appstream_glib
+ plugin_deps += gio
+diff --git a/meson_post_install.sh b/meson_post_install.sh
+index 0cbb6f41..d757a81a 100755
 --- a/meson_post_install.sh
 +++ b/meson_post_install.sh
 @@ -11,6 +11,4 @@

@infinisil
Copy link
Member Author

@jtojnar Um, could you please send the file directly instead of a diff of it (or commit it directly)? I can't apply it because git apply/patch isn't happy with it being a diff of a diff :P

@jtojnar
Copy link
Contributor

jtojnar commented Oct 15, 2018

I do not see how would that be a problem, only the first character on each line should be considered. Try applying it to unstable.

@infinisil
Copy link
Member Author

@jtojnar Ah yeah it worked, I just needed patch pkgs/os-specific/firmware/fwupd/fix-paths.patch the.patch

I'll test this PR again this evening (by just running the fwupd service).

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: fwupd

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests
checking for references to /build in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests...
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/bin/fwupdmgr
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/bin/dfu-tool
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupdate
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupd
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupdtool
/nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2

@jtojnar

This comment has been minimized.

@jtojnar
Copy link
Contributor

jtojnar commented Oct 15, 2018

Could you add a comment with link to next to the patch? fwupd/fwupd#800

@@ -36,6 +36,7 @@ in stdenv.mkDerivation {
LC_ALL = "en_US.UTF-8"; # For po/make-images

patches = [
# https://github.com/hughsie/fwupd/issues/800
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtojnar Like this?

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: fwupd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: fwupd

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests
checking for references to /build in /nix/store/lnnc6i16pa7m518n7bikfpsdawvn2kpw-fwupd-1.1.2-installedTests...
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/bin/dfu-tool
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/bin/fwupdmgr
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupdate
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupd
Wrapping program /nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2/libexec/fwupd/fwupdtool
/nix/store/5xx6009rzc21zbkag47ysrgrc6y2iyq2-fwupd-1.1.2

@jtojnar
Copy link
Contributor

jtojnar commented Oct 30, 2018

New patch (probably will not apply to release): fwupd/fwupd#824

@jtojnar
Copy link
Contributor

jtojnar commented Nov 30, 2018

Closing in favour of #48519

@jtojnar jtojnar closed this Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants