]> git.proxmox.com Git - fwupd-efi.git/log
fwupd-efi.git
2 years agomeson: using local copy ldscript when local copy crt0 be used for SBAT
Lee, Chun-Yi [Wed, 15 Sep 2021 05:19:52 +0000 (13:19 +0800)]
meson: using local copy ldscript when local copy crt0 be used for SBAT

When the system crt0 for aaarch64 is not new enough for SBAT. The
efi/meson.build script will use local copy crt0 instead:

  efi/meson.build:87: WARNING: Cannot find SBAT section in
  /usr/lib64/crt0-efi-aarch64.S, using local copy

In this case, the ld of efi/fwup.so will be failed because missing
symbols:

[   32s] ld:
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
relocation R_AARCH64_PREL32 against symbol `_erodata' which may bind
externally can not be used when making a shared object; recompile with
-fPIC
[   32s]
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
in function `extra_header_fields':
[   32s] (.text.head+0x90): dangerous relocation: unsupported relocation
[   32s] ld:
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
relocation R_AARCH64_PREL32 against symbol `_evtext' which may bind
externally can not be used when making a shared object; recompile with
-fPIC
[   32s]
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
in function `section_table':
[   32s] (.text.head+0x100): dangerous relocation: unsupported
relocation
[   32s] ld:
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
relocation R_AARCH64_PREL32 against symbol `_rodata' which may bind
externally can not be used when making a shared object; recompile with
-fPIC
[   32s] (.text.head+0x17c): dangerous relocation: unsupported
relocation
[   32s] ld:
/home/abuild/rpmbuild/BUILD/fwupd-efi-1.1/build/efi/crt0/crt0-efi-aarch64.o:
relocation R_AARCH64_PREL32 against symbol `_rodata' which may bind
externally can not be used when making a shared object; recompile with
-fPIC
[   32s] (.text.head+0x184): dangerous relocation: unsupported
relocation
[   32s] ninja: build stopped: subcommand failed.

Using local copy ldscript when local copy crt0 be used for SBAT, then
this fail can be fixed.

Reference: https://github.com/fwupd/fwupd-efi/issues/11
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
3 years agosbat: clarify project URL
Nikolai Kostrigin [Wed, 15 Sep 2021 17:18:40 +0000 (20:18 +0300)]
sbat: clarify project URL

Signed-off-by: Nikolai Kostrigin <nickel@altlinux.org>
3 years agotrivial: Ignore some markdown issues
Richard Hughes [Fri, 30 Jul 2021 14:02:16 +0000 (15:02 +0100)]
trivial: Ignore some markdown issues

3 years agoWait 5 seconds to reboot on errors
Mario Limonciello [Fri, 30 Jul 2021 13:08:44 +0000 (08:08 -0500)]
Wait 5 seconds to reboot on errors

This gives a better chance at understanding them without having to
step frame by frame in a video.

See https://github.com/fwupd/firmware-lenovo-thinkpad/issues/139

3 years agoPort pre-commit clang-format, codespell, markdownlint from fwupd
Mario Limonciello [Fri, 30 Jul 2021 13:11:06 +0000 (08:11 -0500)]
Port pre-commit clang-format, codespell, markdownlint from fwupd

3 years agotrivial: fixup python errors by codacity/precommit
Mario Limonciello [Fri, 30 Jul 2021 13:40:58 +0000 (08:40 -0500)]
trivial: fixup python errors by codacity/precommit

3 years agotrivial: fixup markdown format
Mario Limonciello [Fri, 30 Jul 2021 13:40:44 +0000 (08:40 -0500)]
trivial: fixup markdown format

3 years agotrivial: spelling errors
Mario Limonciello [Fri, 30 Jul 2021 13:38:43 +0000 (08:38 -0500)]
trivial: spelling errors

3 years agoSleep longer when no updates to process
Mario Limonciello [Thu, 1 Jul 2021 20:59:47 +0000 (15:59 -0500)]
Sleep longer when no updates to process

https://github.com/fwupd/fwupd/issues/3441

3 years agoREADME: fix typo and URL
Thomas Weißschuh [Sat, 19 Jun 2021 20:23:09 +0000 (22:23 +0200)]
README: fix typo and URL

3 years agotrivial: post release version bump
Richard Hughes [Sat, 19 Jun 2021 13:30:12 +0000 (14:30 +0100)]
trivial: post release version bump

