Commit Graph

5443 Commits

Author SHA1 Message Date
Richard Hughes
166c71df38 trivial: Check FuChunk is the correct GObject type 2021-01-29 14:22:20 +00:00
Richard Hughes
c2f7ed335e trivial: Support <filename> as a child of <artifact> too 2021-01-28 20:11:03 +00:00
Richard Hughes
a3f8fc30ac Convert FuChunk from a C structure to an object 2021-01-28 17:41:46 +00:00
Richard Hughes
774b37cd65 trivial: Allow overriding symbol versions where required
If C struct turns to a GObject, we don't always want the _get_type() symbol to
be the same version as the _new() symbol.
2021-01-28 17:41:46 +00:00
Richard Hughes
d99f86023f trivial: Add getters to FuChunk
At the moment FuChunks are sometimes mutable, and sometimes immutable, and it's
all a bit too low level for comfort.

Before we can do any kind of optimisation or verification we need plugins to
stop reading directly from the C structure. The aim here is to make FuChunk
optionally mutable without making assumptions about the memory model, and also
to be able to introspect it for the docs.
2021-01-28 16:42:54 +00:00
Richard Hughes
b856f0bc42 Allow configuring URI scheme preferences
This would allow, for instance, only allowing IPFS downloads or preferring
https over http downloads.
2021-01-28 15:34:36 +00:00
Richard Hughes
200990f3f7 trivial: Show the fwupd_release_to_string() output when verbose 2021-01-28 15:24:45 +00:00
Richard Hughes
5213fa5a4d trivial: Do not fallback if reading from <artifact> 2021-01-28 15:24:30 +00:00
Richard Hughes
c75466751d trivial: Add fu_common_uri_get_scheme() for future use 2021-01-28 15:05:32 +00:00
Richard Hughes
382524d82f trivial: Fix potential crash when doing crazy things
Fix the asan crash when feeding the value back into itself, e.g

    fu_firmware_set_version (firmware, fu_firmware_get_version (firmware));
2021-01-28 14:13:59 +00:00
Richard Hughes
fed68479c0 dfu: Add support for GD32VF103 as found in the Longan Nano
This bootloader is *weird* -- the chip ID is the first two bytes of the serial
number and the data is offset and encoded in UTF-8, not UTF-16.

The sector information is also wrong. Gah!
2021-01-27 16:27:34 +00:00
Richard Hughes
5bb9cf9392 Fix a crash when using fwupdtool
The docs for `fwupd_device_get_children()` make it very clear that only the
parent should be assigned. Also add a warning to `fwupd_device_add_child()`
explaining it is for internal daemon use only.
2021-01-27 15:48:43 +00:00
Richard Hughes
5d534970cb trivial: Show a warning if the child device gets unref'd from the parent
Should not happen, but bugs will be bugs.
2021-01-27 15:48:43 +00:00
Richard Hughes
5d7fb6ad88 uefi-capsule: Check if the fwupd BootXXXX entry exists on failure
Some systems remove the BootXXXX entry we add (so we can run fwupdx64.efi) and
thus the firmware update does not run. Most commonly this failure is seen with
Lenovo systems that call the helpful option 'Boot Order Lock'.

Hopefully when we depend on the new kernel bios interface sysfs API in we can
check in ->prepare(), not after reboot, but until that we can mark the update
failure as transient as the user can actually fix the problem themselves.

