Commit Graph

5517 Commits

Author SHA1 Message Date
Richard Hughes
d83d0243e0 trivial: Hard limit the fuzz duration to 20 minutes 2021-04-15 16:19:32 +01:00
Daniel Campello
ff51287628 REVERT: flashrom/lspcon: avoid parsing sysfs paths
Reverts 53c61754b3

https://review.coreboot.org/c/flashrom/+/51967 has not landed yet nor
the equivalent change in Chromium OS flashrom fork. This revert fixes
the breakage until that happens.
2021-04-15 08:21:09 -06:00
Richard Hughes
1eec68e2c6 Cancel the GDBusObjectManager operation to fix a potential crash
If blues takes longer than 1500ms to successfully start, then we will call
fu_bluez_backend_connect_cb() with a freed FuBluezBackendHelper.

Hopefully fixes https://bugzilla.redhat.com/show_bug.cgi?id=1949491
2021-04-15 08:35:40 +01:00
Richard Hughes
9cf5f8f7ff Use an OFD lock to prevent more than one fwupdtool process
Fixes https://github.com/fwupd/fwupd/issues/3019
2021-04-15 08:34:55 +01:00
Peter Marheine
53c61754b3 flashrom/lspcon: avoid parsing sysfs paths
sysfs paths don't have strong guarantees about semantics, so attempting
to parse an I2C bus number out of a sysfs path of some device is likely
to be fragile. Instead take advantage of the device layout to find the
I2C bus an LSPCON is on without trying to parse it out of paths.

The bus the device is on is a sibling device of type i2c-dev, so by
locating an i2c-dev device that is a sibling of the detected LSPCON
device, the /dev path of the bus can be found robustly.

Support for specifying an I2C bus by path rather than number is also
required in flashrom, implemented at
https://review.coreboot.org/c/flashrom/+/51967

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2021-04-15 06:53:06 +01:00
Peter Marheine
da9a07ba8f FuUdevDevice: add get_siblings_with_subsystem function
This function returns a list of sibling devices that have a chosen subsystem,
allowing callers to perform a limited walk of the device tree to locate related
devices.
2021-04-15 06:53:06 +01:00
Richard Hughes
a8167d2389 Never allow D-Bus replacement when a firmware update is in operation
Mostly theoretical, although certainly possible when developing...
2021-04-14 20:02:56 +01:00
Daniel Campello
3426d5788c flashrom: lspcon-i2c-spi: add reload method
Re-read the flag and version flash regions after an update to get the
new device status.
2021-04-14 12:09:11 -06:00
Daniel Campello
9f77608ef7 trivial: flashrom: verify write to flag region
Disable verification on sub-block-size write was not needed after all.
2021-04-14 06:51:51 +01:00
Ross Burton
57961cddac Add option to disable the UEFI capsule splash screen generation
The dependencies to generate the "updating..." splash screen are non-trivial, and
pointless in headless systems.  Add an option to disable the generation entirely.
2021-04-13 12:31:17 +01:00
Ross Burton
db09147679 Don't check for native dependencies as target dependencies
Don't look for cairo, fontconfig, and freetype libraries as this will
look for *target* libraries. The presence of these libraries is used as
a proxy for the gobject-introspection libraries being available for
the make-images.py script, but as this runs at build time we don't care
about target libraries at all.

Luckily there's another script, test-deps.py, which looks for the g-i
libraries so these dependencies can be removed.
2021-04-13 12:31:17 +01:00
Ross Burton
4e6cb21aaf trivial: Remove unused readelf dep
readelf isn't used by anything, so there's no need to look for it.
2021-04-13 12:31:17 +01:00
Analogix
b518c536c7
analogic: Fix various trivial problems to enable successful device update
* Changed CUSTOM Define firmware size. 
* Extended time for transferring data time out.

Co-authored-by: xtcui <xtcui@analogix.corp-partner.google.com>
2021-04-13 08:39:18 +01:00
Richard Hughes
ec3542c1dc Mark the Lenovo VL103 no-power USB-C dongle as dual-image
This fixes flashing when in normal runtime mode.

Resolves https://github.com/fwupd/fwupd/issues/2940
2021-04-13 07:01:40 +01:00
Richard Hughes
7dac6198e7 wacom-raw: Fix a possible crash if the user set WacomI2cFlashBlockSize > 128
Spotted by Coverity, thanks!
2021-04-12 12:48:36 +01:00
Richard Hughes
690607e590 intel-spi: Fix compile error when errno is not available 2021-04-12 12:48:36 +01:00
xtcui
0f7f7f2cb5 Add support for some Analogix hardware
With much help from:

 * Ricardo Cañuelo <ricardo.canuelo@collabora.com>
 * Richard Hughes <richard@hughsie.com>
2021-04-12 11:00:54 +01:00
Richard Hughes
848fb2c57f trivial: Add back help2man for arch as it uses the subproject libjcat 2021-04-12 09:55:44 +01:00
Richard Hughes
be1d77bc7c Add fu_ihex_firmware_set_padding_value() for the analogix plugin 2021-04-12 09:55:44 +01:00
Richard Hughes
45493b06d8 trivial: Fix a small memory leak in the new FuContext code
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33155
2021-04-11 19:01:33 +01:00
Richard Hughes
c4bc709359 Do not use help2man to build manual pages
This prevents problems when cross compiling. Using help2man is now also of
limited use; if we can just tell the user to use --help we do not need to keep
the manual in sync.

