Prompt for reboot when unlocking on the command line if applicable
+
Show devices with an UpdateError in get-devices output
+
Support empty proxy server strings
+
Try harder to find duplicate UEFI boot entries
+
+
+
+
+
+
This release adds the following features:
+
+
Add support for Synaptics Prometheus fingerprint readers
+
Check if VersionFormat is ambiguous when adding devices
+
Check the daemon version is at least the client version
+
Export the version-format used by devices to clients
+
Set the version format for more device types
+
+
This release fixes the following bugs:
+
+
Allow using --force to trigger a duplicate offline update
+
Be smarter about existing installed fwupd when using standalone-installer
+
Correctly identify DFU firmware that starts at offset zero
+
Display the remote warning on the console in an easy-to-read way
+
Fix a libasan failure when reading a UEFI variable
+
Never guess the version format from the version string
+
Only use class-based instance IDs for quirk matching
+
Prompt the user to shutdown if requried when installing by ID
+
Reset the forced version during DFU attach and detach
+
+
+
+
+
+
This release adds the following features:
+
+
Allow the fwupdmgr tool to modify the daemon config
+
+
This release fixes the following bugs:
+
+
Correctly parse DFU interfaces with extra vendor-specific data
+
Do not report transient or invalid system failures
+
Fix problems with the version format checking for some updates
+
+
+
+
+
+
This release adds the following features:
+
+
Add a component categories to express the firmware type
+
Add support for 8BitDo M30
+
Add support for the not-child extension from Logitech
+
Shut down the daemon if the on-disk binary is replaced
+
+
This release fixes the following bugs:
+
+
Blacklist the synapticsmst plugin when using amdgpu
+
Correct ATA activation functionality to work for all vendors
+
Implement QMI PDC active config selection for modems
+
Make an error message clearer when there are no updates available
+
Match the old or new version number when setting NEEDS_REBOOT
+
More carefully check the output from tpm2_pcrlist
+
Recreate the history database if migration failed
+
Require AC power when updating Thunderbolt devices
+
Require --force to install a release with a different version format
+
Save history from firmware installed with fwupdtool
+
+
+
+
+
+
This release adds the following features:
+
+
Add a plugin to support modem hardware
+
Add support for delayed activation of docks and ATA devices
+
Add support for reading the SuperIO device checksum and writing to e-flash
+
Add the fwupdagent binary for use in shell scripts
+
Allow restricting firmware updates for enterprise use
+
Allow signing the fwupd report with a client certificate
+
Use Plymouth when updating offline firmware
+
+
This release fixes the following bugs:
+
+
Allow forcing an offline-only update on a live system using --force
+
Allow running offline updates when in system-update.target
+
Ask to reboot after scheduling an offline firmware update
+
Correctly check the new version for devices that replug
+
Do not fail to start the daemon if tpm2_pcrlist hangs
+
Do not fail when scheduling more than one update to be run offline
+
Do not let failing to find DBus prevent fwuptool from starting
+
Do not schedule an update on battery power if it requires AC power
+
Include all device checksums in the LVFS report
+
Rename the shimx64.efi binary for known broken firmware
+
Upload the UPDATE_INFO entry for the UEFI UX capsule
+
+
+
+
+
+
This release adds the following features:
+
+
Allow a device to be updated using more than one plugin
+
Report the DeviceInstanceIDs from fwupdmgr when run as root
+
+
This release fixes the following bugs:
+
+
Add an extra check for Dell NVMe drives to avoid false positives
+
Call composite prepare and cleanup using fwupdtool
+
Correct handling of CAB files with nested directories
+
Detect and special case Dell ATA hardware
+
Do not fail fwupdtool if dbus is unavailable
+
Do not unconditionally enable Werror for the EFI binary
+
Fill holes when reading SREC files
+
Filter the last supported payloads of certain Dell docks
+
Fix flashing failure with latest Intuos Pro tablet
+
Fix potential segfault when applying UEFI updates
+
Fix unifying regression when recovering from failed flash
+
+
+
+
+
+
This release adds the following features:
+
+
Add a directory remote that generates metadata
+
Add a new remote type "directory"
+
Add a plugin to update Wacom embedded EMR and AES panels
+
Add a plugin to upgrade firmware on ATA-ATAPI hardware
+
Add a quirk to use the legacy bootmgr description
+
Add flag to support manually aligning the NVMe firmware to the FWUG value
+
Add SuperIO IT89xx device support
+
Add support for Dell dock passive flow
+
Add 'update' and 'get-updates' commands to fwupdtool
+
Allow Dell dock flashing Thunderbolt over I2C
+
Check the battery percentage before flashing
+
Show a per-release source and details URL
+
Show a `UpdateMessage` and display it in tools
+
+
This release fixes the following bugs:
+
+
Add the needs-shutdown quirk to Phison NVMe drives
+
Correct Nitrokey Storage invalid firmware version read
+
Do not check the BGRT status before uploading a UX capsule
+
Do the UEFI UX checksum calculation in fwupd
+
Fix flashing various Jabra devices
+
Fix the parser to support extended segment addresses
+
Flash the fastboot partition after downloading the file
+
Show a console warning if loading an out-of-tree plugin
+
Support FGUID to get the SKU GUID for NVMe hardware
+
+
+
+
+
+
This release fixes the following bug:
+
+
Correctly migrate the history database
+
+
+
+
+
+
This release adds the following features:
+
+
Add support for devices that support fastboot
+
Add more standard USB identifier GUIDs
+
Add new API to get the release protocol from the metadata
+
Add the PCR0 value as the device checksum for system firmware
+
Include the device firmware checksum and update protocol in the report
+
+
This release fixes the following bugs:
+
+
Add Dell TB18DC to the supported devices list
+
Allow replacing the last byte in the image when using 'dfu-tool replace-data'
+
Append the UEFI capsule header in userspace rather than in the loader
+
Check the device checksum as well as the content checksum during verify
+
Correctly parse format the version numbers correctly using old metadata
+
Fix a crash if AMT returns an empty response
+
Fix a regression when doing GetReleases on unsupported hardware
+
Fix the 8bitdo version number if the daemon locale is not C.UTF-8
+
Remove the Wacom DTH generation hardware from the whitelist
+
Sanitize the version if the version format has been specified
+
+
+
+
+
+
This release adds the following features:
+
+
Add per-release install duration values
+
Shut down the daemon after 2h of inactivity when possible
+
+
This release fixes the following bugs:
+
+
Fix a use-after-free when using --immediate-exit
+
Fix flashing the 8bitdo SF30
+
Fix showing the custom remote agreements
+
Include the os-release information in the release metadata
+
Speed up startup by loading less thunderbolt firmware
+
Speed up startup by using a silo index for GUID queries
+
Use less memory and fragment the heap less when starting
+
+
+
+
+
+
This release adds the following features:
+
+
Add a plugin for an upcoming Dell USB-C dock
+
Add a standalone installer creation script
+
Add support for devices to show an estimated flash time
+
Add support for some new Realtek USB devices
+
Allow firmware files to depend on versions from other devices
+
Allow setting the version format from a quirk entry
+
Port from libappstream-glib to libxmlb for a large reduction in RSS
+
Stop any running daemon over dbus when using fu-tool
+
Support the Intel ME version format
+
+
This release fixes the following bugs:
+
+
Add version format quirks for several Lenovo machines
+
Adjust panamera ESM update routine for some reported issues
+
Adjust synapticsmst EVB board handling
+
Check the amount of free space on the ESP
+
Don't show devices pending a reboot in GetUpgrades
+
Ensure that parent ID is created before creating quirked children
+
Optionally wait for replug before updating a device
+
Set the full AMT device version including the BuildNum
+
Sort the firmware sack by component priority
+
Stop showing errors when no Dell dock plugged in
+
Stop showing the current release during updates in fwupdmgr
+
Update all sub-devices for a composite update
+
Use HTTPS_PROXY if set
+
+
+
+
+
+
This release adds the following features:
+
+
+ Add a new device flag 'ignore-validation' that will
+ override checks
+
+
Add a new plugin to enumerate EC firmware
+
Add a new plugin to update NVMe hardware
+
Add a plugin for updating using the flashrom command line tool
+
Allow the device list to take care of waiting for the device replug
+
Allow updating just one specific device from the command line
+
Allow upgrades using a self-signed fwupd.efi binary
+
Download firmware if the user specifies a URI
+
Include serial number in daemon device output when trusted
+
Notify all plugins of device removals through a new vfunc
+
Use boltd force power API if available
+
+
This release fixes the following bugs:
+
+
Add an install hook for classic snap
+
Allow forcing installation even if no AC power is applied
+
Allow using --force to ignore version_lowest
+
Always use the same HardwareIDs as Windows
+
Check the device state before assuming a fake DFU runtime
+
Copy over parent GUIDs from other plugin donors
+
Detect location of python3 interpreter
+
Do not add udev devices after a small delay
+
Don't fail to run if compiled without GPG/PKCS7
+
Fix a segfault in fwupdtool caused by cleanup of USB plugins
+
Implement the systemd recommendations for offline updates
+
Improve performance when reading keys from the quirk database
+
Remove children of devices when the parent is removed
+
Rewrite synapticsmst to use modern error handling
+
+ Rewrite the unifying plugin to use the new daemon-provided
+ functionality
+
+
Show a time estimate on the progressbar after an update has started
+
+
+
+
+
+
This release adds the following features:
+
+
Add support for the Synaptics Panamera hardware
+
Add validation for Alpine and Titan Ridge
+
Improve the Redfish plugin to actually work with real hardware
+
+
This release fixes the following bugs:
+
+
Allow different plugins to add the same device
+
Allow flashing unifying devices in recovery mode
+
Allow running synapticsmst on non-Dell hardware
+
Check the ESP for sanity at startup
+
Do not hold hidraw devices open forever
+
Don't override _FORTIFY_SOURCE when building the EFI binary
+
Don't show passwords in fwupdmgr
+
Fix a potential segfault in smbios data parsing
+
Fix encoding the GUID into the capsule EFI variable
+
Fix various bugs when reading the thunderbolt version number
+
Reboot synapticsmst devices at the end of flash cycle
+
Show status messages when the daemon is initializing
+
Show the correct title when updating devices
+
Show the reasons that plugins are not run on the CLI
+
Use localedir in po/make-images
+
+
+
+
+
+
This release adds the following features:
+
+
Add a initial Redfish support
+
Add a tool to mimic the original fwupdate CLI interface
+
Allow devices to assign a plugin from the quirk subsystem
+
Change the quirk file structure to be more efficient
+
Merge fwupdate functionality into fwupd
+
+ Run a plugin vfunc before and after all the composite devices are
+ updated
+
+
Support more Wacom tablets
+
+
This release fixes the following bugs:
+
+
Add release information for locked devices
+
Allow building with older meson
+
Detect the EFI system partition location at runtime
+
Do not use 8bitdo bootloader commands after a successful flash
+
Enable accessing downloaded files in flatpak and snap
+
Fix a potential buffer overflow when applying a DFU patch
+
Fix downgrading older releases to devices
+
Fix flashing devices that require a manual replug
+
Fix several small memory leaks in various places
+
Fix the retrieval of Redfish version
+
Fix unifying failure to detach when using a slow host controller
+
Set the Wacom device status when erasing and writing firmware
+
Show errors in the CLI if unable to access directory
+
Use the parent device name for Wacom sub-modules
+
+
+
+
+
+
This release adds the following features:
+
+
Add a plugin to update some future Wacom tablets
+
Add 'fwupdmgr get-topology' to show logical device tree
+
Add support for creating a flatpak
+
Add support for creating a snap
+
Add support for Motorola S-record files
+
Add the Linux Foundation public GPG keys for firmware and metadata
+
Show a translated warning when the server is limiting downloads
+
+
This release fixes the following bugs:
+
+
Add a firmware diagnostic tool called fwupdtool
+
Adjust all licensing to LGPL 2.1+
+
+ Allow installing more than one firmware using 'fwupdmgr
+ install'
+
+
Allow specifying hwids with OR relationships
+
Do not call fu_plugin_init() on blacklisted plugins
+
Do not require libcolorhug to build
+
Fix a crash in libfwupd where no device ID is set
+
Fix a potential DoS in libdfu by limiting holes to 1MiB
+
Fix a segfault that sometimes occurs during cleanup of USB plugins
+
Fix Hardware-ID{0,1,2,12} compatibility with Microsoft
+
Hide devices that aren't updatable by default in fwupdmgr
+
Search all UEFI GUIDs when matching hardware
+
Stop matching Nintendo Switch Pro in the 8bitdo plugin
+
+
+
+
+
+
This release adds the following features:
+
+
Add enable-remote and disable-remote commands to fwupdmgr
+
Add fu_plugin_add_compile_version() for libraries to use
+
Allow requiring specific versions of libraries for firmware updates
+
If no remotes are enabled try to enable the LVFS
+
Show a warning with interactive prompt when enabling a remote
+
+
This release fixes the following bugs:
+
+
Check that EFI system partition is mounted before update
+
Disable synapticsmst remote control on failure
+
Don't recoldplug thunderbolt to fix a flashing failure
+
Fix SQL error when running 'fwupdmgr clear-offline'
+
Improve the update report message
+
Only enumerate Dell Docks if the type is known
+
Only run certtool if a new enough gnutls is present
+
Prevent a client crash if the daemon somehow sends invalid data
+
Reboot after scheduling using logind not systemd
+
Use the right encoding for the label in make-images
+
+
+
+
+
+
This release adds the following features:
+
+
Add bash completion for fwupdmgr
+
Add support for newest Thunderbolt chips
+
Allow all functions that take device arguments to be prompted
+
Allow devices to use the runtime version when in bootloader mode
+
Allow overriding ESP mount point via conf file
+
Delete any old fwupdate capsules and efivars when launching fwupd
+
Generate Vala bindings
+
+
This release fixes the following bugs:
+
+
Allow ctrl-d out of the prompt for devices
+
Allow to create package out of provided binary
+
Correct handling of unknown Thunderbolt devices
+
Correctly detect new remotes that are manually copied
+
Fix a crash related to when passing device to downgrade in CLI
+
Fix running the self tests when no fwupd is installed
+
Fix Unifying signature writing and parsing for Texas bootloader
+
Only send success and failure reports to the server
+
Use a CNAME to redirect to the correct CDN for metadata
+
Use a longer timeout when powering back the Thunderbolt device
+
+
+
+
+
+
This release adds the following features:
+
+
Offer to reboot when processing an offline update
+
Report the efivar, libsmbios and fwupdate library versions
+
Report Thunderbolt safe mode and SecureBoot status
+
Show the user a URL when they report a known problem
+
Support split cabinet archives as produced by Windows Update
+
+
This release fixes the following bugs:
+
+
Be more careful deleting and modifying device history
+
Clarify which devices don't have upgrades
+
Ensure the Thunderbolt version is xx.yy
+
Fix a daemon warning when using fwupdmgr get-results
+
Fix crash with MST flashing
+
Fix DFU detach with newer releases of libusb
+
Include the device VID and PID when generating the device-id
+
Set the RemoteId when using GetDetails
+
Stop matching 8bitdo DS4 controller VID/PID
+
Use help2man for dfu-tool and drop docbook dependencies
+
Use ngettext for any strings with plurals
+
Use the default value if ArchiveSizeMax is unspecified
+
+
+
+
+
+
This release adds the following features:
+
+
Add D-Bus methods to get and modify the history information
+
Allow the user to share firmware update success or failure
+
Ask the user to refresh metadata when it is very old
+
Store firmware update success and failure to a local database
+
+
This release fixes the following bugs:
+
+
Add a device name for locked UEFI devices
+
Allow each plugin to opt-in to the recoldplug action
+
Fix firmware downloading using gnome-software
+
Fix UX capsule reference to the one specified in efivar
+
Never add two devices to the daemon with the same ID
+
Rescan supported flags when refreshing metadata
+
+
+
+
+
+
This release adds the following features:
+
+
Add a new plugin to add support for CSR 'Driverless DFU'
+
Add initial SF30/SN30 Pro support
+
Support AppStream metadata with relative <location> URLs
+
+
This release fixes the following bugs:
+
+
Add more metadata to the user-agent string
+
Block owned Dell TPM updates
+
Choose the correct component from provides matches using requirements
+
Do not try to parse huge compressed archive files
+
Fix a double-free bug in the Udev code
+
Handle Thunderbolt 'native' mode
+
+ Use the new functionality in libgcab >= 1.0 to avoid writing temp
+ files
+
+
+
+
+
+
+
This release adds the following features:
+
+
Add a plugin for the Nitrokey Storage device
+
Add support for the original AVR DFU protocol
+
Allow different plugins to claim the same device
+
Allow quirks to set common USB properties
+
Move a common plugin functionality out to a new shared object
+
Optionally delay the device removal for better replugging
+
Set environment variables to allow easy per-plugin debugging
+
Use a SHA1 hash for the internal DeviceID
+
+
This release fixes the following bugs:
+
+
Add quirk for AT32UC3B1256 as used in the RubberDucky
+
Disable the dell plugin if libsmbios fails
+
Don't register for USB UDev events to later ignore them
+
Fix a possible buffer overflow when debugging ebitdo devices
+
Fix critical warning when more than one remote fails to load
+
Fix DFU attaching AVR32 devices like the XMEGA
+
Ignore useless Thunderbolt device types
+
Refactor ColorHug into a much more modern plugin
+
Release the Steelseries interface if getting the version failed
+
Remove autoconf-isms from the meson configure options
+
Show a nicer error message if the requirement fails
+
Sort the output of GetUpgrades correctly
+
+
+
+
+
+
This release adds the following features:
+
+
Add support for HWID requirements
+
Add support for programming various AVR32 and XMEGA parts using DFU
+
Add the various DFU quirks for the Jabra Speak devices
+
Allow specifying the output file type for 'dfu-tool read'
+
Move the database of supported devices out into runtime loaded files
+
Support the IHEX record type 0x05
+
Use help2man to generate the man page at build time
+
Use the new quirk infrastructure for version numbers
+
+
This release fixes the following bugs:
+
+
Catch invalid Dell dock component requests
+
Correctly output Intel HEX files with > 16bit offset addresses
+
Do not try to verify the element write if upload is unsupported
+
Fix a double-unref when updating any 8Bitdo device
+
Fix crash when enumerating with Dell dock connected but with no UEFI
+
Fix uploading large firmware files over DFU
+
Format the BCD USB revision numbers correctly
+
Guess the DFU transfer size if it is not specified
+
Include the reset timeout as wValue to fix some DFU bootloaders
+
Make the error message clearer when sans fonts are missing
+
Support devices with truncated DFU interface data
+
+ Use the correct remote-specified username and passord when using
+ fwupdmgr
+
+
Use the correct wDetachTimeOut when writing DFU firmware
+
Verify devices with legacy VIDs are actually 8Bitdo controllers
+
+
+
+
+
+
This release breaks API and ABI to remove deprecated symbols!
+
This release adds the following features:
+
+
Add a human-readable title for each remote
+
Add a method to return a list of upgrades for a specific device
+
+ Add an 'Summary' and 'Icons' properties to each
+ device
+
+
Add FuDeviceLocker to simplify device open/close lifecycles
+
Add functionality to blacklist Dell HW with problems
+
Add fu_plugin_check_supported()
+
Add fwupd_remote_get_checksum() to use in client programs
+
Add ModifyRemote as an easy way to enable and disable remotes
+
Add the plugin documentation to the main gtk-doc
+
Allow plugins to depend on each other
+
Disable the fallback USB plugin
+
Parse the SMBIOS v2 and v3 DMI tables directly
+
Support uploading the UEFI firmware splash image
+
Use the intel-wmi-thunderbolt kernel module to force power
+
+
This release fixes the following bugs:
+
+
Only run SMI to toggle host MST GPIO on Dell systems with host MST
+
Disable unifying support if no CONFIG_HIDRAW support
+
Do not auto-open all USB devices at startup
+
Do not fail to load the daemon if cached metadata is invalid
+
Do not use system-specific information for UEFI PCI devices
+
Fix a crash when using fu_plugin_device_add_delay()
+
Fix the libdfu self test failure on s390 and ppc64
+
Fix various printing issues with the progressbar
+
Generate the LD script from the GObject introspection data
+
Never fallback to an offline update from client code
+
Only set the Dell coldplug delay when we know we need it
+
Prefer to use HWIDs to get DMI keys and DE table
+
+
+
+
+
+
This release adds the following features:
+
+
Add a configure switch for the LVFS remotes
+
Add a FirmwareBaseURI parameter to the remote config
+
Add a firmware builder that uses bubblewrap
+
+ Add a python script to create fwupd compatible cab files from
+ Microsoft .exe files
+
+
Add a thunderbolt plugin for new kernel interface
+
Allow plugins to get DMI data from the hardware in a safe way
+
Allow plugins to set metadata on devices created by other plugins
+
Optionally install the LVFS PKCS7 root certificate
+
Optionally use GnuTLS to verify PKCS7 certificates
+
+
This release fixes the following bugs:
+
+
Add back options for HAVE_SYNAPTICS and HAVE_THUNDERBOLT
+
Allow configuring systemd and udev directories
+
Enable C99 support in meson.build
+
Fix an incomplete cipher when using XTEA on data not in 4 byte chunks
+
Fix minor const-correctness issues
+
Implement thunderbolt image validation
+
Remove the confusing ALLOW_OFFLINE and ALLOW_ONLINE flags
+
Show a bouncing progress bar if the percentage remains at zero
+
Use a hwid to match supported systems for synapticsmst
+
Use the new bootloader PIDs for Unifying pico receivers
+
When thunderbolt is in safe mode on a Dell recover using SMBIOS
+
+
+
+
+
+
This release adds the following features:
+
+
Add DfuPatch to support forward-only firmware patching
+
Add --version option to fwupdmgr
+
Display all errors recorded by efi_error tracing
+
Make building introspection optional
+
Support embedded devices with local firmware metadata
+
+
This release fixes the following bugs:
+
+
Check all the device GUIDs against the blacklist when added
+
Correct a memory leak in Dell plugin
+
Default to 'en' for UEFI capsule graphics
+
Don't log a warning when an unknown unifying report is parsed
+
Enable test suite via /etc/fwupd.conf
+
Fix a hang on 32 bit computers
+
Fix compilation of the policy on a variety of configurations
+
Fix UEFI crash when the product name is NULL
+
Make flashing ebitdo devices work with fu-ebitdo-tool
+
Make messages from installing capsules useful
+
Make sure the unifying percentage completion goes from 0% to 100%
+
Run the plugin coldplug methods in a predictable order
+
Test UEFI for kernel support during coldplug
+
Use new GUsb functionality to fix flashing Unifying devices
+
+
+
+
+
+
This release adds the following features:
+
+
Add a get-remotes command to fwupdmgr
+
Add a plugin to get the version of the AMT ME interface
+
Add Arch Linux to CI
+
Add some installed tests flashing actual hardware
+
Allow flashing Unifying devices in bootloader modes
+
Allow ordering the metadata remotes
+
+
This release fixes the following bugs:
+
+
Do not check the runtime if the DFU device is in bootloader mode
+
Do not unlock devices when doing VerifyUpdate
+
Filter by Unifying SwId when making HID++2.0 requests
+
Fix downgrades when version_lowest is set
+
Fix the self tests when running on PPC64 big endian
+
Move the remotes parsing from the client to the server
+
Split up the Unifying HID++2.0 and HID++1.0 functionality
+
Store the metadata files rather than merging to one store
+
Use a longer timeout for some Unifying operations
+
Use the UFY DeviceID prefix for Unifying devices
+
+
+
+
+
+
This release adds the following features:
+
+
Add installed tests that use the daemon
+
Add the ability to restrict firmware to specific vendors
+
Enable Travis CI for Fedora and Debian
+
Export some more API for dealing with checksums
+
Generate a images for status messages during system firmware update
+
Show progress download when refreshing metadata
+
+
This release fixes the following bugs:
+
+
Compile with newer versions of meson
+
Ensure that firmware provides are legal GUIDs
+
Fix a common crash when refreshing metadata
+
Use the correct type signature in the D-Bus introspection file
+
+
+
+
+
+
This release adds the following features:
+
+
Add a 'downgrade' command to fwupdmgr
+
Add a 'get-releases' command to fwupdmgr
+
Add support for ConsoleKit2
+
Add support for Microsoft HardwareIDs
+
Allow downloading metadata from more than just the LVFS
+
Allow multiple checksums on devices and releases
+
+
This release fixes the following bugs:
+
+
Allow to specify bindir
+
Correctly open Unifying devices with original factory firmware
+
Deprecate some of the old FwupdResult API
+
Do not copy the origin from the new metadata file
+
Do not expect a Unifying reply when issuing a REBOOT command
+
Do not re-download firmware that exists in the cache
+
Fix a problem when testing for a Dell system
+
Fix flashing new firmware to 8bitdo controllers
+
Increase minimum required AppStream-Glib version to 0.6.13
+
Make documentation and man pages optional
+
Make systemd dependency at least version 231
+
Only decompress the firmware after the signature check
+
Remove 'lib' prefix when looking for libraries
+
Return the remote ID when getting updates about hardware
+
Send the daemon the remote ID when sending firmware metadata
+
+
+
+
+
+
This release adds the following feature:
+
+
Add support for Unifying DFU features
+
+
This release fixes the following bugs:
+
+
Do not spew a critial warning when parsing an invalid URI
+
Ensure device is closed if did not complete setup
+
Ensure steelseries device is closed if it returns an invalid packet
+
Fix man page installation location
+
Ignore spaces in the Unifying version prefix
+
Set HAVE_POLKIT_0_114 when polkit is newer than 0.114
+
+
+
+
+
+
This release adds the following features:
+
+
Add a config option to allow runtime disabling plugins by name
+
Add the Meson build system and remove autotools
+
Support signed Intel HEX files
+
+
This release fixes the following bugs:
+
+
Add DFU quirk for OpenPICC and SIMtrace
+
Create directories in /var/cache as required
+
Refactor the unifying plugin now we know more about the hardware
+
Set the source origin when saving metadata
+
Support proxy servers in fwupdmgr
+
Use a 60 second timeout on all client downloads
+
+
+
+
+
+
This release fixes the following bugs:
+
+
Adjust systemd confinement restrictions
+
Do not hardcode docbook2man path
+
Don't initialize libsmbios on unsupported systems
+
Fix a crash when enumerating devices on a Dell WLD15
+
Fix compiler warnings
+
Fix fwupdmgr timeout with missing pending database
+
+
+
+
+
+
This release adds the following features:
+
+
Add a set of vfuncs that are run before and after a device update
+
+ Add Dell-specific functionality to allow other plugins turn on
+ TBT/GPIO
+
+
Add support for Intel Thunderbolt devices
+
Add support for Logitech Unifying devices
+
Add support for Synaptics MST cascades hubs
+
Add support for the Altus-Metrum ChaosKey device
+
Add VerifyUpdate to update the device checksums server-side
+
+ Allow the metadata to match a version of fwupd and the existing fw
+ version
+
+
+
This release fixes the following bugs:
+
+
Add a new method for forcing a controller to flash mode
+
Always make sure we're getting a C99 compiler
+
Close USB devices before error returns
+
Don't read data from some DfuSe targets
+
Include all debug messages when run with --verbose
+
Return the pending UEFI update when not on AC power
+
+ Use a heuristic for the start address if the firmware has no DfuSe
+ footer
+
+
Use more restrictive settings when running under systemd
+
+
+
+
+
+
This release adds the following features:
+
+
Add a 'replace-data' command to dfu-tool
+
Use an animated progress bar when performing DFU operations
+
+
This release fixes the following bugs:
+
+
Add quirks for HydraBus as it does not have a DFU runtime
+
+ Don't create the UEFI dummy device if the unlock will happen on
+ next boot
+
+
Enable hardening flags on more binaries
+
Fix an assert when unlocking the dummy ESRT device
+
Fix writing firmware to devices using the ST reference bootloader
+
Match the Dell TB16 device
+
Re-get the quirks when the DfuDevice gets a new GUsbDevice
+
Show the nicely formatted target name for DfuSe devices
+
Verify devices support updating in mode they are called
+
+
+
+
+
+
This release adds the following features:
+
+
Add dfu_firmware_add_symbol()
+
Allow the argument to 'dfu-tool set-release' be major.minor
+
Load the Altos USB descriptor from ELF files
+
Support writing the IHEX symbol table
+
+
This release fixes the following bugs:
+
+
Add a fallback for older appstream-glib releases
+
Fix a possible crash when uploading firmware files using libdfu
+
Fix libfwupd self tests when a host-provided fwupd is not available
+
+ Show the human-readable version in the 'dfu-tool dump'
+ output
+
+
Write the ELF files with the correct section type
+
+
+
+
+
+
This release adds the following features:
+
+
Add a set-address and set-target-size commands to dfu-util
+
Add a small library for talking with 0bitdo hardware
+
Add Dell TPM and TB15/WD15 support via new Dell provider
+
Add FU_DEVICE_FLAG_NEEDS_BOOTLOADER
+
Add fwupd_client_get_status()
+
Add fwupd_result_get_unique_id()
+
Add initial ELF reading and writing support to libdfu
+
Add support for installing multiple devices from a CAB file
+
Allow providers to export percentage completion
+
Show a progress notification when installing firmware
+
Show the vendor flashing instructions when installing
+
+
This release fixes the following bugs:
+
+
Add XPS 9250 to Dell TPM modeswitch blacklist
+
Allow blacklisting devices by their GUID
+
Conditionally enable all providers based upon installed
+
Display flashes left in results output when it gets low
+
Do not attempt to add DFU devices not in runtime mode
+
Do not use the deprecated GNOME_COMPILE_WARNINGS
+
Don't fail while checking versions or locked state
+
Embed fwupd version in generated documentation
+
Ensure the ID is set when getting local firmware details
+
Fix gtk-doc build when srcdir != builddir
+
Fix libdfu hang when parsing corrupt IHEX files
+
Ignore devices that do not add at least one GUID
+
In get-details output, display the blob filename
+
Save the unique ID in the pending database
+
Support the 'DEVO' cipher kind in libdfu
+
Switch to the Amazon S3 CDN for firmware metadata
+
Update fwupdmgr manpage for new commands and arguments
+
Use a private gnupg key store
+
Use the correct firmware when installing a composite device
+
Use the SHA1 hash of the local file data as the origin
+
+
+
+
+
+
This release adds the following features:
+
+
Add a GetDetailsLocal() method to eventually replace GetDetails()
+
Add fu_device_get_alternate()
+
Allow devices to have multiple assigned GUIDs
+
Allow metainfo files to match only specific revisions of devices
+
Show the DFU protocol version in 'dfu-tool list'
+
+
This release fixes the following bugs:
+
+
Enforce allowing providers to take away flash abilities
+
Only claim the DFU interface when required
+
Only return updatable devices from GetDevices()
+
+
+
+
+
+
This release adds the following features:
+
+
Add a --force flag to override provider warnings
+
Add device-added, device-removed and device-changed signals
+
Add dfu_image_get_element_default()
+
Add for a new device field 'Flashes Left'
+
Add fwupd_client_connect()
+
Add the 'monitor' debugging command for fwupdmgr
+
Add the 'supported' flag to the FuDevice
+
+
This release fixes the following bugs:
+
+
Add summary and name field for Rival SteelSeries
+
Fix a critical warning when restarting the daemon
+
Fix BE issues when reading and writing DFU files
+
Make the device display name nicer
+
Match the AppStream metadata after a device has been added
+
Remove non-interactive pinentry setting from fu-keyring
+
Return all update descriptions newer than the installed version
+
Set the device description when parsing local firmware files
+
+
+
+
+
+
This release adds the following features:
+
+
Add a version plugin for SteelSeries hardware
+
Add FwupdClient and FwupdResult to libfwupd
+
Generate gtk-doc documentation for libfwupd
+
Return the device flags when getting firmware details
+
Support other checksum kinds
+
+
This release fixes the following bugs:
+
+
Add Alienware to the version quirk table
+
Allow the test suite to run in %check
+
Do not return updates that require AC when on battery
+
Do not use /tmp for downloaded files
+
Test that GPG key import actually was successful
+
+
+
+
+
+
This release adds the following features:
+
+
Add an unlock method for devices
+
Add a simple plugin infrastructure
+
Add ESRT enable method into UEFI provider
+
Install the hardcoded firmware AppStream file
+
+
This release fixes the following bugs:
+
+
Correct the BCD version number for DFU 1.1
+
Do not use deprecated API from libappstream-glib
+
Ignore the DFU runtime on the DW1820A
+
Only read PCI OptionROM firmware when devices are manually unlocked
+
Require AC power before scheduling some types of firmware update
+
Show ignored DFU devices in dfu-util, but not in fwupd
+
+
+
+
+
+
This release adds the following feature:
+
+
+ Add 'Created' and 'Modified' properties on
+ managed devices
+
+
+
This release fixes the following bugs:
+
+
Fix get-results for UEFI provider
+
Support vendor-specific UEFI version encodings
+
+
+
+
+
+
This release fixes the following bugs:
+
+
Always persist ColorHug devices after replug
+
Do not misdetect different ColorHug devices
+
Only dump the profiling data when run with --verbose
+
+
+
+
+
+
+ This release adds a new GObject library called libdfu and a command
+ line client called dfu-tool. This is a low-level tool used to upgrade
+ USB device firmware and can either be shipped in the same package as
+ fwupd or split off as separate subpackages.
+
+
This release adds the following feature:
+
+
Add support for automatically updating USB DFU-capable devices
+
+
This release fixes the following bugs:
+
+
Emit the changed signal after doing an update
+
Export the AppStream ID when returning device results
+
Fix compile with --disable-shared
+
Use new API available in fwup 0.5
+
Use the same device identification string format as Microsoft
+
+
+
+
+
+
This release fixes the following bugs:
+
+
Avoid seeking when reading the file magic during refresh
+
Do not assume that the compressed XML data will be NUL terminated
+
Use the correct user agent string for fwupdmgr
+
+
+
+
+
+
This release adds the following features:
+
+
Add profiling data to debug slow startup times
+
Support cabinet archives files with more than one firmware
+
+
This release fixes the following bugs:
+
+
Add the update description to the GetDetails results
+
+ Clear the in-memory firmware store only after parsing a valid XML
+ file
+
+
Ensure D-Bus remote errors are registered at fwupdmgr startup
+
+ Fix verify-update to produce components with the correct provide
+ values
+
+
Require appstream-glib 0.5.1
+
Show the dotted-decimal representation of the UEFI version number
+
+ When the version is from the 'FW' extension do not cache
+ the device
+
+
+
+
+
+
+
This release fixes the following bugs:
+
+
Fix the error message when no devices can be updated
+
Fix reading symlink to prevent crash with some compilers
+
+
+
+
+
+
This release adds the following feature:
+
+
Raise the dep on GLib to support and use g_autoptr()
+
+
This release fixes the following bugs:
+
+
Do not merge existing firmware metadata
+
Do not reboot if racing with the PackageKit offline update mechanism
+
+
+
+
+
+
This release adds the following feature:
+
+
Remove fwsignd, we have the LVFS now
+
+
This release fixes the following bugs:
+
+
Add application metadata when getting the updates list
+
Depend on appstream-glib >= 0.5.0
+
Don't apply firmware if something else is processing the update
+
Install fwupd into /usr/lib/$(triplet)/fwupd instead
+
Simplify the version properties on devices to avoid complexity
+
Update the offline update service to invoke right command
+
Use the new secure metadata URI
+
+
+
+
+
+
+ For the device verification code to work correctly you need at least
+ libappstream-glib 0.5.0 installed.
+
+
This release adds the following features:
+
+
Add a Raspberry Pi firmware provider
+
Add a simple config file to store the correct LVFS download URI
+
Make parsing the option ROM runtime optional
+
+
This release fixes the following bugs:
+
+
Allow fwupd to be autostarted by systemd
+
+ Allow no arguments to 'fwupdmgr verify-update' and use sane
+ defaults
+
+
Devices with option ROM are always internal
+
Do not pre-convert the update description from AppStream XML
+
Fix validation of written firmware
+
Move the verification and metadata matching phase to the daemon
+
Sign the test binary with the correct key
+
Use the AppStream 0.9 firmware specification by default
+
+
+
+
+
+
+ In this release we've moved the LVFS website to the fwupd project
+ and made them work really well together. To update all the firmware on
+ your system is now just a case of 'fwupdmgr refresh &&
+ fwupdmgr update'.
+ We've also added verification of BIOS and PCI ROM firmware, which
+ may be useful for forensics or to verify that system updates have been
+ applied.
+
+
This release adds the following features:
+
+
Actually parse the complete PCI option ROM
+
+ Add a 'fwupdmgr update' command to update all devices to
+ latest versions
+
+
Add a simple signing server that operates on .cab files
+
+ Add a 'verify' command that verifies the cryptographic hash
+ of device firmware
+
+
Allow clients to add new firmware metadata to the system cache
+
Move GetUpdates to the daemon
+
Move the LVFS website to the fwupd project
+
+
This release fixes the following bugs:
+
+
Accept multiple files at one time when using fwupdmgr dump-rom
+
Automatically download metadata using fwupdmgr if required
+
Do not return NULL as a gboolean
+
Don't call efibootmgr after fwupdate
+
Fallback to offline install when calling the update argument
+
Fix Intel VBIOS detection on Dell hardware
+
Reload appstream data after refreshing
+
Use the new LVFS GPG key
+
Fix build: libgusb is required even without colorhug support
+
+
+
+
+
+
This release adds the following features:
+
+
Get the firmware version from the device descriptors
+
Run the offline actions using systemd when required
+
Support OpenHardware devices using the fwupd vendor extensions
+
+
This release fixes the following bugs:
+
+
Add an UNKNOWN status so we can return meaningful enum values
+
Coldplug the devices before acquiring the well known name
+
+
+
+
+
+
+
+
+
+
This release adds the following features:
+
+
Add a 'get-updates' command to fwupdmgr
+
Add and document the offline-update lifecycle
+
Create a libfwupd shared library
+
+
This release fixes the following bugs:
+
+
Create runtime directories if they do not exist
+
Do not crash when there are no devices to return
+
+
+
+
+
+
fwupd is a simple daemon to allow session software to update firmware.
+
+
+
diff -Nru fwupd-1.0.9/data/org.freedesktop.fwupd.svg fwupd-1.2.10/data/org.freedesktop.fwupd.svg
--- fwupd-1.0.9/data/org.freedesktop.fwupd.svg 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/data/org.freedesktop.fwupd.svg 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,209 @@
+
+
diff -Nru fwupd-1.0.9/data/remotes.d/fwupd.conf fwupd-1.2.10/data/remotes.d/fwupd.conf
--- fwupd-1.0.9/data/remotes.d/fwupd.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/fwupd.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-[fwupd Remote]
-
-# this remote provides metadata shipped with the fwupd package
-Enabled=true
-Title=Core
-Keyring=none
-MetadataURI=file://@datadir@/fwupd/remotes.d/fwupd/metadata.xml
diff -Nru fwupd-1.0.9/data/remotes.d/lvfs.conf fwupd-1.2.10/data/remotes.d/lvfs.conf
--- fwupd-1.0.9/data/remotes.d/lvfs.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/lvfs.conf 2019-07-15 18:25:54.000000000 +0000
@@ -7,3 +7,4 @@
MetadataURI=https://cdn.fwupd.org/downloads/firmware.xml.gz
ReportURI=https://fwupd.org/lvfs/firmware/report
OrderBefore=fwupd
+ApprovalRequired=false
diff -Nru fwupd-1.0.9/data/remotes.d/lvfs.metainfo.xml fwupd-1.2.10/data/remotes.d/lvfs.metainfo.xml
--- fwupd-1.0.9/data/remotes.d/lvfs.metainfo.xml 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/lvfs.metainfo.xml 2019-07-15 18:25:54.000000000 +0000
@@ -4,7 +4,7 @@
org.freedesktop.fwupd.remotes.lvfsLinux Vendor Firmware Service (stable firmware)
- CC0
+ CC0-1.0
diff -Nru fwupd-1.0.9/data/remotes.d/lvfs-testing.conf fwupd-1.2.10/data/remotes.d/lvfs-testing.conf
--- fwupd-1.0.9/data/remotes.d/lvfs-testing.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/lvfs-testing.conf 2019-07-15 18:25:54.000000000 +0000
@@ -9,3 +9,4 @@
Username=
Password=
OrderBefore=lvfs,fwupd
+ApprovalRequired=false
diff -Nru fwupd-1.0.9/data/remotes.d/lvfs-testing.metainfo.xml fwupd-1.2.10/data/remotes.d/lvfs-testing.metainfo.xml
--- fwupd-1.0.9/data/remotes.d/lvfs-testing.metainfo.xml 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/lvfs-testing.metainfo.xml 2019-07-15 18:25:54.000000000 +0000
@@ -4,7 +4,7 @@
org.freedesktop.fwupd.remotes.lvfs-testingLinux Vendor Firmware Service (testing firmware)
- CC0
+ CC0-1.0
diff -Nru fwupd-1.0.9/data/remotes.d/meson.build fwupd-1.2.10/data/remotes.d/meson.build
--- fwupd-1.0.9/data/remotes.d/meson.build 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/meson.build 2019-07-15 18:25:54.000000000 +0000
@@ -33,15 +33,15 @@
con2 = configuration_data()
con2.set('datadir', datadir)
configure_file(
- input : 'fwupd.conf',
- output : 'fwupd.conf',
+ input : 'vendor.conf',
+ output : 'vendor.conf',
configuration : con2,
install: true,
install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
)
configure_file(
- input : 'vendor.conf',
- output : 'vendor.conf',
+ input : 'vendor-directory.conf',
+ output : 'vendor-directory.conf',
configuration : con2,
install: true,
install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
diff -Nru fwupd-1.0.9/data/remotes.d/README.md fwupd-1.2.10/data/remotes.d/README.md
--- fwupd-1.0.9/data/remotes.d/README.md 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/README.md 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,12 @@
Vendor Firmware
===============
-These are the steps to add vendor that is installed as part of an OSTree image:
+These are the steps to add vendor firmware that is installed as part of an embedded image such as an OSTree or ChromeOS image:
* Change `/etc/fwupd/remotes.d/vendor.conf` to have `Enabled=true`
* Change `/etc/fwupd/remotes.d/vendor.conf` to have the correct `Title`
* Deploy the firmware to `/usr/share/fwupd/remotes.d/vendor/firmware`
-* Deploy the metadata to `/usr/share/fwupd/remotes.d/vendor/vendor.xml`
+* Deploy the metadata to `/usr/share/fwupd/remotes.d/vendor/vendor.xml.gz`
The metadata should be of the form:
@@ -39,13 +39,27 @@
in `/etc/fwupd/remotes.d/vendor.conf` and ensure the correct public key or
signing certificate is installed in the `/etc/pki/fwupd` location.
+Automatic metadata generation
+=============================
+`fwupd` and `fwupdtool` support automatically generating metadata for a remote
+by configuring it to be a *directory* type. This is very convenient if you want to dynamically add firmware from multiple packages while generating the image but there are a few deficiencies:
+* There will be a performance impact of starting the daemon or tool measured by O(# CAB files)
+* It's not possible to verify metadata signature and any file validation should be part of the image validation.
+
+To enable this:
+* Change `/etc/fwupd/remotes.d/vendor-directory.conf` to have `Enabled=true`
+* Change `/etc/fwupd/remotes.d/vendor.conf-directory` to have the correct `Title`
+* Deploy the firmware to `/usr/share/fwupd/remotes.d/vendor/firmware`
+* Change `MetadataURI` to that of the directory (Eg `/usr/share/fwupd/remotes.d/vendor/`)
+
+
Mirroring a Repository
======================
The LVFS currently outputs XML with absolute URI locations, e.g.
`http://foo/bar.cab` rather than `bar.cab`
-This makes mirroring the master LVFS (or other slave instance) somewhat tricky.
+This makes mirroring the master LVFS (or other private instance) somewhat tricky.
To work around this issue client remotes can specify `FirmwareBaseURI` to
replace the URI of the firmware before it is downloaded.
diff -Nru fwupd-1.0.9/data/remotes.d/vendor.conf fwupd-1.2.10/data/remotes.d/vendor.conf
--- fwupd-1.0.9/data/remotes.d/vendor.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/vendor.conf 2019-07-15 18:25:54.000000000 +0000
@@ -1,8 +1,8 @@
[fwupd Remote]
-
# this remote provides metadata shipped by the OS vendor and can be found in
-# /usr/share/fwupd/remotes.d/vendor and /usr/share/fwupd/remotes.d/vendor/firmware
+# @datadir@/fwupd/remotes.d/vendor and firmware in @datadir@/fwupd/remotes.d/vendor/firmware
Enabled=false
Title=Vendor
Keyring=none
MetadataURI=file://@datadir@/fwupd/remotes.d/vendor/vendor.xml.gz
+ApprovalRequired=false
diff -Nru fwupd-1.0.9/data/remotes.d/vendor-directory.conf fwupd-1.2.10/data/remotes.d/vendor-directory.conf
--- fwupd-1.0.9/data/remotes.d/vendor-directory.conf 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/data/remotes.d/vendor-directory.conf 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,8 @@
+[fwupd Remote]
+# this remote provides dynamically generated metadata shipped by the OS vendor and can
+# be found in @datadir@/fwupd/remotes.d/vendor/firmware
+Enabled=false
+Title=Vendor (Automatic)
+Keyring=none
+MetadataURI=file://@datadir@/fwupd/remotes.d/vendor/firmware
+ApprovalRequired=false
diff -Nru fwupd-1.0.9/data/tests/fwupd/daemon.conf fwupd-1.2.10/data/tests/fwupd/daemon.conf
--- fwupd-1.0.9/data/tests/fwupd/daemon.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/tests/fwupd/daemon.conf 2019-07-15 18:25:54.000000000 +0000
@@ -1,2 +1,3 @@
[fwupd]
ArchiveSizeMax=5
+ApprovedFirmware=deadbeef
diff -Nru fwupd-1.0.9/data/tests/metadata.xml fwupd-1.2.10/data/tests/metadata.xml
--- fwupd-1.0.9/data/tests/metadata.xml 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/data/tests/metadata.xml 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,14 @@
+
+
+
+ org.fwupd.8330a096d9f1af8567c7374cb8403e1ce9cf3163.device
+
+ 2d47f29b-83a2-4f31-a2e8-63474f4d4c2e
+
+
+
+
Applying will enable UEFI firmware reporting
+
+
+
+
diff -Nru fwupd-1.0.9/data/tests/quirks.d/merged.quirk fwupd-1.2.10/data/tests/quirks.d/merged.quirk
--- fwupd-1.0.9/data/tests/quirks.d/merged.quirk 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/data/tests/quirks.d/merged.quirk 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,2 @@
+[USB\VID_0A5C&PID_6412]
+Flags = MERGE_ME
diff -Nru fwupd-1.0.9/data/tests/quirks.d/tests.quirk fwupd-1.2.10/data/tests/quirks.d/tests.quirk
--- fwupd-1.0.9/data/tests/quirks.d/tests.quirk 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/tests/quirks.d/tests.quirk 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,20 @@
-[fwupd-plugin-test]
+[USB\VID_0A5C&PID_6412]
+Flags= ignore-runtime
-USB\VID_0A5C&PID_6412=ignore-runtime
+[USB\VID_FFFF&PID_FFFF]
+Flags =
-# this is an empty key
-USB\VID_FFFF&PID_FFFF=
+[ACME Inc.=True]
+Test = awesome
-# this is a key with a space
-ACME Inc.=awesome
+[CORP*]
+Test = town
-# this is a wildcard
-CORP*=town
+[DeviceInstanceId=USB\VID_0BDA&PID_1100]
+Flags = clever
+Name = Hub
+Children = FuDevice|USB\VID_0763&PID_2806&I2C_01
+
+[DeviceInstanceId=USB\VID_0763&PID_2806&I2C_01]
+Name = HDMI
+Flags = updatable,internal
diff -Nru fwupd-1.0.9/data/tests/remotes.d/directory.conf fwupd-1.2.10/data/tests/remotes.d/directory.conf
--- fwupd-1.0.9/data/tests/remotes.d/directory.conf 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/data/tests/remotes.d/directory.conf 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,4 @@
+[fwupd Remote]
+Enabled=true
+Keyring=none
+MetadataURI=file:///tmp/fwupd-self-test/var/cache/fwupd
diff -Nru fwupd-1.0.9/data/tests/remotes.d/testing.conf fwupd-1.2.10/data/tests/remotes.d/testing.conf
--- fwupd-1.0.9/data/tests/remotes.d/testing.conf 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/data/tests/remotes.d/testing.conf 2019-07-15 18:25:54.000000000 +0000
@@ -1,3 +1,4 @@
[fwupd Remote]
Enabled=true
MetadataURI=file:///tmp/fwupd-self-test/testing.xml
+ApprovalRequired=true
diff -Nru fwupd-1.0.9/debian/changelog fwupd-1.2.10/debian/changelog
--- fwupd-1.0.9/debian/changelog 2018-10-23 17:06:37.000000000 +0000
+++ fwupd-1.2.10/debian/changelog 2020-01-09 08:25:38.000000000 +0000
@@ -1,35 +1,238 @@
-fwupd (1.0.9-0ubuntu2) bionic; urgency=medium
+fwupd (1.2.10-1ubuntu2~ubuntu18.04.3) bionic; urgency=medium
- * Restrict libsmbios-dev to x86 architectures (LP: #1791999, #1768627, #1719797)
+ * d/p/0001-dont-semver-conversion.patch, d/p/0001-version-handling.patch
+ d/p/0001-plain_support_in_version.patch:
+ backport regression fix that we can install firmware with the same
+ without --allow-reinstall in command line. the patch already merged
+ in upstream 1.2.X branch. (LP: #1820768)
- -- Mario Limonciello Tue, 23 Oct 2018 11:35:36 -0500
+ -- Yuan-Chen Cheng Thu, 09 Jan 2020 16:25:38 +0800
-fwupd (1.0.9-0ubuntu1) bionic; urgency=medium
+fwupd (1.2.10-1ubuntu2~ubuntu18.04.2) bionic; urgency=medium
- * New upstream 1_0_X point release. (LP: #1791999)
- - Add support for more Wacom tablets (Richard Hughes)
- - Add support for the Synaptics Panamera chip (Mario Limonciello)
- - Add validation for Titan Ridge Thunderbolt devices (Andrei Emeltchenko)
- - Use boltd force power API if available (Mario Limonciello)
- - Allow flashing Unifying devices in recovery mode (Richard Hughes)
- - Allow updating just one specific device from the command line
- (Richard Hughes)
- - Do not hold hidraw devices open forever (Richard Hughes)
- - Do not use 8bitdo bootloader commands after a successful flash (Richard Hughes)
- - Don't crash when the Dell alternate device has not been set (Richard Hughes)
- - Don't potentially expose user passwords for remotes (Richard Hughes)
- - Fix a potential buffer overflow when applying a DFU patch (Richard Hughes)
- - Fix a potential segfault in smbios data processing (Mario Limonciello)
- - Fix downgrading older releases to devices (Richard Hughes)
- - Fix failure to detach Unifying devices when using a slow host controller
- (Richard Hughes)
- - Fix flashing devices that require a manual replug (Richard Hughes)
- - Handle -EAGAIN from the kernel better when reading NVM (Mario Limonciello)
- (LP: #1768627)
- * Backport fix for updates showing up again in gnome-software while staged.
- (LP: #1719797)
+ * d/p/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch:
+ - Only check the vendor ID if the device has one set (LP: #1856896)
- -- Mario Limonciello Wed, 19 Sep 2018 07:41:15 -0500
+ -- Robert Ancell Thu, 19 Dec 2019 13:13:48 +1300
+
+fwupd (1.2.10-1ubuntu2~ubuntu18.04.1) bionic; urgency=medium
+
+ * Backport to bionic (LP: #1820768)
+ - meson-0.45-bc.patch: Fix build with meson 0.45
+
+ [ Steve Langasek ]
+ * Drop added Recommends: on bolt which is not in flavor seeds and adds a
+ new service.
+
+ -- Yuan-Chen Cheng Fri, 25 Oct 2019 16:38:06 +0800
+
+fwupd (1.2.10-1ubuntu2) eoan; urgency=medium
+
+ * Backport a patch from upstream to relax expired cert checks
+ in self tests to fix FTBFS (LP: #184375)
+ * Add a patch to skip some self tests if /etc/machine-id exists
+ but is empty (LP: #184375)
+
+ -- Mario Limonciello Tue, 24 Sep 2019 09:24:22 -0500
+
+fwupd (1.2.10-1ubuntu1) eoan; urgency=medium
+
+ * Merge with debian unstable.
+ - Remainining changes: downgrade tpm2-tools/tpm2-abrmd to Suggests.
+
+ -- Mario Limonciello Mon, 15 Jul 2019 14:13:33 -0500
+
+fwupd (1.2.10-1) unstable; urgency=medium
+
+ * New upstream version (1.2.10)
+
+ -- Mario Limonciello Mon, 15 Jul 2019 13:58:47 -0500
+
+fwupd (1.2.9-1ubuntu1) eoan; urgency=medium
+
+ * Merge with debian unstable.
+ - Remainining changes: downgrade tpm2-tools/tpm2-abrmd to Suggests.
+
+ -- Mario Limonciello Fri, 12 Jul 2019 16:07:38 -0500
+
+fwupd (1.2.9-1) unstable; urgency=medium
+
+ * New upstream version (1.2.9)
+
+ -- Mario Limonciello Fri, 12 Jul 2019 14:25:32 -0500
+
+fwupd (1.2.6-1) unstable; urgency=medium
+
+ * New upstream version (1.2.6)
+ * debian/control:
+ - Add new build depends related to Modem Manager
+
+ -- Mario Limonciello Mon, 01 Apr 2019 21:18:14 -0500
+
+fwupd (1.2.5-2) unstable; urgency=medium
+
+ * debian/gen_signing_json: Update the format of the json metadata to
+ match new requirements:
+ + Move all the data under a new top-level "packages" key
+ + Add an empty "trusted_certs" key - our binaries do not do any
+ further verification with an embedded key.
+
+ -- Steve McIntyre <93sam@debian.org> Mon, 25 Mar 2019 00:32:07 +0000
+
+fwupd (1.2.5-1) unstable; urgency=medium
+
+ * New upstream version (1.2.5)
+ * Drop all patches, upstream
+
+ -- Mario Limonciello Tue, 26 Feb 2019 16:30:52 -0600
+
+fwupd (1.2.4-3) unstable; urgency=medium
+
+ * Backport a patch from master that fixes FTBFS with newer glib
+
+ -- Mario Limonciello Fri, 15 Feb 2019 08:06:55 -0600
+
+fwupd (1.2.4-2) unstable; urgency=medium
+
+ * debian: explicitly depend on shared-mime-info
+
+ -- Mario Limonciello Thu, 14 Feb 2019 21:21:46 -0600
+
+fwupd (1.2.4-1) unstable; urgency=medium
+
+ * New upstream version
+ * refresh build dependencies
+ * Recommends on tpm2 stack to read PCR values
+
+ -- Mario Limonciello Wed, 06 Feb 2019 20:31:24 -0600
+
+fwupd (1.1.4-1) unstable; urgency=medium
+
+ * New upstream version
+
+ -- Mario Limonciello Wed, 07 Nov 2018 11:30:14 -0600
+
+fwupd (1.1.3-2) unstable; urgency=medium
+
+ * Move location of fwupd-SIGNARCH-signed.install to proper directory
+ to fix generation of signed packages.
+
+ -- Mario Limonciello Sat, 13 Oct 2018 14:17:07 -0500
+
+fwupd (1.1.3-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Mario Limonciello Fri, 12 Oct 2018 13:18:46 -0500
+
+fwupd (1.1.2-1) unstable; urgency=medium
+
+ * New upstream release
+ - Fixes ESP autodetection for autofs (Closes: #906216)
+ - Adds missing signing bits (Closes: #906599)
+ * debian/rules:
+ - Pass -a into dh_missing (Closes: #906357)
+ * debian/control:
+ - Recommends for bolt for new thunderbolt power API
+ - Build depends on Noto fonts instead of Dejavu fonts
+ * Drop all patches.
+
+ -- Mario Limonciello Mon, 10 Sep 2018 11:42:03 -0500
+
+fwupd (1.1.1-1) unstable; urgency=medium
+
+ * New upstream release.
+ - Adds support for more Synaptics and Intel hardware.
+ - Fixes firmware update on some UEFI implementations (Closes: #905570)
+ * debian/
+ - contrib: debian: regenerate control on clean
+ - refresh debian/{control,copyright} for upstream fixes
+ - drop all patches, upstream.
+
+ -- Mario Limonciello Mon, 13 Aug 2018 08:08:53 -0500
+
+fwupd (1.1.0-7) unstable; urgency=medium
+
+ * Correct another syntax error in SB signing template (Closes: #905482)
+
+ -- Mario Limonciello Sun, 05 Aug 2018 08:34:37 -0500
+
+fwupd (1.1.0-6) unstable; urgency=medium
+
+ * correct secure boot signing template name (Closes: #905471)
+
+ -- Mario Limonciello Sun, 05 Aug 2018 00:06:30 -0500
+
+fwupd (1.1.0-5) unstable; urgency=medium
+
+ * Fix secure boot signing template version string (Closes: #905468)
+ * Refresh debian/copyright (Closes: #904671)
+
+ -- Mario Limonciello Sat, 04 Aug 2018 22:37:36 -0500
+
+fwupd (1.1.0-4) unstable; urgency=medium
+
+ * debian/rules: dynamically install EFI binaries
+
+ -- Mario Limonciello Sat, 04 Aug 2018 19:43:44 -0500
+
+fwupd (1.1.0-3) unstable; urgency=medium
+
+ * debian/rules: use pkg-config to determine when to turn on redfish and UEFI
+ - Fixes FTBFS due to redfish on other architectures.
+
+ -- Mario Limonciello Sat, 04 Aug 2018 17:04:27 -0500
+
+fwupd (1.1.0-2) unstable; urgency=medium
+
+ * Fix the filename of the signed archive used for secure boot on Ubuntu
+ * Only build uefi plugin on supported architectures
+
+ -- Mario Limonciello Sat, 04 Aug 2018 11:27:24 -0500
+
+fwupd (1.1.0-1) unstable; urgency=medium
+
+ [ Steve Mcintyre ]
+ * Initial support for UEFI Secure Boot in Debian infrastructure
+ + When building, also generate a fwupdate-$ARCH-signed-template package
+ which contains metadata needed by the Debian signing service. This
+ will end up being turned into a new source package including a signed
+ version of the fwupdate binary.
+
+ [ Mario Limonciello ]
+ * New upstream version (1.1.0)
+ * Drop patches merged upstream.
+ * debian/control:
+ - Add a patch from upstream that will add gnu-efi to dependencies
+ - No longer recommends for fwupdate as it has been merged into fwupd.
+ * Adjust infrastructure for fwupdate signed package to be used by fwupd signed
+ package
+
+ -- Mario Limonciello Thu, 12 Jul 2018 08:28:32 -0500
+
+fwupd (1.0.8-1) unstable; urgency=medium
+
+ * New upstream version (1.0.8)
+ - Adds new fwupdtool
+ - License is now LGPL 2.1
+ - Drops colorhug dependency (built in now)
+ - refresh symbols
+
+ -- Mario Limonciello Thu, 07 Jun 2018 08:16:22 -0500
+
+fwupd (1.0.7-1) unstable; urgency=medium
+
+ * New upstream version (1.0.7)
+ * /debian changes:
+ - ignore library-not-linked-against-libc
+ - Remove unused override in debian/lintian/fwupd
+ - rename tag for debian/source/lintian-overrides
+ - Adjust to use https in debian/copyright
+ - Bump debian/compat to 10
+ - Update control version
+ - update standards version
+
+ -- Mario Limonciello Mon, 30 Apr 2018 13:11:17 -0500
fwupd (1.0.6-2) unstable; urgency=medium
@@ -79,7 +282,7 @@
fwupd (1.0.2-1) unstable; urgency=medium
* New upstream version
- * Drop patch for doing libsmbios on only supported architectures,
+ * Drop patch for doing libsmbios on only supported architectures,
now upstream.
-- Mario Limonciello Tue, 28 Nov 2017 09:36:57 -0600
@@ -298,7 +501,7 @@
* Correct a cleanup rule
* Drop intltool build dependency
* Re-enable PIE for builds
- * Add additional build dependencies that will be needed for generating
+ * Add additional build dependencies that will be needed for generating
capsule graphics
* debian/control: sort build-dependencies
* Drop packaging from debian/, it will be git mv'ed from contrib/ upstream
diff -Nru fwupd-1.0.9/debian/compat fwupd-1.2.10/debian/compat
--- fwupd-1.0.9/debian/compat 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/compat 2019-12-19 00:13:48.000000000 +0000
@@ -1 +1 @@
-10
+11
diff -Nru fwupd-1.0.9/debian/control fwupd-1.2.10/debian/control
--- fwupd-1.0.9/debian/control 2018-10-23 16:35:33.000000000 +0000
+++ fwupd-1.2.10/debian/control 2020-01-09 08:25:38.000000000 +0000
@@ -1,32 +1,34 @@
Source: fwupd
Priority: optional
-Maintainer: Debian EFI
+Maintainer: Ubuntu Developers
+XSBC-Original-Maintainer: Debian EFI
Uploaders: Steve McIntyre <93sam@debian.org>,
Daniel Jared Dominguez ,
Matthias Klumpp ,
Mario Limonciello
Build-Depends:
bash-completion,
- debhelper (>= 10.3),
+ bubblewrap,
+ debhelper (>= 11),
dh-strip-nondeterminism,
fontconfig,
- fonts-dejavu,
+ fonts-noto,
gcab,
gettext (>= 0.19.8.1),
gir1.2-pango-1.0,
+ gnu-efi [amd64 arm64 armhf i386],
gnutls-bin,
gnutls-dev,
gobject-introspection,
gtk-doc-tools,
help2man,
- libappstream-glib-dev (>= 0.6.9),
libarchive-dev,
libcairo-dev,
libcairo-gobject2,
- libefivar-dev [amd64 arm64 armhf armel i386],
+ libefiboot-dev [amd64 arm64 armhf i386],
+ libefivar-dev [amd64 arm64 armhf i386],
libelf-dev,
libfreetype6-dev,
- libfwup-dev [amd64 arm64 armhf i386],
libgcab-dev,
libgirepository1.0-dev,
libglib2.0-dev (>= 2.45.8),
@@ -34,11 +36,14 @@
libgudev-1.0-dev,
libgusb-dev (>= 0.2.9),
libjson-glib-dev (>= 1.1.1),
+ libmm-glib-dev,
libpolkit-gobject-1-dev,
- libsmbios-dev [amd64 i386],
+ libqmi-glib-dev,
+ libsmbios-dev [i386 amd64],
libsoup2.4-dev,
libsqlite3-dev,
libtool-bin,
+ libxmlb-dev (>= 0.1.5),
locales,
meson,
pkg-config,
@@ -46,12 +51,13 @@
python3-gi-cairo,
python3-pil,
python3-requests,
+ shared-mime-info,
systemd (>= 231),
udev,
umockdev,
valac,
valgrind [!ia64 !riscv64 !x32 !mips !sparc64 !sh4 !ppc64 !powerpcspe !hppa !alpha !mips64el !armhf !armel !mipsel !m68k],
-Standards-Version: 4.1.4
+Standards-Version: 4.3.0
Section: admin
Homepage: https://github.com/hughsie/fwupd
Vcs-Git: https://salsa.debian.org/efi-team/fwupd.git
@@ -67,8 +73,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides the library used by the daemon.
@@ -76,9 +81,13 @@
Package: fwupd
Architecture: linux-any
Depends: ${misc:Depends},
- ${shlibs:Depends}
-Recommends: fwupdate,
- python3
+ ${shlibs:Depends},
+ shared-mime-info
+Recommends: python3,
+ fwupd-signed
+Suggests: bolt,
+ tpm2-tools,
+ tpm2-abrmd,
Breaks: gir1.2-dfu-1.0 (<< 0.9.7-1),
libdfu1 (<< 0.9.7-1),
libdfu-dev (<< 0.9.7-1)
@@ -90,8 +99,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
Package: fwupd-tests
@@ -113,8 +121,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides a set of installed tests that can be run to validate
@@ -129,8 +136,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides development documentation for creating a package that
@@ -149,8 +155,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides the development files for libfwupd
@@ -166,3 +171,31 @@
.
It can be used by packages using the GIRepository format to generate
dynamic bindings.
+
+Package: fwupd-amd64-signed-template
+Architecture: amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-i386-signed-template
+Architecture: i386
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-armhf-signed-template
+Architecture: armhf
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-arm64-signed-template
+Architecture: arm64
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
diff -Nru fwupd-1.0.9/debian/control.in fwupd-1.2.10/debian/control.in
--- fwupd-1.0.9/debian/control.in 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/control.in 2019-12-19 00:13:48.000000000 +0000
@@ -1,12 +1,13 @@
Source: fwupd
Priority: optional
-Maintainer: Debian EFI
+Maintainer: Ubuntu Developers
+XSBC-Original-Maintainer: Debian EFI
Uploaders: Steve McIntyre <93sam@debian.org>,
Daniel Jared Dominguez ,
Matthias Klumpp ,
Mario Limonciello
Build-Depends: %%%DYNAMIC%%%
-Standards-Version: 4.1.4
+Standards-Version: 4.3.0
Section: admin
Homepage: https://github.com/hughsie/fwupd
Vcs-Git: https://salsa.debian.org/efi-team/fwupd.git
@@ -22,8 +23,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides the library used by the daemon.
@@ -31,9 +31,13 @@
Package: fwupd
Architecture: linux-any
Depends: ${misc:Depends},
- ${shlibs:Depends}
-Recommends: fwupdate,
- python3
+ ${shlibs:Depends},
+ shared-mime-info
+Recommends: python3,
+ fwupd-signed
+Suggests: bolt,
+ tpm2-tools,
+ tpm2-abrmd,
Breaks: gir1.2-dfu-1.0 (<< 0.9.7-1),
libdfu1 (<< 0.9.7-1),
libdfu-dev (<< 0.9.7-1)
@@ -45,8 +49,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
Package: fwupd-tests
@@ -68,8 +71,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides a set of installed tests that can be run to validate
@@ -84,8 +86,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides development documentation for creating a package that
@@ -104,8 +105,7 @@
fwupd is a daemon to allow session software to update device firmware.
You can either use a GUI software manager like GNOME Software to view and
apply updates, the command-line tool or the system D-Bus interface directly.
- Currently, firmware updates using the UEFI capsule format and for the
- ColorHug are supported. More formats may be supported in the future.
+ Firmware updates are supported for a variety of technologies.
See for details
.
This package provides the development files for libfwupd
@@ -121,3 +121,31 @@
.
It can be used by packages using the GIRepository format to generate
dynamic bindings.
+
+Package: fwupd-amd64-signed-template
+Architecture: amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-i386-signed-template
+Architecture: i386
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-armhf-signed-template
+Architecture: armhf
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
+
+Package: fwupd-arm64-signed-template
+Architecture: arm64
+Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
+Description: Template for signed fwupd package
+ This package is used to control code signing by the Debian signing
+ service.
diff -Nru fwupd-1.0.9/debian/copyright fwupd-1.2.10/debian/copyright
--- fwupd-1.0.9/debian/copyright 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/copyright 2020-01-09 08:25:38.000000000 +0000
@@ -3,16 +3,32 @@
Source: https://github.com/hughsie/fwupd
Files: *
-Copyright: 2015 Richard Hughes
+Copyright: Aleksander Morgado
+ Christian J. Kellner
+ Dell Inc.
+ Dell, Inc.
+ Google, Inc.
+ Intel Corporation.
+ Kalev Lember
+ Mario Limonciello
+ Max Ehrlich max.ehr@gmail.com
+ Peichen Huang
+ Peter Jones
+ Realtek Semiconductor Corporation
+ Red Hat, Inc.
+ Richard Hughes
+ Ryan Chang
+ Synaptics
+ Synaptics Inc
License: LGPL-2.1+
-Files: data/tests/colorhug/firmware.metainfo.xml
-Copyright: 2015 Richard Hughes
+Files: *.metainfo.xml
+Copyright: Richard Hughes
License: CC0-1.0
Files: debian/*
Copyright: 2015 Daniel Jared Dominguez
- 2015 Mario Limonciello
+ 2015-2018 Mario Limonciello
License: LGPL-2.1+
License: LGPL-2.1+
diff -Nru fwupd-1.0.9/debian/copyright.in fwupd-1.2.10/debian/copyright.in
--- fwupd-1.0.9/debian/copyright.in 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/copyright.in 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,140 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: fwupd
+Source: https://github.com/hughsie/fwupd
+
+%%%DYNAMIC%%%
+Files: *.metainfo.xml
+Copyright: Richard Hughes
+License: CC0-1.0
+
+Files: debian/*
+Copyright: 2015 Daniel Jared Dominguez
+ 2015-2018 Mario Limonciello
+License: LGPL-2.1+
+
+License: LGPL-2.1+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1".
+
+
+License: CC0-1.0
+ Creative Commons CC0 1.0 Universal
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
+ SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT
+ RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+ CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE
+ INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES
+ RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+ HEREUNDER.
+ .
+ Statement of Purpose
+ .
+ The laws of most jurisdictions throughout the world automatically confer
+ exclusive Copyright and Related Rights (defined below) upon the creator and
+ subsequent owner(s) (each and all, an "owner") of an original work of
+ authorship and/or a database (each, a "Work"). Certain owners wish to
+ permanently relinquish those rights to a Work for the purpose of contributing
+ to a commons of creative, cultural and scientific works ("Commons") that the
+ public can reliably and without fear of later claims of infringement build
+ upon, modify, incorporate in other works, reuse and redistribute as freely as
+ possible in any form whatsoever and for any purposes, including without
+ limitation commercial purposes. These owners may contribute to the Commons to
+ promote the ideal of a free culture and the further production of creative,
+ cultural and scientific works, or to gain reputation or greater distribution
+ for their Work in part through the use and efforts of others. For these and/or
+ other purposes and motivations, and without any expectation of additional
+ consideration or compensation, the person associating CC0 with a Work (the
+ "Affirmer"), to the extent that he or she is an owner of Copyright and Related
+ Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly
+ distribute the Work under its terms, with knowledge of his or her Copyright and
+ Related Rights in the Work and the meaning and intended legal effect of CC0 on
+ those rights.
+ .
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
+ protected by copyright and related or neighboring rights ("Copyright and
+ Related Rights"). Copyright and Related Rights include, but are not limited to,
+ the following:
+ i. the right to reproduce, adapt, distribute, perform, display, communicate,
+ and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+ iii. publicity and privacy rights pertaining to a person's image or likeness
+ depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work, subject
+ to the limitations in paragraph 4(a), below;
+ v. rights protecting the extraction, dissemination, use and reuse of data in a
+ Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+ European Parliament and of the Council of 11 March 1996 on the legal protection
+ of databases, and under any national implementation thereof, including any
+ amended or successor version of such directive); and
+ vii. other similar, equivalent or corresponding rights throughout the world
+ based on applicable law or treaty, and any national implementations thereof.
+ .
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of,
+ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
+ unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
+ and Related Rights and associated claims and causes of action, whether now
+ known or unknown (including existing as well as future claims and causes of
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum
+ duration provided by applicable law or treaty (including future time
+ extensions), (iii) in any current or future medium and for any number of
+ copies, and (iv) for any purpose whatsoever, including without limitation
+ commercial, advertising or promotional purposes (the "Waiver").
+ Affirmer makes the Waiver for the benefit of each member of the public at large
+ and to the detriment of Affirmer's heirs and successors, fully intending that
+ such Waiver shall not be subject to revocation, rescission, cancellation,
+ termination, or any other legal or equitable action to disrupt the quiet
+ enjoyment of the Work by the public as contemplated by Affirmer's express
+ Statement of Purpose.
+ .
+ 3. Public License Fallback. Should any part of the Waiver for any reason be
+ judged legally invalid or ineffective under applicable law, then the Waiver
+ shall be preserved to the maximum extent permitted taking into account
+ Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
+ is so judged Affirmer hereby grants to each affected person a royalty-free, non
+ transferable, non sublicensable, non exclusive, irrevocable and unconditional
+ license to exercise Affirmer's Copyright and Related Rights in the Work (i) in
+ all territories worldwide, (ii) for the maximum duration provided by
+ applicable law or treaty (including future time extensions), (iii) in any
+ current or future medium and for any number of copies, and (iv) for any
+ purpose whatsoever, including without limitation commercial, advertising or
+ promotional purposes (the "License"). The License shall be deemed effective
+ as of the date CC0 was applied by Affirmer to the Work. Should any part of
+ the License for any reason be judged legally invalid or ineffective under
+ applicable law, such partial invalidity or ineffectiveness shall not
+ invalidate the remainder of the License, and in such case Affirmer hereby
+ affirms that he or she will not (i) exercise any of his or her remaining
+ Copyright and Related Rights in the Work or (ii) assert any associated claims
+ and causes of action with respect to the Work, in either case contrary to
+ Affirmer's express Statement of Purpose.
+ .
+ 4. Limitations and Disclaimers.
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+ surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or warranties of
+ any kind concerning the Work, express, implied, statutory or otherwise,
+ including without limitation warranties of title, merchantability, fitness for
+ a particular purpose, non infringement, or the absence of latent or other
+ defects, accuracy, or the present or absence of errors, whether or not
+ discoverable, all to the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons that
+ may apply to the Work or any use thereof, including without limitation any
+ person's Copyright and Related Rights in the Work. Further, Affirmer disclaims
+ responsibility for obtaining any necessary consents, permissions or other
+ rights required for any use of the Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a party
+ to this document and has no duty or obligation with respect to this CC0 or use
+ of the Work.
diff -Nru fwupd-1.0.9/debian/docs fwupd-1.2.10/debian/docs
--- fwupd-1.0.9/debian/docs 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/docs 2019-12-19 00:13:48.000000000 +0000
@@ -1 +1 @@
-NEWS
+
diff -Nru fwupd-1.0.9/debian/fwupd.install fwupd-1.2.10/debian/fwupd.install
--- fwupd-1.0.9/debian/fwupd.install 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/fwupd.install 2019-12-19 00:13:48.000000000 +0000
@@ -4,13 +4,17 @@
usr/share/bash-completion
usr/share/fwupd/*
usr/share/dbus-1/*
+usr/share/icons/*
usr/share/polkit-1/*
usr/share/locale
usr/share/metainfo/*
usr/lib/*/fwupd
+usr/lib/*/fwupdagent
+usr/lib/*/fwupdoffline
usr/lib/*/fwupdtool
usr/share/man/man1/*
lib/systemd/system/*
+lib/systemd/system-shutdown/*
var/lib/fwupd
lib/udev/rules.d/*
data/daemon.conf etc/fwupd
diff -Nru fwupd-1.0.9/debian/fwupd.postinst fwupd-1.2.10/debian/fwupd.postinst
--- fwupd-1.0.9/debian/fwupd.postinst 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/fwupd.postinst 2019-12-19 00:13:48.000000000 +0000
@@ -6,4 +6,6 @@
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
dpkg-maintscript-helper rm_conffile \
/etc/fwupd.conf 1.0.0~ -- "$@"
+ dpkg-maintscript-helper rm_conffile \
+ /etc/fwupd/remotes.d/fwupd.conf 1.2.7~ -- "$@"
fi
diff -Nru fwupd-1.0.9/debian/fwupd-tests.install fwupd-1.2.10/debian/fwupd-tests.install
--- fwupd-1.0.9/debian/fwupd-tests.install 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/fwupd-tests.install 2019-12-19 00:13:48.000000000 +0000
@@ -5,3 +5,4 @@
usr/share/installed-tests/*
usr/lib/*/fwupd-plugins-3/libfu_plugin_test.so
debian/lintian/fwupd-tests usr/share/lintian/overrides
+etc/fwupd/remotes.d/fwupd-tests.conf
diff -Nru fwupd-1.0.9/debian/fwupd-tests.postinst fwupd-1.2.10/debian/fwupd-tests.postinst
--- fwupd-1.0.9/debian/fwupd-tests.postinst 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/fwupd-tests.postinst 2019-12-19 00:13:48.000000000 +0000
@@ -12,4 +12,12 @@
echo "To enable test suite, modify /etc/fwupd/daemon.conf"
fi
fi
+ if [ -f /etc/fwupd/remotes.d/fwupd-tests.conf ]; then
+ if [ "$CI" = "true" ]; then
+ sed "s,^Enabled=false,Enabled=true," -i /etc/fwupd/remotes.d/fwupd-tests.conf
+ else
+ echo "To enable test suite, enable fwupd-tests remote"
+ fi
+
+ fi
fi
diff -Nru fwupd-1.0.9/debian/gbp.conf fwupd-1.2.10/debian/gbp.conf
--- fwupd-1.0.9/debian/gbp.conf 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/gbp.conf 2019-12-19 00:13:48.000000000 +0000
@@ -1,5 +1,5 @@
[DEFAULT]
-debian-branch = debian
+debian-branch = ubuntu
upstream-tag = %(version)s
[buildpackage]
diff -Nru fwupd-1.0.9/debian/gen_signing_changelog fwupd-1.2.10/debian/gen_signing_changelog
--- fwupd-1.0.9/debian/gen_signing_changelog 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/gen_signing_changelog 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Generate a changelog file for the signed fwupdate package, based on
+# a changelog.in file and other state
+
+DIR=$1
+SOURCE=$2
+ARCH=$3
+IN="${DIR}/changelog.in"
+OUT="${DIR}/changelog"
+
+# Parse out fields from our changelg entry - want the signing-template
+# one to match all the important details where we can
+DISTRIBUTION="$(dpkg-parsechangelog | sed -ne 's/^Distribution: \(.*\)/\1/p')"
+URGENCY="$(dpkg-parsechangelog | sed -ne 's/^Urgency: \(.*\)/\1/p')"
+MAINT="$(dpkg-parsechangelog | sed -ne 's/^Maintainer: \(.*\)/\1/p')"
+DATE="$(dpkg-parsechangelog | sed -ne 's/^Date: \(.*\)/\1/p')"
+
+# If the version ends in "+bXXX", this is a binNMU. We don't want a new
+# source package to look like that, so change it to ".bXXX" instead
+VERSION="$(dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)/\1/p')"
+MANGLED_VERSION="$(echo $VERSION | sed -r 's/-/\+/;s/\+(b[[:digit:]]+)$/.\1/')"
+
+printf "%s-%s-signed (%s) %s; urgency=%s\n" "${SOURCE}" "${ARCH}" "${MANGLED_VERSION}" "${DISTRIBUTION}" "${URGENCY}" > $OUT
+printf "\n" >> $OUT
+printf " * Update to %s version %s\n" "${SOURCE}" "${VERSION}" >> $OUT
+printf "\n" >> $OUT
+printf " -- %s %s\n" "${MAINT}" "${DATE}" >> $OUT
+printf "\n" >> $OUT
+
+cat $IN >> $OUT
+rm -f $IN
diff -Nru fwupd-1.0.9/debian/gen_signing_json fwupd-1.2.10/debian/gen_signing_json
--- fwupd-1.0.9/debian/gen_signing_json 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/gen_signing_json 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Generate a json file to go in the the fwupd-signed template
+# package. Describes exactly what needs to be signed, and how.
+
+DIR=$1
+SOURCE=$2
+ARCH=$3
+OUT="$DIR/files.json"
+
+# What file are we looking to sign?
+BINARY=$(find debian/tmp -name '*.efi' | xargs basename)
+
+# Actually needs full path within the binary deb
+BINARY="usr/lib/${SOURCE}/efi/${BINARY}"
+
+rm -f $OUT
+
+printf '{\n' >> $OUT
+printf ' "packages": {\n' >> $OUT
+printf ' "%s": {\n' "${SOURCE}" >> $OUT
+printf ' "trusted_certs": [],\n' >> $OUT
+printf ' "files": [ \n' >> $OUT
+printf ' {"sig_type": "efi", "file": "%s"}\n' "${BINARY}" >> $OUT
+printf ' ]\n' >> $OUT
+printf ' }\n' >> $OUT
+printf ' }\n' >> $OUT
+printf '}\n' >> $OUT
+
diff -Nru fwupd-1.0.9/debian/gir1.2-fwupd-2.0.install fwupd-1.2.10/debian/gir1.2-fwupd-2.0.install
--- fwupd-1.0.9/debian/gir1.2-fwupd-2.0.install 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/gir1.2-fwupd-2.0.install 2019-12-19 00:13:48.000000000 +0000
@@ -1 +1 @@
-usr/lib/*/girepository-1.0/Fwupd-2.0.typelib
+usr/lib/*/girepository-1.0/*.typelib
diff -Nru fwupd-1.0.9/debian/libfwupd2.install fwupd-1.2.10/debian/libfwupd2.install
--- fwupd-1.0.9/debian/libfwupd2.install 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/libfwupd2.install 2019-12-19 00:13:48.000000000 +0000
@@ -1 +1 @@
-usr/lib/*/libfwup*.so.*
+usr/lib/*/*.so.*
diff -Nru fwupd-1.0.9/debian/libfwupd2.symbols fwupd-1.2.10/debian/libfwupd2.symbols
--- fwupd-1.0.9/debian/libfwupd2.symbols 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/libfwupd2.symbols 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,253 @@
+libfwupd.so.2 libfwupd2 #MINVER#
+ LIBFWUPD_0.1.1@LIBFWUPD_0.1.1 1.0.0
+ LIBFWUPD_0.7.0@LIBFWUPD_0.7.0 1.0.0
+ LIBFWUPD_0.7.1@LIBFWUPD_0.7.1 1.0.0
+ LIBFWUPD_0.7.3@LIBFWUPD_0.7.3 1.0.0
+ LIBFWUPD_0.8.0@LIBFWUPD_0.8.0 1.0.0
+ LIBFWUPD_0.9.2@LIBFWUPD_0.9.2 1.0.0
+ LIBFWUPD_0.9.3@LIBFWUPD_0.9.3 1.0.0
+ LIBFWUPD_0.9.4@LIBFWUPD_0.9.4 1.0.0
+ LIBFWUPD_0.9.5@LIBFWUPD_0.9.5 1.0.0
+ LIBFWUPD_0.9.6@LIBFWUPD_0.9.6 1.0.0
+ LIBFWUPD_0.9.7@LIBFWUPD_0.9.7 1.0.0
+ LIBFWUPD_0.9.8@LIBFWUPD_0.9.8 1.0.0
+ LIBFWUPD_1.0.0@LIBFWUPD_1.0.0 1.0.0
+ LIBFWUPD_1.0.3@LIBFWUPD_1.0.3 1.0.3
+ LIBFWUPD_1.0.4@LIBFWUPD_1.0.4 1.0.4
+ LIBFWUPD_1.0.7@LIBFWUPD_1.0.7 1.0.7
+ LIBFWUPD_1.0.8@LIBFWUPD_1.0.8 1.0.8
+ LIBFWUPD_1.1.0@LIBFWUPD_1.1.0 1.1.0
+ LIBFWUPD_1.1.1@LIBFWUPD_1.1.1 1.1.1
+ LIBFWUPD_1.1.2@LIBFWUPD_1.1.2 1.1.2
+ LIBFWUPD_1.1.3@LIBFWUPD_1.1.3 1.1.3
+ LIBFWUPD_1.2.10@LIBFWUPD_1.2.10 1.2.10
+ LIBFWUPD_1.2.1@LIBFWUPD_1.2.1 1.2.1
+ LIBFWUPD_1.2.2@LIBFWUPD_1.2.2 1.2.2
+ LIBFWUPD_1.2.4@LIBFWUPD_1.2.4 1.2.4
+ LIBFWUPD_1.2.5@LIBFWUPD_1.2.5 1.2.5
+ LIBFWUPD_1.2.6@LIBFWUPD_1.2.6 1.2.6
+ LIBFWUPD_1.2.7@LIBFWUPD_1.2.7 1.2.7
+ LIBFWUPD_1.2.8@LIBFWUPD_1.2.8 1.2.8
+ LIBFWUPD_1.2.9@LIBFWUPD_1.2.9 1.2.9
+ fwupd_build_history_report_json@LIBFWUPD_1.0.4 1.0.4
+ fwupd_build_machine_id@LIBFWUPD_1.0.4 1.0.4
+ fwupd_build_user_agent@LIBFWUPD_1.0.3 1.0.3
+ fwupd_checksum_format_for_display@LIBFWUPD_0.9.3 1.0.0
+ fwupd_checksum_get_best@LIBFWUPD_0.9.4 1.0.0
+ fwupd_checksum_get_by_kind@LIBFWUPD_0.9.4 1.0.0
+ fwupd_checksum_guess_kind@LIBFWUPD_0.9.3 1.0.0
+ fwupd_client_activate@LIBFWUPD_1.2.6 1.2.6
+ fwupd_client_clear_results@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_connect@LIBFWUPD_0.7.1 1.0.0
+ fwupd_client_get_approved_firmware@LIBFWUPD_1.2.6 1.2.6
+ fwupd_client_get_daemon_version@LIBFWUPD_0.9.6 1.0.0
+ fwupd_client_get_details@LIBFWUPD_1.0.0 1.0.0
+ fwupd_client_get_device_by_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_client_get_devices@LIBFWUPD_0.9.2 1.0.0
+ fwupd_client_get_downgrades@LIBFWUPD_0.9.8 1.0.0
+ fwupd_client_get_history@LIBFWUPD_1.0.4 1.0.4
+ fwupd_client_get_percentage@LIBFWUPD_0.7.3 1.0.0
+ fwupd_client_get_releases@LIBFWUPD_0.9.3 1.0.0
+ fwupd_client_get_remote_by_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_client_get_remotes@LIBFWUPD_0.9.3 1.0.0
+ fwupd_client_get_results@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_get_status@LIBFWUPD_0.7.3 1.0.0
+ fwupd_client_get_tainted@LIBFWUPD_1.2.4 1.2.4
+ fwupd_client_get_type@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_get_upgrades@LIBFWUPD_0.9.8 1.0.0
+ fwupd_client_install@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_modify_config@LIBFWUPD_1.2.8 1.2.8
+ fwupd_client_modify_device@LIBFWUPD_1.0.4 1.0.4
+ fwupd_client_modify_remote@LIBFWUPD_0.9.8 1.0.0
+ fwupd_client_new@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_self_sign@LIBFWUPD_1.2.6 1.2.6
+ fwupd_client_set_approved_firmware@LIBFWUPD_1.2.6 1.2.6
+ fwupd_client_unlock@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_update_metadata@LIBFWUPD_1.0.0 1.0.0
+ fwupd_client_verify@LIBFWUPD_0.7.0 1.0.0
+ fwupd_client_verify_update@LIBFWUPD_0.8.0 1.0.0
+ fwupd_device_add_checksum@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_add_flag@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_add_guid@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_add_icon@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_add_instance_id@LIBFWUPD_1.2.5 1.2.5
+ fwupd_device_add_release@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_array_from_variant@LIBFWUPD_1.2.10 1.2.10
+ fwupd_device_compare@LIBFWUPD_1.1.1 1.1.1
+ fwupd_device_flag_from_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_device_flag_to_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_device_from_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_device_get_checksums@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_created@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_description@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_flags@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_flashes_left@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_guid_default@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_guids@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_icons@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_get_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_install_duration@LIBFWUPD_1.1.3 1.1.3
+ fwupd_device_get_instance_ids@LIBFWUPD_1.2.5 1.2.5
+ fwupd_device_get_modified@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_name@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_parent@LIBFWUPD_1.0.8 1.0.8
+ fwupd_device_get_parent_id@LIBFWUPD_1.0.8 1.0.8
+ fwupd_device_get_plugin@LIBFWUPD_1.0.0 1.0.0
+ fwupd_device_get_release_default@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_get_releases@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_get_serial@LIBFWUPD_1.1.2 1.1.2
+ fwupd_device_get_summary@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_type@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_update_error@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_get_update_message@LIBFWUPD_1.2.4 1.2.4
+ fwupd_device_get_update_state@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_get_vendor@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_vendor_id@LIBFWUPD_0.9.4 1.0.0
+ fwupd_device_get_version@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_version_bootloader@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_get_version_format@LIBFWUPD_1.2.9 1.2.9
+ fwupd_device_get_version_lowest@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_has_flag@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_has_guid@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_has_instance_id@LIBFWUPD_1.2.5 1.2.5
+ fwupd_device_incorporate@LIBFWUPD_1.1.0 1.1.0
+ fwupd_device_new@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_remove_flag@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_created@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_description@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_flags@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_flashes_left@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_install_duration@LIBFWUPD_1.1.3 1.1.3
+ fwupd_device_set_modified@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_name@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_parent@LIBFWUPD_1.0.8 1.0.8
+ fwupd_device_set_parent_id@LIBFWUPD_1.0.8 1.0.8
+ fwupd_device_set_plugin@LIBFWUPD_1.0.0 1.0.0
+ fwupd_device_set_serial@LIBFWUPD_1.1.2 1.1.2
+ fwupd_device_set_summary@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_update_error@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_set_update_message@LIBFWUPD_1.2.4 1.2.4
+ fwupd_device_set_update_state@LIBFWUPD_0.9.8 1.0.0
+ fwupd_device_set_vendor@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_vendor_id@LIBFWUPD_0.9.4 1.0.0
+ fwupd_device_set_version@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_version_bootloader@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_set_version_format@LIBFWUPD_1.2.9 1.2.9
+ fwupd_device_set_version_lowest@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_to_json@LIBFWUPD_1.2.6 1.2.6
+ fwupd_device_to_string@LIBFWUPD_0.9.3 1.0.0
+ fwupd_device_to_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_device_to_variant_full@LIBFWUPD_1.1.2 1.1.2
+ fwupd_error_from_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_error_quark@LIBFWUPD_0.1.1 1.0.0
+ fwupd_error_to_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_get_os_release@LIBFWUPD_1.0.7 1.0.7
+ fwupd_guid_from_string@LIBFWUPD_1.2.5 1.2.5
+ fwupd_guid_hash_data@LIBFWUPD_1.2.5 1.2.5
+ fwupd_guid_hash_string@LIBFWUPD_1.2.5 1.2.5
+ fwupd_guid_is_valid@LIBFWUPD_1.2.5 1.2.5
+ fwupd_guid_to_string@LIBFWUPD_1.2.5 1.2.5
+ fwupd_keyring_kind_from_string@LIBFWUPD_0.9.7 1.0.0
+ fwupd_keyring_kind_to_string@LIBFWUPD_0.9.7 1.0.0
+ fwupd_release_add_category@LIBFWUPD_1.2.7 1.2.7
+ fwupd_release_add_checksum@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_add_flag@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_add_metadata@LIBFWUPD_1.0.4 1.0.4
+ fwupd_release_add_metadata_item@LIBFWUPD_1.0.4 1.0.4
+ fwupd_release_array_from_variant@LIBFWUPD_1.2.10 1.2.10
+ fwupd_release_flag_from_string@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_flag_to_string@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_from_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_release_get_appstream_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_categories@LIBFWUPD_1.2.7 1.2.7
+ fwupd_release_get_checksums@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_description@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_details_url@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_get_filename@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_flags@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_get_homepage@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_install_duration@LIBFWUPD_1.2.1 1.2.4
+ fwupd_release_get_license@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_metadata@LIBFWUPD_1.0.4 1.0.4
+ fwupd_release_get_metadata_item@LIBFWUPD_1.0.4 1.0.4
+ fwupd_release_get_name@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_protocol@LIBFWUPD_1.2.2 1.2.4
+ fwupd_release_get_remote_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_size@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_source_url@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_get_summary@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_trust_flags@LIBFWUPD_0.9.8 1.0.0
+ fwupd_release_get_type@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_update_message@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_get_uri@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_vendor@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_get_version@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_has_category@LIBFWUPD_1.2.7 1.2.7
+ fwupd_release_has_checksum@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_has_flag@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_new@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_remove_flag@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_set_appstream_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_description@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_details_url@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_set_filename@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_flags@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_set_homepage@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_install_duration@LIBFWUPD_1.2.1 1.2.4
+ fwupd_release_set_license@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_name@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_protocol@LIBFWUPD_1.2.2 1.2.4
+ fwupd_release_set_remote_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_size@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_source_url@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_set_summary@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_trust_flags@LIBFWUPD_0.9.8 1.0.0
+ fwupd_release_set_update_message@LIBFWUPD_1.2.4 1.2.4
+ fwupd_release_set_uri@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_vendor@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_set_version@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_to_json@LIBFWUPD_1.2.6 1.2.6
+ fwupd_release_to_string@LIBFWUPD_0.9.3 1.0.0
+ fwupd_release_to_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_remote_array_from_variant@LIBFWUPD_1.2.10 1.2.10
+ fwupd_remote_build_firmware_uri@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_from_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_remote_get_age@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_get_agreement@LIBFWUPD_1.0.7 1.0.7
+ fwupd_remote_get_approval_required@LIBFWUPD_1.2.6 1.2.6
+ fwupd_remote_get_checksum@LIBFWUPD_1.0.0 1.0.0
+ fwupd_remote_get_enabled@LIBFWUPD_0.9.3 1.0.0
+ fwupd_remote_get_filename_cache@LIBFWUPD_0.9.6 1.0.0
+ fwupd_remote_get_filename_cache_sig@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_get_filename_source@LIBFWUPD_0.9.8 1.0.0
+ fwupd_remote_get_firmware_base_uri@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_get_id@LIBFWUPD_0.9.3 1.0.0
+ fwupd_remote_get_keyring_kind@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_get_kind@LIBFWUPD_0.9.6 1.0.0
+ fwupd_remote_get_metadata_uri@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_get_metadata_uri_sig@LIBFWUPD_0.9.7 1.0.0
+ fwupd_remote_get_order_after@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_get_order_before@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_get_password@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_get_priority@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_get_report_uri@LIBFWUPD_1.0.4 1.0.4
+ fwupd_remote_get_title@LIBFWUPD_0.9.8 1.0.0
+ fwupd_remote_get_type@LIBFWUPD_0.9.3 1.0.0
+ fwupd_remote_get_username@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_kind_from_string@LIBFWUPD_0.9.6 1.0.0
+ fwupd_remote_kind_to_string@LIBFWUPD_0.9.6 1.0.0
+ fwupd_remote_load_from_filename@LIBFWUPD_0.9.3 1.0.0
+ fwupd_remote_new@LIBFWUPD_0.9.3 1.0.0
+ fwupd_remote_set_agreement@LIBFWUPD_1.0.7 1.0.7
+ fwupd_remote_set_mtime@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_set_priority@LIBFWUPD_0.9.5 1.0.0
+ fwupd_remote_to_variant@LIBFWUPD_1.0.0 1.0.0
+ fwupd_status_from_string@LIBFWUPD_0.1.1 1.0.0
+ fwupd_status_to_string@LIBFWUPD_0.1.1 1.0.0
+ fwupd_trust_flag_from_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_trust_flag_to_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_update_state_from_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_update_state_to_string@LIBFWUPD_0.7.0 1.0.0
+ fwupd_version_format_from_string@LIBFWUPD_1.2.9 1.2.9
+ fwupd_version_format_to_string@LIBFWUPD_1.2.9 1.2.9
diff -Nru fwupd-1.0.9/debian/libfwupd-dev.install fwupd-1.2.10/debian/libfwupd-dev.install
--- fwupd-1.0.9/debian/libfwupd-dev.install 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/libfwupd-dev.install 2019-12-19 00:13:48.000000000 +0000
@@ -1,6 +1,5 @@
-usr/include/fwupd-1/fwupd.h
-usr/include/fwupd-1/libfwupd
-usr/lib/*/libfwupd*.so
-usr/lib/*/pkgconfig/fwupd.pc
-usr/share/gir-1.0/Fwupd*.gir
+usr/include/*
+usr/lib/*/*.so
+usr/lib/*/pkgconfig/*.pc
+usr/share/gir-1.0/*.gir
usr/share/vala/vapi
diff -Nru fwupd-1.0.9/debian/lintian/fwupd fwupd-1.2.10/debian/lintian/fwupd
--- fwupd-1.0.9/debian/lintian/fwupd 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/lintian/fwupd 2019-12-19 00:13:48.000000000 +0000
@@ -4,3 +4,7 @@
fwupd binary: systemd-service-file-missing-install-key lib/systemd/system/system-update.target.wants/fwupd-offline-update.service
#see debian bug 896012
fwupd: library-not-linked-against-libc usr/lib/*/fwupd-plugins-3/libfu_plugin_upower.so
+#EFI applications are PE executables
+fwupd: executable-not-elf-or-script usr/lib/fwupd/efi/*.efi
+fwupd: portable-executable-missing-security-features usr/lib/fwupd/efi/*.efi ASLR DEP/NX
+fwupd: library-not-linked-against-libc usr/lib/*/fwupd-plugins-3/libfu_plugin_modem_manager.so
diff -Nru fwupd-1.0.9/debian/patches/0001-dont-semver-conversion.patch fwupd-1.2.10/debian/patches/0001-dont-semver-conversion.patch
--- fwupd-1.0.9/debian/patches/0001-dont-semver-conversion.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-dont-semver-conversion.patch 2020-01-09 08:24:28.000000000 +0000
@@ -0,0 +1,94 @@
+commit dfa9edcc487cc174c475bdc712f3c1965bcdfac3
+Author: Richard Hughes
+Date: Wed Dec 4 15:05:12 2019 +0000
+
+ Do not do semver conversion in fu_common_vercmp()
+
+ We don't know the version format, and so it's impossible to do it reliably --
+ just do it in the caller where we *do* know the FuDevice version format.
+
+ Cherry-picked from 1fbcb1a1808adebbe80a9c45f156bb695b02fb43
+
+--- a/src/fu-common-version.c
++++ b/src/fu-common-version.c
+@@ -347,8 +347,8 @@
+
+ /**
+ * fu_common_vercmp:
+- * @version_a: the release version, e.g. 1.2.3
+- * @version_b: the release version, e.g. 1.2.3.1
++ * @version_a: the semver release version, e.g. 1.2.3
++ * @version_b: the semver release version, e.g. 1.2.3.1
+ *
+ * Compares version numbers for sorting.
+ *
+@@ -360,8 +360,6 @@
+ fu_common_vercmp (const gchar *version_a, const gchar *version_b)
+ {
+ guint longest_split;
+- g_autofree gchar *str_a = NULL;
+- g_autofree gchar *str_b = NULL;
+ g_auto(GStrv) split_a = NULL;
+ g_auto(GStrv) split_b = NULL;
+
+@@ -374,10 +372,8 @@
+ return 0;
+
+ /* split into sections, and try to parse */
+- str_a = fu_common_version_parse (version_a);
+- str_b = fu_common_version_parse (version_b);
+- split_a = g_strsplit (str_a, ".", -1);
+- split_b = g_strsplit (str_b, ".", -1);
++ split_a = g_strsplit (version_a, ".", -1);
++ split_b = g_strsplit (version_b, ".", -1);
+ longest_split = MAX (g_strv_length (split_a), g_strv_length (split_b));
+ for (guint i = 0; i < longest_split; i++) {
+ gchar *endptr_a = NULL;
+--- a/src/fu-install-task.c
++++ b/src/fu-install-task.c
+@@ -111,10 +111,11 @@
+ {
+ const gchar *tmp;
+ const gchar *version;
+- const gchar *version_release;
++ const gchar *version_release_raw;
+ const gchar *version_lowest;
+ gboolean matches_guid = FALSE;
+ gint vercmp;
++ g_autofree gchar *version_release = NULL;
+ g_autoptr(GError) error_local = NULL;
+ g_autoptr(GPtrArray) provides = NULL;
+ g_autoptr(XbNode) release = NULL;
+@@ -209,8 +210,8 @@
+ }
+
+ /* is this a downgrade or re-install */
+- version_release = xb_node_get_attr (release, "version");
+- if (version_release == NULL) {
++ version_release_raw = xb_node_get_attr (release, "version");
++ if (version_release_raw == NULL) {
+ g_set_error_literal (error,
+ FWUPD_ERROR,
+ FWUPD_ERROR_INVALID_FILE,
+@@ -273,6 +274,8 @@
+ }
+
+ /* check semver */
++ version_release = fu_common_version_parse_from_format (version_release_raw,
++ fu_device_get_version_format (self->device));
+ vercmp = fu_common_vercmp (version, version_release);
+ if (vercmp == 0 && (flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) == 0) {
+ g_set_error (error,
+--- a/src/fu-self-test.c
++++ b/src/fu-self-test.c
+@@ -3620,10 +3620,6 @@
+ g_assert_cmpint (fu_common_vercmp ("1.2.3", "1.2.3"), ==, 0);
+ g_assert_cmpint (fu_common_vercmp ("001.002.003", "001.002.003"), ==, 0);
+
+- /* same, not dotted decimal */
+- g_assert_cmpint (fu_common_vercmp ("1.2.3", "0x1020003"), ==, 0);
+- g_assert_cmpint (fu_common_vercmp ("0x10203", "0x10203"), ==, 0);
+-
+ /* upgrade and downgrade */
+ g_assert_cmpint (fu_common_vercmp ("1.2.3", "1.2.4"), <, 0);
+ g_assert_cmpint (fu_common_vercmp ("001.002.000", "001.002.009"), <, 0);
diff -Nru fwupd-1.0.9/debian/patches/0001-fu-engine-Don-t-show-devices-pending-a-reboot-in-Get.patch fwupd-1.2.10/debian/patches/0001-fu-engine-Don-t-show-devices-pending-a-reboot-in-Get.patch
--- fwupd-1.0.9/debian/patches/0001-fu-engine-Don-t-show-devices-pending-a-reboot-in-Get.patch 2018-09-19 12:40:27.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-fu-engine-Don-t-show-devices-pending-a-reboot-in-Get.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,34 +0,0 @@
-From 80f6e995f68ad7559c4a386a58e9ee43750bf6aa Mon Sep 17 00:00:00 2001
-From: Mario Limonciello
-Date: Thu, 13 Sep 2018 10:06:39 -0500
-Subject: [PATCH] fu-engine: Don't show devices pending a reboot in GetUpgrades
-
-Fixes part of http://gitlab.gnome.org/GNOME/gnome-software/issues/341
----
- src/fu-engine.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/fu-engine.c b/src/fu-engine.c
-index f333f08..c7474aa 100644
---- a/src/fu-engine.c
-+++ b/src/fu-engine.c
-@@ -2538,6 +2538,16 @@ fu_engine_get_upgrades (FuEngine *self, const gchar *device_id, GError **error)
- if (device == NULL)
- return NULL;
-
-+ /* don't show upgrades again until we reboot */
-+ if (fu_device_get_update_state (device) == FWUPD_UPDATE_STATE_NEEDS_REBOOT) {
-+ g_set_error (error,
-+ FWUPD_ERROR,
-+ FWUPD_ERROR_NOTHING_TO_DO,
-+ "No upgrades for %s: A reboot is pending",
-+ fu_device_get_name (device));
-+ return NULL;
-+ }
-+
- /* get all the releases for the device */
- releases_tmp = fu_engine_get_releases_for_device (self, device, error);
- if (releases_tmp == NULL)
---
-2.7.4
-
diff -Nru fwupd-1.0.9/debian/patches/0001-Only-check-the-vendor-ID-if-the-device-has-one-set.patch fwupd-1.2.10/debian/patches/0001-Only-check-the-vendor-ID-if-the-device-has-one-set.patch
--- fwupd-1.0.9/debian/patches/0001-Only-check-the-vendor-ID-if-the-device-has-one-set.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-Only-check-the-vendor-ID-if-the-device-has-one-set.patch 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,28 @@
+From 004a0624d05211e8436060bb7af6b0c6f2d805a3 Mon Sep 17 00:00:00 2001
+From: Richard Hughes
+Date: Mon, 9 Dec 2019 10:30:19 +0000
+Subject: [PATCH] Only check the vendor ID if the device has one set
+
+This means we don't get a weird error if the metadata sets a vendor-id, but the
+device does not.
+---
+ src/fu-engine.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/fu-engine.c b/src/fu-engine.c
+index d07843c3..814d15a6 100644
+--- a/src/fu-engine.c
++++ b/src/fu-engine.c
+@@ -1058,7 +1058,8 @@ fu_engine_check_requirement_firmware (FuEngine *self, XbNode *req,
+ }
+
+ /* vendor ID */
+- if (g_strcmp0 (xb_node_get_text (req), "vendor-id") == 0) {
++ if (g_strcmp0 (xb_node_get_text (req), "vendor-id") == 0 &&
++ fu_device_get_vendor_id (device) != NULL) {
+ const gchar *version = fu_device_get_vendor_id (device);
+ if (!fu_engine_require_vercmp (req, version, &error_local)) {
+ if (g_strcmp0 (xb_node_get_attr (req, "compare"), "ge") == 0) {
+--
+2.20.1
+
diff -Nru fwupd-1.0.9/debian/patches/0001-plain_support_in_version.patch fwupd-1.2.10/debian/patches/0001-plain_support_in_version.patch
--- fwupd-1.0.9/debian/patches/0001-plain_support_in_version.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-plain_support_in_version.patch 2020-01-09 08:24:33.000000000 +0000
@@ -0,0 +1,32 @@
+commit a7434265e671ba330214aaab54a41ad1335015ad
+Author: Richard Hughes
+Date: Wed Dec 4 15:04:19 2019 +0000
+
+ trivial: Support 'plain' in fu_common_version_from_uintXX()
+
+ Cherry picked from f21add626
+
+diff --git a/src/fu-common-version.c b/src/fu-common-version.c
+index e4a11002..0ee73f2a 100644
+--- a/src/fu-common-version.c
++++ b/src/fu-common-version.c
+@@ -52,7 +52,8 @@ fu_common_version_from_uint32 (guint32 val, FwupdVersionFormat kind)
+ (val >> 16) & 0xffff,
+ val & 0xffff);
+ }
+- if (kind == FWUPD_VERSION_FORMAT_NUMBER) {
++ if (kind == FWUPD_VERSION_FORMAT_NUMBER ||
++ kind == FWUPD_VERSION_FORMAT_PLAIN) {
+ /* AABBCCDD */
+ return g_strdup_printf ("%" G_GUINT32_FORMAT, val);
+ }
+@@ -109,7 +110,8 @@ fu_common_version_from_uint16 (guint16 val, FwupdVersionFormat kind)
+ (guint) (val >> 8) & 0xff,
+ (guint) val & 0xff);
+ }
+- if (kind == FWUPD_VERSION_FORMAT_NUMBER) {
++ if (kind == FWUPD_VERSION_FORMAT_NUMBER ||
++ kind == FWUPD_VERSION_FORMAT_PLAIN) {
+ return g_strdup_printf ("%" G_GUINT16_FORMAT, val);
+ }
+ g_critical ("failed to convert version format %s: %u",
diff -Nru fwupd-1.0.9/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch fwupd-1.2.10/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch
--- fwupd-1.0.9/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,86 @@
+From b4627629cdaadd1a75d7c650b7c5973fcd18dfb0 Mon Sep 17 00:00:00 2001
+From: Richard Hughes
+Date: Thu, 1 Aug 2019 09:45:25 +0100
+Subject: [PATCH] Relax the certificate time checks in the self tests for the
+ legacy certificate
+
+One test verifies a firmware with a signature from the old LVFS which was
+hosted on secure-lvfs.rhcloud.com and used the original PKCS-7 key. This key
+had a two year validity (expiring today, ohh the naivety...) rather than the
+newer fwupd.org key which expires in the year 2058.
+
+For this specific test only, disable the certificate time checks to fix CI.
+
+Fixes https://github.com/hughsie/fwupd/issues/1264
+---
+ src/fu-keyring-pkcs7.c | 10 +++++++++-
+ src/fu-keyring.h | 6 ++++--
+ src/fu-self-test.c | 3 ++-
+ 3 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/fu-keyring-pkcs7.c b/src/fu-keyring-pkcs7.c
+index 6dc944ed..a42feaa7 100644
+--- a/src/fu-keyring-pkcs7.c
++++ b/src/fu-keyring-pkcs7.c
+@@ -642,6 +642,14 @@ fu_keyring_pkcs7_verify_data (FuKeyring *keyring,
+ for (gint i = 0; i < count; i++) {
+ gnutls_pkcs7_signature_info_st info;
+ gint64 signing_time = 0;
++ gnutls_certificate_verify_flags verify_flags = 0;
++
++ /* use with care */
++ if (flags & FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS) {
++ g_debug ("WARNING: disabling time checks");
++ verify_flags |= GNUTLS_VERIFY_DISABLE_TIME_CHECKS;
++ verify_flags |= GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS;
++ }
+
+ /* verify the data against the detached signature */
+ if (flags & FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT) {
+@@ -652,7 +660,7 @@ fu_keyring_pkcs7_verify_data (FuKeyring *keyring,
+ 0, /* vdata_size */
+ i, /* index */
+ &datum, /* data */
+- 0); /* flags */
++ verify_flags);
+ }
+ if (rc < 0) {
+ g_set_error (error,
+diff --git a/src/fu-keyring.h b/src/fu-keyring.h
+index 39819ca4..2f20e35e 100644
+--- a/src/fu-keyring.h
++++ b/src/fu-keyring.h
+@@ -20,12 +20,14 @@ G_DECLARE_DERIVABLE_TYPE (FuKeyring, fu_keyring, FU, KEYRING, GObject)
+ * FuKeyringVerifyFlags:
+ * @FU_KEYRING_VERIFY_FLAG_NONE: No flags set
+ * @FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT: Use client certificate to verify
++ * @FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS: Disable checking of validity periods
+ *
+ * The flags to use when interacting with a keyring
+ **/
+ typedef enum {
+- FU_KEYRING_VERIFY_FLAG_NONE = 0,
+- FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT = 1 << 1,
++ FU_KEYRING_VERIFY_FLAG_NONE = 0,
++ FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT = 1 << 1,
++ FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS = 1 << 2,
+ /*< private >*/
+ FU_KEYRING_VERIFY_FLAG_LAST
+ } FuKeyringVerifyFlags;
+diff --git a/src/fu-self-test.c b/src/fu-self-test.c
+index 363f644e..24b12110 100644
+--- a/src/fu-self-test.c
++++ b/src/fu-self-test.c
+@@ -2628,7 +2628,8 @@ fu_keyring_pkcs7_func (void)
+ g_assert_no_error (error);
+ g_assert_nonnull (blob_sig);
+ result_pass = fu_keyring_verify_data (keyring, blob_pass, blob_sig,
+- FU_KEYRING_VERIFY_FLAG_NONE, &error);
++ FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS,
++ &error);
+ g_assert_no_error (error);
+ g_assert_nonnull (result_pass);
+ g_assert_cmpint (fu_keyring_result_get_timestamp (result_pass), >= , 1502871248);
+--
+2.20.1
+
diff -Nru fwupd-1.0.9/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch fwupd-1.2.10/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch
--- fwupd-1.0.9/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,38 @@
+From d0fd614bb9023ea7c8f831fc6bfe122a3dbc9032 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello
+Date: Tue, 24 Sep 2019 10:29:22 -0500
+Subject: [PATCH] trivial: libfwupd: skip tests if machine-id is empty too
+
+Ubuntu's buildds seem to have changed and this is causing test suite
+failures.
+---
+ libfwupd/fwupd-self-test.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+Index: fwupd-1.2.10/libfwupd/fwupd-self-test.c
+===================================================================
+--- fwupd-1.2.10.orig/libfwupd/fwupd-self-test.c
++++ fwupd-1.2.10/libfwupd/fwupd-self-test.c
+@@ -504,6 +504,8 @@ fwupd_has_system_bus (void)
+ static void
+ fwupd_common_machine_hash_func (void)
+ {
++ gsize sz = 0;
++ g_autofree gchar *buf = NULL;
+ g_autofree gchar *mhash1 = NULL;
+ g_autofree gchar *mhash2 = NULL;
+ g_autoptr(GError) error = NULL;
+@@ -512,6 +514,13 @@ fwupd_common_machine_hash_func (void)
+ g_test_skip ("Missing /etc/machine-id");
+ return;
+ }
++ if (!g_file_get_contents ("/etc/machine-id", &buf, &sz, &error))
++ return;
++
++ if (sz == 0) {
++ g_test_skip ("Empty /etc/machine-id");
++ return;
++ }
+
+ mhash1 = fwupd_build_machine_id ("salt1", &error);
+ g_assert_no_error (error);
diff -Nru fwupd-1.0.9/debian/patches/0001-version-handling.patch fwupd-1.2.10/debian/patches/0001-version-handling.patch
--- fwupd-1.0.9/debian/patches/0001-version-handling.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/0001-version-handling.patch 2020-01-09 08:24:37.000000000 +0000
@@ -0,0 +1,103 @@
+commit a59d92fe11637d2a62f71bda9024481cbb9956c5
+Author: Mario Limonciello
+Date: Mon Oct 14 08:44:39 2019 -0500
+
+ fu-engine: Read all releases and convert versions when comparing
+
+ Fixes matching ESRT version to metadata version for UEFI
+
+ Cherry-picked from 91d36095e12f2486c774d38eeabcc5b0ddfb0685
+
+diff --git a/src/fu-common-version.c b/src/fu-common-version.c
+index cd732a38..e4a11002 100644
+--- a/src/fu-common-version.c
++++ b/src/fu-common-version.c
+@@ -214,6 +214,31 @@ fu_common_version_ensure_semver (const gchar *version)
+ */
+ gchar *
+ fu_common_version_parse (const gchar *version)
++{
++ return fu_common_version_parse_from_format (version, FWUPD_VERSION_FORMAT_TRIPLET);
++}
++
++/**
++ * fu_common_version_parse_from_format
++ * @version: A version number
++ * @fmt: A FwupdVersionFormat
++ *
++ * Returns a dotted decimal version string from a version string using fmt.
++ * The supported formats are:
++ *
++ * - Dotted decimal, e.g. "1.2.3"
++ * - Base 16, a hex number *with* a 0x prefix, e.g. "0x10203"
++ * - Base 10, a string containing just [0-9], e.g. "66051"
++ * - Date in YYYYMMDD format, e.g. 20150915
++ *
++ * Anything with a '.' or that doesn't match [0-9] or 0x[a-f,0-9] is considered
++ * a string and returned without modification.
++ *
++ * Returns: A version number, e.g. "1.0.3"
++ *
++ */
++gchar *
++fu_common_version_parse_from_format (const gchar *version, FwupdVersionFormat fmt)
+ {
+ const gchar *version_noprefix = version;
+ gchar *endptr = NULL;
+@@ -246,7 +271,7 @@ fu_common_version_parse (const gchar *version)
+ return g_strdup (version);
+ if (tmp == 0)
+ return g_strdup (version);
+- return fu_common_version_from_uint32 ((guint32) tmp, FWUPD_VERSION_FORMAT_TRIPLET);
++ return fu_common_version_from_uint32 ((guint32) tmp, fmt);
+ }
+
+ /**
+diff --git a/src/fu-common-version.h b/src/fu-common-version.h
+index 7899da2d..c25b37ac 100644
+--- a/src/fu-common-version.h
++++ b/src/fu-common-version.h
+@@ -18,6 +18,8 @@ gchar *fu_common_version_from_uint32 (guint32 val,
+ gchar *fu_common_version_from_uint16 (guint16 val,
+ FwupdVersionFormat kind);
+ gchar *fu_common_version_parse (const gchar *version);
++gchar *fu_common_version_parse_from_format (const gchar *version,
++ FwupdVersionFormat fmt);
+ gchar *fu_common_version_ensure_semver (const gchar *version);
+ FwupdVersionFormat fu_common_version_guess_format (const gchar *version);
+ gboolean fu_common_version_verify_format (const gchar *version,
+diff --git a/src/fu-engine.c b/src/fu-engine.c
+index 814d15a6..0139c8e5 100644
+--- a/src/fu-engine.c
++++ b/src/fu-engine.c
+@@ -842,14 +842,27 @@ fu_engine_verify (FuEngine *self, const gchar *device_id, GError **error)
+ /* try again with the system metadata */
+ if (release == NULL) {
+ GPtrArray *guids = fu_device_get_guids (device);
++ FwupdVersionFormat fmt = fu_device_get_version_format (device);
+ for (guint i = 0; i < guids->len; i++) {
+ const gchar *guid = g_ptr_array_index (guids, i);
+ g_autofree gchar *xpath2 = NULL;
++ g_autoptr(GPtrArray) releases = NULL;
+ xpath2 = g_strdup_printf ("components/component/"
+ "provides/firmware[@type='flashed'][text()='%s']/"
+- "../../releases/release[@version='%s']",
+- guid, version);
+- release = xb_silo_query_first (self->silo, xpath2, NULL);
++ "../../releases/release",
++ guid);
++ releases = xb_silo_query (self->silo, xpath2, 0, error);
++ if (releases == NULL)
++ return FALSE;
++ for (guint j = 0; j < releases->len; j++) {
++ XbNode *rel = g_ptr_array_index (releases, j);
++ const gchar *rel_ver = xb_node_get_attr (rel, "version");
++ g_autofree gchar *tmp_ver = fu_common_version_parse_from_format (rel_ver, fmt);
++ if (fu_common_vercmp (tmp_ver, version) == 0) {
++ release = g_object_ref (rel);
++ break;
++ }
++ }
+ if (release != NULL)
+ break;
+ }
diff -Nru fwupd-1.0.9/debian/patches/meson-0.45-bc.patch fwupd-1.2.10/debian/patches/meson-0.45-bc.patch
--- fwupd-1.0.9/debian/patches/meson-0.45-bc.patch 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/patches/meson-0.45-bc.patch 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,47 @@
+Description: meson 0.45 backward compatibility patch
+
+ * meson 0.45 backward compatibility patch from Mario.
+
+Author: Yuan-Chen Cheng
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: ,
+Bug:
+Bug-Debian: https://bugs.debian.org/
+Bug-Ubuntu: https://launchpad.net/bugs/
+Forwarded:
+Reviewed-By:
+Last-Update: 2019-08-01
+
+--- fwupd-1.2.10.orig/meson.build
++++ fwupd-1.2.10/meson.build
+@@ -1,7 +1,7 @@
+ project('fwupd', 'c',
+ version : '1.2.10',
+ license : 'LGPL-2.1+',
+- meson_version : '>=0.47.0',
++ meson_version : '>=0.44.0',
+ default_options : ['warning_level=2', 'c_std=c99'],
+ )
+
+@@ -115,8 +115,14 @@ test_link_args = [
+ '-Wl,-z,now',
+ ]
+ foreach arg: test_link_args
+- if cc.has_link_argument(arg)
+- global_link_args += arg
++ if meson.version().version_compare('>=0.46.0')
++ if cc.has_link_argument(arg)
++ global_link_args += arg
++ endif
++ else
++ if cc.has_argument(arg)
++ global_link_args += arg
++ endif
+ endif
+ endforeach
+ add_global_link_arguments(
diff -Nru fwupd-1.0.9/debian/patches/series fwupd-1.2.10/debian/patches/series
--- fwupd-1.0.9/debian/patches/series 2018-09-19 12:40:49.000000000 +0000
+++ fwupd-1.2.10/debian/patches/series 2020-01-09 08:25:01.000000000 +0000
@@ -1 +1,8 @@
-0001-fu-engine-Don-t-show-devices-pending-a-reboot-in-Get.patch
+0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch
+0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch
+meson-0.45-bc.patch
+0001-Only-check-the-vendor-ID-if-the-device-has-one-set.patch
+0001-dont-semver-conversion.patch
+0001-version-handling.patch
+0001-plain_support_in_version.patch
+
diff -Nru fwupd-1.0.9/debian/README.Debian fwupd-1.2.10/debian/README.Debian
--- fwupd-1.0.9/debian/README.Debian 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/README.Debian 2019-12-19 00:13:48.000000000 +0000
@@ -1,7 +1,18 @@
-fwupd for Debian
-----------------
+signed vs unsigned fwupd programs
+------------------------------------
-fwupd is still heavily in development. As of this date, the functionality
-it provides is not yet available on most systems.
+fwupd 1.1.0 is configured to understand when to use a signed version
+of the EFI binary. If the signed version isn't installed but secure
+boot is turned on, it will avoid copying to the EFI system partition.
+
+This allows supporting secure boot even if not turned on at install, or
+changed later after install.
+
+In Ubuntu, both fwupd-signed and fwupd are seeded in the default
+installation. Nothing is installed to the ESP until it's needed.
+
+In Debian, the package name for the signed version is slightly
+different due to different infrastructure. fwupd-signed-$ARCH and
+fwupd should both be installed and then things will work similarly
+to what's described above.
- -- Daniel Jared Dominguez Wed, 20 May 2015 17:16:02 -0500
diff -Nru fwupd-1.0.9/debian/rules fwupd-1.2.10/debian/rules
--- fwupd-1.0.9/debian/rules 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/rules 2019-12-19 00:13:48.000000000 +0000
@@ -3,6 +3,7 @@
export LC_ALL := C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_LDFLAGS_MAINT_STRIP=-Wl,-Bsymbolic-functions
#GPGME needs this for proper building on 32 bit archs
ifeq "$(DEB_HOST_ARCH_BITS)" "32"
@@ -10,36 +11,84 @@
endif
ifneq ($(CI),)
- export CI=--werror
+ export CI=--werror --wrap-mode=default
+endif
+
+regenerate_control:
+ OS=debian-x86_64 ./contrib/ci/generate_debian.py
+
+SB_STYLE := debian
+deb_version := $(shell dpkg-parsechangelog --show-field Version)
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+ SB_STYLE := ubuntu
+ tar_name := fwupd_$(deb_version)_$(DEB_HOST_ARCH).tar.gz
+else
+ TMPLDIR := debian/fwupd-$(DEB_HOST_ARCH)-signed-template/usr/share/code-signing/fwupd-$(DEB_HOST_ARCH)-signed-template
endif
%:
- dh $@ --with gir,systemd
+ [ -f debian/control ] || debian/rules regenerate_control
+ dh $@ --with gir
-override_dh_auto_clean:
+override_dh_auto_clean: regenerate_control
rm -fr debian/build
+ifeq (ubuntu,$(SB_STYLE))
+ rm -rf debian/fwupd-images
+endif
override_dh_auto_configure:
- if pkg-config --exists fwup; then \
- export UEFI="-Dplugin_uefi=true"; \
+ if pkg-config --exists libsmbios_c; then \
+ export DELL="-Dplugin_dell=true"; \
else \
- export UEFI="-Dplugin_uefi=false"; \
+ export DELL="-Dplugin_dell=false"; \
fi; \
- if pkg-config --exists libsmbios_c; then \
- export DELL="-Dplugin_dell=true -Dplugin_synaptics=true"; \
+ if pkg-config --exists efivar; then \
+ export UEFI="-Dplugin_uefi=true -Dplugin_redfish=true -Dplugin_nvme=true"; \
+ else \
+ export UEFI="-Dplugin_uefi=false -Dplugin_redfish=false -Dplugin_nvme=false"; \
+ fi; \
+ if [ ! -z "$$CI" ]; then \
+ export FLASHROM="-Dplugin_flashrom=true"; \
else \
- export DELL="-Dplugin_dell=false -Dplugin_synaptics=false"; \
+ export FLASHROM="-Dplugin_flashrom=false"; \
fi; \
- dh_auto_configure -- $$UEFI $$DELL $$CI -Dplugin_dummy=true --libexecdir=/usr/lib
+ dh_auto_configure -- $$UEFI $$DELL $$FLASHROM $$CI -Dplugin_dummy=true --libexecdir=/usr/lib
override_dh_install:
find debian/tmp/usr -type f -name "*a" -print | xargs rm -f
sed -i 's,wheel,sudo,' ./debian/tmp/usr/share/polkit-1/rules.d/org.freedesktop.fwupd.rules
dh_install
- dh_missing --fail-missing
+ #install the EFI binaries if needed
+ if [ -d debian/tmp/usr/lib/fwupd/efi/ ]; then \
+ dh_install -pfwupd usr/lib/fwupd/efi ;\
+ dh_install -pfwupd usr/lib/fwupd/fwupdate; \
+ fi
+ #if build with meson subproject in CI need to install this too
+ if [ ! -z "$$CI" ] && [ -f debian/tmp/usr/lib/xb-tool ]; then \
+ dh_install -pfwupd usr/lib/xb-tool ;\
+ fi
+ if [ ! -z "$$CI" ] && [ -f debian/tmp/usr/sbin/flashrom ]; then \
+ dh_install -pfwupd usr/sbin/flashrom ;\
+ fi
+ dh_missing -a --fail-missing
#this is placed in fwupd-tests
rm -f debian/fwupd/usr/lib/*/fwupd-plugins-3/libfu_plugin_test.so
+ rm -f debian/fwupd/etc/fwupd/remotes.d/fwupd-tests.conf
+
+ifeq (debian,$(SB_STYLE))
+ # Generate the template source for the Debian signing service to use
+ mkdir -p $(TMPLDIR)/source-template/debian
+ cp -a debian/signing-template/* $(TMPLDIR)/source-template/debian
+ cp debian/README.Debian $(TMPLDIR)/source-template/debian
+ find $(TMPLDIR)/source-template/debian -type f | xargs sed -i "s,SIGNARCH,$(DEB_HOST_ARCH),"
+ find $(TMPLDIR)/source-template/debian -type f | xargs sed -i "s,SIGNVERSION,$(deb_version),"
+ for file in $$(find $(TMPLDIR)/source-template/debian -type f -name *SIGNARCH*); do file1=$$(echo $$file | sed "s,SIGNARCH,$(DEB_HOST_ARCH),"); mv -v $$file $$file1; done
+ install -m 0755 debian/fwupd.postinst $(TMPLDIR)/source-template/debian/fwupd-$(DEB_HOST_ARCH)-signed.postinst
+ install -m 0755 debian/fwupd.postrm $(TMPLDIR)/source-template/debian/fwupd-$(DEB_HOST_ARCH)-signed.postrm
+ ./debian/gen_signing_changelog $(TMPLDIR)/source-template/debian fwupd $(DEB_HOST_ARCH)
+ ./debian/gen_signing_json $(TMPLDIR) fwupd ${DEB_HOST_ARCH}
+endif
override_dh_strip_nondeterminism:
dh_strip_nondeterminism -Xfirmware-example.xml.gz
@@ -48,3 +97,18 @@
if [ -x /usr/bin/valgrind ] ; then \
dh_auto_test; \
fi
+
+override_dh_builddeb:
+ dh_builddeb
+ifeq (ubuntu,$(SB_STYLE))
+ if [ -d debian/tmp/usr/lib/fwupd/efi/ ]; then \
+ mkdir -p debian/fwupd-images/$(deb_version) ;\
+ cp debian/tmp/usr/lib/fwupd/efi/fwupd*.efi debian/fwupd-images/$(deb_version) ;\
+ echo $(deb_version) > debian/fwupd-images/$(deb_version)/version ;\
+ tar -C debian/fwupd-images -czvf ../$(tar_name) . ;\
+ dpkg-distaddfile $(tar_name) raw-uefi - ;\
+ fi
+endif
+
+override_dh_shlibdeps:
+ dh_shlibdeps $$DHSLIBS
diff -Nru fwupd-1.0.9/debian/signing-template/changelog.in fwupd-1.2.10/debian/signing-template/changelog.in
--- fwupd-1.0.9/debian/signing-template/changelog.in 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/changelog.in 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,5 @@
+fwupd-SIGNARCH-signed (1) unstable; urgency=medium
+
+ * Add template source package for signing
+
+ -- Steve McIntyre <93sam@debian.org> Sat, 07 Apr 2018 12:44:55 +0100
diff -Nru fwupd-1.0.9/debian/signing-template/compat fwupd-1.2.10/debian/signing-template/compat
--- fwupd-1.0.9/debian/signing-template/compat 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/compat 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1 @@
+9
diff -Nru fwupd-1.0.9/debian/signing-template/control fwupd-1.2.10/debian/signing-template/control
--- fwupd-1.0.9/debian/signing-template/control 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/control 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,24 @@
+Source: fwupd-SIGNARCH-signed
+Priority: optional
+Maintainer: Debian EFI
+Uploaders: Daniel Jared Dominguez , Steve McIntyre <93sam@debian.org>, Mario Limonciello
+Build-Depends: debhelper (>= 9.0.0), sbsigntool [amd64 arm64 armhf i386], fwupd (= SIGNVERSION) [SIGNARCH]
+Standards-Version: 4.1.3
+Section: libs
+Homepage: https://github.com/hughsie/fwupd
+Vcs-Git: https://salsa.debian.org/efi-team/fwupd.git
+Vcs-Browser: https://salsa.debian.org/efi-team/fwupd
+
+Package: fwupd-SIGNARCH-signed
+Section: admin
+Architecture: SIGNARCH
+Provides: fwupd-signed
+Depends: ${shlibs:Depends}, ${misc:Depends}, fwupd (= SIGNVERSION)
+Description: Tools to manage UEFI firmware updates (signed)
+ fwupd provides functionality to update system firmware. It has been
+ initially designed to update firmware using UEFI capsule updates, but
+ it is designed to be extensible to other firmware update standards.
+ .
+ This package contains just the signed version of the fwupd binary,
+ needed if your system has UEFI Secure Boot enabled. It depends on the
+ normal fwupd package for everything else.
diff -Nru fwupd-1.0.9/debian/signing-template/copyright fwupd-1.2.10/debian/signing-template/copyright
--- fwupd-1.0.9/debian/signing-template/copyright 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/copyright 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,33 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: fwupd
+Source: https://github.com/hughsie/fwupd
+
+Files: *
+Copyright: 2015 Richard Hughes
+License: LGPL-2.1+
+
+Files: data/tests/colorhug/firmware.metainfo.xml
+Copyright: 2015 Richard Hughes
+License: CC0-1.0
+
+Files: debian/*
+Copyright: 2015 Daniel Jared Dominguez
+ 2015 Mario Limonciello
+License: LGPL-2.1+
+
+License: LGPL-2.1+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1".
diff -Nru fwupd-1.0.9/debian/signing-template/fwupd-SIGNARCH-signed.install fwupd-1.2.10/debian/signing-template/fwupd-SIGNARCH-signed.install
--- fwupd-1.0.9/debian/signing-template/fwupd-SIGNARCH-signed.install 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/fwupd-SIGNARCH-signed.install 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1 @@
+*.efi.signed /usr/lib/fwupd/efi
diff -Nru fwupd-1.0.9/debian/signing-template/README.source fwupd-1.2.10/debian/signing-template/README.source
--- fwupd-1.0.9/debian/signing-template/README.source 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/README.source 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,4 @@
+This source package is generated by the Debian signing service from a
+template built by the fwupd package. It should never be updated directly.
+
+ -- Steve McIntyre <93sam@debian.org> Sat, 07 Apr 2018 12:44:55 +0100
diff -Nru fwupd-1.0.9/debian/signing-template/rules fwupd-1.2.10/debian/signing-template/rules
--- fwupd-1.0.9/debian/signing-template/rules 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/rules 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1,15 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+PACKAGE_NAME := fwupd
+SIG_PKG_NAME := fwupd-SIGNARCH-signed
+SIGNATURE_DIR := debian/signatures/$(PACKAGE_NAME)
+BINARY := $(shell find /usr/lib/fwupd/efi -name '*.efi' | xargs basename)
+
+%:
+ dh $@
+
+override_dh_auto_build:
+ cp /usr/lib/fwupd/efi/$(BINARY) .
+ sbattach --attach $(SIGNATURE_DIR)/usr/lib/fwupd/efi/$(BINARY).sig $(BINARY)
+ mv $(BINARY) $(BINARY).signed
diff -Nru fwupd-1.0.9/debian/signing-template/source/format fwupd-1.2.10/debian/signing-template/source/format
--- fwupd-1.0.9/debian/signing-template/source/format 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/debian/signing-template/source/format 2019-12-19 00:13:48.000000000 +0000
@@ -0,0 +1 @@
+3.0 (native)
diff -Nru fwupd-1.0.9/debian/source/lintian-overrides fwupd-1.2.10/debian/source/lintian-overrides
--- fwupd-1.0.9/debian/source/lintian-overrides 2018-09-11 18:33:14.000000000 +0000
+++ fwupd-1.2.10/debian/source/lintian-overrides 2019-12-19 00:13:48.000000000 +0000
@@ -1,2 +1,4 @@
#github doesn't have these
fwupd source: debian-watch-does-not-check-gpg-signature
+#to make CI happy until libxmlb lands
+fwupd source: source-is-missing
diff -Nru fwupd-1.0.9/docs/architecture-plan.svg fwupd-1.2.10/docs/architecture-plan.svg
--- fwupd-1.0.9/docs/architecture-plan.svg 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/docs/architecture-plan.svg 2019-07-15 18:25:54.000000000 +0000
@@ -13,7 +13,7 @@
height="744.09448"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="architecture-plan.svg"
inkscape:export-filename="/home/hughsie/Code/colord/doc/website/img/architecture-plan.png"
inkscape:export-xdpi="59.99197"
@@ -184,6 +184,34 @@
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
+
+
+
+
+
+
+ ry="5"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
fwupd
+ x="540.91553"
+ y="710.87421"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:Cantarell;-inkscape-font-specification:Cantarell;text-align:center;text-anchor:middle">fwupd
+ style="fill:#fce94f;fill-opacity:1;stroke:#edd400;stroke-width:1.88976378;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
ESRT
+ style="fill:#fce94f;fill-opacity:1;stroke:#edd400;stroke-width:1.88976378;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
VendorcustomProvders
+ id="tspan1140">plugins
+ ry="5"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
Udev
+ x="269.30994"
+ y="810.13818"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;line-height:1.25;font-family:Cantarell;-inkscape-font-specification:Cantarell;text-align:center;text-anchor:middle">udev
+ style="fill:#ad7fa8;fill-opacity:1;stroke:#75507b;stroke-width:1.88976378;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
systemd
+ ry="5"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
pending.db
+ x="809.0918"
+ y="807.82349"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;line-height:1.25;font-family:Cantarell;-inkscape-font-specification:Cantarell;text-align:center;text-anchor:middle">pending.db
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="cc" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="ccc" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="cc" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
session
+ x="48.273308"
+ y="481.51367"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:Cantarell;-inkscape-font-specification:Cantarell">internet
system
- system
+
-
-
- fwupdmgr
+ style="fill:#729fcf;fill-opacity:1;stroke:#3465a4;stroke-width:1.88976383;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
+ style="fill:#d3d7cf;fill-opacity:1;stroke:#888a85;stroke-width:1.88976383;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
downloadcache
-
+ y="560.53821"
+ x="809.99036"
+ style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Bitstream Vera Sans';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
+ xml:space="preserve"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408">downloadcache
-
+ style="fill:#8ae234;fill-opacity:1;stroke:#73d216;stroke-width:1.88976383;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
Internet
+ sodipodi:role="line">CDN
- Gudev + rules
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="cc" />
sqlite$home
- gnome-softwaregnome-software
+ id="tspan1643">fwupdmgr
+
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="cc" />
UpdateMetadata()GetDevices()
+ height="60"
+ x="720"
+ y="872.36218"
+ ry="5" />
sysfs
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408"
+ sodipodi:nodetypes="ccc" />
metadata
+ sodipodi:role="line">only metadata
firmware
- firmware
+
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
+ inkscape:export-filename="/home/hughsie/Documents/Presentations/LVFS/010-architecture-plan.png"
+ inkscape:export-xdpi="119.94408"
+ inkscape:export-ydpi="119.94408" />
AppStream XML
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LVFS
+
+
+
+
+ session
+ embargoed metadata
+
+
+
diff -Nru fwupd-1.0.9/docs/libfwupd/libfwupd-docs.xml fwupd-1.2.10/docs/libfwupd/libfwupd-docs.xml
--- fwupd-1.0.9/docs/libfwupd/libfwupd-docs.xml 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/docs/libfwupd/libfwupd-docs.xml 2019-07-15 18:25:54.000000000 +0000
@@ -41,13 +41,15 @@
Functionality available to plugins.
-
-
-
-
+
-
+
+
+
+
+
+
@@ -153,7 +155,7 @@
- Creating an abstact device
+ Creating an abstract device
This section shows how you would create a device which is exported
to the daemon and thus can be queried and updated by the client software.
@@ -292,7 +294,7 @@
For some hardware, we might want to do an action before or after
the actual firmware is squirted into the device.
This could be something as simple as checking the system battery
- level is over a certain theshold, or it could be as complicated as
+ level is over a certain threshold, or it could be as complicated as
ensuring a vendor-specific GPIO is asserted when specific types
of hardware are updated.
@@ -332,7 +334,7 @@
Detaching to bootloader mode
Some hardware can only be updated in a special bootloader mode, which
- for most devices can be switched to automaticaly.
+ for most devices can be switched to automatically.
In some cases the user to do something manually, for instance
re-inserting the hardware with a secret button pressed.
diff -Nru fwupd-1.0.9/docs/meson.build fwupd-1.2.10/docs/meson.build
--- fwupd-1.0.9/docs/meson.build 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/docs/meson.build 2019-07-15 18:25:54.000000000 +0000
@@ -1,3 +1 @@
-if get_option('gtkdoc')
- subdir('libfwupd')
-endif
+subdir('libfwupd')
diff -Nru fwupd-1.0.9/docs/version-format.md fwupd-1.2.10/docs/version-format.md
--- fwupd-1.0.9/docs/version-format.md 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/docs/version-format.md 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,58 @@
+Version Formats
+===============
+
+In some circumstances fwupd has to convert from a unsigned integer version
+number into something that has either been used in documentation or has been
+defined in some specification.
+A good example here is the UEFI ESRT table, which specifies a `uint32_t` for
+the version but does not specify how this should be formatted for the user.
+
+As is typical in underspecified specifications, vendors have converted the
+integer in different ways. For instance, Dell uses version strings like 1.2.3
+and Microsoft use versions like 1.2.3.4.
+
+The fwudp daemon can match specific devices and apply the correct version style
+using quirk files. The version format can also be specified in the firmware
+`metainfo.xml` file so that the new version is correctly shown, and so that it
+matches on the LVFS website.
+
+The current version formats supported by fwupd and the LVFS are:
+
+ * `plain`: Use plain integer version numbers with no dots, e.g. `AABBCCDD`
+ * `quad`: Use Dell-style `AA.BB.CC.DD` version numbers
+ * `triplet`: Use Microsoft-style `AA.BB.CCDD` version numbers
+ * `pair`: Use two `AABB.CCDD` version numbers
+ * `bcd`: Use binary coded decimal notation
+ * `intel-me`: Use Intel ME-style notation (`aaa+11.bbbbb.CC.DDDD`)
+ * `intel-me2`: Use alternate Intel ME-style-style `A.B.CC.DDDD` notation
+
+These can be specified in quirk files like this:
+
+ # Vendor Modelname
+ [Guid=5b92717b-2cad-4a96-a13b-9d65781df8bf]
+ VersionFormat = intel-me2
+
+...or in metainfo.xml files like this:
+
+
+ intel-me2
+
+
+Runtime requirements
+--------------------
+
+Versions of fwupd `< 1.2.0` can only support firmware updates with key values
+`LVFS::VersionFormat` of `quad` and `triplet`. Additionally, on older versions
+no quirk `VersionFormat` device fixups are supported.
+
+If want to use one of the additional version formats you should depend on a
+specific version of fwupd in the firmware file:
+
+
+ org.freedesktop.fwupd
+
+
+This is not *strictly* required, as the integer value can be used for update
+calculations if the version is specified in hex (e.g. `0x12345678`) in the
+`` tag, although the user might get a bit confused if the update
+version does not match the update description.
diff -Nru fwupd-1.0.9/.github/pull_request_template.md fwupd-1.2.10/.github/pull_request_template.md
--- fwupd-1.0.9/.github/pull_request_template.md 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/.github/pull_request_template.md 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,5 @@
+Type of pull request:
+- [ ] New plugin (Please include [new plugin checklist](https://github.com/hughsie/fwupd/wiki/New-plugin-checklist))
+- [ ] Code fix
+- [ ] Feature
+- [ ] Documentation
diff -Nru fwupd-1.0.9/.gitignore fwupd-1.2.10/.gitignore
--- fwupd-1.0.9/.gitignore 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/.gitignore 2019-07-15 18:25:54.000000000 +0000
@@ -11,3 +11,13 @@
/prime
/stage
/snap/.snapcraft
+/libxmlb
+/*.deb
+/*.ddeb
+/*.changes
+/*.buildinfo
+/fwupd*.build
+/*.dsc
+/*.xz
+/*.gz
+__pycache__
diff -Nru fwupd-1.0.9/.gitmodules fwupd-1.2.10/.gitmodules
--- fwupd-1.0.9/.gitmodules 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/.gitmodules 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,3 @@
+[submodule "contrib/flatpak"]
+ path = contrib/flatpak
+ url = https://github.com/flathub/org.freedesktop.fwupd
diff -Nru fwupd-1.0.9/.lgtm.yml fwupd-1.2.10/.lgtm.yml
--- fwupd-1.0.9/.lgtm.yml 1970-01-01 00:00:00.000000000 +0000
+++ fwupd-1.2.10/.lgtm.yml 2019-07-15 18:25:54.000000000 +0000
@@ -0,0 +1,23 @@
+extraction:
+ python:
+ python_setup:
+ version: "3"
+ cpp:
+ prepare:
+ packages:
+ - bsdtar
+ - python3-gi
+ - libcogl-pango-dev
+ - python3-pil
+ - python3-cairo
+ after_prepare:
+ - "wget -O libxmlb.zip https://github.com/hughsie/libxmlb/archive/0.1.7.zip"
+ - "mkdir -p subprojects/libxmlb"
+ - "bsdtar --strip-components=1 -xvf libxmlb.zip -C subprojects/libxmlb"
+ - "wget -O flashrom.zip https://github.com/hughsie/flashrom/archive/wip/hughsie/fwupd.zip"
+ - "mkdir -p subprojects/flashrom"
+ - "bsdtar --strip-components=1 -xvf flashrom.zip -C subprojects/flashrom"
+ index:
+ build_command:
+ - "meson setup build"
+ - "ninja -C build"
diff -Nru fwupd-1.0.9/libfwupd/fwupd-client.c fwupd-1.2.10/libfwupd/fwupd-client.c
--- fwupd-1.0.9/libfwupd/fwupd-client.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-client.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2016-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -38,6 +37,7 @@
typedef struct {
FwupdStatus status;
+ gboolean tainted;
guint percentage;
gchar *daemon_version;
GDBusConnection *conn;
@@ -58,6 +58,7 @@
PROP_STATUS,
PROP_PERCENTAGE,
PROP_DAEMON_VERSION,
+ PROP_TAINTED,
PROP_LAST
};
@@ -132,6 +133,14 @@
g_object_notify (G_OBJECT (client), "status");
}
}
+ if (g_variant_dict_contains (dict, "Tainted")) {
+ g_autoptr(GVariant) val = NULL;
+ val = g_dbus_proxy_get_cached_property (proxy, "Tainted");
+ if (val != NULL) {
+ priv->tainted = g_variant_get_boolean (val);
+ g_object_notify (G_OBJECT (client), "tainted");
+ }
+ }
if (g_variant_dict_contains (dict, "Percentage")) {
g_autoptr(GVariant) val = NULL;
val = g_dbus_proxy_get_cached_property (proxy, "Percentage");
@@ -204,6 +213,7 @@
{
FwupdClientPrivate *priv = GET_PRIVATE (client);
g_autoptr(GVariant) val = NULL;
+ g_autoptr(GVariant) val2 = NULL;
g_return_val_if_fail (FWUPD_IS_CLIENT (client), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
@@ -236,91 +246,12 @@
val = g_dbus_proxy_get_cached_property (priv->proxy, "DaemonVersion");
if (val != NULL)
fwupd_client_set_daemon_version (client, g_variant_get_string (val, NULL));
+ val2 = g_dbus_proxy_get_cached_property (priv->proxy, "Tainted");
+ if (val2 != NULL)
+ priv->tainted = g_variant_get_boolean (val2);
return TRUE;
}
-static GPtrArray *
-fwupd_client_parse_releases_from_variant (GVariant *val)
-{
- GPtrArray *array = NULL;
- gsize sz;
- g_autoptr(GVariant) untuple = NULL;
-
- array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- untuple = g_variant_get_child_value (val, 0);
- sz = g_variant_n_children (untuple);
- for (guint i = 0; i < sz; i++) {
- FwupdRelease *rel;
- g_autoptr(GVariant) data = NULL;
- data = g_variant_get_child_value (untuple, i);
- rel = fwupd_release_from_variant (data);
- if (rel == NULL)
- continue;
- g_ptr_array_add (array, rel);
- }
- return array;
-}
-
-static GPtrArray *
-fwupd_client_parse_devices_from_variant (GVariant *val)
-{
- GPtrArray *array = NULL;
- gsize sz;
- g_autoptr(GVariant) untuple = NULL;
- g_autoptr(GHashTable) devices_by_id = NULL;
-
- array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- devices_by_id = g_hash_table_new (g_str_hash, g_str_equal);
- untuple = g_variant_get_child_value (val, 0);
- sz = g_variant_n_children (untuple);
- for (guint i = 0; i < sz; i++) {
- FwupdDevice *dev;
- g_autoptr(GVariant) data = NULL;
- data = g_variant_get_child_value (untuple, i);
- dev = fwupd_device_from_variant (data);
- if (dev == NULL)
- continue;
- g_ptr_array_add (array, dev);
- if (fwupd_device_get_id (dev) != NULL) {
- g_hash_table_insert (devices_by_id,
- (gpointer) fwupd_device_get_id (dev),
- (gpointer) dev);
- }
- }
-
- /* set the parent on each child */
- for (guint i = 0; i < array->len; i++) {
- FwupdDevice *dev = g_ptr_array_index (array, i);
- const gchar *parent_id = fwupd_device_get_parent_id (dev);
- if (parent_id != NULL) {
- FwupdDevice *dev_tmp;
- dev_tmp = g_hash_table_lookup (devices_by_id, parent_id);
- fwupd_device_set_parent (dev, dev_tmp);
- }
- }
-
- return array;
-}
-
-static GPtrArray *
-fwupd_client_parse_remotes_from_data (GVariant *devices)
-{
- GPtrArray *remotes = NULL;
- gsize sz;
- g_autoptr(GVariant) untuple = NULL;
-
- remotes = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- untuple = g_variant_get_child_value (devices, 0);
- sz = g_variant_n_children (untuple);
- for (guint i = 0; i < sz; i++) {
- g_autoptr(GVariant) data = g_variant_get_child_value (untuple, i);
- FwupdRemote *remote = fwupd_remote_from_variant (data);
- g_ptr_array_add (remotes, remote);
- }
-
- return remotes;
-}
-
static void
fwupd_client_fixup_dbus_error (GError *error)
{
@@ -393,7 +324,7 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_devices_from_variant (val);
+ return fwupd_device_array_from_variant (val);
}
/**
@@ -435,7 +366,7 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_devices_from_variant (val);
+ return fwupd_device_array_from_variant (val);
}
/**
@@ -524,7 +455,7 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_releases_from_variant (val);
+ return fwupd_release_array_from_variant (val);
}
/**
@@ -569,7 +500,7 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_releases_from_variant (val);
+ return fwupd_release_array_from_variant (val);
}
/**
@@ -614,7 +545,7 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_releases_from_variant (val);
+ return fwupd_release_array_from_variant (val);
}
static void
@@ -631,6 +562,104 @@
}
/**
+ * fwupd_client_modify_config
+ * @client: A #FwupdClient
+ * @key: key, e.g. `BlacklistPlugins`
+ * @value: value, e.g. `*`
+ * @cancellable: the #GCancellable, or %NULL
+ * @error: the #GError, or %NULL
+ *
+ * Modifies a daemon config option.
+ * The daemon will only respond to this request with proper permissions
+ *
+ * Returns: %TRUE for success
+ *
+ * Since: 1.2.8
+ **/
+gboolean
+fwupd_client_modify_config (FwupdClient *client, const gchar *key, const gchar *value,
+ GCancellable *cancellable, GError **error)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ g_autoptr(FwupdClientHelper) helper = NULL;
+
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ /* connect */
+ if (!fwupd_client_connect (client, cancellable, error))
+ return FALSE;
+
+ /* call into daemon */
+ helper = fwupd_client_helper_new ();
+ g_dbus_proxy_call (priv->proxy,
+ "ModifyConfig",
+ g_variant_new ("(ss)", key, value),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ fwupd_client_proxy_call_cb,
+ helper);
+ g_main_loop_run (helper->loop);
+ if (!helper->ret) {
+ g_propagate_error (error, helper->error);
+ helper->error = NULL;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
+ * fwupd_client_activate:
+ * @client: A #FwupdClient
+ * @cancellable: the #GCancellable, or %NULL
+ * @device_id: a device
+ * @error: the #GError, or %NULL
+ *
+ * Activates up a device, which normally means the device switches to a new
+ * firmware version. This should only be called when data loss cannot occur.
+ *
+ * Returns: %TRUE for success
+ *
+ * Since: 1.2.6
+ **/
+gboolean
+fwupd_client_activate (FwupdClient *client, GCancellable *cancellable,
+ const gchar *device_id, GError **error)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ g_autoptr(FwupdClientHelper) helper = NULL;
+
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (device_id != NULL, FALSE);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ /* connect */
+ if (!fwupd_client_connect (client, cancellable, error))
+ return FALSE;
+
+ /* call into daemon */
+ helper = fwupd_client_helper_new ();
+ g_dbus_proxy_call (priv->proxy,
+ "Activate",
+ g_variant_new ("(s)", device_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ fwupd_client_proxy_call_cb,
+ helper);
+ g_main_loop_run (helper->loop);
+ if (!helper->ret) {
+ g_propagate_error (error, helper->error);
+ helper->error = NULL;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
* fwupd_client_verify:
* @client: A #FwupdClient
* @device_id: the device ID
@@ -932,7 +961,7 @@
return FALSE;
/* set options */
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (&builder, "{sv}",
"reason", g_variant_new_string ("user-action"));
g_variant_builder_add (&builder, "{sv}",
@@ -1082,7 +1111,7 @@
}
/* return results */
- return fwupd_client_parse_devices_from_variant (helper->val);
+ return fwupd_device_array_from_variant (helper->val);
}
/**
@@ -1140,6 +1169,24 @@
}
/**
+ * fwupd_client_get_tainted:
+ * @client: A #FwupdClient
+ *
+ * Gets if the daemon has been tainted by 3rd party code.
+ *
+ * Returns: %TRUE if the daemon is unsupported
+ *
+ * Since: 1.2.4
+ **/
+gboolean
+fwupd_client_get_tainted (FwupdClient *client)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), FALSE);
+ return priv->tainted;
+}
+
+/**
* fwupd_client_update_metadata:
* @client: A #FwupdClient
* @remote_id: the remote ID, e.g. `lvfs-testing`
@@ -1281,7 +1328,161 @@
fwupd_client_fixup_dbus_error (*error);
return NULL;
}
- return fwupd_client_parse_remotes_from_data (val);
+ return fwupd_remote_array_from_variant (val);
+}
+
+/**
+ * fwupd_client_get_approved_firmware:
+ * @client: A #FwupdClient
+ * @cancellable: the #GCancellable, or %NULL
+ * @error: the #GError, or %NULL
+ *
+ * Gets the list of approved firmware.
+ *
+ * Returns: (transfer full): list of remotes, or %NULL
+ *
+ * Since: 1.2.6
+ **/
+gchar **
+fwupd_client_get_approved_firmware (FwupdClient *client,
+ GCancellable *cancellable,
+ GError **error)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ g_autoptr(GVariant) val = NULL;
+ gchar **retval = NULL;
+
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ /* connect */
+ if (!fwupd_client_connect (client, cancellable, error))
+ return NULL;
+
+ /* call into daemon */
+ val = g_dbus_proxy_call_sync (priv->proxy,
+ "GetApprovedFirmware",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (val == NULL) {
+ if (error != NULL)
+ fwupd_client_fixup_dbus_error (*error);
+ return NULL;
+ }
+ g_variant_get (val, "(^as)", &retval);
+ return retval;
+}
+
+/**
+ * fwupd_client_set_approved_firmware:
+ * @client: A #FwupdClient
+ * @checksums: Array of checksums
+ * @cancellable: the #GCancellable, or %NULL
+ * @error: the #GError, or %NULL
+ *
+ * Sets the list of approved firmware.
+ *
+ * Returns: %TRUE for success
+ *
+ * Since: 1.2.6
+ **/
+gboolean
+fwupd_client_set_approved_firmware (FwupdClient *client,
+ gchar **checksums,
+ GCancellable *cancellable,
+ GError **error)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ g_autoptr(GVariant) val = NULL;
+
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ /* connect */
+ if (!fwupd_client_connect (client, cancellable, error))
+ return FALSE;
+
+ /* call into daemon */
+ val = g_dbus_proxy_call_sync (priv->proxy,
+ "SetApprovedFirmware",
+ g_variant_new ("(^as)", checksums),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (val == NULL) {
+ if (error != NULL)
+ fwupd_client_fixup_dbus_error (*error);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
+ * fwupd_client_self_sign:
+ * @client: A #FwupdClient
+ * @value: A string to sign, typically a JSON blob
+ * @flags: #FwupdSelfSignFlags, e.g. %FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP
+ * @cancellable: the #GCancellable, or %NULL
+ * @error: the #GError, or %NULL
+ *
+ * Signs the data using the client self-signed certificate.
+ *
+ * Returns: %TRUE for success
+ *
+ * Since: 1.2.6
+ **/
+gchar *
+fwupd_client_self_sign (FwupdClient *client,
+ const gchar *value,
+ FwupdSelfSignFlags flags,
+ GCancellable *cancellable,
+ GError **error)
+{
+ FwupdClientPrivate *priv = GET_PRIVATE (client);
+ GVariantBuilder builder;
+ g_autoptr(GVariant) val = NULL;
+ gchar *retval = NULL;
+
+ g_return_val_if_fail (FWUPD_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ /* connect */
+ if (!fwupd_client_connect (client, cancellable, error))
+ return NULL;
+
+ /* set options */
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+ if (flags & FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP) {
+ g_variant_builder_add (&builder, "{sv}",
+ "add-timestamp", g_variant_new_boolean (TRUE));
+ }
+ if (flags & FWUPD_SELF_SIGN_FLAG_ADD_CERT) {
+ g_variant_builder_add (&builder, "{sv}",
+ "add-cert", g_variant_new_boolean (TRUE));
+ }
+
+ /* call into daemon */
+ val = g_dbus_proxy_call_sync (priv->proxy,
+ "SelfSign",
+ g_variant_new ("(sa{sv})", value, &builder),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (val == NULL) {
+ if (error != NULL)
+ fwupd_client_fixup_dbus_error (*error);
+ return NULL;
+ }
+ g_variant_get (val, "(s)", &retval);
+ return retval;
}
/**
@@ -1462,6 +1663,9 @@
case PROP_STATUS:
g_value_set_uint (value, priv->status);
break;
+ case PROP_TAINTED:
+ g_value_set_boolean (value, priv->tainted);
+ break;
case PROP_PERCENTAGE:
g_value_set_uint (value, priv->percentage);
break;
@@ -1596,10 +1800,21 @@
*/
pspec = g_param_spec_uint ("status", NULL, NULL,
0, FWUPD_STATUS_LAST, FWUPD_STATUS_UNKNOWN,
- G_PARAM_READWRITE);
+ G_PARAM_READWRITE | G_PARAM_STATIC_NAME);
g_object_class_install_property (object_class, PROP_STATUS, pspec);
/**
+ * FwupdClient:tainted:
+ *
+ * If the daemon is tainted by 3rd party code.
+ *
+ * Since: 1.2.4
+ */
+ pspec = g_param_spec_boolean ("tainted", NULL, NULL, FALSE,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_TAINTED, pspec);
+
+ /**
* FwupdClient:percentage:
*
* The last-reported percentage of the daemon.
@@ -1608,7 +1823,7 @@
*/
pspec = g_param_spec_uint ("percentage", NULL, NULL,
0, 100, 0,
- G_PARAM_READWRITE);
+ G_PARAM_READWRITE | G_PARAM_STATIC_NAME);
g_object_class_install_property (object_class, PROP_PERCENTAGE, pspec);
/**
@@ -1619,7 +1834,7 @@
* Since: 0.9.6
*/
pspec = g_param_spec_string ("daemon-version", NULL, NULL,
- NULL, G_PARAM_READABLE);
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_NAME);
g_object_class_install_property (object_class, PROP_DAEMON_VERSION, pspec);
}
diff -Nru fwupd-1.0.9/libfwupd/fwupd-client.h fwupd-1.2.10/libfwupd/fwupd-client.h
--- fwupd-1.0.9/libfwupd/fwupd-client.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-client.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,10 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2016-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_CLIENT_H
-#define __FWUPD_CLIENT_H
+#pragma once
#include
#include
@@ -80,6 +78,15 @@
const gchar *device_id,
GCancellable *cancellable,
GError **error);
+gboolean fwupd_client_modify_config (FwupdClient *client,
+ const gchar *key,
+ const gchar *value,
+ GCancellable *cancellable,
+ GError **error);
+gboolean fwupd_client_activate (FwupdClient *client,
+ GCancellable *cancellable,
+ const gchar *device_id,
+ GError **error);
gboolean fwupd_client_clear_results (FwupdClient *client,
const gchar *device_id,
GCancellable *cancellable,
@@ -117,6 +124,7 @@
GCancellable *cancellable,
GError **error);
FwupdStatus fwupd_client_get_status (FwupdClient *client);
+gboolean fwupd_client_get_tainted (FwupdClient *client);
guint fwupd_client_get_percentage (FwupdClient *client);
const gchar *fwupd_client_get_daemon_version (FwupdClient *client);
@@ -128,7 +136,17 @@
GCancellable *cancellable,
GError **error);
-G_END_DECLS
-
-#endif /* __FWUPD_CLIENT_H */
+gchar **fwupd_client_get_approved_firmware (FwupdClient *client,
+ GCancellable *cancellable,
+ GError **error);
+gboolean fwupd_client_set_approved_firmware (FwupdClient *client,
+ gchar **checksums,
+ GCancellable *cancellable,
+ GError **error);
+gchar *fwupd_client_self_sign (FwupdClient *client,
+ const gchar *value,
+ FwupdSelfSignFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-common.c fwupd-1.2.10/libfwupd/fwupd-common.c
--- fwupd-1.0.9/libfwupd/fwupd-common.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-common.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -17,6 +16,10 @@
#include
#include
+#if !GLIB_CHECK_VERSION(2,54,0)
+#include
+#endif
+
/**
* fwupd_checksum_guess_kind:
* @checksum: A checksum
@@ -46,7 +49,7 @@
}
static const gchar *
-_g_checksum_type_to_string (GChecksumType checksum_type)
+fwupd_checksum_type_to_string_display (GChecksumType checksum_type)
{
if (checksum_type == G_CHECKSUM_MD5)
return "MD5";
@@ -73,7 +76,9 @@
fwupd_checksum_format_for_display (const gchar *checksum)
{
GChecksumType kind = fwupd_checksum_guess_kind (checksum);
- return g_strdup_printf ("%s(%s)", _g_checksum_type_to_string (kind), checksum);
+ return g_strdup_printf ("%s(%s)",
+ fwupd_checksum_type_to_string_display (kind),
+ checksum);
}
/**
@@ -357,6 +362,24 @@
checksums = fwupd_release_get_checksums (rel);
json_builder_add_string_value (builder, fwupd_checksum_get_by_kind (checksums, G_CHECKSUM_SHA1));
+ /* identify the firmware written */
+ checksums = fwupd_device_get_checksums (dev);
+ if (checksums->len > 0) {
+ json_builder_set_member_name (builder, "ChecksumDevice");
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < checksums->len; i++) {
+ const gchar *checksum = g_ptr_array_index (checksums, i);
+ json_builder_add_string_value (builder, checksum);
+ }
+ json_builder_end_array (builder);
+ }
+
+ /* include the protocol used */
+ if (fwupd_release_get_protocol (rel) != NULL) {
+ json_builder_set_member_name (builder, "Protocol");
+ json_builder_add_string_value (builder, fwupd_release_get_protocol (rel));
+ }
+
/* set the error state of the report */
json_builder_set_member_name (builder, "UpdateState");
json_builder_add_int_value (builder, fwupd_device_get_update_state (dev));
@@ -364,6 +387,10 @@
json_builder_set_member_name (builder, "UpdateError");
json_builder_add_string_value (builder, fwupd_device_get_update_error (dev));
}
+ if (fwupd_release_get_update_message (rel) != NULL) {
+ json_builder_set_member_name (builder, "UpdateMessage");
+ json_builder_add_string_value (builder, fwupd_release_get_update_message (rel));
+ }
/* map back to the dev type on the LVFS */
json_builder_set_member_name (builder, "Guid");
@@ -492,3 +519,305 @@
}
return data;
}
+
+#define FWUPD_GUID_NAMESPACE_DEFAULT "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
+#define FWUPD_GUID_NAMESPACE_MICROSOFT "70ffd812-4c7f-4c7d-0000-000000000000"
+
+typedef struct __attribute__((packed)) {
+ guint32 a;
+ guint16 b;
+ guint16 c;
+ guint16 d;
+ guint8 e[6];
+} fwupd_guid_native_t;
+
+/**
+ * fwupd_guid_to_string:
+ * @guid: a #fwupd_guid_t to read
+ * @flags: some %FwupdGuidFlags, e.g. %FWUPD_GUID_FLAG_MIXED_ENDIAN
+ *
+ * Returns a text GUID of mixed or BE endian for a packed buffer.
+ *
+ * Returns: A new GUID
+ *
+ * Since: 1.2.5
+ **/
+gchar *
+fwupd_guid_to_string (const fwupd_guid_t *guid, FwupdGuidFlags flags)
+{
+ fwupd_guid_native_t gnat;
+
+ g_return_val_if_fail (guid != NULL, NULL);
+
+ /* copy to avoid issues with aligning */
+ memcpy (&gnat, guid, sizeof(gnat));
+
+ /* mixed is bizaar, but specified as the DCE encoding */
+ if (flags & FWUPD_GUID_FLAG_MIXED_ENDIAN) {
+ return g_strdup_printf ("%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
+ GUINT32_FROM_LE(gnat.a),
+ GUINT16_FROM_LE(gnat.b),
+ GUINT16_FROM_LE(gnat.c),
+ GUINT16_FROM_BE(gnat.d),
+ gnat.e[0], gnat.e[1],
+ gnat.e[2], gnat.e[3],
+ gnat.e[4], gnat.e[5]);
+ }
+ return g_strdup_printf ("%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
+ GUINT32_FROM_BE(gnat.a),
+ GUINT16_FROM_BE(gnat.b),
+ GUINT16_FROM_BE(gnat.c),
+ GUINT16_FROM_BE(gnat.d),
+ gnat.e[0], gnat.e[1],
+ gnat.e[2], gnat.e[3],
+ gnat.e[4], gnat.e[5]);
+}
+
+#if !GLIB_CHECK_VERSION(2,54,0)
+static gboolean
+str_has_sign (const gchar *str)
+{
+ return str[0] == '-' || str[0] == '+';
+}
+
+static gboolean
+str_has_hex_prefix (const gchar *str)
+{
+ return str[0] == '0' && g_ascii_tolower (str[1]) == 'x';
+}
+
+static gboolean
+g_ascii_string_to_unsigned (const gchar *str,
+ guint base,
+ guint64 min,
+ guint64 max,
+ guint64 *out_num,
+ GError **error)
+{
+ const gchar *end_ptr = NULL;
+ gint saved_errno = 0;
+ guint64 number;
+
+ g_return_val_if_fail (str != NULL, FALSE);
+ g_return_val_if_fail (base >= 2 && base <= 36, FALSE);
+ g_return_val_if_fail (min <= max, FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ if (str[0] == '\0') {
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
+ "Empty string is not a number");
+ return FALSE;
+ }
+
+ errno = 0;
+ number = g_ascii_strtoull (str, (gchar **)&end_ptr, base);
+ saved_errno = errno;
+
+ if (g_ascii_isspace (str[0]) || str_has_sign (str) ||
+ (base == 16 && str_has_hex_prefix (str)) ||
+ (saved_errno != 0 && saved_errno != ERANGE) ||
+ end_ptr == NULL ||
+ *end_ptr != '\0') {
+ g_set_error (error,
+ G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
+ "“%s” is not an unsigned number", str);
+ return FALSE;
+ }
+ if (saved_errno == ERANGE || number < min || number > max) {
+ g_autofree gchar *min_str = g_strdup_printf ("%" G_GUINT64_FORMAT, min);
+ g_autofree gchar *max_str = g_strdup_printf ("%" G_GUINT64_FORMAT, max);
+ g_set_error (error,
+ G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
+ "Number “%s” is out of bounds [%s, %s]",
+ str, min_str, max_str);
+ return FALSE;
+ }
+ if (out_num != NULL)
+ *out_num = number;
+ return TRUE;
+}
+#endif /* GLIB_CHECK_VERSION(2,54,0) */
+
+/**
+ * fwupd_guid_from_string:
+ * @guidstr: (nullable): a GUID, e.g. `00112233-4455-6677-8899-aabbccddeeff`
+ * @guid: a #fwupd_guid_t, or NULL to just check the GUID
+ * @flags: some %FwupdGuidFlags, e.g. %FWUPD_GUID_FLAG_MIXED_ENDIAN
+ * @error: A #GError or %NULL
+ *
+ * Converts a string GUID into its binary encoding. All string GUIDs are
+ * formatted as big endian but on-disk can be encoded in different ways.
+ *
+ * Returns: %TRUE for success
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+fwupd_guid_from_string (const gchar *guidstr,
+ fwupd_guid_t *guid,
+ FwupdGuidFlags flags,
+ GError **error)
+{
+ fwupd_guid_native_t gu = { 0x0 };
+ gboolean mixed_endian = flags & FWUPD_GUID_FLAG_MIXED_ENDIAN;
+ guint64 tmp;
+ g_auto(GStrv) split = NULL;
+
+ g_return_val_if_fail (guidstr != NULL, FALSE);
+
+ /* split into sections */
+ if (strlen (guidstr) != 36) {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_DATA,
+ "is not valid format");
+ return FALSE;
+ }
+ split = g_strsplit (guidstr, "-", 5);
+ if (g_strv_length (split) != 5) {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_DATA,
+ "is not valid format, no dashes");
+ return FALSE;
+ }
+ if (strlen (split[0]) != 8 && strlen (split[1]) != 4 &&
+ strlen (split[2]) != 4 && strlen (split[3]) != 4 &&
+ strlen (split[4]) != 12) {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_DATA,
+ "is not valid format, not GUID");
+ return FALSE;
+ }
+
+ /* parse */
+ if (!g_ascii_string_to_unsigned (split[0], 16, 0, 0xffffffff, &tmp, error))
+ return FALSE;
+ gu.a = mixed_endian ? GUINT32_TO_LE(tmp) : GUINT32_TO_BE(tmp);
+ if (!g_ascii_string_to_unsigned (split[1], 16, 0, 0xffff, &tmp, error))
+ return FALSE;
+ gu.b = mixed_endian ? GUINT16_TO_LE(tmp) : GUINT16_TO_BE(tmp);
+ if (!g_ascii_string_to_unsigned (split[2], 16, 0, 0xffff, &tmp, error))
+ return FALSE;
+ gu.c = mixed_endian ? GUINT16_TO_LE(tmp) : GUINT16_TO_BE(tmp);
+ if (!g_ascii_string_to_unsigned (split[3], 16, 0, 0xffff, &tmp, error))
+ return FALSE;
+ gu.d = GUINT16_TO_BE(tmp);
+ for (guint i = 0; i < 6; i++) {
+ gchar buffer[3] = { 0x0 };
+ memcpy (buffer, split[4] + (i * 2), 2);
+ if (!g_ascii_string_to_unsigned (buffer, 16, 0, 0xff, &tmp, error))
+ return FALSE;
+ gu.e[i] = tmp;
+ }
+ if (guid != NULL)
+ memcpy (guid, &gu, sizeof(gu));
+
+ /* success */
+ return TRUE;
+}
+
+/**
+ * fwupd_guid_hash_data:
+ * @data: data to hash
+ * @datasz: length of @data
+ * @flags: some %FwupdGuidFlags, e.g. %FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT
+ *
+ * Returns a GUID for some data. This uses a hash and so even small
+ * differences in the @data will produce radically different return values.
+ *
+ * The implementation is taken from RFC4122, Section 4.1.3; specifically
+ * using a type-5 SHA-1 hash.
+ *
+ * Returns: A new GUID, or %NULL for internal error
+ *
+ * Since: 1.2.5
+ **/
+gchar *
+fwupd_guid_hash_data (const guint8 *data, gsize datasz, FwupdGuidFlags flags)
+{
+ const gchar *namespace_id = FWUPD_GUID_NAMESPACE_DEFAULT;
+ gsize digestlen = 20;
+ guint8 hash[20];
+ fwupd_guid_t uu_namespace;
+ fwupd_guid_t uu_new;
+ g_autoptr(GChecksum) csum = NULL;
+
+ g_return_val_if_fail (namespace_id != NULL, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
+ g_return_val_if_fail (datasz != 0, NULL);
+
+ /* old MS GUID */
+ if (flags & FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT)
+ namespace_id = FWUPD_GUID_NAMESPACE_MICROSOFT;
+
+ /* convert the namespace to binary: hardcoded BE, not @flags */
+ if (!fwupd_guid_from_string (namespace_id, &uu_namespace, FWUPD_GUID_FLAG_NONE, NULL))
+ return NULL;
+
+ /* hash the namespace and then the string */
+ csum = g_checksum_new (G_CHECKSUM_SHA1);
+ g_checksum_update (csum, (guchar *) &uu_namespace, sizeof(uu_namespace));
+ g_checksum_update (csum, (guchar *) data, (gssize) datasz);
+ g_checksum_get_digest (csum, hash, &digestlen);
+
+ /* copy most parts of the hash 1:1 */
+ memcpy (uu_new, hash, sizeof(uu_new));
+
+ /* set specific bits according to Section 4.1.3 */
+ uu_new[6] = (guint8) ((uu_new[6] & 0x0f) | (5 << 4));
+ uu_new[8] = (guint8) ((uu_new[8] & 0x3f) | 0x80);
+ return fwupd_guid_to_string ((const fwupd_guid_t *) &uu_new, flags);
+}
+
+/**
+ * fwupd_guid_is_valid:
+ * @guid: string to check, e.g. `00112233-4455-6677-8899-aabbccddeeff`
+ *
+ * Checks the string is a valid GUID.
+ *
+ * Returns: %TRUE if @guid was a valid GUID, %FALSE otherwise
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+fwupd_guid_is_valid (const gchar *guid)
+{
+ if (guid == NULL)
+ return FALSE;
+ if (!fwupd_guid_from_string (guid, NULL, FWUPD_GUID_FLAG_NONE, NULL))
+ return FALSE;
+ if (g_strcmp0 (guid, "00000000-0000-0000-0000-000000000000") == 0)
+ return FALSE;
+ return TRUE;
+}
+
+/**
+ * fwupd_guid_hash_string:
+ * @str: A source string to use as a key
+ *
+ * Returns a GUID for a given string. This uses a hash and so even small
+ * differences in the @str will produce radically different return values.
+ *
+ * The default implementation is taken from RFC4122, Section 4.1.3; specifically
+ * using a type-5 SHA-1 hash with a DNS namespace.
+ * The same result can be obtained with this simple python program:
+ *
+ * #!/usr/bin/python
+ * import uuid
+ * print uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
+ *
+ * Returns: A new GUID, or %NULL if the string was invalid
+ *
+ * Since: 1.2.5
+ **/
+gchar *
+fwupd_guid_hash_string (const gchar *str)
+{
+ if (str == NULL || str[0] == '\0')
+ return NULL;
+ return fwupd_guid_hash_data ((const guint8 *) str, strlen (str),
+ FWUPD_GUID_FLAG_NONE);
+}
diff -Nru fwupd-1.0.9/libfwupd/fwupd-common.h fwupd-1.2.10/libfwupd/fwupd-common.h
--- fwupd-1.0.9/libfwupd/fwupd-common.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-common.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,21 +1,42 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_COMMON_H
-#define __FWUPD_COMMON_H
+#pragma once
#include
+G_BEGIN_DECLS
+
#define FWUPD_DBUS_PATH "/"
#define FWUPD_DBUS_SERVICE "org.freedesktop.fwupd"
#define FWUPD_DBUS_INTERFACE "org.freedesktop.fwupd"
#define FWUPD_DEVICE_ID_ANY "*"
+/**
+ * FwupdGuidFlags:
+ * @FWUPD_GUID_FLAG_NONE: No trust
+ * @FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT: Use the Microsoft-compatible namespace
+ * @FWUPD_GUID_FLAG_MIXED_ENDIAN: Use EFI mixed endian representation
+ *
+ * The flags to show how the data should be converted.
+ **/
+typedef enum {
+ FWUPD_GUID_FLAG_NONE = 0, /* Since: 1.2.5 */
+ FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT = 1 << 0, /* Since: 1.2.5 */
+ FWUPD_GUID_FLAG_MIXED_ENDIAN = 1 << 1, /* Since: 1.2.5 */
+ /*< private >*/
+ FWUPD_GUID_FLAG_LAST
+} FwupdGuidFlags;
+
+/* GObject Introspection does not understand typedefs with sizes */
+#ifndef __GI_SCANNER__
+typedef guint8 fwupd_guid_t[16];
+#endif
+
const gchar *fwupd_checksum_get_best (GPtrArray *checksums);
const gchar *fwupd_checksum_get_by_kind (GPtrArray *checksums,
GChecksumType kind);
@@ -27,5 +48,25 @@
GHashTable *fwupd_get_os_release (GError **error);
gchar *fwupd_build_history_report_json (GPtrArray *devices,
GError **error);
+#ifndef __GI_SCANNER__
+gchar *fwupd_guid_to_string (const fwupd_guid_t *guid,
+ FwupdGuidFlags flags);
+gboolean fwupd_guid_from_string (const gchar *guidstr,
+ fwupd_guid_t *guid,
+ FwupdGuidFlags flags,
+ GError **error);
+#else
+gchar *fwupd_guid_to_string (const guint8 guid[16],
+ FwupdGuidFlags flags);
+gboolean fwupd_guid_from_string (const gchar *guidstr,
+ guint8 guid[16],
+ FwupdGuidFlags flags,
+ GError **error);
+#endif
+gboolean fwupd_guid_is_valid (const gchar *guid);
+gchar *fwupd_guid_hash_string (const gchar *str);
+gchar *fwupd_guid_hash_data (const guint8 *data,
+ gsize datasz,
+ FwupdGuidFlags flags);
-#endif /* __FWUPD_COMMON_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-common-private.h fwupd-1.2.10/libfwupd/fwupd-common-private.h
--- fwupd-1.0.9/libfwupd/fwupd-common-private.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-common-private.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,17 +1,17 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_COMMON_PRIVATE_H
-#define __FWUPD_COMMON_PRIVATE_H
+#pragma once
#include
#include "fwupd-common.h"
+G_BEGIN_DECLS
+
gchar *fwupd_checksum_format_for_display (const gchar *checksum);
-#endif /* __FWUPD_COMMON_PRIVATE_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-deprecated.h fwupd-1.2.10/libfwupd/fwupd-deprecated.h
--- fwupd-1.0.9/libfwupd/fwupd-deprecated.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-deprecated.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,13 +1,13 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_DEPRECATED_H
-#define __FWUPD_DEPRECATED_H
+#pragma once
+
+G_BEGIN_DECLS
/* indeed, nothing */
-#endif /* __FWUPD_DEPRECATED_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-device.c fwupd-1.2.10/libfwupd/fwupd-device.c
--- fwupd-1.0.9/libfwupd/fwupd-device.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-device.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -35,8 +34,10 @@
guint64 modified;
guint64 flags;
GPtrArray *guids;
+ GPtrArray *instance_ids;
GPtrArray *icons;
gchar *name;
+ gchar *serial;
gchar *summary;
gchar *description;
gchar *vendor;
@@ -46,14 +47,23 @@
gchar *version;
gchar *version_lowest;
gchar *version_bootloader;
+ FwupdVersionFormat version_format;
GPtrArray *checksums;
guint32 flashes_left;
+ guint32 install_duration;
FwupdUpdateState update_state;
gchar *update_error;
+ gchar *update_message;
GPtrArray *releases;
FwupdDevice *parent;
} FwupdDevicePrivate;
+enum {
+ PROP_0,
+ PROP_VERSION_FORMAT,
+ PROP_LAST
+};
+
G_DEFINE_TYPE_WITH_PRIVATE (FwupdDevice, fwupd_device, G_TYPE_OBJECT)
#define GET_PRIVATE(o) (fwupd_device_get_instance_private (o))
@@ -135,6 +145,42 @@
}
/**
+ * fwupd_device_get_serial:
+ * @device: A #FwupdDevice
+ *
+ * Gets the serial number for the device.
+ *
+ * Returns: a string value, or %NULL if never set.
+ *
+ * Since: 1.1.2
+ **/
+const gchar *
+fwupd_device_get_serial (FwupdDevice *device)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), NULL);
+ return priv->serial;
+}
+
+/**
+ * fwupd_device_set_serial:
+ * @device: A #FwupdDevice
+ * @serial: the device serial number
+ *
+ * Sets the serial number for the device.
+ *
+ * Since: 1.1.2
+ **/
+void
+fwupd_device_set_serial (FwupdDevice *device, const gchar *serial)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ g_free (priv->serial);
+ priv->serial = g_strdup (serial);
+}
+
+/**
* fwupd_device_get_id:
* @device: A #FwupdDevice
*
@@ -325,6 +371,69 @@
}
/**
+ * fwupd_device_get_instance_ids:
+ * @device: A #FwupdDevice
+ *
+ * Gets the InstanceIDs.
+ *
+ * Returns: (element-type utf8) (transfer none): the InstanceID
+ *
+ * Since: 1.2.5
+ **/
+GPtrArray *
+fwupd_device_get_instance_ids (FwupdDevice *device)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), NULL);
+ return priv->instance_ids;
+}
+
+/**
+ * fwupd_device_has_instance_id:
+ * @device: A #FwupdDevice
+ * @instance_id: the InstanceID, e.g. `PCI\VEN_10EC&DEV_525A`
+ *
+ * Finds out if the device has this specific InstanceID.
+ *
+ * Returns: %TRUE if the InstanceID is found
+ *
+ * Since: 1.2.5
+ **/
+gboolean
+fwupd_device_has_instance_id (FwupdDevice *device, const gchar *instance_id)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), FALSE);
+
+ for (guint i = 0; i < priv->instance_ids->len; i++) {
+ const gchar *instance_id_tmp = g_ptr_array_index (priv->instance_ids, i);
+ if (g_strcmp0 (instance_id, instance_id_tmp) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * fwupd_device_add_instance_id:
+ * @device: A #FwupdDevice
+ * @instance_id: the GUID, e.g. `PCI\VEN_10EC&DEV_525A`
+ *
+ * Adds the InstanceID if it does not already exist.
+ *
+ * Since: 1.2.5
+ **/
+void
+fwupd_device_add_instance_id (FwupdDevice *device, const gchar *instance_id)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ if (fwupd_device_has_instance_id (device, instance_id))
+ return;
+ g_ptr_array_add (priv->instance_ids, g_strdup (instance_id));
+}
+
+/**
* fwupd_device_get_icons:
* @device: A #FwupdDevice
*
@@ -664,6 +773,41 @@
}
/**
+ * fwupd_device_get_install_duration:
+ * @device: A #FwupdDevice
+ *
+ * Gets the time estimate for firmware installation (in seconds)
+ *
+ * Returns: the estimated time to flash this device (or 0 if unset)
+ *
+ * Since: 1.1.3
+ **/
+guint32
+fwupd_device_get_install_duration (FwupdDevice *device)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), 0);
+ return priv->install_duration;
+}
+
+/**
+ * fwupd_device_set_install_duration:
+ * @device: A #FwupdDevice
+ * @duration: The amount of time
+ *
+ * Sets the time estimate for firmware installation (in seconds)
+ *
+ * Since: 1.1.3
+ **/
+void
+fwupd_device_set_install_duration (FwupdDevice *device, guint32 duration)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ priv->install_duration = duration;
+}
+
+/**
* fwupd_device_get_plugin:
* @device: A #FwupdDevice
*
@@ -859,17 +1003,98 @@
}
/**
- * fwupd_device_to_variant:
+ * fwupd_device_incorporate:
+ * @self: A #FwupdDevice
+ * @donor: Another #FwupdDevice
+ *
+ * Copy all properties from the donor object if they have not already been set.
+ *
+ * Since: 1.1.0
+ **/
+void
+fwupd_device_incorporate (FwupdDevice *self, FwupdDevice *donor)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (self);
+ FwupdDevicePrivate *priv_donor = GET_PRIVATE (donor);
+
+ if (priv->flags == 0)
+ fwupd_device_add_flag (self, priv_donor->flags);
+ if (priv->created == 0)
+ fwupd_device_set_created (self, priv_donor->created);
+ if (priv->modified == 0)
+ fwupd_device_set_modified (self, priv_donor->modified);
+ if (priv->flashes_left == 0)
+ fwupd_device_set_flashes_left (self, priv_donor->flashes_left);
+ if (priv->install_duration == 0)
+ fwupd_device_set_install_duration (self, priv_donor->install_duration);
+ if (priv->update_state == 0)
+ fwupd_device_set_update_state (self, priv_donor->update_state);
+ if (priv->description == NULL)
+ fwupd_device_set_description (self, priv_donor->description);
+ if (priv->id == NULL)
+ fwupd_device_set_id (self, priv_donor->id);
+ if (priv->parent_id == NULL)
+ fwupd_device_set_parent_id (self, priv_donor->parent_id);
+ if (priv->name == NULL)
+ fwupd_device_set_name (self, priv_donor->name);
+ if (priv->serial == NULL)
+ fwupd_device_set_serial (self, priv_donor->serial);
+ if (priv->summary == NULL)
+ fwupd_device_set_summary (self, priv_donor->summary);
+ if (priv->vendor == NULL)
+ fwupd_device_set_vendor (self, priv_donor->vendor);
+ if (priv->vendor_id == NULL)
+ fwupd_device_set_vendor_id (self, priv_donor->vendor_id);
+ if (priv->plugin == NULL)
+ fwupd_device_set_plugin (self, priv_donor->plugin);
+ if (priv->update_error == NULL)
+ fwupd_device_set_update_error (self, priv_donor->update_error);
+ if (priv->update_message == NULL)
+ fwupd_device_set_update_message (self, priv_donor->update_message);
+ if (priv->version == NULL)
+ fwupd_device_set_version (self, priv_donor->version);
+ if (priv->version_lowest == NULL)
+ fwupd_device_set_version_lowest (self, priv_donor->version_lowest);
+ if (priv->version_bootloader == NULL)
+ fwupd_device_set_version_bootloader (self, priv_donor->version_bootloader);
+ if (priv->version_format == FWUPD_VERSION_FORMAT_UNKNOWN)
+ fwupd_device_set_version_format (self, priv_donor->version_format);
+ for (guint i = 0; i < priv_donor->guids->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv_donor->guids, i);
+ fwupd_device_add_guid (self, tmp);
+ }
+ for (guint i = 0; i < priv_donor->instance_ids->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv_donor->instance_ids, i);
+ fwupd_device_add_instance_id (self, tmp);
+ }
+ for (guint i = 0; i < priv_donor->icons->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv_donor->icons, i);
+ fwupd_device_add_icon (self, tmp);
+ }
+ for (guint i = 0; i < priv_donor->checksums->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv_donor->checksums, i);
+ fwupd_device_add_checksum (self, tmp);
+ }
+ for (guint i = 0; i < priv_donor->releases->len; i++) {
+ FwupdRelease *tmp = g_ptr_array_index (priv_donor->releases, i);
+ fwupd_device_add_release (self, tmp);
+ }
+}
+
+/**
+ * fwupd_device_to_variant_full:
* @device: A #FwupdDevice
+ * @flags: #FwupdDeviceFlags for the call
*
* Creates a GVariant from the device data.
+ * Optionally provides additional data based upon flags
*
* Returns: the GVariant, or %NULL for error
*
- * Since: 1.0.0
+ * Since: 1.1.2
**/
GVariant *
-fwupd_device_to_variant (FwupdDevice *device)
+fwupd_device_to_variant_full (FwupdDevice *device, FwupdDeviceFlags flags)
{
FwupdDevicePrivate *priv = GET_PRIVATE (device);
GVariantBuilder builder;
@@ -877,7 +1102,7 @@
g_return_val_if_fail (FWUPD_IS_DEVICE (device), NULL);
/* create an array with all the metadata in */
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
if (priv->id != NULL) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_DEVICE_ID,
@@ -978,16 +1203,44 @@
FWUPD_RESULT_KEY_FLASHES_LEFT,
g_variant_new_uint32 (priv->flashes_left));
}
+ if (priv->install_duration > 0) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_INSTALL_DURATION,
+ g_variant_new_uint32 (priv->install_duration));
+ }
if (priv->update_error != NULL) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_UPDATE_ERROR,
g_variant_new_string (priv->update_error));
}
+ if (priv->update_message != NULL) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_UPDATE_MESSAGE,
+ g_variant_new_string (priv->update_message));
+ }
if (priv->update_state != FWUPD_UPDATE_STATE_UNKNOWN) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_UPDATE_STATE,
g_variant_new_uint32 (priv->update_state));
}
+ if (priv->version_format != FWUPD_VERSION_FORMAT_UNKNOWN) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_VERSION_FORMAT,
+ g_variant_new_uint32 (priv->version_format));
+ }
+ if (flags & FWUPD_DEVICE_FLAG_TRUSTED) {
+ if (priv->serial != NULL) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_SERIAL,
+ g_variant_new_string (priv->serial));
+ }
+ if (priv->instance_ids->len > 0) {
+ const gchar * const *tmp = (const gchar * const *) priv->instance_ids->pdata;
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_INSTANCE_IDS,
+ g_variant_new_strv (tmp, priv->instance_ids->len));
+ }
+ }
/* create an array with all the metadata in */
if (priv->releases->len > 0) {
@@ -1006,6 +1259,22 @@
return g_variant_new ("a{sv}", &builder);
}
+/**
+ * fwupd_device_to_variant:
+ * @device: A #FwupdDevice
+ *
+ * Creates a GVariant from the device data omitting sensitive fields
+ *
+ * Returns: the GVariant, or %NULL for error
+ *
+ * Since: 1.0.0
+ **/
+GVariant *
+fwupd_device_to_variant (FwupdDevice *device)
+{
+ return fwupd_device_to_variant_full (device, FWUPD_DEVICE_FLAG_NONE);
+}
+
static void
fwupd_device_from_key_value (FwupdDevice *device, const gchar *key, GVariant *value)
{
@@ -1047,6 +1316,12 @@
fwupd_device_add_guid (device, guids[i]);
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_INSTANCE_IDS) == 0) {
+ g_autofree const gchar **instance_ids = g_variant_get_strv (value, NULL);
+ for (guint i = 0; instance_ids != NULL && instance_ids[i] != NULL; i++)
+ fwupd_device_add_instance_id (device, instance_ids[i]);
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_ICON) == 0) {
g_autofree const gchar **icons = g_variant_get_strv (value, NULL);
for (guint i = 0; icons != NULL && icons[i] != NULL; i++)
@@ -1065,6 +1340,10 @@
fwupd_device_set_vendor_id (device, g_variant_get_string (value, NULL));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_SERIAL) == 0) {
+ fwupd_device_set_serial (device, g_variant_get_string (value, NULL));
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_SUMMARY) == 0) {
fwupd_device_set_summary (device, g_variant_get_string (value, NULL));
return;
@@ -1102,14 +1381,26 @@
fwupd_device_set_flashes_left (device, g_variant_get_uint32 (value));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_INSTALL_DURATION) == 0) {
+ fwupd_device_set_install_duration (device, g_variant_get_uint32 (value));
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_UPDATE_ERROR) == 0) {
fwupd_device_set_update_error (device, g_variant_get_string (value, NULL));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_UPDATE_MESSAGE) == 0) {
+ fwupd_device_set_update_message (device, g_variant_get_string (value, NULL));
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_UPDATE_STATE) == 0) {
fwupd_device_set_update_state (device, g_variant_get_uint32 (value));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_VERSION_FORMAT) == 0) {
+ fwupd_device_set_version_format (device, g_variant_get_uint32 (value));
+ return;
+ }
}
static void
@@ -1205,6 +1496,77 @@
}
/**
+ * fwupd_device_get_version_format:
+ * @device: A #FwupdDevice
+ *
+ * Gets the update state.
+ *
+ * Returns: the update state, or %FWUPD_VERSION_FORMAT_UNKNOWN if unset
+ *
+ * Since: 1.2.9
+ **/
+FwupdVersionFormat
+fwupd_device_get_version_format (FwupdDevice *device)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), FWUPD_VERSION_FORMAT_UNKNOWN);
+ return priv->version_format;
+}
+
+/**
+ * fwupd_device_set_version_format:
+ * @device: A #FwupdDevice
+ * @version_format: the state, e.g. %FWUPD_VERSION_FORMAT_PENDING
+ *
+ * Sets the update state.
+ *
+ * Since: 1.2.9
+ **/
+void
+fwupd_device_set_version_format (FwupdDevice *device, FwupdVersionFormat version_format)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ priv->version_format = version_format;
+}
+
+/**
+ * fwupd_device_get_update_message:
+ * @device: A #FwupdDevice
+ *
+ * Gets the update message.
+ *
+ * Returns: the update message, or %NULL if unset
+ *
+ * Since: 1.2.4
+ **/
+const gchar *
+fwupd_device_get_update_message (FwupdDevice *device)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device), NULL);
+ return priv->update_message;
+}
+
+/**
+ * fwupd_device_set_update_message:
+ * @device: A #FwupdDevice
+ * @update_message: the update message string
+ *
+ * Sets the update message.
+ *
+ * Since: 1.2.4
+ **/
+void
+fwupd_device_set_update_message (FwupdDevice *device, const gchar *update_message)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ g_free (priv->update_message);
+ priv->update_message = g_strdup (update_message);
+}
+
+/**
* fwupd_device_get_update_error:
* @device: A #FwupdDevice
*
@@ -1303,6 +1665,115 @@
fwupd_pad_kv_str (str, key, fwupd_update_state_to_string (value));
}
+static void
+fwupd_device_json_add_string (JsonBuilder *builder, const gchar *key, const gchar *str)
+{
+ if (str == NULL)
+ return;
+ json_builder_set_member_name (builder, key);
+ json_builder_add_string_value (builder, str);
+}
+
+static void
+fwupd_device_json_add_int (JsonBuilder *builder, const gchar *key, guint64 num)
+{
+ if (num == 0)
+ return;
+ json_builder_set_member_name (builder, key);
+ json_builder_add_int_value (builder, num);
+}
+
+/**
+ * fwupd_device_to_json:
+ * @device: A #FwupdDevice
+ * @builder: A #JsonBuilder
+ *
+ * Adds a fwupd device to a JSON builder
+ *
+ * Since: 1.2.6
+ **/
+void
+fwupd_device_to_json (FwupdDevice *device, JsonBuilder *builder)
+{
+ FwupdDevicePrivate *priv = GET_PRIVATE (device);
+
+ g_return_if_fail (FWUPD_IS_DEVICE (device));
+ g_return_if_fail (builder != NULL);
+
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_NAME, priv->name);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_DEVICE_ID, priv->id);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_PARENT_DEVICE_ID,
+ priv->parent_id);
+ if (priv->guids->len > 0) {
+ json_builder_set_member_name (builder, FWUPD_RESULT_KEY_GUID);
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->guids->len; i++) {
+ const gchar *guid = g_ptr_array_index (priv->guids, i);
+ json_builder_add_string_value (builder, guid);
+ }
+ json_builder_end_array (builder);
+ }
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_SERIAL, priv->serial);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_SUMMARY, priv->summary);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_DESCRIPTION, priv->description);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_PLUGIN, priv->plugin);
+ if (priv->flags != FWUPD_DEVICE_FLAG_NONE) {
+ json_builder_set_member_name (builder, FWUPD_RESULT_KEY_FLAGS);
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < 64; i++) {
+ const gchar *tmp;
+ if ((priv->flags & ((guint64) 1 << i)) == 0)
+ continue;
+ tmp = fwupd_device_flag_to_string ((guint64) 1 << i);
+ json_builder_add_string_value (builder, tmp);
+ }
+ json_builder_end_array (builder);
+ }
+ if (priv->checksums->len > 0) {
+ json_builder_set_member_name (builder, "Checksums");
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->checksums->len; i++) {
+ const gchar *checksum = g_ptr_array_index (priv->checksums, i);
+ json_builder_add_string_value (builder, checksum);
+ }
+ json_builder_end_array (builder);
+ }
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VENDOR, priv->vendor);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VENDOR_ID, priv->vendor_id);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VERSION, priv->version);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VERSION_LOWEST, priv->version_lowest);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VERSION_BOOTLOADER, priv->version_bootloader);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_VERSION_FORMAT,
+ fwupd_version_format_to_string (priv->version_format));
+ fwupd_device_json_add_int (builder, FWUPD_RESULT_KEY_FLASHES_LEFT, priv->flashes_left);
+ if (priv->icons->len > 0) {
+ json_builder_set_member_name (builder, "Icons");
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->icons->len; i++) {
+ const gchar *icon = g_ptr_array_index (priv->icons, i);
+ json_builder_add_string_value (builder, icon);
+ }
+ json_builder_end_array (builder);
+ }
+ fwupd_device_json_add_int (builder, FWUPD_RESULT_KEY_INSTALL_DURATION, priv->install_duration);
+ fwupd_device_json_add_int (builder, FWUPD_RESULT_KEY_CREATED, priv->created);
+ fwupd_device_json_add_int (builder, FWUPD_RESULT_KEY_MODIFIED, priv->modified);
+ fwupd_device_json_add_int (builder, FWUPD_RESULT_KEY_UPDATE_STATE, priv->update_state);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_UPDATE_ERROR, priv->update_error);
+ fwupd_device_json_add_string (builder, FWUPD_RESULT_KEY_UPDATE_MESSAGE, priv->update_message);
+ if (priv->releases->len > 0) {
+ json_builder_set_member_name (builder, "Releases");
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->releases->len; i++) {
+ FwupdRelease *release = g_ptr_array_index (priv->releases, i);
+ json_builder_begin_object (builder);
+ fwupd_release_to_json (release, builder);
+ json_builder_end_object (builder);
+ }
+ json_builder_end_array (builder);
+ }
+}
+
/**
* fwupd_device_to_string:
* @device: A #FwupdDevice
@@ -1318,6 +1789,7 @@
{
FwupdDevicePrivate *priv = GET_PRIVATE (device);
GString *str;
+ g_autoptr(GHashTable) ids = NULL;
g_return_val_if_fail (FWUPD_IS_DEVICE (device), NULL);
@@ -1328,10 +1800,25 @@
str = g_string_append (str, "Unknown Device\n");
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_ID, priv->id);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_PARENT_DEVICE_ID, priv->parent_id);
+ ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+ for (guint i = 0; i < priv->instance_ids->len; i++) {
+ const gchar *instance_id = g_ptr_array_index (priv->instance_ids, i);
+ g_hash_table_insert (ids,
+ fwupd_guid_hash_string (instance_id),
+ g_strdup (instance_id));
+ }
for (guint i = 0; i < priv->guids->len; i++) {
const gchar *guid = g_ptr_array_index (priv->guids, i);
- fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, guid);
+ const gchar *instance_id = g_hash_table_lookup (ids, guid);
+ if (instance_id == NULL) {
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, guid);
+ } else {
+ g_autofree gchar *tmp = NULL;
+ tmp = g_strdup_printf ("%s <- %s", guid, instance_id);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, tmp);
+ }
}
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_SERIAL, priv->serial);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_SUMMARY, priv->summary);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DESCRIPTION, priv->description);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_PLUGIN, priv->plugin);
@@ -1346,6 +1833,8 @@
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VERSION, priv->version);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VERSION_LOWEST, priv->version_lowest);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VERSION_BOOTLOADER, priv->version_bootloader);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VERSION_FORMAT,
+ fwupd_version_format_to_string (priv->version_format));
if (priv->flashes_left < 2)
fwupd_pad_kv_int (str, FWUPD_RESULT_KEY_FLASHES_LEFT, priv->flashes_left);
if (priv->icons->len > 0) {
@@ -1358,10 +1847,12 @@
g_string_truncate (tmp, tmp->len - 1);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_ICON, tmp->str);
}
+ fwupd_pad_kv_int (str, FWUPD_RESULT_KEY_INSTALL_DURATION, priv->install_duration);
fwupd_pad_kv_unx (str, FWUPD_RESULT_KEY_CREATED, priv->created);
fwupd_pad_kv_unx (str, FWUPD_RESULT_KEY_MODIFIED, priv->modified);
fwupd_pad_kv_ups (str, FWUPD_RESULT_KEY_UPDATE_STATE, priv->update_state);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_UPDATE_ERROR, priv->update_error);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_UPDATE_MESSAGE, priv->update_message);
for (guint i = 0; i < priv->releases->len; i++) {
FwupdRelease *release = g_ptr_array_index (priv->releases, i);
g_autofree gchar *tmp = fwupd_release_to_string (release);
@@ -1373,10 +1864,53 @@
}
static void
+fwupd_device_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
+{
+ FwupdDevice *self = FWUPD_DEVICE (object);
+ FwupdDevicePrivate *priv = GET_PRIVATE (self);
+ switch (prop_id) {
+ case PROP_VERSION_FORMAT:
+ g_value_set_uint (value, priv->version_format);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+fwupd_device_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ FwupdDevice *self = FWUPD_DEVICE (object);
+ switch (prop_id) {
+ case PROP_VERSION_FORMAT:
+ fwupd_device_set_version_format (self, g_value_get_uint (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
fwupd_device_class_init (FwupdDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
object_class->finalize = fwupd_device_finalize;
+ object_class->get_property = fwupd_device_get_property;
+ object_class->set_property = fwupd_device_set_property;
+
+ pspec = g_param_spec_uint ("version-format", NULL, NULL,
+ FWUPD_VERSION_FORMAT_UNKNOWN,
+ FWUPD_VERSION_FORMAT_LAST,
+ FWUPD_VERSION_FORMAT_UNKNOWN,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_VERSION_FORMAT, pspec);
}
static void
@@ -1384,6 +1918,7 @@
{
FwupdDevicePrivate *priv = GET_PRIVATE (device);
priv->guids = g_ptr_array_new_with_free_func (g_free);
+ priv->instance_ids = g_ptr_array_new_with_free_func (g_free);
priv->icons = g_ptr_array_new_with_free_func (g_free);
priv->checksums = g_ptr_array_new_with_free_func (g_free);
priv->releases = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
@@ -1401,15 +1936,18 @@
g_free (priv->id);
g_free (priv->parent_id);
g_free (priv->name);
+ g_free (priv->serial);
g_free (priv->summary);
g_free (priv->vendor);
g_free (priv->vendor_id);
g_free (priv->plugin);
g_free (priv->update_error);
+ g_free (priv->update_message);
g_free (priv->version);
g_free (priv->version_lowest);
g_free (priv->version_bootloader);
g_ptr_array_unref (priv->guids);
+ g_ptr_array_unref (priv->instance_ids);
g_ptr_array_unref (priv->icons);
g_ptr_array_unref (priv->checksums);
g_ptr_array_unref (priv->releases);
@@ -1430,30 +1968,30 @@
/**
* fwupd_device_from_variant:
- * @data: a #GVariant
+ * @value: a #GVariant
*
* Creates a new device using packed data.
*
- * Returns: (transfer full): a new #FwupdDevice, or %NULL if @data was invalid
+ * Returns: (transfer full): a new #FwupdDevice, or %NULL if @value was invalid
*
* Since: 1.0.0
**/
FwupdDevice *
-fwupd_device_from_variant (GVariant *data)
+fwupd_device_from_variant (GVariant *value)
{
FwupdDevice *dev = NULL;
const gchar *type_string;
g_autoptr(GVariantIter) iter = NULL;
/* format from GetDetails */
- type_string = g_variant_get_type_string (data);
+ type_string = g_variant_get_type_string (value);
if (g_strcmp0 (type_string, "(a{sv})") == 0) {
dev = fwupd_device_new ();
- g_variant_get (data, "(a{sv})", &iter);
+ g_variant_get (value, "(a{sv})", &iter);
fwupd_device_set_from_variant_iter (dev, iter);
} else if (g_strcmp0 (type_string, "a{sv}") == 0) {
dev = fwupd_device_new ();
- g_variant_get (data, "a{sv}", &iter);
+ g_variant_get (value, "a{sv}", &iter);
fwupd_device_set_from_variant_iter (dev, iter);
} else {
g_warning ("type %s not known", type_string);
@@ -1462,6 +2000,78 @@
}
/**
+ * fwupd_device_array_from_variant:
+ * @value: a #GVariant
+ *
+ * Creates an array of new devices using packed data.
+ *
+ * Returns: (transfer container) (element-type FwupdDevice): devices, or %NULL if @value was invalid
+ *
+ * Since: 1.2.10
+ **/
+GPtrArray *
+fwupd_device_array_from_variant (GVariant *value)
+{
+ GPtrArray *array = NULL;
+ gsize sz;
+ g_autoptr(GVariant) untuple = NULL;
+ g_autoptr(GHashTable) devices_by_id = NULL;
+
+ array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ devices_by_id = g_hash_table_new (g_str_hash, g_str_equal);
+ untuple = g_variant_get_child_value (value, 0);
+ sz = g_variant_n_children (untuple);
+ for (guint i = 0; i < sz; i++) {
+ FwupdDevice *dev;
+ g_autoptr(GVariant) data = NULL;
+ data = g_variant_get_child_value (untuple, i);
+ dev = fwupd_device_from_variant (data);
+ if (dev == NULL)
+ continue;
+ g_ptr_array_add (array, dev);
+ if (fwupd_device_get_id (dev) != NULL) {
+ g_hash_table_insert (devices_by_id,
+ (gpointer) fwupd_device_get_id (dev),
+ (gpointer) dev);
+ }
+ }
+
+ /* set the parent on each child */
+ for (guint i = 0; i < array->len; i++) {
+ FwupdDevice *dev = g_ptr_array_index (array, i);
+ const gchar *parent_id = fwupd_device_get_parent_id (dev);
+ if (parent_id != NULL) {
+ FwupdDevice *dev_tmp;
+ dev_tmp = g_hash_table_lookup (devices_by_id, parent_id);
+ fwupd_device_set_parent (dev, dev_tmp);
+ }
+ }
+
+ return array;
+}
+
+/**
+ * fwupd_device_compare:
+ * @device1: a #FwupdDevice
+ * @device2: a #FwupdDevice
+ *
+ * Comparison function for comparing two FwupdDevice objects.
+ *
+ * Returns: negative, 0 or positive
+ *
+ * Since: 1.1.1
+ **/
+gint
+fwupd_device_compare (FwupdDevice *device1, FwupdDevice *device2)
+{
+ FwupdDevicePrivate *priv1 = GET_PRIVATE (device1);
+ FwupdDevicePrivate *priv2 = GET_PRIVATE (device2);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device1), 0);
+ g_return_val_if_fail (FWUPD_IS_DEVICE (device2), 0);
+ return g_strcmp0 (priv1->id, priv2->id);
+}
+
+/**
* fwupd_device_new:
*
* Creates a new device.
diff -Nru fwupd-1.0.9/libfwupd/fwupd-device.h fwupd-1.2.10/libfwupd/fwupd-device.h
--- fwupd-1.0.9/libfwupd/fwupd-device.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-device.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,10 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_DEVICE_H
-#define __FWUPD_DEVICE_H
+#pragma once
#include
@@ -46,6 +44,9 @@
const gchar *fwupd_device_get_name (FwupdDevice *device);
void fwupd_device_set_name (FwupdDevice *device,
const gchar *name);
+const gchar *fwupd_device_get_serial (FwupdDevice *device);
+void fwupd_device_set_serial (FwupdDevice *device,
+ const gchar *serial);
const gchar *fwupd_device_get_summary (FwupdDevice *device);
void fwupd_device_set_summary (FwupdDevice *device,
const gchar *summary);
@@ -61,9 +62,15 @@
const gchar *fwupd_device_get_version_bootloader (FwupdDevice *device);
void fwupd_device_set_version_bootloader (FwupdDevice *device,
const gchar *version_bootloader);
+FwupdVersionFormat fwupd_device_get_version_format (FwupdDevice *device);
+void fwupd_device_set_version_format (FwupdDevice *device,
+ FwupdVersionFormat version_format);
guint32 fwupd_device_get_flashes_left (FwupdDevice *device);
void fwupd_device_set_flashes_left (FwupdDevice *device,
guint32 flashes_left);
+guint32 fwupd_device_get_install_duration (FwupdDevice *device);
+void fwupd_device_set_install_duration (FwupdDevice *device,
+ guint32 duration);
guint64 fwupd_device_get_flags (FwupdDevice *device);
void fwupd_device_set_flags (FwupdDevice *device,
guint64 flags);
@@ -97,6 +104,11 @@
const gchar *guid);
GPtrArray *fwupd_device_get_guids (FwupdDevice *device);
const gchar *fwupd_device_get_guid_default (FwupdDevice *device);
+void fwupd_device_add_instance_id (FwupdDevice *device,
+ const gchar *instance_id);
+gboolean fwupd_device_has_instance_id (FwupdDevice *device,
+ const gchar *instance_id);
+GPtrArray *fwupd_device_get_instance_ids (FwupdDevice *device);
void fwupd_device_add_icon (FwupdDevice *device,
const gchar *icon);
GPtrArray *fwupd_device_get_icons (FwupdDevice *device);
@@ -107,12 +119,17 @@
const gchar *fwupd_device_get_update_error (FwupdDevice *device);
void fwupd_device_set_update_error (FwupdDevice *device,
const gchar *update_error);
+const gchar *fwupd_device_get_update_message (FwupdDevice *device);
+void fwupd_device_set_update_message (FwupdDevice *device,
+ const gchar *update_message);
void fwupd_device_add_release (FwupdDevice *device,
FwupdRelease *release);
GPtrArray *fwupd_device_get_releases (FwupdDevice *device);
FwupdRelease *fwupd_device_get_release_default (FwupdDevice *device);
+gint fwupd_device_compare (FwupdDevice *device1,
+ FwupdDevice *device2);
-G_END_DECLS
-
-#endif /* __FWUPD_DEVICE_H */
+FwupdDevice *fwupd_device_from_variant (GVariant *value);
+GPtrArray *fwupd_device_array_from_variant (GVariant *value);
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-device-private.h fwupd-1.2.10/libfwupd/fwupd-device-private.h
--- fwupd-1.0.9/libfwupd/fwupd-device-private.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-device-private.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,23 +1,25 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_DEVICE_PRIVATE_H
-#define __FWUPD_DEVICE_PRIVATE_H
+#pragma once
#include
+#include
#include "fwupd-device.h"
G_BEGIN_DECLS
-FwupdDevice *fwupd_device_from_variant (GVariant *data);
GVariant *fwupd_device_to_variant (FwupdDevice *device);
+GVariant *fwupd_device_to_variant_full (FwupdDevice *device,
+ FwupdDeviceFlags flags);
+void fwupd_device_incorporate (FwupdDevice *self,
+ FwupdDevice *donor);
+void fwupd_device_to_json (FwupdDevice *device,
+ JsonBuilder *builder);
G_END_DECLS
-#endif /* __FWUPD_DEVICE_PRIVATE_H */
-
diff -Nru fwupd-1.0.9/libfwupd/fwupd-enums.c fwupd-1.2.10/libfwupd/fwupd-enums.c
--- fwupd-1.0.9/libfwupd/fwupd-enums.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-enums.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -58,6 +57,8 @@
return "downloading";
if (status == FWUPD_STATUS_WAITING_FOR_AUTH)
return "waiting-for-auth";
+ if (status == FWUPD_STATUS_SHUTDOWN)
+ return "shutdown";
return NULL;
}
@@ -100,6 +101,8 @@
return FWUPD_STATUS_DEVICE_BUSY;
if (g_strcmp0 (status, "waiting-for-auth") == 0)
return FWUPD_STATUS_WAITING_FOR_AUTH;
+ if (g_strcmp0 (status, "shutdown") == 0)
+ return FWUPD_STATUS_SHUTDOWN;
return FWUPD_STATUS_LAST;
}
@@ -136,6 +139,8 @@
return "registered";
if (device_flag == FWUPD_DEVICE_FLAG_NEEDS_REBOOT)
return "needs-reboot";
+ if (device_flag == FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN)
+ return "needs-shutdown";
if (device_flag == FWUPD_DEVICE_FLAG_REPORTED)
return "reported";
if (device_flag == FWUPD_DEVICE_FLAG_NOTIFIED)
@@ -146,6 +151,18 @@
return "install-parent-first";
if (device_flag == FWUPD_DEVICE_FLAG_IS_BOOTLOADER)
return "is-bootloader";
+ if (device_flag == FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG)
+ return "wait-for-replug";
+ if (device_flag == FWUPD_DEVICE_FLAG_IGNORE_VALIDATION)
+ return "ignore-validation";
+ if (device_flag == FWUPD_DEVICE_FLAG_ANOTHER_WRITE_REQUIRED)
+ return "another-write-required";
+ if (device_flag == FWUPD_DEVICE_FLAG_NO_AUTO_INSTANCE_IDS)
+ return "no-auto-instance-ids";
+ if (device_flag == FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION)
+ return "needs-activation";
+ if (device_flag == FWUPD_DEVICE_FLAG_ENSURE_SEMVER)
+ return "ensure-semver";
if (device_flag == FWUPD_DEVICE_FLAG_UNKNOWN)
return "unknown";
return NULL;
@@ -186,6 +203,8 @@
return FWUPD_DEVICE_FLAG_REGISTERED;
if (g_strcmp0 (device_flag, "needs-reboot") == 0)
return FWUPD_DEVICE_FLAG_NEEDS_REBOOT;
+ if (g_strcmp0 (device_flag, "needs-shutdown") == 0)
+ return FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN;
if (g_strcmp0 (device_flag, "reported") == 0)
return FWUPD_DEVICE_FLAG_REPORTED;
if (g_strcmp0 (device_flag, "notified") == 0)
@@ -196,6 +215,18 @@
return FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST;
if (g_strcmp0 (device_flag, "is-bootloader") == 0)
return FWUPD_DEVICE_FLAG_IS_BOOTLOADER;
+ if (g_strcmp0 (device_flag, "wait-for-replug") == 0)
+ return FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG;
+ if (g_strcmp0 (device_flag, "ignore-validation") == 0)
+ return FWUPD_DEVICE_FLAG_IGNORE_VALIDATION;
+ if (g_strcmp0 (device_flag, "another-write-required") == 0)
+ return FWUPD_DEVICE_FLAG_ANOTHER_WRITE_REQUIRED;
+ if (g_strcmp0 (device_flag, "no-auto-instance-ids") == 0)
+ return FWUPD_DEVICE_FLAG_NO_AUTO_INSTANCE_IDS;
+ if (g_strcmp0 (device_flag, "needs-activation") == 0)
+ return FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION;
+ if (g_strcmp0 (device_flag, "ensure-semver") == 0)
+ return FWUPD_DEVICE_FLAG_ENSURE_SEMVER;
return FWUPD_DEVICE_FLAG_UNKNOWN;
}
@@ -220,6 +251,8 @@
return "success";
if (update_state == FWUPD_UPDATE_STATE_FAILED)
return "failed";
+ if (update_state == FWUPD_UPDATE_STATE_FAILED_TRANSIENT)
+ return "failed-transient";
if (update_state == FWUPD_UPDATE_STATE_NEEDS_REBOOT)
return "needs-reboot";
return NULL;
@@ -246,6 +279,8 @@
return FWUPD_UPDATE_STATE_SUCCESS;
if (g_strcmp0 (update_state, "failed") == 0)
return FWUPD_UPDATE_STATE_FAILED;
+ if (g_strcmp0 (update_state, "failed-transient") == 0)
+ return FWUPD_UPDATE_STATE_FAILED_TRANSIENT;
if (g_strcmp0 (update_state, "needs-reboot") == 0)
return FWUPD_UPDATE_STATE_NEEDS_REBOOT;
return FWUPD_UPDATE_STATE_UNKNOWN;
@@ -338,3 +373,125 @@
return "pkcs7";
return NULL;
}
+
+/**
+ * fwupd_release_flag_to_string:
+ * @release_flag: A #FwupdReleaseFlags, e.g. %FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD
+ *
+ * Converts a #FwupdReleaseFlags to a string.
+ *
+ * Return value: identifier string
+ *
+ * Since: 1.2.6
+ **/
+const gchar *
+fwupd_release_flag_to_string (FwupdReleaseFlags release_flag)
+{
+ if (release_flag == FWUPD_RELEASE_FLAG_NONE)
+ return "none";
+ if (release_flag == FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD)
+ return "trusted-payload";
+ if (release_flag == FWUPD_RELEASE_FLAG_TRUSTED_METADATA)
+ return "trusted-metadata";
+ if (release_flag == FWUPD_RELEASE_FLAG_IS_UPGRADE)
+ return "is-upgrade";
+ if (release_flag == FWUPD_RELEASE_FLAG_IS_DOWNGRADE)
+ return "is-downgrade";
+ if (release_flag == FWUPD_RELEASE_FLAG_BLOCKED_VERSION)
+ return "blocked-version";
+ if (release_flag == FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL)
+ return "blocked-approval";
+ return NULL;
+}
+
+/**
+ * fwupd_release_flag_from_string:
+ * @release_flag: A string, e.g. `trusted-payload`
+ *
+ * Converts a string to a #FwupdReleaseFlags.
+ *
+ * Return value: enumerated value
+ *
+ * Since: 1.2.6
+ **/
+FwupdReleaseFlags
+fwupd_release_flag_from_string (const gchar *release_flag)
+{
+ if (g_strcmp0 (release_flag, "trusted-payload") == 0)
+ return FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD;
+ if (g_strcmp0 (release_flag, "trusted-metadata") == 0)
+ return FWUPD_RELEASE_FLAG_TRUSTED_METADATA;
+ if (g_strcmp0 (release_flag, "is-upgrade") == 0)
+ return FWUPD_RELEASE_FLAG_IS_UPGRADE;
+ if (g_strcmp0 (release_flag, "is-downgrade") == 0)
+ return FWUPD_RELEASE_FLAG_IS_DOWNGRADE;
+ if (g_strcmp0 (release_flag, "blocked-version") == 0)
+ return FWUPD_RELEASE_FLAG_BLOCKED_VERSION;
+ if (g_strcmp0 (release_flag, "blocked-approval") == 0)
+ return FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL;
+ return FWUPD_RELEASE_FLAG_NONE;
+}
+
+/**
+ * fwupd_version_format_from_string:
+ * @str: A string, e.g. `quad`
+ *
+ * Converts text to a display version type.
+ *
+ * Returns: A #FwupdVersionFormat, e.g. %FWUPD_VERSION_FORMAT_TRIPLET
+ *
+ * Since: 1.2.9
+ **/
+FwupdVersionFormat
+fwupd_version_format_from_string (const gchar *str)
+{
+ if (g_strcmp0 (str, "plain") == 0)
+ return FWUPD_VERSION_FORMAT_PLAIN;
+ if (g_strcmp0 (str, "pair") == 0)
+ return FWUPD_VERSION_FORMAT_PAIR;
+ if (g_strcmp0 (str, "number") == 0)
+ return FWUPD_VERSION_FORMAT_NUMBER;
+ if (g_strcmp0 (str, "triplet") == 0)
+ return FWUPD_VERSION_FORMAT_TRIPLET;
+ if (g_strcmp0 (str, "quad") == 0)
+ return FWUPD_VERSION_FORMAT_QUAD;
+ if (g_strcmp0 (str, "bcd") == 0)
+ return FWUPD_VERSION_FORMAT_BCD;
+ if (g_strcmp0 (str, "intel-me") == 0)
+ return FWUPD_VERSION_FORMAT_INTEL_ME;
+ if (g_strcmp0 (str, "intel-me2") == 0)
+ return FWUPD_VERSION_FORMAT_INTEL_ME2;
+ return FWUPD_VERSION_FORMAT_UNKNOWN;
+}
+
+/**
+ * fwupd_version_format_to_string:
+ * @kind: A #FwupdVersionFormat, e.g. %FWUPD_VERSION_FORMAT_TRIPLET
+ *
+ * Converts a display version type to text.
+ *
+ * Returns: A string, e.g. `quad`, or %NULL if not known
+ *
+ * Since: 1.2.9
+ **/
+const gchar *
+fwupd_version_format_to_string (FwupdVersionFormat kind)
+{
+ if (kind == FWUPD_VERSION_FORMAT_PLAIN)
+ return "plain";
+ if (kind == FWUPD_VERSION_FORMAT_NUMBER)
+ return "number";
+ if (kind == FWUPD_VERSION_FORMAT_PAIR)
+ return "pair";
+ if (kind == FWUPD_VERSION_FORMAT_TRIPLET)
+ return "triplet";
+ if (kind == FWUPD_VERSION_FORMAT_QUAD)
+ return "quad";
+ if (kind == FWUPD_VERSION_FORMAT_BCD)
+ return "bcd";
+ if (kind == FWUPD_VERSION_FORMAT_INTEL_ME)
+ return "intel-me";
+ if (kind == FWUPD_VERSION_FORMAT_INTEL_ME2)
+ return "intel-me2";
+ return NULL;
+}
diff -Nru fwupd-1.0.9/libfwupd/fwupd-enums.h fwupd-1.2.10/libfwupd/fwupd-enums.h
--- fwupd-1.0.9/libfwupd/fwupd-enums.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-enums.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,15 +1,15 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_ENUMS_H
-#define __FWUPD_ENUMS_H
+#pragma once
#include
+G_BEGIN_DECLS
+
/**
* FwupdStatus:
* @FWUPD_STATUS_UNKNOWN: Unknown state
@@ -25,6 +25,7 @@
* @FWUPD_STATUS_DEVICE_ERASE: Erasing a device
* @FWUPD_STATUS_WAITING_FOR_AUTH: Waiting for authentication
* @FWUPD_STATUS_DEVICE_BUSY: The device is busy
+ * @FWUPD_STATUS_SHUTDOWN: The daemon is shutting down
*
* The flags to show daemon status.
**/
@@ -42,6 +43,7 @@
FWUPD_STATUS_DEVICE_ERASE, /* Since: 1.0.0 */
FWUPD_STATUS_WAITING_FOR_AUTH, /* Since: 1.0.0 */
FWUPD_STATUS_DEVICE_BUSY, /* Since: 1.0.1 */
+ FWUPD_STATUS_SHUTDOWN, /* Since: 1.2.1 */
/*< private >*/
FWUPD_STATUS_LAST
} FwupdStatus;
@@ -79,6 +81,14 @@
* @FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION: Always use the runtime version rather than the bootloader
* @FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST: Install composite firmware on the parent before the child
* @FWUPD_DEVICE_FLAG_IS_BOOTLOADER: Is currently in bootloader mode
+ * @FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG: The hardware is waiting to be replugged
+ * @FWUPD_DEVICE_FLAG_IGNORE_VALIDATION: Ignore validation safety checks when flashing this device
+ * @FWUPD_DEVICE_FLAG_TRUSTED: Extra metadata can be exposed about this device
+ * @FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN: Requires system shutdown to apply firmware
+ * @FWUPD_DEVICE_FLAG_ANOTHER_WRITE_REQUIRED: Requires the update to be retried with a new plugin
+ * @FWUPD_DEVICE_FLAG_NO_AUTO_INSTANCE_IDS: Do not add instance IDs from the device baseclass
+ * @FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION: Device update needs to be separately activated
+ * @FWUPD_DEVICE_FLAG_ENSURE_SEMVER: Ensure the version is a valid semantic version, e.g. numbers separated with dots
*
* The device flags.
**/
@@ -97,10 +107,40 @@
#define FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION (1u << 11) /* Since: 1.0.6 */
#define FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST (1u << 12) /* Since: 1.0.8 */
#define FWUPD_DEVICE_FLAG_IS_BOOTLOADER (1u << 13) /* Since: 1.0.8 */
+#define FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG (1u << 14) /* Since: 1.1.2 */
+#define FWUPD_DEVICE_FLAG_IGNORE_VALIDATION (1u << 15) /* Since: 1.1.2 */
+#define FWUPD_DEVICE_FLAG_TRUSTED (1u << 16) /* Since: 1.1.2 */
+#define FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN (1u << 17) /* Since: 1.2.4 */
+#define FWUPD_DEVICE_FLAG_ANOTHER_WRITE_REQUIRED (1u << 18) /* Since: 1.2.5 */
+#define FWUPD_DEVICE_FLAG_NO_AUTO_INSTANCE_IDS (1u << 19) /* Since: 1.2.5 */
+#define FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION (1u << 20) /* Since: 1.2.6 */
+#define FWUPD_DEVICE_FLAG_ENSURE_SEMVER (1u << 21) /* Since: 1.2.9 */
#define FWUPD_DEVICE_FLAG_UNKNOWN G_MAXUINT64 /* Since: 0.7.3 */
typedef guint64 FwupdDeviceFlags;
/**
+ * FwupdReleaseFlags:
+ * @FWUPD_RELEASE_FLAG_NONE: No flags set
+ * @FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD: The payload binary is trusted
+ * @FWUPD_RELEASE_FLAG_TRUSTED_METADATA: The payload metadata is trusted
+ * @FWUPD_RELEASE_FLAG_IS_UPGRADE: Is newer than the device version
+ * @FWUPD_RELEASE_FLAG_IS_DOWNGRADE: Is older than the device version
+ * @FWUPD_RELEASE_FLAG_BLOCKED_VERSION: Blocked as below device version-lowest
+ * @FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL: Blocked as release not approved
+ *
+ * The release flags.
+ **/
+#define FWUPD_RELEASE_FLAG_NONE (0u) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD (1u << 0) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_TRUSTED_METADATA (1u << 1) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_IS_UPGRADE (1u << 2) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_IS_DOWNGRADE (1u << 3) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_BLOCKED_VERSION (1u << 4) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL (1u << 5) /* Since: 1.2.6 */
+#define FWUPD_RELEASE_FLAG_UNKNOWN G_MAXUINT64 /* Since: 1.2.6 */
+typedef guint64 FwupdReleaseFlags;
+
+/**
* FwupdInstallFlags:
* @FWUPD_INSTALL_FLAG_NONE: No flags set
* @FWUPD_INSTALL_FLAG_OFFLINE: Schedule this for next boot
@@ -123,12 +163,29 @@
} FwupdInstallFlags;
/**
+ * FwupdSelfSignFlags:
+ * @FWUPD_SELF_SIGN_FLAG_NONE: No flags set
+ * @FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP: Add the timestamp to the detached signature
+ * @FWUPD_SELF_SIGN_FLAG_ADD_CERT: Add the certificate to the detached signature
+ *
+ * Flags to set when performing the firwmare update or install.
+ **/
+typedef enum {
+ FWUPD_SELF_SIGN_FLAG_NONE = 0, /* Since: 1.2.6 */
+ FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP = 1 << 0, /* Since: 1.2.6 */
+ FWUPD_SELF_SIGN_FLAG_ADD_CERT = 1 << 1, /* Since: 1.2.6 */
+ /*< private >*/
+ FWUPD_SELF_SIGN_FLAG_LAST
+} FwupdSelfSignFlags;
+
+/**
* FwupdUpdateState:
* @FWUPD_UPDATE_STATE_UNKNOWN: Unknown
* @FWUPD_UPDATE_STATE_PENDING: Update is pending
- * @FWUPD_UPDATE_STATE_SUCCESS: Update was successfull
+ * @FWUPD_UPDATE_STATE_SUCCESS: Update was successful
* @FWUPD_UPDATE_STATE_FAILED: Update failed
* @FWUPD_UPDATE_STATE_NEEDS_REBOOT: Waiting for a reboot to apply
+ * @FWUPD_UPDATE_STATE_FAILED_TRANSIENT: Update failed due to transient issue, e.g. AC power required
*
* The update state.
**/
@@ -138,6 +195,7 @@
FWUPD_UPDATE_STATE_SUCCESS, /* Since: 0.7.0 */
FWUPD_UPDATE_STATE_FAILED, /* Since: 0.7.0 */
FWUPD_UPDATE_STATE_NEEDS_REBOOT, /* Since: 1.0.4 */
+ FWUPD_UPDATE_STATE_FAILED_TRANSIENT, /* Since: 1.2.7 */
/*< private >*/
FWUPD_UPDATE_STATE_LAST
} FwupdUpdateState;
@@ -160,15 +218,50 @@
FWUPD_KEYRING_KIND_LAST
} FwupdKeyringKind;
+/**
+ * FwupdVersionFormat:
+ * @FWUPD_VERSION_FORMAT_UNKNOWN: Unknown version format
+ * @FWUPD_VERSION_FORMAT_PLAIN: An unidentified format text string
+ * @FWUPD_VERSION_FORMAT_NUMBER: A single integer version number
+ * @FWUPD_VERSION_FORMAT_PAIR: Two AABB.CCDD version numbers
+ * @FWUPD_VERSION_FORMAT_TRIPLET: Microsoft-style AA.BB.CCDD version numbers
+ * @FWUPD_VERSION_FORMAT_QUAD: Dell-style AA.BB.CC.DD version numbers
+ * @FWUPD_VERSION_FORMAT_BCD: Binary coded decimal notation
+ * @FWUPD_VERSION_FORMAT_INTEL_ME: Intel ME-style bitshifted notation
+ * @FWUPD_VERSION_FORMAT_INTEL_ME2: Intel ME-style A.B.CC.DDDD notation notation
+ *
+ * The flags used when parsing version numbers.
+ *
+ * If no verification is required then %FWUPD_VERSION_FORMAT_PLAIN should
+ * be used to signify an unparsable text string.
+ **/
+typedef enum {
+ FWUPD_VERSION_FORMAT_UNKNOWN, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_PLAIN, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_NUMBER, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_PAIR, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_TRIPLET, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_QUAD, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_BCD, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_INTEL_ME, /* Since: 1.2.9 */
+ FWUPD_VERSION_FORMAT_INTEL_ME2, /* Since: 1.2.9 */
+ /*< private >*/
+ FWUPD_VERSION_FORMAT_LAST
+} FwupdVersionFormat;
+
const gchar *fwupd_status_to_string (FwupdStatus status);
FwupdStatus fwupd_status_from_string (const gchar *status);
const gchar *fwupd_device_flag_to_string (FwupdDeviceFlags device_flag);
FwupdDeviceFlags fwupd_device_flag_from_string (const gchar *device_flag);
+const gchar *fwupd_release_flag_to_string (FwupdReleaseFlags release_flag);
+FwupdReleaseFlags fwupd_release_flag_from_string (const gchar *release_flag);
const gchar *fwupd_update_state_to_string (FwupdUpdateState update_state);
FwupdUpdateState fwupd_update_state_from_string (const gchar *update_state);
const gchar *fwupd_trust_flag_to_string (FwupdTrustFlags trust_flag);
FwupdTrustFlags fwupd_trust_flag_from_string (const gchar *trust_flag);
FwupdKeyringKind fwupd_keyring_kind_from_string (const gchar *keyring_kind);
const gchar *fwupd_keyring_kind_to_string (FwupdKeyringKind keyring_kind);
+FwupdVersionFormat fwupd_version_format_from_string (const gchar *str);
+const gchar *fwupd_version_format_to_string (FwupdVersionFormat kind);
-#endif /* __FWUPD_ENUMS_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-enums-private.h fwupd-1.2.10/libfwupd/fwupd-enums-private.h
--- fwupd-1.0.9/libfwupd/fwupd-enums-private.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-enums-private.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,12 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2016-2017 Richard Hughes
+/*
+ * Copyright (C) 2016-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_ENUMS_PRIVATE_H
-#define __FWUPD_ENUMS_PRIVATE_H
+#pragma once
+
+G_BEGIN_DECLS
#define FWUPD_RESULT_KEY_APPSTREAM_ID "AppstreamId" /* s */
#define FWUPD_RESULT_KEY_CHECKSUM "Checksum" /* as */
@@ -15,10 +15,16 @@
#define FWUPD_RESULT_KEY_DEVICE_ID "DeviceId" /* s */
#define FWUPD_RESULT_KEY_PARENT_DEVICE_ID "ParentDeviceId"/* s */
#define FWUPD_RESULT_KEY_FILENAME "Filename" /* s */
+#define FWUPD_RESULT_KEY_PROTOCOL "Protocol" /* s */
+#define FWUPD_RESULT_KEY_CATEGORIES "Categories" /* as */
#define FWUPD_RESULT_KEY_FLAGS "Flags" /* t */
#define FWUPD_RESULT_KEY_FLASHES_LEFT "FlashesLeft" /* u */
+#define FWUPD_RESULT_KEY_INSTALL_DURATION "InstallDuration" /* u */
#define FWUPD_RESULT_KEY_GUID "Guid" /* as */
+#define FWUPD_RESULT_KEY_INSTANCE_IDS "InstanceIds" /* as */
#define FWUPD_RESULT_KEY_HOMEPAGE "Homepage" /* s */
+#define FWUPD_RESULT_KEY_DETAILS_URL "DetailsUrl" /* s */
+#define FWUPD_RESULT_KEY_SOURCE_URL "SourceUrl" /* s */
#define FWUPD_RESULT_KEY_ICON "Icon" /* as */
#define FWUPD_RESULT_KEY_LICENSE "License" /* s */
#define FWUPD_RESULT_KEY_MODIFIED "Modified" /* t */
@@ -27,9 +33,11 @@
#define FWUPD_RESULT_KEY_PLUGIN "Plugin" /* s */
#define FWUPD_RESULT_KEY_RELEASE "Release" /* a{sv} */
#define FWUPD_RESULT_KEY_REMOTE_ID "RemoteId" /* s */
+#define FWUPD_RESULT_KEY_SERIAL "Serial" /* s */
#define FWUPD_RESULT_KEY_SIZE "Size" /* t */
#define FWUPD_RESULT_KEY_SUMMARY "Summary" /* s */
#define FWUPD_RESULT_KEY_TRUST_FLAGS "TrustFlags" /* t */
+#define FWUPD_RESULT_KEY_UPDATE_MESSAGE "UpdateMessage" /* s */
#define FWUPD_RESULT_KEY_UPDATE_ERROR "UpdateError" /* s */
#define FWUPD_RESULT_KEY_UPDATE_STATE "UpdateState" /* u */
#define FWUPD_RESULT_KEY_URI "Uri" /* s */
@@ -37,7 +45,8 @@
#define FWUPD_RESULT_KEY_VENDOR "Vendor" /* s */
#define FWUPD_RESULT_KEY_VENDOR "Vendor" /* s */
#define FWUPD_RESULT_KEY_VERSION_BOOTLOADER "VersionBootloader" /* s */
+#define FWUPD_RESULT_KEY_VERSION_FORMAT "VersionFormat" /* u */
#define FWUPD_RESULT_KEY_VERSION_LOWEST "VersionLowest" /* s */
#define FWUPD_RESULT_KEY_VERSION "Version" /* s */
-#endif /* __FWUPD_ENUMS_PRIVATE_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-error.c fwupd-1.2.10/libfwupd/fwupd-error.c
--- fwupd-1.0.9/libfwupd/fwupd-error.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-error.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2016 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -64,6 +63,10 @@
return FWUPD_DBUS_INTERFACE ".AcPowerRequired";
if (error == FWUPD_ERROR_PERMISSION_DENIED)
return FWUPD_DBUS_INTERFACE ".PermissionDenied";
+ if (error == FWUPD_ERROR_BROKEN_SYSTEM)
+ return FWUPD_DBUS_INTERFACE ".BrokenSystem";
+ if (error == FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW)
+ return FWUPD_DBUS_INTERFACE ".BatteryLevelTooLow";
return NULL;
}
@@ -108,6 +111,10 @@
return FWUPD_ERROR_AC_POWER_REQUIRED;
if (g_strcmp0 (error, FWUPD_DBUS_INTERFACE ".PermissionDenied") == 0)
return FWUPD_ERROR_PERMISSION_DENIED;
+ if (g_strcmp0 (error, FWUPD_DBUS_INTERFACE ".BrokenSystem") == 0)
+ return FWUPD_ERROR_BROKEN_SYSTEM;
+ if (g_strcmp0 (error, FWUPD_DBUS_INTERFACE ".BatteryLevelTooLow") == 0)
+ return FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW;
return FWUPD_ERROR_LAST;
}
diff -Nru fwupd-1.0.9/libfwupd/fwupd-error.h fwupd-1.2.10/libfwupd/fwupd-error.h
--- fwupd-1.0.9/libfwupd/fwupd-error.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-error.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,15 +1,15 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015-2016 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_ERROR_H
-#define __FWUPD_ERROR_H
+#pragma once
#include
+G_BEGIN_DECLS
+
#define FWUPD_ERROR fwupd_error_quark()
/**
@@ -28,6 +28,8 @@
* @FWUPD_ERROR_SIGNATURE_INVALID: Signature was invalid
* @FWUPD_ERROR_AC_POWER_REQUIRED: AC power was required
* @FWUPD_ERROR_PERMISSION_DENIED: Permission was denied
+ * @FWUPD_ERROR_BROKEN_SYSTEM: User has configured their system in a broken way
+ * @FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW: The system battery level is too low
*
* The error code.
**/
@@ -46,6 +48,8 @@
FWUPD_ERROR_SIGNATURE_INVALID, /* Since: 0.1.2 */
FWUPD_ERROR_AC_POWER_REQUIRED, /* Since: 0.8.0 */
FWUPD_ERROR_PERMISSION_DENIED, /* Since: 0.9.8 */
+ FWUPD_ERROR_BROKEN_SYSTEM, /* Since: 1.2.8 */
+ FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW, /* Since: 1.2.10 */
/*< private >*/
FWUPD_ERROR_LAST
} FwupdError;
@@ -54,4 +58,4 @@
const gchar *fwupd_error_to_string (FwupdError error);
FwupdError fwupd_error_from_string (const gchar *error);
-#endif /* __FWUPD_ERROR_H */
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd.h fwupd-1.2.10/libfwupd/fwupd.h
--- fwupd-1.0.9/libfwupd/fwupd.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,18 +1,16 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2015 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
+#pragma once
+
/**
* SECTION:fwupd
* @short_description: Helper objects for accessing fwupd
*/
-#ifndef __FWUPD_H__
-#define __FWUPD_H__
-
#define __FWUPD_H_INSIDE__
#include
@@ -29,6 +27,3 @@
#endif
#undef __FWUPD_H_INSIDE__
-
-#endif /* __FWUPD_H__ */
-
diff -Nru fwupd-1.0.9/libfwupd/fwupd.map fwupd-1.2.10/libfwupd/fwupd.map
--- fwupd-1.0.9/libfwupd/fwupd.map 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd.map 2019-07-15 18:25:54.000000000 +0000
@@ -252,3 +252,122 @@
fwupd_device_set_parent_id;
local: *;
} LIBFWUPD_1.0.7;
+
+LIBFWUPD_1.1.0 {
+ global:
+ fwupd_device_incorporate;
+ local: *;
+} LIBFWUPD_1.0.8;
+
+LIBFWUPD_1.1.1 {
+ global:
+ fwupd_device_compare;
+ local: *;
+} LIBFWUPD_1.1.0;
+
+LIBFWUPD_1.1.2 {
+ global:
+ fwupd_device_get_serial;
+ fwupd_device_set_serial;
+ fwupd_device_to_variant_full;
+ local: *;
+} LIBFWUPD_1.1.1;
+
+LIBFWUPD_1.1.3 {
+ global:
+ fwupd_device_get_install_duration;
+ fwupd_device_set_install_duration;
+ local: *;
+} LIBFWUPD_1.1.2;
+
+LIBFWUPD_1.2.1 {
+ global:
+ fwupd_release_get_install_duration;
+ fwupd_release_set_install_duration;
+ local: *;
+} LIBFWUPD_1.1.3;
+
+LIBFWUPD_1.2.2 {
+ global:
+ fwupd_release_get_protocol;
+ fwupd_release_set_protocol;
+ local: *;
+} LIBFWUPD_1.2.1;
+
+LIBFWUPD_1.2.4 {
+ global:
+ fwupd_client_get_tainted;
+ fwupd_device_get_update_message;
+ fwupd_device_set_update_message;
+ fwupd_release_get_details_url;
+ fwupd_release_get_source_url;
+ fwupd_release_get_update_message;
+ fwupd_release_set_details_url;
+ fwupd_release_set_source_url;
+ fwupd_release_set_update_message;
+ local: *;
+} LIBFWUPD_1.2.2;
+
+LIBFWUPD_1.2.5 {
+ global:
+ fwupd_device_add_instance_id;
+ fwupd_device_get_instance_ids;
+ fwupd_device_has_instance_id;
+ fwupd_guid_from_string;
+ fwupd_guid_hash_data;
+ fwupd_guid_hash_string;
+ fwupd_guid_is_valid;
+ fwupd_guid_to_string;
+ local: *;
+} LIBFWUPD_1.2.4;
+
+LIBFWUPD_1.2.6 {
+ global:
+ fwupd_client_activate;
+ fwupd_client_get_approved_firmware;
+ fwupd_client_self_sign;
+ fwupd_client_set_approved_firmware;
+ fwupd_device_to_json;
+ fwupd_release_add_flag;
+ fwupd_release_flag_from_string;
+ fwupd_release_flag_to_string;
+ fwupd_release_get_flags;
+ fwupd_release_has_checksum;
+ fwupd_release_has_flag;
+ fwupd_release_remove_flag;
+ fwupd_release_set_flags;
+ fwupd_release_to_json;
+ fwupd_remote_get_approval_required;
+ local: *;
+} LIBFWUPD_1.2.5;
+
+LIBFWUPD_1.2.7 {
+ global:
+ fwupd_release_add_category;
+ fwupd_release_get_categories;
+ fwupd_release_has_category;
+ local: *;
+} LIBFWUPD_1.2.6;
+
+LIBFWUPD_1.2.8 {
+ global:
+ fwupd_client_modify_config;
+ local: *;
+} LIBFWUPD_1.2.7;
+
+LIBFWUPD_1.2.9 {
+ global:
+ fwupd_device_get_version_format;
+ fwupd_device_set_version_format;
+ fwupd_version_format_from_string;
+ fwupd_version_format_to_string;
+ local: *;
+} LIBFWUPD_1.2.8;
+
+LIBFWUPD_1.2.10 {
+ global:
+ fwupd_device_array_from_variant;
+ fwupd_release_array_from_variant;
+ fwupd_remote_array_from_variant;
+ local: *;
+} LIBFWUPD_1.2.9;
diff -Nru fwupd-1.0.9/libfwupd/fwupd-release.c fwupd-1.2.10/libfwupd/fwupd-release.c
--- fwupd-1.0.9/libfwupd/fwupd-release.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-release.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,6 +1,5 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2015-2017 Richard Hughes
+/*
+ * Copyright (C) 2015-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
@@ -31,10 +30,14 @@
typedef struct {
GPtrArray *checksums;
+ GPtrArray *categories;
GHashTable *metadata;
gchar *description;
gchar *filename;
+ gchar *protocol;
gchar *homepage;
+ gchar *details_url;
+ gchar *source_url;
gchar *appstream_id;
gchar *license;
gchar *name;
@@ -44,12 +47,18 @@
gchar *version;
gchar *remote_id;
guint64 size;
- FwupdTrustFlags trust_flags;
+ guint32 install_duration;
+ FwupdReleaseFlags flags;
+ gchar *update_message;
} FwupdReleasePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (FwupdRelease, fwupd_release, G_TYPE_OBJECT)
#define GET_PRIVATE(o) (fwupd_release_get_instance_private (o))
+/* the deprecated fwupd_release_get_trust_flags() function should only
+ * return the last two bits of the #FwupdReleaseFlags */
+#define FWUPD_RELEASE_TRUST_FLAGS_MASK 0x3
+
/**
* fwupd_release_get_remote_id:
* @release: A #FwupdRelease
@@ -159,6 +168,144 @@
}
/**
+ * fwupd_release_get_update_message:
+ * @release: A #FwupdRelease
+ *
+ * Gets the update message.
+ *
+ * Returns: the update message, or %NULL if unset
+ *
+ * Since: 1.2.4
+ **/
+const gchar *
+fwupd_release_get_update_message (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
+ return priv->update_message;
+}
+
+/**
+ * fwupd_release_set_update_message:
+ * @release: A #FwupdRelease
+ * @update_message: the update message string
+ *
+ * Sets the update message.
+ *
+ * Since: 1.2.4
+ **/
+void
+fwupd_release_set_update_message (FwupdRelease *release, const gchar *update_message)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_free (priv->update_message);
+ priv->update_message = g_strdup (update_message);
+}
+
+/**
+ * fwupd_release_get_protocol:
+ * @release: A #FwupdRelease
+ *
+ * Gets the update protocol.
+ *
+ * Returns: the update protocol, or %NULL if unset
+ *
+ * Since: 1.2.2
+ **/
+const gchar *
+fwupd_release_get_protocol (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
+ return priv->protocol;
+}
+
+/**
+ * fwupd_release_set_protocol:
+ * @release: A #FwupdRelease
+ * @protocol: the update protocol, e.g. `org.usb.dfu`
+ *
+ * Sets the update protocol.
+ *
+ * Since: 1.2.2
+ **/
+void
+fwupd_release_set_protocol (FwupdRelease *release, const gchar *protocol)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_free (priv->protocol);
+ priv->protocol = g_strdup (protocol);
+}
+
+/**
+ * fwupd_release_get_categories:
+ * @release: A #FwupdRelease
+ *
+ * Gets the release categories.
+ *
+ * Returns: (element-type utf8) (transfer none): the categories, which may be empty
+ *
+ * Since: 1.2.7
+ **/
+GPtrArray *
+fwupd_release_get_categories (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
+ return priv->categories;
+}
+
+/**
+ * fwupd_release_add_category:
+ * @release: A #FwupdRelease
+ * @category: the update category, e.g. `X-EmbeddedController`
+ *
+ * Adds the update category.
+ *
+ * Since: 1.2.7
+ **/
+void
+fwupd_release_add_category (FwupdRelease *release, const gchar *category)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_return_if_fail (category != NULL);
+ for (guint i = 0; i < priv->categories->len; i++) {
+ const gchar *category_tmp = g_ptr_array_index (priv->categories, i);
+ if (g_strcmp0 (category_tmp, category) == 0)
+ return;
+ }
+ g_ptr_array_add (priv->categories, g_strdup (category));
+}
+
+/**
+ * fwupd_release_has_category:
+ * @release: A #FwupdRelease
+ * @category: the update category, e.g. `X-EmbeddedController`
+ *
+ * Finds out if the release has the update category.
+ *
+ * Returns: %TRUE if the release matches
+ *
+ * Since: 1.2.7
+ **/
+gboolean
+fwupd_release_has_category (FwupdRelease *release, const gchar *category)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), FALSE);
+ g_return_val_if_fail (category != NULL, FALSE);
+ for (guint i = 0; i < priv->categories->len; i++) {
+ const gchar *category_tmp = g_ptr_array_index (priv->categories, i);
+ if (g_strcmp0 (category_tmp, category) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
* fwupd_release_get_checksums:
* @release: A #FwupdRelease
*
@@ -200,6 +347,31 @@
}
/**
+ * fwupd_release_has_checksum:
+ * @release: A #FwupdRelease
+ * @checksum: the update checksum
+ *
+ * Finds out if the release has the update checksum.
+ *
+ * Returns: %TRUE if the release matches
+ *
+ * Since: 1.2.6
+ **/
+gboolean
+fwupd_release_has_checksum (FwupdRelease *release, const gchar *checksum)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), FALSE);
+ g_return_val_if_fail (checksum != NULL, FALSE);
+ for (guint i = 0; i < priv->checksums->len; i++) {
+ const gchar *checksum_tmp = g_ptr_array_index (priv->checksums, i);
+ if (g_strcmp0 (checksum_tmp, checksum) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
* fwupd_release_get_metadata:
* @release: A #FwupdRelease
*
@@ -357,6 +529,78 @@
}
/**
+ * fwupd_release_get_details_url:
+ * @release: A #FwupdRelease
+ *
+ * Gets the URL for the online update notes.
+ *
+ * Returns: the update URL, or %NULL if unset
+ *
+ * Since: 1.2.4
+ **/
+const gchar *
+fwupd_release_get_details_url (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
+ return priv->details_url;
+}
+
+/**
+ * fwupd_release_set_details_url:
+ * @release: A #FwupdRelease
+ * @details_url: the URL
+ *
+ * Sets the URL for the online update notes.
+ *
+ * Since: 1.2.4
+ **/
+void
+fwupd_release_set_details_url (FwupdRelease *release, const gchar *details_url)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_free (priv->details_url);
+ priv->details_url = g_strdup (details_url);
+}
+
+/**
+ * fwupd_release_get_source_url:
+ * @release: A #FwupdRelease
+ *
+ * Gets the URL of the source code used to build this release.
+ *
+ * Returns: the update source_url, or %NULL if unset
+ *
+ * Since: 1.2.4
+ **/
+const gchar *
+fwupd_release_get_source_url (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
+ return priv->source_url;
+}
+
+/**
+ * fwupd_release_set_source_url:
+ * @release: A #FwupdRelease
+ * @source_url: the URL
+ *
+ * Sets the URL of the source code used to build this release.
+ *
+ * Since: 1.2.4
+ **/
+void
+fwupd_release_set_source_url (FwupdRelease *release, const gchar *source_url)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_free (priv->source_url);
+ priv->source_url = g_strdup (source_url);
+}
+
+/**
* fwupd_release_get_description:
* @release: A #FwupdRelease
*
@@ -622,7 +866,7 @@
{
FwupdReleasePrivate *priv = GET_PRIVATE (release);
g_return_val_if_fail (FWUPD_IS_RELEASE (release), 0);
- return priv->trust_flags;
+ return priv->flags & FWUPD_RELEASE_TRUST_FLAGS_MASK;
}
/**
@@ -639,7 +883,133 @@
{
FwupdReleasePrivate *priv = GET_PRIVATE (release);
g_return_if_fail (FWUPD_IS_RELEASE (release));
- priv->trust_flags = trust_flags;
+
+ /* only overwrite the last two bits of the flags */
+ priv->flags &= ~FWUPD_RELEASE_TRUST_FLAGS_MASK;
+ priv->flags |= trust_flags;
+}
+
+/**
+ * fwupd_release_get_flags:
+ * @release: A #FwupdRelease
+ *
+ * Gets the release flags.
+ *
+ * Returns: the release flags, or 0 if unset
+ *
+ * Since: 1.2.6
+ **/
+FwupdReleaseFlags
+fwupd_release_get_flags (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), 0);
+ return priv->flags;
+}
+
+/**
+ * fwupd_release_set_flags:
+ * @release: A #FwupdRelease
+ * @flags: the release flags, e.g. %FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD
+ *
+ * Sets the release flags.
+ *
+ * Since: 1.2.6
+ **/
+void
+fwupd_release_set_flags (FwupdRelease *release, FwupdReleaseFlags flags)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ priv->flags = flags;
+}
+
+/**
+ * fwupd_release_add_flag:
+ * @release: A #FwupdRelease
+ * @flag: the #FwupdReleaseFlags
+ *
+ * Adds a specific release flag to the release.
+ *
+ * Since: 1.2.6
+ **/
+void
+fwupd_release_add_flag (FwupdRelease *release, FwupdReleaseFlags flag)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ priv->flags |= flag;
+}
+
+/**
+ * fwupd_release_remove_flag:
+ * @release: A #FwupdRelease
+ * @flag: the #FwupdReleaseFlags
+ *
+ * Removes a specific release flag from the release.
+ *
+ * Since: 1.2.6
+ **/
+void
+fwupd_release_remove_flag (FwupdRelease *release, FwupdReleaseFlags flag)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ priv->flags &= ~flag;
+}
+
+/**
+ * fwupd_release_has_flag:
+ * @release: A #FwupdRelease
+ * @flag: the #FwupdReleaseFlags
+ *
+ * Finds if the release has a specific release flag.
+ *
+ * Returns: %TRUE if the flag is set
+ *
+ * Since: 1.2.6
+ **/
+gboolean
+fwupd_release_has_flag (FwupdRelease *release, FwupdReleaseFlags flag)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), FALSE);
+ return (priv->flags & flag) > 0;
+}
+
+/**
+ * fwupd_release_get_install_duration:
+ * @release: A #FwupdRelease
+ *
+ * Gets the time estimate for firmware installation (in seconds)
+ *
+ * Returns: the estimated time to flash this release (or 0 if unset)
+ *
+ * Since: 1.2.1
+ **/
+guint32
+fwupd_release_get_install_duration (FwupdRelease *release)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_val_if_fail (FWUPD_IS_RELEASE (release), 0);
+ return priv->install_duration;
+}
+
+/**
+ * fwupd_release_set_install_duration:
+ * @release: A #FwupdRelease
+ * @duration: The amount of time
+ *
+ * Sets the time estimate for firmware installation (in seconds)
+ *
+ * Since: 1.2.1
+ **/
+void
+fwupd_release_set_install_duration (FwupdRelease *release, guint32 duration)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ priv->install_duration = duration;
}
static GVariant *
@@ -688,7 +1058,7 @@
g_return_val_if_fail (FWUPD_IS_RELEASE (release), NULL);
/* create an array with all the metadata in */
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
if (priv->remote_id != NULL) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_REMOTE_ID,
@@ -704,6 +1074,11 @@
FWUPD_RESULT_KEY_FILENAME,
g_variant_new_string (priv->filename));
}
+ if (priv->protocol != NULL) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_PROTOCOL,
+ g_variant_new_string (priv->protocol));
+ }
if (priv->license != NULL) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_LICENSE,
@@ -729,6 +1104,14 @@
FWUPD_RESULT_KEY_DESCRIPTION,
g_variant_new_string (priv->description));
}
+ if (priv->categories->len > 0) {
+ g_autofree const gchar **strv = g_new0 (const gchar *, priv->categories->len + 1);
+ for (guint i = 0; i < priv->categories->len; i++)
+ strv[i] = (const gchar *) g_ptr_array_index (priv->categories, i);
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_CATEGORIES,
+ g_variant_new_strv (strv, -1));
+ }
if (priv->checksums->len > 0) {
g_autoptr(GString) str = g_string_new ("");
for (guint i = 0; i < priv->checksums->len; i++) {
@@ -751,6 +1134,16 @@
FWUPD_RESULT_KEY_HOMEPAGE,
g_variant_new_string (priv->homepage));
}
+ if (priv->details_url != NULL) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_DETAILS_URL,
+ g_variant_new_string (priv->details_url));
+ }
+ if (priv->source_url != NULL) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_SOURCE_URL,
+ g_variant_new_string (priv->source_url));
+ }
if (priv->version != NULL) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_VERSION,
@@ -761,16 +1154,21 @@
FWUPD_RESULT_KEY_VENDOR,
g_variant_new_string (priv->vendor));
}
- if (priv->trust_flags != 0) {
+ if (priv->flags != 0) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_TRUST_FLAGS,
- g_variant_new_uint64 (priv->trust_flags));
+ g_variant_new_uint64 (priv->flags));
}
if (g_hash_table_size (priv->metadata) > 0) {
g_variant_builder_add (&builder, "{sv}",
FWUPD_RESULT_KEY_METADATA,
_hash_kv_to_variant (priv->metadata));
}
+ if (priv->install_duration > 0) {
+ g_variant_builder_add (&builder, "{sv}",
+ FWUPD_RESULT_KEY_INSTALL_DURATION,
+ g_variant_new_uint32 (priv->install_duration));
+ }
return g_variant_new ("a{sv}", &builder);
}
@@ -790,6 +1188,10 @@
fwupd_release_set_filename (release, g_variant_get_string (value, NULL));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_PROTOCOL) == 0) {
+ fwupd_release_set_protocol (release, g_variant_get_string (value, NULL));
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_LICENSE) == 0) {
fwupd_release_set_license (release, g_variant_get_string (value, NULL));
return;
@@ -810,6 +1212,12 @@
fwupd_release_set_description (release, g_variant_get_string (value, NULL));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_CATEGORIES) == 0) {
+ g_autofree const gchar **strv = g_variant_get_strv (value, NULL);
+ for (guint i = 0; strv[i] != NULL; i++)
+ fwupd_release_add_category (release, strv[i]);
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_CHECKSUM) == 0) {
const gchar *checksums = g_variant_get_string (value, NULL);
g_auto(GStrv) split = g_strsplit (checksums, ",", -1);
@@ -825,6 +1233,14 @@
fwupd_release_set_homepage (release, g_variant_get_string (value, NULL));
return;
}
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_DETAILS_URL) == 0) {
+ fwupd_release_set_details_url (release, g_variant_get_string (value, NULL));
+ return;
+ }
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_SOURCE_URL) == 0) {
+ fwupd_release_set_source_url (release, g_variant_get_string (value, NULL));
+ return;
+ }
if (g_strcmp0 (key, FWUPD_RESULT_KEY_VERSION) == 0) {
fwupd_release_set_version (release, g_variant_get_string (value, NULL));
return;
@@ -834,7 +1250,15 @@
return;
}
if (g_strcmp0 (key, FWUPD_RESULT_KEY_TRUST_FLAGS) == 0) {
- fwupd_release_set_trust_flags (release, g_variant_get_uint64 (value));
+ fwupd_release_set_flags (release, g_variant_get_uint64 (value));
+ return;
+ }
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_INSTALL_DURATION) == 0) {
+ fwupd_release_set_install_duration (release, g_variant_get_uint32 (value));
+ return;
+ }
+ if (g_strcmp0 (key, FWUPD_RESULT_KEY_UPDATE_MESSAGE) == 0) {
+ fwupd_release_set_update_message (release, g_variant_get_string (value, NULL));
return;
}
if (g_strcmp0 (key, FWUPD_RESULT_KEY_METADATA) == 0) {
@@ -869,23 +1293,127 @@
}
static void
-fwupd_pad_kv_tfl (GString *str, const gchar *key, FwupdTrustFlags trust_flags)
+fwupd_pad_kv_tfl (GString *str, const gchar *key, FwupdReleaseFlags release_flags)
{
g_autoptr(GString) tmp = g_string_new ("");
- for (guint i = 1; i < FWUPD_TRUST_FLAG_LAST; i *= 2) {
- if ((trust_flags & i) == 0)
+ for (guint i = 0; i < 64; i++) {
+ if ((release_flags & ((guint64) 1 << i)) == 0)
continue;
g_string_append_printf (tmp, "%s|",
- fwupd_trust_flag_to_string (i));
+ fwupd_release_flag_to_string ((guint64) 1 << i));
}
if (tmp->len == 0) {
- g_string_append (tmp, fwupd_trust_flag_to_string (0));
+ g_string_append (tmp, fwupd_release_flag_to_string (0));
} else {
g_string_truncate (tmp, tmp->len - 1);
}
fwupd_pad_kv_str (str, key, tmp->str);
}
+static void
+fwupd_pad_kv_int (GString *str, const gchar *key, guint32 value)
+{
+ g_autofree gchar *tmp = NULL;
+
+ /* ignore */
+ if (value == 0)
+ return;
+ tmp = g_strdup_printf("%" G_GUINT32_FORMAT, value);
+ fwupd_pad_kv_str (str, key, tmp);
+}
+
+static void
+fwupd_release_json_add_string (JsonBuilder *builder, const gchar *key, const gchar *str)
+{
+ if (str == NULL)
+ return;
+ json_builder_set_member_name (builder, key);
+ json_builder_add_string_value (builder, str);
+}
+
+static void
+fwupd_release_json_add_int (JsonBuilder *builder, const gchar *key, guint64 num)
+{
+ if (num == 0)
+ return;
+ json_builder_set_member_name (builder, key);
+ json_builder_add_int_value (builder, num);
+}
+
+/**
+ * fwupd_release_to_json:
+ * @release: A #FwupdRelease
+ * @builder: A #JsonBuilder
+ *
+ * Adds a fwupd release to a JSON builder
+ *
+ * Since: 1.2.6
+ **/
+void
+fwupd_release_to_json (FwupdRelease *release, JsonBuilder *builder)
+{
+ FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ g_autoptr(GList) keys = NULL;
+
+ g_return_if_fail (FWUPD_IS_RELEASE (release));
+ g_return_if_fail (builder != NULL);
+
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_APPSTREAM_ID, priv->appstream_id);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_REMOTE_ID, priv->remote_id);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_SUMMARY, priv->summary);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_DESCRIPTION, priv->description);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_VERSION, priv->version);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_FILENAME, priv->filename);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_PROTOCOL, priv->protocol);
+ if (priv->categories->len > 0) {
+ json_builder_set_member_name (builder, FWUPD_RESULT_KEY_CATEGORIES);
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->categories->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv->categories, i);
+ json_builder_add_string_value (builder, tmp);
+ }
+ json_builder_end_array (builder);
+ }
+ if (priv->checksums->len > 0) {
+ json_builder_set_member_name (builder, FWUPD_RESULT_KEY_CHECKSUM);
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < priv->checksums->len; i++) {
+ const gchar *checksum = g_ptr_array_index (priv->checksums, i);
+ json_builder_add_string_value (builder, checksum);
+ }
+ json_builder_end_array (builder);
+ }
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_LICENSE, priv->license);
+ fwupd_release_json_add_int (builder, FWUPD_RESULT_KEY_SIZE, priv->size);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_URI, priv->uri);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_HOMEPAGE, priv->homepage);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_DETAILS_URL, priv->details_url);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_SOURCE_URL, priv->source_url);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_VENDOR, priv->vendor);
+ if (priv->flags != FWUPD_RELEASE_FLAG_NONE) {
+ json_builder_set_member_name (builder, FWUPD_RESULT_KEY_FLAGS);
+ json_builder_begin_array (builder);
+ for (guint i = 0; i < 64; i++) {
+ const gchar *tmp;
+ if ((priv->flags & ((guint64) 1 << i)) == 0)
+ continue;
+ tmp = fwupd_release_flag_to_string ((guint64) 1 << i);
+ json_builder_add_string_value (builder, tmp);
+ }
+ json_builder_end_array (builder);
+ }
+ fwupd_release_json_add_int (builder, FWUPD_RESULT_KEY_INSTALL_DURATION, priv->install_duration);
+ fwupd_release_json_add_string (builder, FWUPD_RESULT_KEY_UPDATE_MESSAGE, priv->update_message);
+
+ /* metadata */
+ keys = g_hash_table_get_keys (priv->metadata);
+ for (GList *l = keys; l != NULL; l = l->next) {
+ const gchar *key = l->data;
+ const gchar *value = g_hash_table_lookup (priv->metadata, key);
+ fwupd_release_json_add_string (builder, key, value);
+ }
+}
+
/**
* fwupd_release_to_string:
* @release: A #FwupdRelease
@@ -912,6 +1440,11 @@
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DESCRIPTION, priv->description);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VERSION, priv->version);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_FILENAME, priv->filename);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_PROTOCOL, priv->protocol);
+ for (guint i = 0; i < priv->categories->len; i++) {
+ const gchar *tmp = g_ptr_array_index (priv->categories, i);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_CATEGORIES, tmp);
+ }
for (guint i = 0; i < priv->checksums->len; i++) {
const gchar *checksum = g_ptr_array_index (priv->checksums, i);
g_autofree gchar *checksum_display = fwupd_checksum_format_for_display (checksum);
@@ -921,9 +1454,13 @@
fwupd_pad_kv_siz (str, FWUPD_RESULT_KEY_SIZE, priv->size);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_URI, priv->uri);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_HOMEPAGE, priv->homepage);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DETAILS_URL, priv->details_url);
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_SOURCE_URL, priv->source_url);
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_VENDOR, priv->vendor);
- fwupd_pad_kv_tfl (str, FWUPD_RESULT_KEY_TRUST_FLAGS, priv->trust_flags);
-
+ fwupd_pad_kv_tfl (str, FWUPD_RESULT_KEY_FLAGS, priv->flags);
+ fwupd_pad_kv_int (str, FWUPD_RESULT_KEY_INSTALL_DURATION, priv->install_duration);
+ if (priv->update_message != NULL)
+ fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_UPDATE_MESSAGE, priv->update_message);
/* metadata */
keys = g_hash_table_get_keys (priv->metadata);
for (GList *l = keys; l != NULL; l = l->next) {
@@ -946,6 +1483,7 @@
fwupd_release_init (FwupdRelease *release)
{
FwupdReleasePrivate *priv = GET_PRIVATE (release);
+ priv->categories = g_ptr_array_new_with_free_func (g_free);
priv->checksums = g_ptr_array_new_with_free_func (g_free);
priv->metadata = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
}
@@ -958,15 +1496,20 @@
g_free (priv->description);
g_free (priv->filename);
+ g_free (priv->protocol);
g_free (priv->appstream_id);
g_free (priv->license);
g_free (priv->name);
g_free (priv->summary);
g_free (priv->uri);
g_free (priv->homepage);
+ g_free (priv->details_url);
+ g_free (priv->source_url);
g_free (priv->vendor);
g_free (priv->version);
g_free (priv->remote_id);
+ g_free (priv->update_message);
+ g_ptr_array_unref (priv->categories);
g_ptr_array_unref (priv->checksums);
g_hash_table_unref (priv->metadata);
@@ -986,30 +1529,30 @@
/**
* fwupd_release_from_variant:
- * @data: a #GVariant
+ * @value: a #GVariant
*
* Creates a new release using packed data.
*
- * Returns: (transfer full): a new #FwupdRelease, or %NULL if @data was invalid
+ * Returns: (transfer full): a new #FwupdRelease, or %NULL if @value was invalid
*
* Since: 1.0.0
**/
FwupdRelease *
-fwupd_release_from_variant (GVariant *data)
+fwupd_release_from_variant (GVariant *value)
{
FwupdRelease *rel = NULL;
const gchar *type_string;
g_autoptr(GVariantIter) iter = NULL;
/* format from GetDetails */
- type_string = g_variant_get_type_string (data);
+ type_string = g_variant_get_type_string (value);
if (g_strcmp0 (type_string, "(a{sv})") == 0) {
rel = fwupd_release_new ();
- g_variant_get (data, "(a{sv})", &iter);
+ g_variant_get (value, "(a{sv})", &iter);
fwupd_release_set_from_variant_iter (rel, iter);
} else if (g_strcmp0 (type_string, "a{sv}") == 0) {
rel = fwupd_release_new ();
- g_variant_get (data, "a{sv}", &iter);
+ g_variant_get (value, "a{sv}", &iter);
fwupd_release_set_from_variant_iter (rel, iter);
} else {
g_warning ("type %s not known", type_string);
@@ -1018,6 +1561,38 @@
}
/**
+ * fwupd_release_array_from_variant:
+ * @value: a #GVariant
+ *
+ * Creates an array of new releases using packed data.
+ *
+ * Returns: (transfer container) (element-type FwupdRelease): releases, or %NULL if @value was invalid
+ *
+ * Since: 1.2.10
+ **/
+GPtrArray *
+fwupd_release_array_from_variant (GVariant *value)
+{
+ GPtrArray *array = NULL;
+ gsize sz;
+ g_autoptr(GVariant) untuple = NULL;
+
+ array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ untuple = g_variant_get_child_value (value, 0);
+ sz = g_variant_n_children (untuple);
+ for (guint i = 0; i < sz; i++) {
+ FwupdRelease *rel;
+ g_autoptr(GVariant) data = NULL;
+ data = g_variant_get_child_value (untuple, i);
+ rel = fwupd_release_from_variant (data);
+ if (rel == NULL)
+ continue;
+ g_ptr_array_add (array, rel);
+ }
+ return array;
+}
+
+/**
* fwupd_release_new:
*
* Creates a new release.
diff -Nru fwupd-1.0.9/libfwupd/fwupd-release.h fwupd-1.2.10/libfwupd/fwupd-release.h
--- fwupd-1.0.9/libfwupd/fwupd-release.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-release.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,10 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2015-2017 Richard Hughes
+/*
+ * Copyright (C) 2015-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_RELEASE_H
-#define __FWUPD_RELEASE_H
+#pragma once
#include
@@ -39,9 +37,16 @@
const gchar *fwupd_release_get_uri (FwupdRelease *release);
void fwupd_release_set_uri (FwupdRelease *release,
const gchar *uri);
+GPtrArray *fwupd_release_get_categories (FwupdRelease *release);
+void fwupd_release_add_category (FwupdRelease *release,
+ const gchar *category);
+gboolean fwupd_release_has_category (FwupdRelease *release,
+ const gchar *category);
GPtrArray *fwupd_release_get_checksums (FwupdRelease *release);
void fwupd_release_add_checksum (FwupdRelease *release,
const gchar *checksum);
+gboolean fwupd_release_has_checksum (FwupdRelease *release,
+ const gchar *checksum);
GHashTable *fwupd_release_get_metadata (FwupdRelease *release);
void fwupd_release_add_metadata (FwupdRelease *release,
@@ -55,6 +60,9 @@
const gchar *fwupd_release_get_filename (FwupdRelease *release);
void fwupd_release_set_filename (FwupdRelease *release,
const gchar *filename);
+const gchar *fwupd_release_get_protocol (FwupdRelease *release);
+void fwupd_release_set_protocol (FwupdRelease *release,
+ const gchar *protocol);
const gchar *fwupd_release_get_appstream_id (FwupdRelease *release);
void fwupd_release_set_appstream_id (FwupdRelease *release,
const gchar *appstream_id);
@@ -76,17 +84,40 @@
const gchar *fwupd_release_get_homepage (FwupdRelease *release);
void fwupd_release_set_homepage (FwupdRelease *release,
const gchar *homepage);
+const gchar *fwupd_release_get_details_url (FwupdRelease *release);
+void fwupd_release_set_details_url (FwupdRelease *release,
+ const gchar *details_url);
+const gchar *fwupd_release_get_source_url (FwupdRelease *release);
+void fwupd_release_set_source_url (FwupdRelease *release,
+ const gchar *source_url);
guint64 fwupd_release_get_size (FwupdRelease *release);
void fwupd_release_set_size (FwupdRelease *release,
guint64 size);
const gchar *fwupd_release_get_license (FwupdRelease *release);
void fwupd_release_set_license (FwupdRelease *release,
const gchar *license);
-FwupdTrustFlags fwupd_release_get_trust_flags (FwupdRelease *release);
+FwupdTrustFlags fwupd_release_get_trust_flags (FwupdRelease *release)
+G_DEPRECATED_FOR(fwupd_release_get_flags);
void fwupd_release_set_trust_flags (FwupdRelease *release,
- FwupdTrustFlags trust_flags);
+ FwupdTrustFlags trust_flags)
+G_DEPRECATED_FOR(fwupd_release_set_flags);
+FwupdReleaseFlags fwupd_release_get_flags (FwupdRelease *release);
+void fwupd_release_set_flags (FwupdRelease *release,
+ FwupdReleaseFlags flags);
+void fwupd_release_add_flag (FwupdRelease *release,
+ FwupdReleaseFlags flag);
+void fwupd_release_remove_flag (FwupdRelease *release,
+ FwupdReleaseFlags flag);
+gboolean fwupd_release_has_flag (FwupdRelease *release,
+ FwupdReleaseFlags flag);
+guint32 fwupd_release_get_install_duration (FwupdRelease *release);
+void fwupd_release_set_install_duration (FwupdRelease *release,
+ guint32 duration);
+const gchar *fwupd_release_get_update_message (FwupdRelease *release);
+void fwupd_release_set_update_message (FwupdRelease *release,
+ const gchar *update_message);
-G_END_DECLS
-
-#endif /* __FWUPD_RELEASE_H */
+FwupdRelease *fwupd_release_from_variant (GVariant *value);
+GPtrArray *fwupd_release_array_from_variant (GVariant *value);
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-release-private.h fwupd-1.2.10/libfwupd/fwupd-release-private.h
--- fwupd-1.0.9/libfwupd/fwupd-release-private.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-release-private.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,23 +1,21 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_RELEASE_PRIVATE_H
-#define __FWUPD_RELEASE_PRIVATE_H
+#pragma once
#include
+#include
#include "fwupd-release.h"
G_BEGIN_DECLS
-FwupdRelease *fwupd_release_from_variant (GVariant *data);
GVariant *fwupd_release_to_variant (FwupdRelease *release);
+void fwupd_release_to_json (FwupdRelease *release,
+ JsonBuilder *builder);
G_END_DECLS
-#endif /* __FWUPD_RELEASE_PRIVATE_H */
-
diff -Nru fwupd-1.0.9/libfwupd/fwupd-remote.c fwupd-1.2.10/libfwupd/fwupd-remote.c
--- fwupd-1.0.9/libfwupd/fwupd-remote.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-remote.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -43,6 +42,7 @@
gchar *filename_cache_sig;
gchar *filename_source;
gboolean enabled;
+ gboolean approval_required;
gint priority;
guint64 mtime;
gchar **order_after;
@@ -53,6 +53,7 @@
PROP_0,
PROP_ID,
PROP_ENABLED,
+ PROP_APPROVAL_REQUIRED,
PROP_LAST
};
@@ -276,6 +277,8 @@
return FWUPD_REMOTE_KIND_DOWNLOAD;
if (g_strcmp0 (kind, "local") == 0)
return FWUPD_REMOTE_KIND_LOCAL;
+ if (g_strcmp0 (kind, "directory") == 0)
+ return FWUPD_REMOTE_KIND_DIRECTORY;
return FWUPD_REMOTE_KIND_UNKNOWN;
}
@@ -296,6 +299,8 @@
return "download";
if (kind == FWUPD_REMOTE_KIND_LOCAL)
return "local";
+ if (kind == FWUPD_REMOTE_KIND_DIRECTORY)
+ return "directory";
return NULL;
}
@@ -385,7 +390,14 @@
if (metadata_uri == NULL)
return FALSE;
if (g_str_has_prefix (metadata_uri, "file://")) {
- priv->kind = FWUPD_REMOTE_KIND_LOCAL;
+ const gchar *filename_cache = metadata_uri;
+ if (g_str_has_prefix (filename_cache, "file://"))
+ filename_cache += 7;
+ fwupd_remote_set_filename_cache (self, filename_cache);
+ if (g_file_test (filename_cache, G_FILE_TEST_IS_DIR))
+ priv->kind = FWUPD_REMOTE_KIND_DIRECTORY;
+ else
+ priv->kind = FWUPD_REMOTE_KIND_LOCAL;
} else if (g_str_has_prefix (metadata_uri, "http://") ||
g_str_has_prefix (metadata_uri, "https://")) {
priv->kind = FWUPD_REMOTE_KIND_DOWNLOAD;
@@ -400,6 +412,7 @@
/* extract data */
priv->enabled = g_key_file_get_boolean (kf, group, "Enabled", NULL);
+ priv->approval_required = g_key_file_get_boolean (kf, group, "ApprovalRequired", NULL);
priv->title = g_key_file_get_string (kf, group, "Title", NULL);
/* reporting is optional */
@@ -445,14 +458,6 @@
fwupd_remote_set_filename_cache (self, filename_cache);
}
- /* all LOCAL remotes have to include a valid MetadataURI */
- if (priv->kind == FWUPD_REMOTE_KIND_LOCAL) {
- const gchar *filename_cache = metadata_uri;
- if (g_str_has_prefix (filename_cache, "file://"))
- filename_cache += 7;
- fwupd_remote_set_filename_cache (self, filename_cache);
- }
-
/* load the checksum */
if (priv->filename_cache_sig != NULL &&
g_file_test (priv->filename_cache_sig, G_FILE_TEST_EXISTS)) {
@@ -474,6 +479,25 @@
if (firmware_base_uri != NULL)
fwupd_remote_set_firmware_base_uri (self, firmware_base_uri);
+ /* some validation around DIRECTORY types */
+ if (priv->kind == FWUPD_REMOTE_KIND_DIRECTORY) {
+ if (priv->keyring_kind != FWUPD_KEYRING_KIND_NONE) {
+ g_set_error (error,
+ FWUPD_ERROR,
+ FWUPD_ERROR_INVALID_FILE,
+ "Keyring kind %s is not supported with directory remote",
+ fwupd_keyring_kind_to_string (priv->keyring_kind));
+ return FALSE;
+ }
+ if (firmware_base_uri != NULL) {
+ g_set_error_literal (error,
+ FWUPD_ERROR,
+ FWUPD_ERROR_INVALID_FILE,
+ "Directory remotes don't support firmware base URI");
+ return FALSE;
+ }
+ }
+
/* dep logic */
order_before = g_key_file_get_string (kf, group, "OrderBefore", NULL);
if (order_before != NULL)
@@ -890,6 +914,25 @@
}
/**
+ * fwupd_remote_get_approval_required:
+ * @self: A #FwupdRemote
+ *
+ * Gets if firmware from the remote should be checked against the list
+ * of a approved checksums.
+ *
+ * Returns: a #TRUE if the remote is restricted
+ *
+ * Since: 1.2.6
+ **/
+gboolean
+fwupd_remote_get_approval_required (FwupdRemote *self)
+{
+ FwupdRemotePrivate *priv = GET_PRIVATE (self);
+ g_return_val_if_fail (FWUPD_IS_REMOTE (self), FALSE);
+ return priv->approval_required;
+}
+
+/**
* fwupd_remote_get_id:
* @self: A #FwupdRemote
*
@@ -948,6 +991,8 @@
fwupd_remote_set_checksum (self, g_variant_get_string (value, NULL));
} else if (g_strcmp0 (key, "Enabled") == 0) {
priv->enabled = g_variant_get_boolean (value);
+ } else if (g_strcmp0 (key, "ApprovalRequired") == 0) {
+ priv->approval_required = g_variant_get_boolean (value);
} else if (g_strcmp0 (key, "Priority") == 0) {
priv->priority = g_variant_get_int32 (value);
} else if (g_strcmp0 (key, "ModificationTime") == 0) {
@@ -977,7 +1022,7 @@
g_return_val_if_fail (FWUPD_IS_REMOTE (self), NULL);
/* create an array with all the metadata in */
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
if (priv->id != NULL) {
g_variant_builder_add (&builder, "{sv}", FWUPD_RESULT_KEY_REMOTE_ID,
g_variant_new_string (priv->id));
@@ -1040,6 +1085,8 @@
}
g_variant_builder_add (&builder, "{sv}", "Enabled",
g_variant_new_boolean (priv->enabled));
+ g_variant_builder_add (&builder, "{sv}", "ApprovalRequired",
+ g_variant_new_boolean (priv->approval_required));
return g_variant_new ("a{sv}", &builder);
}
@@ -1054,6 +1101,9 @@
case PROP_ENABLED:
g_value_set_boolean (value, priv->enabled);
break;
+ case PROP_APPROVAL_REQUIRED:
+ g_value_set_boolean (value, priv->approval_required);
+ break;
case PROP_ID:
g_value_set_string (value, priv->id);
break;
@@ -1074,6 +1124,9 @@
case PROP_ENABLED:
priv->enabled = g_value_get_boolean (value);
break;
+ case PROP_APPROVAL_REQUIRED:
+ priv->approval_required = g_value_get_boolean (value);
+ break;
case PROP_ID:
fwupd_remote_set_id (self, g_value_get_string (value));
break;
@@ -1100,7 +1153,7 @@
* Since: 0.9.3
*/
pspec = g_param_spec_string ("id", NULL, NULL,
- NULL, G_PARAM_READWRITE);
+ NULL, G_PARAM_READWRITE | G_PARAM_STATIC_NAME);
g_object_class_install_property (object_class, PROP_ID, pspec);
/**
@@ -1111,8 +1164,20 @@
* Since: 0.9.3
*/
pspec = g_param_spec_boolean ("enabled", NULL, NULL,
- FALSE, G_PARAM_READWRITE);
+ FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_NAME);
g_object_class_install_property (object_class, PROP_ENABLED, pspec);
+
+ /**
+ * FwupdRemote:approval-required:
+ *
+ * If firmware from the remote should be checked against the system
+ * list of approved firmware.
+ *
+ * Since: 1.2.6
+ */
+ pspec = g_param_spec_boolean ("approval-required", NULL, NULL,
+ FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_APPROVAL_REQUIRED, pspec);
}
static void
@@ -1147,30 +1212,30 @@
/**
* fwupd_remote_from_variant:
- * @data: a #GVariant
+ * @value: a #GVariant
*
* Creates a new remote using packed data.
*
- * Returns: (transfer full): a new #FwupdRemote, or %NULL if @data was invalid
+ * Returns: (transfer full): a new #FwupdRemote, or %NULL if @value was invalid
*
* Since: 1.0.0
**/
FwupdRemote *
-fwupd_remote_from_variant (GVariant *data)
+fwupd_remote_from_variant (GVariant *value)
{
FwupdRemote *rel = NULL;
const gchar *type_string;
g_autoptr(GVariantIter) iter = NULL;
- type_string = g_variant_get_type_string (data);
+ type_string = g_variant_get_type_string (value);
if (g_strcmp0 (type_string, "(a{sv})") == 0) {
rel = fwupd_remote_new ();
- g_variant_get (data, "(a{sv})", &iter);
+ g_variant_get (value, "(a{sv})", &iter);
fwupd_remote_set_from_variant_iter (rel, iter);
fwupd_remote_set_from_variant_iter (rel, iter);
} else if (g_strcmp0 (type_string, "a{sv}") == 0) {
rel = fwupd_remote_new ();
- g_variant_get (data, "a{sv}", &iter);
+ g_variant_get (value, "a{sv}", &iter);
fwupd_remote_set_from_variant_iter (rel, iter);
} else {
g_warning ("type %s not known", type_string);
@@ -1179,6 +1244,35 @@
}
/**
+ * fwupd_remote_array_from_variant:
+ * @value: a #GVariant
+ *
+ * Creates an array of new devices using packed data.
+ *
+ * Returns: (transfer container) (element-type FwupdRemote): remotes, or %NULL if @value was invalid
+ *
+ * Since: 1.2.10
+ **/
+GPtrArray *
+fwupd_remote_array_from_variant (GVariant *value)
+{
+ GPtrArray *remotes = NULL;
+ gsize sz;
+ g_autoptr(GVariant) untuple = NULL;
+
+ remotes = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ untuple = g_variant_get_child_value (value, 0);
+ sz = g_variant_n_children (untuple);
+ for (guint i = 0; i < sz; i++) {
+ g_autoptr(GVariant) data = g_variant_get_child_value (untuple, i);
+ FwupdRemote *remote = fwupd_remote_from_variant (data);
+ g_ptr_array_add (remotes, remote);
+ }
+
+ return remotes;
+}
+
+/**
* fwupd_remote_new:
*
* Creates a new fwupd remote.
diff -Nru fwupd-1.0.9/libfwupd/fwupd-remote.h fwupd-1.2.10/libfwupd/fwupd-remote.h
--- fwupd-1.0.9/libfwupd/fwupd-remote.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-remote.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,12 +1,10 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017-2018 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_REMOTE_H
-#define __FWUPD_REMOTE_H
+#pragma once
#include "fwupd-enums.h"
@@ -33,6 +31,7 @@
* @FWUPD_REMOTE_KIND_UNKNOWN: Unknown kind
* @FWUPD_REMOTE_KIND_DOWNLOAD: Requires files to be downloaded
* @FWUPD_REMOTE_KIND_LOCAL: Reads files from the local machine
+ * @FWUPD_REMOTE_KIND_DIRECTORY: Reads directory from the local machine
*
* The kind of remote.
**/
@@ -40,6 +39,7 @@
FWUPD_REMOTE_KIND_UNKNOWN,
FWUPD_REMOTE_KIND_DOWNLOAD,
FWUPD_REMOTE_KIND_LOCAL,
+ FWUPD_REMOTE_KIND_DIRECTORY, /* Since: 1.2.4 */
/*< private >*/
FWUPD_REMOTE_KIND_LAST
} FwupdRemoteKind;
@@ -62,6 +62,7 @@
const gchar *fwupd_remote_get_metadata_uri (FwupdRemote *self);
const gchar *fwupd_remote_get_metadata_uri_sig (FwupdRemote *self);
gboolean fwupd_remote_get_enabled (FwupdRemote *self);
+gboolean fwupd_remote_get_approval_required (FwupdRemote *self);
gint fwupd_remote_get_priority (FwupdRemote *self);
guint64 fwupd_remote_get_age (FwupdRemote *self);
FwupdRemoteKind fwupd_remote_get_kind (FwupdRemote *self);
@@ -70,7 +71,7 @@
const gchar *url,
GError **error);
-G_END_DECLS
-
-#endif /* __FWUPD_REMOTE_H */
+FwupdRemote *fwupd_remote_from_variant (GVariant *value);
+GPtrArray *fwupd_remote_array_from_variant (GVariant *value);
+G_END_DECLS
diff -Nru fwupd-1.0.9/libfwupd/fwupd-remote-private.h fwupd-1.2.10/libfwupd/fwupd-remote-private.h
--- fwupd-1.0.9/libfwupd/fwupd-remote-private.h 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-remote-private.h 2019-07-15 18:25:54.000000000 +0000
@@ -1,18 +1,15 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2017 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __FWUPD_REMOTE_PRIVATE_H
-#define __FWUPD_REMOTE_PRIVATE_H
+#pragma once
#include "fwupd-remote.h"
G_BEGIN_DECLS
-FwupdRemote *fwupd_remote_from_variant (GVariant *data);
GVariant *fwupd_remote_to_variant (FwupdRemote *self);
gboolean fwupd_remote_load_from_filename (FwupdRemote *self,
const gchar *filename,
@@ -28,6 +25,3 @@
gchar **fwupd_remote_get_order_before (FwupdRemote *self);
G_END_DECLS
-
-#endif /* __FWUPD_REMOTE_PRIVATE_H */
-
diff -Nru fwupd-1.0.9/libfwupd/fwupd-self-test.c fwupd-1.2.10/libfwupd/fwupd-self-test.c
--- fwupd-1.0.9/libfwupd/fwupd-self-test.c 2018-09-11 18:07:39.000000000 +0000
+++ fwupd-1.2.10/libfwupd/fwupd-self-test.c 2019-07-15 18:25:54.000000000 +0000
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
* Copyright (C) 2016 Richard Hughes
*
* SPDX-License-Identifier: LGPL-2.1+
@@ -9,12 +8,12 @@
#include
#include
-#include
#include "fwupd-client.h"
#include "fwupd-common.h"
#include "fwupd-enums.h"
#include "fwupd-error.h"
+#include "fwupd-device-private.h"
#include "fwupd-release-private.h"
#include "fwupd-remote-private.h"
@@ -45,6 +44,60 @@
return FALSE;
}
+/* https://gitlab.gnome.org/GNOME/glib/issues/225 */
+static guint
+_g_string_replace (GString *string, const gchar *search, const gchar *replace)
+{
+ gchar *tmp;
+ guint count = 0;
+ gsize search_idx = 0;
+ gsize replace_len;
+ gsize search_len;
+
+ g_return_val_if_fail (string != NULL, 0);
+ g_return_val_if_fail (search != NULL, 0);
+ g_return_val_if_fail (replace != NULL, 0);
+
+ /* nothing to do */
+ if (string->len == 0)
+ return 0;
+
+ search_len = strlen (search);
+ replace_len = strlen (replace);
+
+ do {
+ tmp = g_strstr_len (string->str + search_idx, -1, search);
+ if (tmp == NULL)
+ break;
+
+ /* advance the counter in case @replace contains @search */
+ search_idx = (gsize) (tmp - string->str);
+
+ /* reallocate the string if required */
+ if (search_len > replace_len) {
+ g_string_erase (string,
+ (gssize) search_idx,
+ (gssize) (search_len - replace_len));
+ memcpy (tmp, replace, replace_len);
+ } else if (search_len < replace_len) {
+ g_string_insert_len (string,
+ (gssize) search_idx,
+ replace,
+ (gssize) (replace_len - search_len));
+ /* we have to treat this specially as it could have
+ * been reallocated when the insertion happened */
+ memcpy (string->str + search_idx, replace, replace_len);
+ } else {
+ /* just memcmp in the new string */
+ memcpy (tmp, replace, replace_len);
+ }
+ search_idx += replace_len;
+ count++;
+ } while (TRUE);
+
+ return count;
+}
+
static void
fwupd_enums_func (void)
{
@@ -69,6 +122,11 @@
g_assert_cmpstr (tmp, !=, NULL);
g_assert_cmpint (fwupd_trust_flag_from_string (tmp), ==, i);
}
+ for (guint i = 1; i < FWUPD_VERSION_FORMAT_LAST; i++) {
+ const gchar *tmp = fwupd_version_format_to_string (i);
+ g_assert_cmpstr (tmp, !=, NULL);
+ g_assert_cmpint (fwupd_version_format_from_string (tmp), ==, i);
+ }
/* bitfield */
for (guint64 i = 1; i < FWUPD_DEVICE_FLAG_UNKNOWN; i *= 2) {
@@ -173,7 +231,7 @@
g_autoptr(GError) error = NULL;
remote = fwupd_remote_new ();
- fn = g_build_filename (FU_SELF_TEST_REMOTES_DIR, "remotes.d", "fwupd.conf", NULL);
+ fn = g_build_filename (FU_LOCAL_REMOTE_DIR, "dell-esrt.conf", NULL);
ret = fwupd_remote_load_from_filename (remote, fn, NULL, &error);
g_assert_no_error (error);
g_assert (ret);
@@ -183,8 +241,8 @@
g_assert (fwupd_remote_get_metadata_uri (remote) == NULL);
g_assert (fwupd_remote_get_metadata_uri_sig (remote) == NULL);
g_assert (fwupd_remote_get_report_uri (remote) == NULL);
- g_assert_cmpstr (fwupd_remote_get_title (remote), ==, "Core");
- g_assert_cmpstr (fwupd_remote_get_filename_cache (remote), ==, "@datadir@/fwupd/remotes.d/fwupd/metadata.xml");
+ g_assert_cmpstr (fwupd_remote_get_title (remote), ==, "Enable UEFI capsule updates on Dell systems");
+ g_assert_cmpstr (fwupd_remote_get_filename_cache (remote), ==, "@datadir@/fwupd/remotes.d/dell-esrt/metadata.xml");
g_assert_cmpstr (fwupd_remote_get_filename_cache_sig (remote), ==, NULL);
g_assert_cmpstr (fwupd_remote_get_checksum (remote), ==, NULL);
}
@@ -209,10 +267,15 @@
fwupd_device_func (void)
{
gboolean ret;
+ g_autofree gchar *data = NULL;
g_autofree gchar *str = NULL;
g_autoptr(FwupdDevice) dev = NULL;
g_autoptr(FwupdRelease) rel = NULL;
g_autoptr(GError) error = NULL;
+ g_autoptr(GString) str_ascii = NULL;
+ g_autoptr(JsonBuilder) builder = NULL;
+ g_autoptr(JsonGenerator) json_generator = NULL;
+ g_autoptr(JsonNode) json_root = NULL;
/* create dummy object */
dev = fwupd_device_new ();
@@ -228,7 +291,7 @@
fwupd_device_add_icon (dev, "input-mouse");
fwupd_device_add_flag (dev, FWUPD_DEVICE_FLAG_REQUIRE_AC);
rel = fwupd_release_new ();
- fwupd_release_set_trust_flags (rel, FWUPD_TRUST_FLAG_PAYLOAD);
+ fwupd_release_add_flag (rel, FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD);
fwupd_release_add_checksum (rel, "deadbeef");
fwupd_release_set_description (rel, "