Commit Graph

4304 Commits

Author SHA1 Message Date
Mario Limonciello
3164784d9e dell: fix crashes when enumerating with dock connected but UEFI capsule off
Crashes will happen when UEFI capsule is turned off due to fwupdate
trying to do a SMI request that invalidates the buffer used by fwupd.

This is due to both fwupdate and fwupd using libsmbios in the same process.
Fixes: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1726367
2017-11-07 09:46:36 -06:00
Richard Hughes
d25e2d543a trivial: Add some self tests that use the Atmel Xplained boards in DFU mode
This does mean the tests have to be run as root to work, but they are just
skipped if run as a user.
2017-11-07 12:40:25 +00:00
Richard Hughes
21852821c5 dfu: Add ChipID quirks for various XMEGA parts
This also adds an *almost* throw-away python script to import the chip-ids from
the default conf file from the avrdude project. I've imported it here in case we
have to start caring about different page sizes or application offsets.
2017-11-07 12:40:25 +00:00
Richard Hughes
8517464eac dfu: Use a 24-byte chip ID for XMEGA parts so we match signature values with dfu-programmer 2017-11-07 12:40:25 +00:00
Richard Hughes
d44a5ee56d dfu: Add support for XMEGA chips
Notably, bootloaders for this class of device export an incorrect DFU interface.

Additionally, allow setting the buffer size for the UPLOAD to a larger size
than the defined device transfer size, which allows us to return the full
packet from the larger XMEGA devices.
2017-11-07 12:40:25 +00:00
Richard Hughes
ac9fa21eda dfu: Use a GError chain to properly report parsing failures 2017-11-07 12:40:25 +00:00
Richard Hughes
bdb6d7027a dfu: Allow setting a specific DFU version for hardware
Ignoring the warning is not good enough when we're setting policy based on the
specific version. Use the new quirk functionality to do this easily, which
also allows us to remove one more thing in the quirk mega-bitfield.
2017-11-07 12:40:25 +00:00
Richard Hughes
387017c331 trivial: Don't show (null) in the UI when the DFU status is unknown 2017-11-07 12:40:25 +00:00
Richard Hughes
a1c09e1b16 dfu: Fix a potential divide by zero issue
If page_sz == 0, which is supported, then we try to take the modulus of it
which is undefined behaviour and can cause a division by zero crash.

Found using Coverity.
2017-11-07 09:41:07 +00:00
Richard Hughes
8a0ec158bd dfu: Return failure when getting device status fails 2017-11-06 20:10:26 +00:00
Paul Menzel
8ab2784a1c .github: Add note how to find version before fwupd 0.9.6
Fixes: https://github.com/hughsie/fwupd/issues/300
2017-11-06 14:17:11 +00:00
Richard Hughes
79d08a327b trivial: Use a #define value for signature reads 2017-11-06 12:56:38 +00:00
Paul Menzel
5b1c5084e7 README: Use more secure HTTPS URL for fwupd Web site
```
$ curl -I http://www.fwupd.org
HTTP/1.1 301 Moved Permanently
Date: Mon, 06 Nov 2017 12:25:17 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5
Location: https://fwupd.org/
Content-Type: text/html; charset=iso-8859-1

```

Using the target of the redirect, this also saves one redirect.
2017-11-06 12:29:45 +00:00
Paul Menzel
d1adf460e2 .github: Correct typo in command in issue template
Use `fwupdmgr` over `fwupdgmr`.
2017-11-06 12:18:42 +00:00
Richard Hughes
2ec78d68db Add support for HWID requirements
In the latest version of the LVFS you can restrict the firmware to a specific
machine type, for instance a specific baseboard vendor. This is the same as
done in Microsoft Update using the CHID mechanism.

This commit adds support for the <hardware> requires type, although it needs to
be built against appstream-glib 0.7.4 to be supported and/or tested.
2017-11-03 23:42:57 +00:00
Richard Hughes
674ed347d2 dfu: Use FuQuirk to map the chip ID to the AVR32 UM0424 alt-name 2017-11-02 19:08:51 +00:00
Richard Hughes
adeefcd4e0 dfu: Use FuQuirk to encode the Jabra magic packet contents
This allows us to remove the Jabra-specific quirk entry in the device bitfield,
and more importantly allows us to support some more Jabra devices in the future
without code changes.
2017-11-02 19:08:51 +00:00
Richard Hughes
6a32b92ef8 dfu: Move some code to allow re-use 2017-11-02 19:08:51 +00:00
Richard Hughes
74a80ccc50 dell: Use the new quirk infrastructure for version numbers 2017-11-02 19:08:51 +00:00
Richard Hughes
24c452297d dfu: Use the FuQuirk infrastructure to move the quirks out of the code
This is slightly more verbose than desired as we also have to include the quirk
information when running the dfu-tool, which does not have an already set-up
FuQuirks object as it has no plugin.
2017-11-02 19:08:51 +00:00
Richard Hughes
9c028f06b5 Move the database of supported devices out into runtime loaded files
When fwupd is installed in long-term support distros it's very hard to backport
new versions as new hardware is released.

There are several reasons why we can't just include the mapping and quirk
information in the AppStream metadata:

 * The extra data is hugely specific to the installed fwupd plugin versions
 * The device-id is per-device, and the mapping is usually per-plugin
 * Often the information is needed before the FuDevice is created
 * There are security implications in allowing plugins to handle new devices

