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: split daemon again #79371

Merged
merged 2 commits into from Feb 6, 2020
Merged

fwupd: split daemon again #79371

merged 2 commits into from Feb 6, 2020

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Feb 6, 2020

In 1.3.5, fwupdprivate library was made into a shared fwupdplugin library. This library is considered semi-private and is used by fwupd daemon and fwupd plug-ins and now possibly third party plug-ins.

The fwupdplugin library refers to the plug-in directory in fwupd.out causing a dependency cycle. For that reason we need to move it to out.

  • tests.fwupd succeeded.
  • Rebuilt system with this.
    • Daemon starts
      • no weird journal entries
    • fwupdmgr get-devices prints devices

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 6, 2020

Looks like we need to disable the invalid plug-in.

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 6, 2020

Marked as a blocker because I forgot to disable the invalid plug-in in the previous PR.

# We do not want to place the daemon into lib
"--libexecdir=${placeholder "out"}/libexec"
# Our builder only adds $lib/lib into rpath
"-Dc_link_args=-Wl,-rpath,${placeholder "out"}/lib"
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything else I think I understand here, but would you mind explaining this for me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Nix does not have /usr/lib, every library a program depends on must have path for finding it listed in DT_RUNPATH entry in the ELF file. Our generic builder populates the entry for us but apparently only with lib outputs. Because the libfwupdplugin is in out its location is not included so we need to add it manually.

I believe the builder adds every /lib directory to entry of every[citation needed] ELF file but superfluous paths (those not containing libraries listed in DT_NEEDED entries) are stripped by[citation needed] strip setup-hook so there is no cycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I improved the comments slightly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks a lot 👍 All clear here.

In 1.3.5, fwupdprivate library was made into a shared fwupdplugin library.
This library is considered semi-private and is used by fwupd daemon and
fwupd plug-ins and now possibly third party plug-ins.

The fwupdplugin library refers to the plug-in directory in fwupd.out
causing a dependency cycle. For that reason we need to move it to out.
invalid test was introduced in fwupd/fwupd@297d159
and it is disabled in the shipped daemon.conf.

I forgot to reflect that in the module, which caused the daemon to print the following on start-up:

    FuEngine             invalid has incorrect built version invalid

and the command to warn:

    WARNING: The daemon has loaded 3rd party code and is no longer supported by the upstream developers!

To reduce the change of this happening in the future, I moved the list of default disabled plug-ins to the package expression.

I also set the value of the NixOS module option in the config section of the module instead of the default value used previously,
which will allow users to not care about these plug-ins.
@worldofpeace
Copy link
Contributor

worldofpeace commented Feb 6, 2020

@GrahamcOfBorg test installed-tests.fwupd

@jtojnar jtojnar merged commit 07281f2 into NixOS:master Feb 6, 2020
@jtojnar jtojnar deleted the hughsie-pkgs branch February 6, 2020 23:35
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Feb 7, 2020
fwupd: split daemon again
(cherry picked from commit 07281f2)
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

2 participants