It also allows us to drop the several other supporting files that we use when
the help2man output isn't actually that useful.

Fixes https://github.com/fwupd/fwupd/issues/3025
2021-04-11 13:42:04 +01:00
Richard Hughes
ede384068f Add more things to the precommit list 2021-04-11 08:09:56 +01:00
Richard Hughes
7f6f525f21 Add fu_bytes_get_data_safe() to check for zero sized data
Fixes https://github.com/fwupd/fwupd/issues/3122
2021-04-10 13:20:07 +01:00
Mario Limonciello
0a0753d6cd trivial: pre-commit: check XML for trailing whitespace too
I almost committed something with trailing whitespace :)
2021-04-09 11:15:27 -05:00
Mario Limonciello
d0c6c4b323 trivial: install shellcheck from dependencies.xml 2021-04-09 11:15:27 -05:00
Mario Limonciello
c6bbe4507a trivial: remove some trailing whitespace from docs 2021-04-09 11:15:27 -05:00
Mario Limonciello
681be2a0ed trivial: restore python3-pil build dependency for Ubuntu
Commit 13524af202 broke the ABI checker.
This is because it runs on the last released version, which still has
a dependency on python3-pil.

This commit can be dropped after the 1.6.x release.
2021-04-09 11:15:27 -05:00
Mario Limonciello
ab20cfb35b trivial: ci: don't run no-commit-to-branch during merges 2021-04-09 10:21:29 -05:00
Mario Limonciello
0b80c872b3 trivial: move all pre-commit checks into dedicated CI job
This one should launch faster than Fedora, and should fail all the jobs
way sooner.
2021-04-09 16:02:20 +01:00
Mario Limonciello
bb9390d45c trivial: Add pre-commit hooks for style 2021-04-09 16:02:20 +01:00
Mario Limonciello
1079f08b85 trivial: Add me to maintainers 2021-04-09 16:02:20 +01:00
Mario Limonciello
1ed118d22f trivial: fixup black on a few more python files without python extensions 2021-04-09 16:02:20 +01:00
Mario Limonciello
433034d675 trivial: correct example vscode launch json parsing 2021-04-09 16:02:20 +01:00
Mario Limonciello
61ef63addc trivial: correct parsing of sample flashrom xml file 2021-04-09 16:02:20 +01:00
Mario Limonciello
9bca3bf53c trivial: correct docstring location for a few python files 2021-04-09 16:02:20 +01:00
Mario Limonciello
563d24954b trivial: fix a shellcheck failure 2021-04-09 16:02:20 +01:00
Mario Limonciello
1f9c035788 trivial: fix some trailing whitespace problems across the project 2021-04-09 16:02:20 +01:00
Richard Hughes
13524af202 Write BMP data directly without using PIL
This allows us to drop a build-time dep.
2021-04-09 15:59:51 +01:00
Daniel Campello
4483f609f1 flashrom: lspcon-i2c-spi: add write_firmware
Added firmware flash logic.
2021-04-08 18:12:16 -06:00
Daniel Campello
314b94b41f flashrom: lspcon-i2c-spi: read active_partion and version
Reads the active_partition and firmware version from active_partition
2021-04-08 18:12:16 -06:00
Daniel Campello
fe073a304d flashrom: add lspcon-i2c-spi programmer support
Created lspcon-i2c-spi flashrom device that uses udev to detect i2c
devices that can be updated with the lspcon-i2c-spi flashrom programmer.

This change implements the logic from crrev.com/c/2792124 adapted to the
upstream flashrom plugin.
2021-04-08 18:12:16 -06:00
Daniel Campello
0b9b7ecc84 fu-engine: only disable coldplug if no HwId is found
This change only disables coldplug instead of the whole plugin if no
HwId is found when FWUPD_PLUGIN_FLAG_NO_HARDWARE is set.
2021-04-08 18:12:16 -06:00
Daniel Campello
08236d839d flashrom: make fu-flashrom-device derive from fu-udev-device
This change allows the flashrom plugin to probe for udev devices.
2021-04-08 18:12:16 -06:00
Mario Limonciello
7064ec0227 trivial: ci: use black to check all python code in CI 2021-04-08 10:43:29 -05:00
Mario Limonciello
6d1afc3e87 trivial: reformat all python code with black 2021-04-08 10:43:29 -05:00
Richard Hughes
b5555003bb Detect files with CRLF line endings
Mixing Unix-style and Windows-style line endings causes some of our tools
heartache. Just standardize on the former.
2021-04-08 15:55:36 +01:00
Daniel Campello
f37dcd4fab flashrom: make fu-flashrom-device a derivable type
This change allows other device types to derive from common flashrom
code in the flashrom-device type.

Change-Id: Ic963fd586e0a73153c54889fce50055753a1bf5c
2021-04-08 15:40:41 +01:00
Emily Miller
d216fb8d45 vli: fix bizlink json tests 2021-04-08 10:48:26 +01:00
Richard Hughes
50af03a507 trivial: Set HP battery threshold to 50% 2021-04-08 10:03:24 +01:00
Richard Hughes
b1da502318 trivial: Set Star Labs battery threshold to 30% 2021-04-07 13:50:33 +01:00