The idea with quirks is that the end user can drop an additional (or replace
an existing) file in a .d director with a simple format and the hardware will
magically start working. This assumes no new quirks are required, as this would
obviously need code changes, but allows us to get most existing devices working
in an easy way without the user compiling anything.

This allows us to fix issues like https://github.com/hughsie/fwupd/issues/265
2017-11-02 19:08:51 +00:00
Richard Hughes
78c1e6c009 dfu: Correctly output Intel HEX files with > 16bit offset addresses
Also, fix the checksum to actually produce valid files...
2017-10-31 18:30:05 +00:00
Richard Hughes
6e72343851 dfu: Allow specifying the output file type for 'dfu-tool read'
Guess the file type if it is not explicitly specified.
2017-10-31 18:30:05 +00:00
Richard Hughes
c4e9b08f41 dfu: Remove the CanDownload and CanUpload attribute when required
When the AVR device is not recognised as a supported part we can't read or
write the firmware from the chip.
2017-10-31 18:30:05 +00:00
Richard Hughes
3e1e8227be dfu: Add support for one type of AVR32 device
Currently the only supported model is the AT32UC3A3256S, more to come...
2017-10-31 18:30:05 +00:00
Richard Hughes
d49f64f700 dfu: Split out the STM functionality to a new file 2017-10-31 18:30:05 +00:00
Richard Hughes
fc27df7ceb dfu: Add the ability to dump the raw DFU packets 2017-10-31 18:30:05 +00:00
Richard Hughes
c314b89316 dfu: Add DfuChunked
This allows us to segment a buffer taking into account page borders and maximum
transfer sizes.
2017-10-31 18:30:05 +00:00
Richard Hughes
9acf8cd16f dfu: Set up the DfuTarget when opening the DfuDevice
In the future we'll use this to set vendor-specific quirks.
2017-10-31 18:30:05 +00:00
Richard Hughes
1b577710c5 dfu: Ignore the not-supported error code when opening the DfuDevice
This allows us to fail optional things and still show useful output in:

$ dfu-tool list
2017-10-31 18:30:05 +00:00
Richard Hughes
97520bd583 dfu: Add support for a chip ID
This allows us to show the user something they can include in a bug report.
2017-10-31 18:30:05 +00:00
Richard Hughes
9c0405576b trivial: Add installed tests for the Jabra Speak devices
This makes sure the tests are run on the release-time CI server and prevents
regressions between versions.
2017-10-30 13:37:11 +00:00
Richard Hughes
f3e27065e6 dfu: Support devices with truncated DFU interface data
We can assume they support DFU 1.1. Fixes flashing the Jabra Speak 410.
2017-10-30 13:37:11 +00:00
Richard Hughes
54c7c0cc9f dfu: Only detach the HID interface when updating Jabra devices 2017-10-30 13:37:11 +00:00
Richard Hughes
ac32f71a00 trivial: Remove the GObjectClass padding for private objects 2017-10-28 15:18:35 +01:00
Mario Limonciello
f8451a907e Make the error message clearer when sans fonts are missing (Closes #289) 2017-10-27 11:10:35 -05:00
Mario Limonciello
8b2fbb2664 trivial: debian: debci: shuffle dependency location 2017-10-26 15:44:12 -05:00
Richard Hughes
66513c3b9d dfu: Don't show a debug message when the download timeout is zero 2017-10-26 20:49:10 +01:00
Richard Hughes
181f516114 dfu: Guess the transfer size if it is not specified 2017-10-26 20:49:10 +01:00
Richard Hughes
55d5fb1ab0 dfu: Remove redundant dfu_device_has_dfuse_support() 2017-10-26 20:49:10 +01:00
Richard Hughes
3dd875f975 dfu: Add some utility functions to dfu-common.h 2017-10-26 20:49:10 +01:00
Richard Hughes
3218de03b9 dfu: Add dfu_target_get_sector_default()
This allows us to get the first sector defined for the target.
2017-10-26 20:49:10 +01:00
Richard Hughes
1b1f9d7b6a dfu: Support the IHEX record type 0x05 2017-10-26 08:48:20 +01:00
Mario Limonciello
cc9cfbc74a debian/debci: add explicit dependency on policykit-1 for the test 2017-10-25 09:12:14 -05:00
Mario Limonciello
d00b05959d debian: update standards version 2017-10-24 16:21:35 -05:00
Richard Hughes
3b84753769 Use help2man to generate the man page at build time
The man pages are always old and out-of-sync with the actual tool, so just
generate them using the output of --help.

Fixes https://github.com/hughsie/fwupd/issues/285
2017-10-23 16:47:08 +01:00
Kelly Anderson
c015642803 fix mispelled redesign 2017-10-19 22:35:17 -05:00
Richard Hughes
98a8046d7b trivial: Fix a tiny memory leak when processing signals from the daemon 2017-10-19 17:13:19 +01:00
Mario Limonciello
e1ab2e8818 debian: explicitly depend on umockdev in build depends
The previous problem for umockdev wasn't caught in debian buildds
with umockdev 0.9.4 due to they weren't installing the umockdev
package.
2017-10-19 08:40:08 -05:00
Mario Limonciello
fecfe3b8db thunderbolt: move test for mock environment (Closes #280)
umockdev 0.9.4 changed how to test for running in mock and this
causes the assumptions on mock testing at init to fail.

Move the test for this to after the environment has been set up.
2017-10-19 08:40:08 -05:00