Fixes https://github.com/fwupd/fwupd/issues/2801
2021-01-27 14:49:57 +00:00
Richard Hughes
9e2cce9596 trivial: Correctly print PrivateFlags when using --verbose 2021-01-27 10:20:12 +00:00
Richard Hughes
d48e841f77 trivial: Fix up two gtk-doc problems 2021-01-27 09:54:14 +00:00
Richard Hughes
af75522a5e dfu: Show the DfuTargets when calling DfuDevice->to_string()
This is a much more standard way of doing this.
2021-01-27 09:18:44 +00:00
Richard Hughes
da7b898fb5 Coldplug devices when using fwupdtool firmware-dump
Else, we don't find any devices. Doh.
2021-01-26 21:38:00 +00:00
Richard Hughes
e1abefb788 trivial: Use fwupd_client_download_bytes2_async() when installing releases 2021-01-26 20:32:32 +00:00
Richard Hughes
633ff10772 libfwupd: Add fwupd_client_install_release2_async()
We forgot to include FwupdClientDownloadFlags when adding the original method
fwupd_client_install_release() -- and we want to use additional download flags
for operations in the future.
2021-01-26 18:01:33 +00:00
Richard Hughes
ddeceb419f Allow allow downloading from a list of possible URLs 2021-01-26 18:01:09 +00:00
Richard Hughes
b8dfaccce7 libfwupd: Add fwupd_release_add_location()
The metadata might want to pass more than one location URI to the client, for
instance if the file is available from more than one HTTP mirror.

Use the noun of location to match the AppStream <artifact> naming; this is the
last place where LVFS AppStream diverges from the official specification and
it would be good to bring fwupd back into line -- although the LVFS will have
to write both elements for a very long time.

See https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html

Also: we're not changing the format of the `Uri` GVariant key to preserve both
forward and backwards compatibility of the library. We can remove it when we
next break API.
2021-01-26 14:26:06 +00:00
Richard Hughes
8e7a0dce4a trivial: Do not use deprecated symbols internally
This means shuffling things around a little, but no logic changes.
2021-01-26 14:25:56 +00:00
Richard Hughes
e52e1b49ad trivial: Add fu_common_strjoin_array() to join arrays of strings 2021-01-26 14:25:56 +00:00
Mario Limonciello
fcc9dcc0e5 trivial: drop Jared from signing template uploaders 2021-01-25 20:23:47 -06:00
Richard Hughes
b54d69467d Run the child setup when calling the parent device
If we're creating the child device using `Children=FuFooDevice|FOO&I2C_01` in
the quirk file then there's not actually anywhere to call FuDevice->setup()
on the child.

The logical place to do it is when we setup the parent, which is a NOP if
already called for the child. We also don't need to convert the child instance
IDs as it's already being handled during the child setup.

Tested-By: Ricky Wu <ricky_wu@realtek.com>
2021-01-25 18:23:28 +08:00
Đoàn Trần Công Danh
e9adb950b7 esp-list: allow external ESP again
In fwupd 1.5.1 and before, we allowed ESP on external device.
From 56d816a5, (Fall back to FAT32 internal partitions for detecting
ESP, 2020-11-11), we started to only consider internal devices only.

While it would be desirable to only consider internal devices for
fallback esp partition, there're some setup that put ESP on external
device, e.g. full disk encryption with /boot on a USB.

Let's allow external ESP again.
2021-01-24 07:58:15 +00:00
Jeremy Soller
fb3b349f16 system76-launch: Add a plugin for the System76 Launch Configurable Keyboard
This plugin supports reading the keyboard firmware version at runtime and
rebooting the keyboard to USB DFU mode. Tested with firmware uploaded to
embargo-system76.
2021-01-23 20:28:16 +00:00
Mario Limonciello
b543446fda Add a CI test to make sure we can always link to fwupdplugin
Based on a patch from Simon McVittie on
https://salsa.debian.org/efi-team/fwupd/-/merge_requests/4

Suggested-by: Simon McVittie <smcv@debian.org>
2021-01-22 14:01:25 -06:00
Mario Limonciello
e95c1b3bd5 trivial: fwupdplugin: install deprecated header as well 2021-01-22 14:01:25 -06:00
Mario Limonciello
75835b4a0b Use FWUPD_COMPILATION define to indicate an in tree build
When this is done, include:
* Including the hash
* Including anything that is not ABI stable in plugins yet

Suggested-by: Simon McVittie <smcv@debian.org>
2021-01-22 14:01:25 -06:00
Mario Limonciello
1313f23307 trivial: correct includes for fu-plugin.h
Needed for working "out of tree" compilation.
2021-01-22 14:01:25 -06:00
Mario Limonciello
93e53fe6fe trivial: add python3-gi-cairo to lgtm depends 2021-01-22 10:05:05 -06:00
Simon McVittie
4289c1665c trivial: debian: Add trivial compile/link/run test for libfwupd-dev
Tests like these are a surprisingly effective way to detect packaging
mistakes.

