Commit Graph

40 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Ivan Mikhanchuk
5e04fae8f2 Add functions to read from and write to FU_PATH_KIND_FIRMWARE_SEARCH 2021-07-13 21:57:08 +01:00
Mario Limonciello
da895169a7 Add a new path for configuring runtime firmware load path
The kernel allows configuring this, and certain plugins will use this
path to be able to load firmware in the kernel driver through runtime,
but to flash to the device.
2021-07-13 21:57:08 +01:00
Richard Hughes
974d63851d Allow calculating the CRC-16 with the CCITT polynomial 2021-07-03 13:49:50 +01:00
Mario Limonciello
d20a95458d libfwupdplugin: add support for firmware-attributes 2021-06-25 08:12:58 -05:00
Mario Limonciello
3a48af58c2 trivial: move kernel version check into common library code
This will be used by more than one plugin in an upcoming commit.
2021-06-16 14:54:17 -05:00
Richard Hughes
e9cc87d740 trivial: Add some more missing GObjectIntrospection markup 2021-05-11 16:55:53 +01:00
Daniel Campello
a4fbe2a6f4 Switch lock directory from /var/run to /run/lock
This allows for proper locking between executions of fwupdtool in
Chromium OS minijail environment. It is needed after commit
9cf5f8f7ff was introduced.

Change-Id: I37b33c8d1fbe97ec9baddc5f77ea94e2f4ff1fa4
2021-05-05 13:34:49 -06: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
Richard Hughes
4d76d18d35 Set the system battery state and level on the FuContext shared state
This allows plugins to set the battery power state of the *machine* which means
we can automatically inhibit devices with FWUPD_DEVICE_FLAG_REQUIRE_AC set.

It also allows to set the BatteryThreshold to 25% for Lenovo hardware, and we
can override other vendors with further quirks as required.

Fixes https://github.com/fwupd/fwupd/issues/3084
2021-04-07 08:05:15 +01:00
Richard Hughes
52441f28a4 Allow objects to deserialize to XML
This makes a lot more sense; we can parse a firmware and export the same XML
we would use in a .builder.xml file. This allows us to two two things:

 * Check we can round trip from XML -> binary -> XML

 * Using a .builder.xml file we can check ->write() is endian safe
2021-03-15 12:07:30 +00:00
Richard Hughes
74db340d93 trivial: Add fu_byte_array_align_up() for future usage 2021-03-11 15:47:13 +00:00
Richard Hughes
58d52ede18 trivial: Add fu_common_align_up() for future usage 2021-03-10 17:06:57 +00:00
Richard Hughes
e9664e8448 trivial: Add fu_byte_array_append_bytes() helper 2021-03-10 14:01:11 +00:00
Richard Hughes
2d84386034 Remove unused, unsafe and deprecated functions from libfwupdplugin
Keeping *internal* API and ABI compatibility makes working with an already
complex codebase more mentally demanding than it needs to be.

Remember: plugins should be in-tree and upstream! If your out of tree plugin
stops working then it should be upstream.

The public-facing libfwupd will remain API and ABI stable for obvious reasons.
2021-03-09 15:47:56 +00:00
Richard Hughes
f2849d24cc Add missing uint64 read and write helpers 2021-03-05 19:34:54 +00:00
Richard Hughes
32ffdb2677 Add helper API to write in a safer way 2021-03-05 09:34:18 +00:00
Richard Hughes
9b11af985f Add fu_memdup_safe()
See https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html
for more details.
2021-02-04 21:01:00 +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
e52e1b49ad trivial: Add fu_common_strjoin_array() to join arrays of strings 2021-01-26 14:25:56 +00:00
Richard Hughes
68175e9ba8 Use a quarter of the RAM size as the archive maximum
It is impossible to choose a static default that is appropriate for both a tiny
ARM IoT device and a giant Xeon server.

Fixes https://github.com/fwupd/fwupd/issues/2760
2021-01-14 22:36:38 +00:00
Richard Hughes
b63cfa90d6 Detect the AMD TSME encryption state for HSI 2021-01-06 16:45:33 +00:00
Richard Hughes
364e2685ca Do not show unprintable chars from invalid firmware in the logs 2021-01-05 15:15:07 +00:00
Richard Hughes
a2abc42760 libfwupdplugin: Use G_GNUC_WARN_UNUSED_RESULT for methods that should be checked 2021-01-04 15:24:35 +00:00
Richard Hughes
05e3377d11 trivial: Add fu_common_bytes_new_offset()
This is a safer version of g_bytes_new_from_bytes() which returns a GError
if the offsets are invalid rather than emitting a critical warning.

This prevents a critical warning and potential crash when parsing invalid
bcm57xx firmware.
2020-12-08 20:54:25 +00:00
Richard Hughes
0bdf561035 Use UDisks to find out if swap devices are encrypted
Using a heuristic is certainly not awesome.
2020-11-02 14:22:37 +00:00
Richard Hughes
a2a8f8ea70 Add fu_byte_array_set_size()
The GLib g_byte_array_set_size() function does not zero the contents if the
array size is larger, which leads to unpredictable output when using valgrind.
2020-10-20 19:54:07 +01:00
Richard Hughes
44ae2a75e4 trivial: Add CRC8 as well 2020-09-25 18:00:21 +01:00
Richard Hughes
6f5e35a3ea Add common CRC routines
We have quite a few versions of CRC in-tree, and are about to get two more...
2020-09-25 17:52:43 +01:00
Richard Hughes
bd1dc2a1e2 pcb-bcr: Use the correct BCR register for Bay Trail CPUs
Fixes https://github.com/fwupd/fwupd/issues/2328
2020-08-20 22:07:05 +01:00
Mario Limonciello
82c3e3471d Remove support for UEFI dbx security attribute
This is no longer relevant as fwupd is providing dbxtool now.
2020-08-19 07:38:51 +01:00
Richard Hughes
361114784b Add a compatible re-implementation of the rhboot dbxtool 2020-08-13 19:09:40 +01:00
Richard Hughes
8f0b2d1708 libfwupdplugin: Add FuVolume to interact with the ESP
This allows us to rip out a lot of legacy code and make interacting with the
ESP possible from more than one plugin.
2020-08-12 18:35:15 +01:00
Richard Hughes
a715791707 Add a new path enum of FU_PATH_KIND_ACPI_TABLES 2020-05-11 17:53:50 +01:00
Richard Hughes
9223c89019 trivial: Add a helper method to check for an Intel CPU
Some plugins will be Intel specific.
2020-05-10 17:49:13 +01:00
Richard Hughes
b9640a28ec uefi-dbx: Add a plugin that analyses the UEFI dbx variable
This will be used for future functionality.
2020-05-07 16:59:36 +01:00
Richard Hughes
a84d7a7e2a trivial: Add fu_common_filename_glob() for future use 2020-05-07 16:59:36 +01:00
Richard Hughes
c368958518 swap: Add a plugin that parses /proc/swaps
This will be used for future functionality.
2020-05-06 15:09:59 +01:00
Mario Limonciello
9dce1f7011 Detect kernel lockdown status
Disable superio when kernel lockdown in effect.
2020-02-04 10:08:25 -06:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00