3 years agoRelease fwupd-efi 1.1
Richard Hughes [Sat, 19 Jun 2021 13:29:03 +0000 (14:29 +0100)]
Release fwupd-efi 1.1

3 years agoAccount for objdump missing --target option on FreeBSD
Sergii Dmytruk [Fri, 14 May 2021 17:50:12 +0000 (20:50 +0300)]
Account for objdump missing --target option on FreeBSD

It's a non-GNU implementation of objcopy.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
3 years agoFix finding lds file of gnu-efi on FreeBSD
Sergii Dmytruk [Fri, 14 May 2021 16:32:02 +0000 (19:32 +0300)]
Fix finding lds file of gnu-efi on FreeBSD

It has "_fbsd" suffix on x86-64 architecture.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
3 years agomeson: pass the found genpeimg to generate_binary
Ross Burton [Fri, 14 May 2021 13:07:11 +0000 (14:07 +0100)]
meson: pass the found genpeimg to generate_binary

3 years agogenerate_binary: add genpeimg option
Ross Burton [Fri, 14 May 2021 13:06:31 +0000 (14:06 +0100)]
generate_binary: add genpeimg option

Add a --genpeimg option as the meson.build uses find_program(), so the
binary could be anywhere.

3 years agomeson: remove unused objcopy find_program
Ross Burton [Fri, 14 May 2021 13:12:42 +0000 (14:12 +0100)]
meson: remove unused objcopy find_program

This isn't used, as the build uses the efi-objcopy option.

3 years agomeson: abort if the host architecture isn't known
Ross Burton [Fri, 14 May 2021 13:07:36 +0000 (14:07 +0100)]
meson: abort if the host architecture isn't known

Instead of continuing and likely failing weirdly later, exit out early
if the host architecture isn't recognised.

3 years agomeson: remove compiler flags that are never used
Ross Burton [Thu, 13 May 2021 10:58:43 +0000 (11:58 +0100)]
meson: remove compiler flags that are never used

The meson.build checks for a slew of warning and linker flags that were
copied from fwupd, but they're never used as fwupd-efi currently invokes
the compile itself.

3 years agotrivial: post release version bump
Richard Hughes [Fri, 23 Apr 2021 14:11:00 +0000 (15:11 +0100)]
trivial: post release version bump

3 years agoAdd a metainfo file for release information
Richard Hughes [Fri, 23 Apr 2021 10:15:35 +0000 (11:15 +0100)]
Add a metainfo file for release information

3 years agoClarify documentation
Mario Limonciello [Thu, 22 Apr 2021 05:13:35 +0000 (00:13 -0500)]
Clarify documentation

3 years agoAdd Debian packaging
Mario Limonciello [Wed, 21 Apr 2021 21:33:45 +0000 (16:33 -0500)]
Add Debian packaging

3 years agoFix precommit script, no dependency building
Mario Limonciello [Wed, 21 Apr 2021 17:27:47 +0000 (12:27 -0500)]
Fix precommit script, no dependency building

3 years agoGenerate a pkgconfig file for fwupd to detect
Mario Limonciello [Wed, 21 Apr 2021 17:12:10 +0000 (12:12 -0500)]
Generate a pkgconfig file for fwupd to detect

3 years agoAutomatically generate RPM packages from CI
Richard Hughes [Wed, 21 Apr 2021 14:53:07 +0000 (15:53 +0100)]
Automatically generate RPM packages from CI

3 years agotrivial: Fix the README location when SBAT distro ID is unset
Richard Hughes [Wed, 21 Apr 2021 14:34:39 +0000 (15:34 +0100)]
trivial: Fix the README location when SBAT distro ID is unset

3 years agoAdd an example Fedora spec file
Richard Hughes [Wed, 21 Apr 2021 11:27:49 +0000 (12:27 +0100)]
Add an example Fedora spec file

3 years agoAdd CI system
Mario Limonciello [Wed, 21 Apr 2021 13:41:40 +0000 (08:41 -0500)]
Add CI system

3 years agoAdjust build system for subproject
Mario Limonciello [Wed, 21 Apr 2021 13:41:09 +0000 (08:41 -0500)]
Adjust build system for subproject