Reproduces: #980691, #980684
2021-01-21 09:57:25 -06:00
Simon McVittie
fe36968d5e trivial: debian: d/control.in: Add missing -dev dependencies
Each -dev package needs to depend on all dependencies' -dev packages
that are required when linking against the included library with
pkg-config.

Closes: #980691, #980684
2021-01-21 09:57:14 -06:00
Richard Hughes
8ca69364af dfu: Allow quirking the target transfer size 2021-01-21 09:18:38 +00:00
Richard Hughes
89ee9edc0a Allow going back to the 'default' branch
We only want to translate a NULL branch into 'default' for display, and not
actually store it in the GPtrArray.
2021-01-20 20:19:02 +00:00
Richard Hughes
814a5ee874 trivial: Only offer to switch-branch updatable devices 2021-01-20 20:19:02 +00:00
Mario Limonciello
5791b3df94 trivial: debian: remove ata.conf on upgrade (Closes: #980570) 2021-01-20 14:16:47 -06:00
Richard Hughes
9c1bdf68be trivial: Split off a subpackage for the UX capsule data
This makes the CoreOS image over 1Mb smaller, which is over 30% of the size of
the base fwupd package.
2021-01-20 11:03:20 +00:00
Richard Hughes
11603b3e06 Install the UX data into a single .tar.xz file
This allows much better compression (-60%) than gziping them individually and
also allows us to build the capsule UX images as part of the build stage.

Also add more popular screen resolutions for laptops you can buy in 2021.
2021-01-20 11:03:20 +00:00
Mario Limonciello
ac5d2c5370 trivial: debian: fwupd.postinst: Adjust to read /etc/os-release instead
`/etc/lsb-release` isn't in modern debian installations
2021-01-19 15:47:50 -06:00
Richard Hughes
6101067f03 coreboot: Remove plugin and instead add metadata to flashrom devices
The coreboot plugin never actually gained the ability to write. As it stands a
coreboot system now adds *two* system-firmware devices (from both flashrom and
coreboot) which isn't ideal.

Just allow flashrom to enumerate quirked devices and add coreboot-specific
metadata as required. If we require some kind of cbfs parsing then we can do
that in FuFlashromDevice->prepare_firmware().
2021-01-19 21:32:59 +00:00
Mario Limonciello
5c04b4f4bd trivial: debian: read /etc/lsb-release instead of dpkg-dev (Closes: #977860, #977861, #970783) 2021-01-19 12:47:46 -06:00
Richard Hughes
0155ad6f9b Add the PCR0 to the report metadata
Although we could reconstruct the PCR0 value on the LVFS from the (already
included) event log, it's much more scalable if the client just provides the
data that we want to filter by.
2021-01-19 14:57:48 +00:00
Richard Hughes
a512d91d43 Report the lockdown status from UEFI and SuperIO plugins
I was asked the other day how many machines would support a /dev/mem mmap'd
update mechanism, and I had to say that I didn't know. We use direct port IO in
the SuperIO plugin too, and it would be good to know how quickly we need to
port this to something else.
2021-01-19 14:57:10 +00:00
Richard Hughes
8bafffa5f3 Read the kernel lockdown status at startup 2021-01-19 14:57:10 +00:00
Richard Hughes
9a81d63add pci-bcr: Only mark the device non-updatable if WPD unset and BLE set
It's unusual, but if BIOS lock enable is enabled (so we cannot *change* the
value of BIOSWE) but the BIOS is already WE then we can write to the hardware
just fine.
2021-01-19 14:44:51 +00:00
Richard Hughes
4a19138026 trivial: Use argparse for make-images.py 2021-01-19 11:56:55 +00:00
Richard Hughes
51f7bde2b7 trivial: Move the make-images script to the consumer 2021-01-19 11:56:55 +00:00