Commit Graph

150 Commits

Author SHA1 Message Date
Richard Hughes
058dc2301a Include the plugin README text in the generated docs 2023-01-10 14:58:30 +00:00
Sean Rhodes
d83007e1c8
plugins/flashrom: Allow 32MiB images for the StarBook Mk VI (#5383)
Also allow 32MiB images for the coreboot firmware

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2023-01-06 10:12:36 +00:00
Sean Rhodes
b20737fe4a plugins/flashrom: Allow 32MiB images for the StarBook Mk VI
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2023-01-05 14:57:58 +00:00
Josh Soref
67deecde31
Lots of spelling fixes
Fixes:

* activate
* active
* additional
* and
* approaches
* attestation
* bootloader
* calculate
* capability
* children
* close
* compatible
* continuous
* convenience
* critical
* data
* delivery
* disabled
* disambiguate
* documented
* elapse
* emergency
* erasable
* expectations
* filesystem
* from
* haptic
* ignorable
* images
* infinity
* information
* information
* inhibited
* insufficient
* interrupt
* into
* limited
* management
* manifest
* maximum
* memory
* metadata
* mismatch
* model
* nonexistent
* not
* objects
* offset
* omissions
* ota
* past
* perform
* peripherals
* predictable
* product
* quarterly
* quirk
* quirks
* recognize
* release
* requests
* revocation
* sanitized
* sector
* status
* the
* the update
* timeout
* transfer
* transfers
* typically
* unspecified
* upgrade
* which
* will
* wireless
2022-12-29 13:57:31 +00:00
Richard Hughes
c79e14d63d Flip around the FuDeviceInstanceFlags logic
Opt-ing 'in' to each both behaviours requires less mental gymnastics compared
to having one flag inverted.
2022-11-04 13:44:23 +00:00
Richard Hughes
1e7d741601 Check system integrity when installing UEFI updates
Recently we had an update that changed the system-defined Platform Key, and
we've certainly had updates in the past that changed the Boot#### variables.

Store some core ACPI and UEFI system integrity state from before and after the
update which can be used to mark (waivable) test failures on the LVFS.
2022-11-03 15:51:10 +00:00
Richard Hughes
3add9e8cb7 flashrom: Only use the IFD when the system is Intel-based 2022-10-31 13:47:30 +00:00
Sean Rhodes
01fe8bdcb2
Add new GUIDs for Star Labs laptops (#5201)
* plugins/{flashrom,superio]: Add GUIDs for StarBook Mk VI - Intel

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

* plugins/{flashrom,superio]: Add GUIDs for StarBook Mk VI - AMD

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

* plugins/{flashrom,superio]: Add GUIDs for Byte Mk I - AMD

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-10-26 13:48:38 +01:00
Richard Hughes
d1c6acd752 trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
Mario Limonciello
15c9cac1b0 add an rpath to things not compiled into a library
A harmless error shows up in debian packages at build time:
```
dpkg-shlibdeps: warning: cannot find library libfwupdplugin.so needed by debian/fwupd/usr/lib/x86_64-linux-gnu/fwupd-1.8.6/libfu_plugin_flashrom.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
```

This doesn't cause a functional problem because libfwupdplugin has already
been loaded by the daemon by the time these libraries are loaded.

In case the `dpkg-shlibdeps` checker becomes more stringent in the future
fix the warning.
2022-10-07 14:16:37 -05:00
Richard Hughes
1f261ba283 Rename the source file and private data of modular plugins
This would allow us to convert more easily to a built-in plugin in the future
and means we match the source style used in 97% of the other plugins.

No logic changes.
2022-09-30 15:20:23 +01:00
Richard Hughes
fc3cfbad92 Do not check the build hash of modular plugins
We removed the abilty to easily build modular plugins, and so we don't need to
worry so much about random 3rd party modules being loaded.
2022-09-30 14:19:56 +01:00
Richard Hughes
e8de491030 trivial: Do not require fu-hash.h for builtin plugins 2022-09-30 10:36:12 +01:00
Mario Limonciello
d5585728a2 trivial: don't refer to plugindir in the build system anymore 2022-09-28 15:12:10 -05:00
Richard Hughes
99002a7a18 Build many more plugins as builtin
This reduces the plugin directory size by 2.2Mb
2022-09-28 17:01:23 +01:00
Richard Hughes
c4b7f42e43 Only compress one version of the builtin-quirks
Saving the quirks in the GResource section worked well, but it made the build
system very complicated and also meant the .data section was duplicated in
both `fwupd` and `fwupdtool` -- negating a lot of the hard-fought savings.

Simplify this feature so that we just `cat` all the quirk files together, then
gzip them into a single file. This means that at startup fwupd only needs to
check the mtime of one file, and weirdly it's actually faster to load a smaller
compressed file from disk that it is to load multiple uncompressed files.
2022-09-27 12:44:04 +01:00
Richard Hughes
0415db6f67 Revert "trivial: Use files() rather than current_source_dir()"
This reverts commit b581fa5670 as it breaks
`ninja dist` with `-Dgresource_quirks=enabled`.
2022-09-25 10:31:14 +01:00
Richard Hughes
b581fa5670 trivial: Use files() rather than current_source_dir() 2022-09-24 09:12:14 -05:00
Sean Rhodes
a4a1be569b
plugins/{superio,flashrom}: Add LabTop Mk III HwId (#4920)
Add the HwId for the Star LabTop Mk III when using coreboot firmware,
as this differs to AMI.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-08-12 14:00:50 +00:00
Sean Rhodes
639493259d
plugins/flashrom: Skip BC check for coreboot devices (#4892)
Set BcrAddr to 0x0 for all coreboot devices, so that the check of
BIOS Control is skipped as coreboot won't forcibly set this.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-08-02 10:11:55 -05:00
Richard Hughes
47efacfe5d Remove the firmware builder functionality
We used the firmware builder functionality to either build or modify
firmware images on the end-user system, e.g. copying the MAC address
from the old system image to the new system image.

Unfortunately running fwupd on the command line (e.g. ./src/fwupd)
leaves the tty connected and thus bubblewrap doesn't protect us from
installing malicious signed firmware. The firmware would have to have
been uploaded to the LVFS by a trusted vendor and signed before being
installed, which further decreases the severity of this problem.

As there was only one vendor who asked for this functionality (who have
yet to upload a single firmware to the LVFS...) just rip out this
functionality to reduce our attack surface and completely fix the bug,
and any like it.

Many thanks to Aaron Janse <aaron@ajanse.me> for discovering and
disclosing this issue to us.
2022-07-29 16:52:38 +01:00
Richard Hughes
829258401e Allow plugins and backends to print debugging information to the console
This is really useful for debugging.
2022-07-28 16:10:06 +01:00
Richard Hughes
a61bb37881 Build the quirk files into the daemon as a GResource
Interestingly, this increases the `fwupd` binary size by ~30kb but
reduces the installed size of /usr/share/fwupd/quirks.d by ~330kb.
2022-06-30 18:52:24 +01:00
Richard Hughes
b8be6daf1f trivial: Use 'priv' for plugin private data to be consistent 2022-06-26 13:57:53 -05:00
Gaël PORTAY
299b42fe96 trivial: Make meson.build indentation consistent 2022-06-21 03:27:38 -04:00
Richard Hughes
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
4b1313b406 Split out the GByte helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
0d1ba6667f trivial: Remove a few ctags headers that snuck in 2022-06-14 17:57:38 +01:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
2870426958 trivial: Fix a critical warning when no flashrom devices are found 2022-05-10 10:39:04 +01:00
Richard Hughes
9f584a234a flashrom: Allow dumping firmware using fwupdtool 2022-05-04 14:10:18 +01:00
Richard Hughes
c0bdb8dd7a flashrom: Only set the BIOS size if not already quirked 2022-05-04 11:11:23 +01:00
Richard Hughes
5ac8594d92 flashrom: Use more ideomatic GLib style 2022-05-04 11:11:23 +01:00
Sergii Dmytruk
e9f765dc47 plugins/flashrom/fu-flashrom-device.c: create layout on open
This avoids possible reading IFD multiple times and fixes a memory leak
of layout on errors and an unconditional leak in
fu_flashrom_device_prepare(), which didn't call
flashrom_layout_release().

Notice that flashrom_layout_set() call does NOT transfer ownership.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-21 15:39:47 +01:00
Sergii Dmytruk
e1d708a4ff plugins/flashrom: manage flashrom context at plugin level
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-21 15:39:47 +01:00
Sergii Dmytruk
ddf4e10d7b plugins/flashrom: enable for 2 Tuxedo laptops
Their ME region in flash can be unlocked manually, give user
instructions on how to do it.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-21 15:39:47 +01:00
Sergii Dmytruk
e65cb98cc8 plugins/flashrom: add flashrom-specific GUIDs
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-21 15:39:47 +01:00
Sergii Dmytruk
2bac03eee1 plugins/flashrom: create separate device for ME region
Created only if intel_spi plugin indicates that the region exists by
creating its own device for it.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-21 15:39:47 +01:00
Sergii Dmytruk
523ed0d7b4 plugins/flashrom: make region we're flashing a property
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-19 10:47:41 +01:00
Richard Hughes
2d5186622c Add FuProgress to ->prepare and ->cleanup
Some plugins were creating local versions (which were not attached to
the daemon progress in any way) as a workaround as they needed to do
actions that took a long time to complete.
2022-04-15 16:50:06 +01:00
Richard Hughes
18301f92cf flashrom: Fix a harmless warning when adding an instance ID 2022-04-05 11:38:30 +01:00
Richard Hughes
3390d7f9a5 flashrom: Allow quirking the flashrom flash size
We were using an 'undocumented' local copy of the flash size, when
FuDevice was setting the [ignored] standard device property.
2022-04-05 11:38:30 +01:00
Michał Kopeć
d3ce827f96 plugins/flashrom/flashrom.quirk: update NovaCustom GUIDs
Add NS5x GUID and missing NV4x guids for devices running older firmware versions.

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2022-04-01 12:43:18 +01:00
Sean Rhodes
0ac171c452
plugins/flashrom: Move MaxSize quirk to GUID (#4468)
Move the quirk from HwID to GUID to the apply correctly.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-03-31 20:38:38 +01:00
Sean Rhodes
d8b6f5f0b3
plugin/flashrom: Change the default format from triplet to pair (#4395)
Flashrom is primarily used with coreboot, which has a pair version number
currently 4.16. As such, chance the default to pair so that fewer quirks
are required.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-03-17 07:58:25 +00:00