3 years agoUpdate README/RELEASE for new process on fwupd-efi
Mario Limonciello [Wed, 21 Apr 2021 13:40:53 +0000 (08:40 -0500)]
Update README/RELEASE for new process on fwupd-efi

3 years agofu-tool.c: Use traditional UNIX record locks if OFD is not available
Norbert Kamiński [Mon, 19 Apr 2021 10:39:47 +0000 (12:39 +0200)]
fu-tool.c: Use traditional UNIX record locks if OFD is not available

Open file description locks are Linux-specific. If fwupd is not built
for Linux, it should use the traditional UNIX record locks (F_SETLK).

Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
3 years agoUse an OFD lock to prevent more than one fwupdtool process
Richard Hughes [Wed, 14 Apr 2021 19:03:55 +0000 (20:03 +0100)]
Use an OFD lock to prevent more than one fwupdtool process

Fixes https://github.com/fwupd/fwupd/issues/3019

3 years agoAdd option to disable the UEFI capsule splash screen generation
Ross Burton [Mon, 22 Mar 2021 12:51:54 +0000 (12:51 +0000)]
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.

3 years agoDon't check for native dependencies as target dependencies
Ross Burton [Mon, 12 Apr 2021 16:31:14 +0000 (17:31 +0100)]
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.

3 years agotrivial: Remove unused readelf dep
Ross Burton [Mon, 12 Apr 2021 16:30:54 +0000 (17:30 +0100)]
trivial: Remove unused readelf dep

readelf isn't used by anything, so there's no need to look for it.

3 years agoAdd more things to the precommit list
Richard Hughes [Sat, 10 Apr 2021 16:16:57 +0000 (17:16 +0100)]
Add more things to the precommit list

3 years agotrivial: pre-commit: check XML for trailing whitespace too
Mario Limonciello [Fri, 9 Apr 2021 15:46:25 +0000 (10:46 -0500)]
trivial: pre-commit: check XML for trailing whitespace too

I almost committed something with trailing whitespace :)

3 years agotrivial: Add pre-commit hooks for style
Mario Limonciello [Thu, 8 Apr 2021 14:19:12 +0000 (09:19 -0500)]
trivial: Add pre-commit hooks for style

3 years agotrivial: Add me to maintainers
Mario Limonciello [Thu, 8 Apr 2021 17:15:36 +0000 (12:15 -0500)]
trivial: Add me to maintainers

3 years agotrivial: reformat all python code with black
Mario Limonciello [Thu, 8 Apr 2021 14:17:22 +0000 (09:17 -0500)]
trivial: reformat all python code with black

3 years agouefi-capsule: Include crt0 for arm and aarch64 that add a SBAT section
Javier Martinez Canillas [Wed, 31 Mar 2021 11:03:15 +0000 (13:03 +0200)]
uefi-capsule: Include crt0 for arm and aarch64 that add a SBAT section

Due the lack of pei-aarch64 support in binutils, the gnu-efi crt0 harcodes
the PE32+ sections among other things. These crt0 aren't aware of the SBAT
section and so custom ones have to be used.

