Commit Graph

111 Commits

Author SHA1 Message Date
Richard Hughes
c6afb51e32 Add a FirmwareBaseURI parameter to the remote configs
This allows somebody to mirror the CDN without resigning the metadata files.

Fixes: https://github.com/hughsie/fwupd/issues/186
2017-08-23 14:22:12 +01:00
Richard Hughes
0dea1efb92 Use MetadataURI for both kinds of remote
I think this is clearer having one key for both types of remote.
2017-08-23 14:22:08 +01:00
Richard Hughes
d067ed675e Add a configure switch for the LVFS remotes
On embedded devices these are not required.
2017-08-22 10:37:26 +01:00
Richard Hughes
38c1685c92 Do not install the PKCS7 certificate if installed with -Denable-pkcs7=false 2017-08-21 14:48:58 +01:00
Richard Hughes
f03f386c68 trivial: Add a test for firmware signed with a derivative of the LVFS key
This also switches around the test for the self signed key to now fail, as the
generated certificate is no longer loaded into the trust list. This is a more
useful test as it more accurately represents what the fwupd daemon is doing.

As a side-note the detached signature from the derivate cannot be generated
using `--no-p7-include-cert` as only the main LVFS-CA certificate is shipped
with fwupd.
2017-08-18 12:11:59 +01:00
Richard Hughes
7ce6c93bf5 Install the LVFS PKCS7 certificate
This allows LVFS instances signed by the master key to distribute metadata and
firmware without using GPG and instead using PKCS7 certificates.
2017-08-18 11:10:15 +01:00
Richard Hughes
14047d7d24 trivial: Split up the keyring setup and public key adding 2017-08-18 11:10:03 +01:00
Richard Hughes
f69a4810fa Return the authority and timestamp as part of the signing validation
This means we return an error when encountering a rollback attack. This can
currently be performed by providing the old metadata and old signature when
calling into UpdateMetadata.
2017-08-17 16:15:47 +01:00
Mario Limonciello
38d7f13976 Allow configuring systemd and udev directories (Fixes: #176) 2017-08-16 17:02:32 -05:00
Richard Hughes
7403dc505f Optionally use GnuTLS to verify PKCS7 certificates
We can use this as an alternative for GPG. No PKCS7 certificates are currently
installed by fwupd and it's expected that the LVFS will still only provide GPG
detached signatures.

If an OEM distributor wants to sign firmware with a PKCS7 and the corresponding
certificate is provided then the firmware will be marked as valid.

Only firmware shipping with a .p7b file will use the PKCS7 functionality,
similarly remote metadata validation will default to GPG unless Keyring=pkcs7
is specified in the config file.
2017-08-14 09:42:48 +01:00
Richard Hughes
049ccc8f6c Add a helper function to spawn a subprocess
This allows us to watch the output of a flashing tool and screen-scrape the
progress completion.
2017-08-09 15:35:58 +01:00
Richard Hughes
41cbe2aab3 Add a firmware builder
This runs a script inside the firmware archive to generate firmware specific to
the machine. This uses bubblewrap to protect the local machine.
2017-08-09 10:33:39 +01:00
Richard Hughes
2d95a71a0c Support embedded devices with local firmware metadata
In this mode, both the metadata and firmware is stored on the local filesystem
and distributed using a distribution system like OSTree.

Fixes https://github.com/hughsie/fwupd/issues/162
2017-07-28 17:41:24 +01:00
Richard Hughes
3745e8e481 trivial: Fix spelling of delimiter 2017-07-18 10:20:59 +01:00
Mario Limonciello
ef2079b20a trivial: clarify delimitter in use for fwupd.conf is a semicolon 2017-07-17 14:50:17 -05:00
Mario Limonciello
5033d9c92e Add capability to enable test suite via /etc/fwupd.conf 2017-07-17 14:45:51 -05:00
Richard Hughes
55e0207b96 trivial: Add installed firmware tests for the K780 2017-07-03 20:17:43 +01:00
Richard Hughes
c4195b075d trivial: Add an installed test for the K780 2017-06-28 12:05:32 +01:00
Richard Hughes
433fbb4574 trivial: Do not cache junk if the LVFS returns 404 2017-06-28 12:05:32 +01:00
Mario Limonciello
cca4297153 trivial: Switch installedtests from python2 to python3 2017-06-22 13:42:59 -05:00
Richard Hughes
25f6a42f26 trivial: Fix the location of the hardware installed test cache 2017-06-22 19:03:52 +01:00
Richard Hughes
62e7393edf Add some installed tests which require specific hardware 2017-06-22 09:36:32 +01:00
Richard Hughes
71e73ca048 trivial: Fix the installed tests
We ony want to replace the fake LVFS metadata with the real data after we've
downgraded the dummy device.
2017-06-16 17:21:17 +01:00
Richard Hughes
0a87f6fb03 Store the metadata files rather than merging to one store
Now we have multiple remotes that can be enabled or changed at runtime we need
to do several things better:

* Only load components from remotes that are enabled

* Only load a component if a higher priority remote has not already added it

Rather than just appending all recieved metadata into one big XML file, save
the original metadata .xml.gz files in /var/lib/fwupd/remotes.d and only load
them in the correct priority order if the remote is known and enabled.

Remove the old /var/cache/app-info/xmls/fwupd.xml file, also noting it wasn't
really a cache file at all but actually something quite important.
2017-06-16 16:43:13 +01:00
Richard Hughes
f0bde3e4af Add a get-remotes command to fwupdmgr
This allows the user to show the configured remotes.
2017-06-16 14:31:20 +01:00
Richard Hughes
a71e0a71f6 Allow ordering the metadata remotes
This allows us to load one metadata source file before or after another.
2017-06-16 12:40:24 +01:00
Richard Hughes
bbde1df44f Fix downgrades when version_lowest is set
Also, add some tests to test this with the dummy device.
2017-06-16 12:40:15 +01:00
Richard Hughes
8a870d0399 trivial: Ensure there are no updates after the update is applied 2017-06-16 12:40:10 +01:00
Richard Hughes
b7bf715435 Add an installed test for device update
This also moves the tests into one file as gnome-desktop-testing-runner
intentionally randomizes the order and runs them in parallel where allowed.
Since tests like get-updates have to be run after the metadata injection simply
put these into one test that calls a simple script.
2017-06-15 20:19:03 +01:00
Richard Hughes
ae7e0d21b2 Add an installed test for verification 2017-06-15 16:23:52 +01:00
Richard Hughes
038ab7dcb2 Add an AppStream metainfo file
This seems like the right thing to do, and also means we *could* move the NEWS
data in the future.
2017-06-15 12:53:33 +01:00
Richard Hughes
bacbac1245 Add some installed tests that use the daemon
Functionality like this would have prevented the "(shh)" bug being included in
the last release.
2017-06-14 15:36:08 +01:00
Richard Hughes
ad9b22480a trivial: Fix missing test files
Resolves: https://github.com/hughsie/fwupd/issues/129
2017-06-07 17:08:49 +01:00
Richard Hughes
dfed515573 Allow downloading metadata from more than just the LVFS
Add the concept of 'remotes' that can dropped into /etc and used as firmware
metadata sources. This may be desirable when firmware is only accessable with
a valid support contract or from behind a VPN.
2017-06-02 13:19:05 +01:00
Eric Koegel
23603f0452 Add support for ConsoleKit2
Make systemd and ConsoleKit support an optional compile time flag
with both enabled by default. If both are used, the ifdef/elif will
ensure only the systemd calls are used so there's no conflict.
2017-06-01 09:00:16 +01:00
Richard Hughes
2d8a7958b2 trivial: Get the pkg-config variables rather than hardcoding 2017-04-19 14:51:59 +01:00
Richard Hughes
a9a99bdb48 Actually use /usr/libexec/fwupd/fwupd
It appears the enormity of replacing a directory with a file is just too much
for package managers in 2017.

I guess we might ship other things in /usr/libexec/fwupd/ in the future.
2017-04-19 08:50:52 +01:00
Mario Limonciello
ff8a02f9f9 trivial: Do not use the prefix for localstatedir
Signed-off-by: Richard Hughes <richard@hughsie.com>
2017-04-19 08:41:09 +01:00
Richard Hughes
05ede65e24 Add a config option to allow runtime disabling plugins by name
See https://github.com/hughsie/fwupd/issues/110
2017-04-16 09:11:39 +01:00
Richard Hughes
1fdb335025 Remove the automake build system 2017-04-13 18:42:08 +01:00
Richard Hughes
c388002b72 trivial: Fix under-dep issue with 'ninja test' 2017-04-12 18:08:49 +01:00
Richard Hughes
57746cb839 Add the Meson build system as an alternate to autotools
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.

See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
f41d3956a8 trivial: Fix the ExecStart path
This fixes a regression from a1585c6b7f.
2017-04-12 16:34:45 +01:00
Richard Hughes
a1585c6b7f Install the daemon in libexecdir
I know Debian doesn't use libexecdir, but most other distros do. On Fedora it's
really strange to see a binary in /usr/libexec/fwupd/fwupd and supporting this
not-quite-servicedir is causing confusion in the Makefiles and also problems in
other external tools.

Simply redefine libexecdir if you need the daemon binary to be installed
somewhere different.
2017-04-12 14:38:34 +01:00
Mario Limonciello
332415d378 trivial: make /boot/efi an optional ReadWritePath (#97) 2017-02-28 08:24:40 -06:00
Shea Levy
345a7b7f3d Only try to mkdir the localstatedir if we have the right permissions (#96) 2017-02-27 20:41:58 -06:00
Mario Limonciello
5b6103ce97 trivial: allow configuring ESP location (#94) 2017-02-27 10:39:50 -06:00
Mario Limonciello
ec7f3ab02e trivial: install /var/lib/fwupd in make install (#94) 2017-02-27 10:36:50 -06:00
Richard Hughes
6c898739c9 Really remove the NoNewPrivileges systemd confinement
Even with the other changes this is still required for me on Fedora 25.
2017-02-24 10:56:39 +00:00
Mario Limonciello
20c112a891 Adjust systemd confinement restrictions
commit 99b317d4f7 introduced much
more strict confinement. This actually caused some regressions
though.

commit 3c54edb15e tried to fix
one of the problems, but didn't cover the rest.

The actual changes:
- Drop PrivateUsers=yes
  This is causing crashes when initializing libsmbios
  Presumably it's related to accessing memory.
- Add back in NoNewPrivileges
  This hasn't caused any crashes for libsmbios for me.
- Remove ProtectKernelTunables
  This is needed to access /sys for the dcdbas kernel
  module used by libsmbios.  Calls fail without it
- Add ReadWritePaths=/var/lib/fwupd /boot/efi
  The refresh function was failing the first time due to
  ProtectSystem=full being in effect and /var/lib/fwupd
  being read only
  Flashing UEFI capsules was failing due to being unable
  to write to /boot/efi/EFI/$(EFIDIR)/fw/
2017-02-23 15:13:24 -06:00