In the same vein as commit 6ed2d0012c9 ("uefi-capsule: Ensure SBAT metadata
is added correctly") included custom linker scripts, this change add a set
of crt0 for arm and aarch64 that hardcode a SBAT section in the PE headers.

These are the crt0 from gnu-efi plus the following fixes from Peter Jones:

* Include .sbat in section headers
* Fix some PE headers
* Calculate the VirtualSize of .sbat separately
* Put .rel* and .dyn* in .rodata

3 years agouefi-capsule: Sync linker scripts with latest used by shim
Javier Martinez Canillas [Tue, 30 Mar 2021 09:15:29 +0000 (11:15 +0200)]
uefi-capsule: Sync linker scripts with latest used by shim

The linker scripts used in the project were copied from the shim project,
but there were a few fixes made after this original copy.

Until binutils have proper pei-aarch64 support, the linker scripts should
be kept in sync to make sure that the PE32+ binaries are built correctly.

The fixes included in this change are the following:

 * Include missing .text sections in PE/COFF binary (Chris Coulson)
 * Put .sbat after _edata (Peter Jones)
 * Fix some PE headers for arm and aarch64 (Peter Jones)
 * Include the aligned part in SizeOfRawData of sbat for arm and aarch64 (Gary Lin)
 * Swizzle some sections to make old sbsign happier for arm and aarch64 (Peter Jones)
 * Put .rel* and .dyn* in .rodata for arm and aarch64 (Peter Jones)

3 years agoFix build on musl.
Érico Nogueira [Mon, 29 Mar 2021 17:45:20 +0000 (14:45 -0300)]
Fix build on musl.

malloc_trim isn't a linux function, it's a GNU extension to malloc.  We
can check for it in meson.build, which avoids hardcoding platform
knowledge.

3 years agoTweak the SBAT output for a vendor string
Steve McIntyre [Fri, 26 Mar 2021 15:06:08 +0000 (15:06 +0000)]
Tweak the SBAT output for a vendor string

The format is meant to be "<project>.<vendor>" with a period as a
separator.

Signed-off-by: Steve McIntyre <93sam@debian.org>
3 years agotrivial: Rename spi to intel-spi as it's all Intel specific
Richard Hughes [Wed, 17 Mar 2021 19:11:32 +0000 (19:11 +0000)]
trivial: Rename spi to intel-spi as it's all Intel specific

If we need to export the EFI symbols into libfwupdplugin for other plugins we
can do that when we need them.

3 years agofwupd port for BSD distros
Norbert Kamiński [Mon, 8 Mar 2021 10:38:43 +0000 (11:38 +0100)]
fwupd port for BSD distros

Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
3 years agotrivial: Codespell fixes
Richard Hughes [Fri, 19 Mar 2021 16:01:26 +0000 (16:01 +0000)]
trivial: Codespell fixes

3 years agoAllow objects to deserialize to XML
Richard Hughes [Fri, 12 Mar 2021 21:21:10 +0000 (21:21 +0000)]
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

3 years agoParse the IFD BIOS section into EFI FV and FFS2 sections
Richard Hughes [Tue, 9 Mar 2021 18:38:11 +0000 (18:38 +0000)]
Parse the IFD BIOS section into EFI FV and FFS2 sections

3 years agospi: Move all the IFD parsing to the new 'spi' plugin
Richard Hughes [Fri, 12 Mar 2021 09:54:00 +0000 (09:54 +0000)]
spi: Move all the IFD parsing to the new 'spi' plugin

We do not want to export this unfinished API, and it's probably best just to
not compile it by default until it is actually useful.

3 years agotrivial: Actually print the po/test-deps failure on the console
Richard Hughes [Fri, 12 Mar 2021 18:21:04 +0000 (18:21 +0000)]
trivial: Actually print the po/test-deps failure on the console

3 years agoRemove unused, unsafe and deprecated functions from libfwupdplugin
Richard Hughes [Tue, 9 Mar 2021 12:25:04 +0000 (12:25 +0000)]
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.

3 years agotrivial: post branch version bump
Richard Hughes [Tue, 9 Mar 2021 15:21:42 +0000 (15:21 +0000)]
trivial: post branch version bump

3 years agouefi-capsule: Specify the section flags for .sbat
Gary Lin [Tue, 9 Mar 2021 07:26:20 +0000 (15:26 +0800)]
uefi-capsule: Specify the section flags for .sbat

When using "objcopy -O binary" to generate AArch64 EFI images, it
silently drops the sections without "alloc" or "load" or the sections
with "unload", and this caused the content of .sbat was skipped in the
final EFI image.

This commit sets the common read-only data section flags to .sbat to
make sure the content will be copied.

Signed-off-by: Gary Lin <glin@suse.com>
3 years agocontrib/qubes: Add Qubes wrapper source and create packages
Norbert Kamiński [Thu, 25 Feb 2021 11:41:15 +0000 (12:41 +0100)]
contrib/qubes: Add Qubes wrapper source and create packages

This patch is adding the fwupd wrapper for Qubes.
The wrapper provides fwupd functionalities for Qubes R4.1.
It creates three packages (two RPMs and one Debian package):
fwupd-qubes-dom0 (RPM)
fwupd-qubes-vm (RPM)
fwupd-qubes-vm-whonix (deb)
More information about the wrapper could be found in the
contrib/qubes/README.md

Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
3 years agotrivial: add linker script for armhf
Mario Limonciello [Tue, 23 Feb 2021 22:41:30 +0000 (16:41 -0600)]
trivial: add linker script for armhf

fixes FTBFS in Debian:
https://buildd.debian.org/status/fetch.php?pkg=fwupd&arch=armhf&ver=1.5.7-1&stamp=1614100547&raw=0

3 years agotrivial: post release version bump
Richard Hughes [Tue, 23 Feb 2021 14:57:22 +0000 (14:57 +0000)]
trivial: post release version bump

3 years agotrivial: Disable bluez by default
Richard Hughes [Tue, 23 Feb 2021 09:57:18 +0000 (09:57 +0000)]
trivial: Disable bluez by default

We can enable this once we have a real plugin that actually depends on it.

3 years agouefi-capsule: Ensure SBAT metadata is added correctly
Chris Coulson [Sat, 20 Feb 2021 14:27:17 +0000 (14:27 +0000)]
uefi-capsule: Ensure SBAT metadata is added correctly

The current approach of adding SBAT metadata after linking is creating
an image that is badly formed in 2 ways:

 * The SBAT section's file offset and size are not a multiple of the
   file alignment.

 * The SBAT section has a virtual address of zero. EDK2 loads the header
   here, and so it gets rejected.

This changes the approach to match shim, where an object file is
created with a .sbat section and then the linker takes care of placing
the section at a more appropriate virtual address.

See https://github.com/vathpela/gnu-efi/pull/14 for the section addition.

3 years agoAdd initial support for Bluez bluetooth devices
Ricardo Cañuelo [Fri, 12 Feb 2021 11:48:58 +0000 (12:48 +0100)]
Add initial support for Bluez bluetooth devices

Bare skeleton for what will be the Bluez backend and the base bluetooth
device class.

3 years agouefi-capsule: Set the component generation to 1
Richard Hughes [Thu, 18 Feb 2021 19:03:28 +0000 (19:03 +0000)]
uefi-capsule: Set the component generation to 1

See https://github.com/rhboot/shim/blob/main/SBAT.md

3 years agouefi-capsule: Include all the sections when using objcopy
Richard Hughes [Thu, 18 Feb 2021 18:53:59 +0000 (18:53 +0000)]
uefi-capsule: Include all the sections when using objcopy

Fixes the regression introduced in 6fa8551e38aa8b48d33c3881f6867f6478377f9b

3 years agotrivial: Rename meson option tpm->plugin_tpm
Mario Limonciello [Thu, 18 Feb 2021 09:38:03 +0000 (09:38 +0000)]
trivial: Rename meson option tpm->plugin_tpm

3 years agotrivial: post release version bump
Richard Hughes [Tue, 16 Feb 2021 12:16:22 +0000 (12:16 +0000)]
trivial: post release version bump

3 years agoAllow building without SBAT metadata
Richard Hughes [Tue, 16 Feb 2021 10:14:36 +0000 (10:14 +0000)]
Allow building without SBAT metadata

Two reasons:

 * It seems a bit antisocial to hard-require all this data without fair warning
 * The aarch64 pesign crashes when trying to sign the binary with SBAT metadata

3 years agotrivial: Untie efi_os_dir from the SBAT distro ID
Richard Hughes [Fri, 12 Feb 2021 09:15:36 +0000 (09:15 +0000)]
trivial: Untie efi_os_dir from the SBAT distro ID

We happily fallback with an unset -Defi_os_dir and it gets confusing explaining
why the EFI dir needs to be set on a non-supported system.

In practice they'll probably have the same eventual value on most supported
distributions.

Fixes https://github.com/fwupd/fwupd/issues/2873

3 years agouefi-capsule: Fix objcopy failing to add a .sbat section on aarch64
Javier Martinez Canillas [Fri, 12 Feb 2021 11:48:20 +0000 (12:48 +0100)]
uefi-capsule: Fix objcopy failing to add a .sbat section on aarch64

The objcopy tool only has support for pei-x86_64 and pei-i386 targets, and
so trying to add a .sbat section for fwupdaa64.efi fails with this error:

objcopy: plugins/uefi-capsule/efi/fwupdaa64.efi: file format not recognized

To fix this issue, add the .sbat section to the ELF fwup.so shared object
and keep that section when generating the resulting fwupdaa64.efi binary.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
3 years agofmap: Use memmem to find the FMAP signature
Richard Hughes [Thu, 11 Feb 2021 12:03:24 +0000 (12:03 +0000)]
fmap: Use memmem to find the FMAP signature

Trust glibc to optimize for the binary search, removing a oss-fuzz detected
crash with our bad pointer maths.

3 years agouefi-capsule: Add SBAT metadata to the fwupd EFI binary
Javier Martinez Canillas [Thu, 4 Feb 2021 14:53:25 +0000 (14:53 +0000)]
uefi-capsule: Add SBAT metadata to the fwupd EFI binary

The Secure Boot Advanced Targeting (SBAT) [0] is a Generation Number Based
Revocation mechanism that is meant to replace the DBX revocation file list.

Binaries must contain a .sbat data section that has a set entries, each of
them consisting of UTF-8 strings as comma separated values. Allow to embed
this information into the fwupd EFI binary at build time.

The SBAT metadata must contain at least two entries. One that defines the
SBAT version used and another one that defines the component generation.

Downstream users can add additional entries if have changes that make them
diverge from the upstream code and potentially add other vulnerabilities.

[0]: https://github.com/rhboot/shim/blob/sbat/SBAT.md

3 years agoIntegrate oss-fuzz with the CI
Richard Hughes [Mon, 8 Feb 2021 16:28:09 +0000 (16:28 +0000)]
Integrate oss-fuzz with the CI

3 years agotrivial: Remove unused -Dlink_language support
Richard Hughes [Sun, 7 Feb 2021 16:57:09 +0000 (16:57 +0000)]
trivial: Remove unused -Dlink_language support

3 years agouefi: Rewrite generate_binary.sh script in Python
Javier Martinez Canillas [Fri, 29 Jan 2021 09:34:02 +0000 (10:34 +0100)]
uefi: Rewrite generate_binary.sh script in Python

The generate_binary.sh is a script that calls the objcopy tool and
genpeimg in the case of Windows, to generate a PE binary file.

But doesn't have to be a shell script and could be rewritten as a
python script. This will make this code to generate a PE binary
easier to extend if needed.

Also, the only reason that's a template is to define the objcopy
tool used, but this can also be passed as a positional argument.

3 years agotrivial: Do not use deprecated symbols internally
Richard Hughes [Tue, 26 Jan 2021 10:01:05 +0000 (10:01 +0000)]
trivial: Do not use deprecated symbols internally

This means shuffling things around a little, but no logic changes.

3 years agoUse FWUPD_COMPILATION define to indicate an in tree build
Mario Limonciello [Thu, 21 Jan 2021 18:47:32 +0000 (12:47 -0600)]
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>
3 years agocoreboot: Remove plugin and instead add metadata to flashrom devices
Richard Hughes [Thu, 14 Jan 2021 21:00:37 +0000 (21:00 +0000)]
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().

3 years agosynaptics-rmi: Support parsing and writing signed firmware
Richard Hughes [Tue, 12 Jan 2021 10:25:41 +0000 (10:25 +0000)]
synaptics-rmi: Support parsing and writing signed firmware

Validate the firmware signature if provided

3 years agoAllow more than one plugin to use GnuTLS directly
Richard Hughes [Tue, 12 Jan 2021 11:07:02 +0000 (11:07 +0000)]
Allow more than one plugin to use GnuTLS directly

3 years agoMake GUsb optional for fuzzing
Richard Hughes [Wed, 13 Jan 2021 18:43:44 +0000 (18:43 +0000)]
Make GUsb optional for fuzzing

3 years agoMake libarchive optional for fuzzing
Richard Hughes [Wed, 13 Jan 2021 19:25:10 +0000 (19:25 +0000)]
Make libarchive optional for fuzzing

3 years agotrivial: Rename the meson option for plugin_synaptics_mst
Richard Hughes [Tue, 12 Jan 2021 20:46:27 +0000 (20:46 +0000)]
trivial: Rename the meson option for plugin_synaptics_mst

3 years agotrivial: post release version bump
Richard Hughes [Mon, 11 Jan 2021 10:20:48 +0000 (10:20 +0000)]
trivial: post release version bump

3 years agotrivial: Fix typo in fuzzing instructions
Richard Hughes [Fri, 8 Jan 2021 15:47:32 +0000 (15:47 +0000)]
trivial: Fix typo in fuzzing instructions

3 years agoOnly include the start year in the copyright header
Richard Hughes [Thu, 7 Jan 2021 14:20:49 +0000 (14:20 +0000)]
Only include the start year in the copyright header

The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.

3 years agotrivial: Fix the meson option for UEFI capsule support
Richard Hughes [Tue, 5 Jan 2021 16:56:51 +0000 (16:56 +0000)]
trivial: Fix the meson option for UEFI capsule support

3 years agoCheck the AMI test key if not installed for HSI-1
Richard Hughes [Mon, 21 Dec 2020 21:21:50 +0000 (21:21 +0000)]
Check the AMI test key if not installed for HSI-1

Fixes https://github.com/fwupd/fwupd/issues/2695

3 years agolibfwupdplugin: Subclass FuFirmware in FuSmbios
Richard Hughes [Tue, 5 Jan 2021 13:37:42 +0000 (13:37 +0000)]
libfwupdplugin: Subclass FuFirmware in FuSmbios

This allows us to get fuzzing support for free.

3 years agotrivial: Update fuzzing instructions to not use libcurl
Richard Hughes [Tue, 5 Jan 2021 13:14:30 +0000 (13:14 +0000)]
trivial: Update fuzzing instructions to not use libcurl

3 years agotrivial: Fix building on older meson
Richard Hughes [Tue, 5 Jan 2021 15:38:54 +0000 (15:38 +0000)]
trivial: Fix building on older meson

3 years agouefi: Rename to uefi-capsule
Richard Hughes [Tue, 5 Jan 2021 09:53:54 +0000 (09:53 +0000)]
uefi: Rename to uefi-capsule

Rename the plugin to make it clearer of the scope.

Based on a patch from Mario Limonciello <mario.limonciello@dell.com>

3 years agolibfwupdplugin: Subclass FuFirmware in FuEfiSignatureList
Richard Hughes [Tue, 5 Jan 2021 11:07:28 +0000 (11:07 +0000)]
libfwupdplugin: Subclass FuFirmware in FuEfiSignatureList

This allows us to get fuzzing support 'for free' and also simplifies the code.

3 years agoAdd plugin to update PixArt RF devices
Jimmy Yu [Sat, 26 Dec 2020 14:49:32 +0000 (14:49 +0000)]
Add plugin to update PixArt RF devices

Signed-off-by: Richard Hughes <richard@hughsie.com>
3 years agoMake libcurl optional for fuzzing
Richard Hughes [Mon, 28 Dec 2020 21:57:04 +0000 (21:57 +0000)]
Make libcurl optional for fuzzing

For fuzzing we want to exclude libcurl support as it depends on other very heavy
libraries like OpenSSL or libtasn which make the fuzzing binary much larger if
linked statically.

3 years agotrivial: post release version bump
Richard Hughes [Wed, 16 Dec 2020 13:16:36 +0000 (13:16 +0000)]
trivial: post release version bump

3 years agotrivial: Actually check if __get_cpuid_count exists before using cpuid.h
Richard Hughes [Tue, 15 Dec 2020 12:05:48 +0000 (12:05 +0000)]
trivial: Actually check if __get_cpuid_count exists before using cpuid.h

3 years agoAllow linking with the CXX linker
Richard Hughes [Mon, 14 Dec 2020 16:53:08 +0000 (16:53 +0000)]
Allow linking with the CXX linker

This is required by oss-fuzz, for non-obvious reasons!

3 years agoLower libcurl requirement further still
Richard Hughes [Fri, 11 Dec 2020 16:20:19 +0000 (16:20 +0000)]
Lower libcurl requirement further still

This allows us to build on Ubuntu 16.04!

3 years agoDon't assume we have memfd_create()
Richard Hughes [Mon, 14 Dec 2020 11:36:28 +0000 (11:36 +0000)]
Don't assume we have memfd_create()

3 years agotrivial: Only define HF_ITER if available...
Richard Hughes [Fri, 11 Dec 2020 09:45:48 +0000 (09:45 +0000)]
trivial: Only define HF_ITER if available...

3 years agoUse honggfuzz to fuzz firmware rather than AFL
Richard Hughes [Tue, 8 Dec 2020 16:02:03 +0000 (16:02 +0000)]
Use honggfuzz to fuzz firmware rather than AFL

This has better multi-core performance and can run in persistent mode -- which
allows us to construct a test harness of all the parsers (which takes time) and
then just reuse the process for lots of different data.