Commit Graph

670 Commits

Author SHA1 Message Date
Richard Hughes
03aead9fe7 uefi: Check the filesystem type when checking the ESP 2018-08-08 20:35:04 +01:00
Richard Hughes
99b0b1be04 uefi: Check the user-supplied ESP path
Additionally, if the user specified something invalid, do not autodetect the
ESP but return with a journal error. It seems wrong to ignore what the user
explicitly set and perhaps do something dangerous.

Alternative to https://github.com/hughsie/fwupd/pull/599
2018-08-08 20:35:04 +01:00
Richard Hughes
34ea74fb2c uefi: Don't override _FORTIFY_SOURCE when building the EFI binary
Fixes https://github.com/hughsie/fwupd/issues/631
2018-08-08 20:16:53 +01:00
Mario Limonciello
faa9aaae0b trivial: synapticsmst: whitespace fixes 2018-08-06 00:34:42 -05:00
Mario Limonciello
dc5566a8db synapticsmst: Add support Synaptics Panamera chip
Panamera is a newer MST chip with a different flash layout and
multiple MCU running and accessing SPI/EEPROM simultaneously.

The firmware update process has to be run separately for each
SPI/EEPROM region.

Signed-off-by: Ryan Chang <ryan.chang@synaptics.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2018-08-06 00:34:42 -05:00
Mario Limonciello
9a77f1c7ad synapticsmst: Rework Tesla/Leaf write process
- Split up `synapticsmst_device_write_firmware` to smaller more manageable
  chunks
- Use `FuDeviceLocker` to ensure that device is in a known state after
  update is complete (both in success or failure scenarios)
- Retry the write process up to 10 times in case of DPCD update failures
- Wait for flash clear to settle before writing to EEPROM/SPI
2018-08-06 00:34:42 -05:00
Mario Limonciello
0677d92b03 synapticsmst: If failing to enable remote control, disable and retry
Any previously failed runs or outside tools may adjust the remote
control register leaving the MST controller in a poor state.

If remote control enablement fails, try to disable and then re-enable
before aborting.
2018-08-06 00:34:42 -05:00
Mario Limonciello
2b4013562d synapticsmst: Add a reboot at end of flash cycle
This makes sure the MST hub jumps to the new active firmware after
completion.
2018-08-06 00:34:42 -05:00
Mario Limonciello
801cca6dc3 synapticsmst: remove support for setting dock type from another plugin
As seen by recent testing this is not working every time.
Since e6cda81f we're now building GUIDs that represent all the possibilities
for shared parts so it's not important to set dock type.
2018-08-06 00:34:42 -05:00
Mario Limonciello
d173901e79 synapticsmst: set parent devices for known docks without metadata 2018-08-06 00:34:42 -05:00
Gary Lin
b54f4706cb redfish: Add an option for CA verification
Since the Redfish service may use a self-signed certificate without
specifying the hostname, we could have the problem to verify such
certificate. A new option, CACheck, is introduced so that the user can
decide whether to ignore the CA verification or not.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
986c0ebe77 redfish: Check validity of the json objects
We might get a NULL json object.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
7f79aa9ea7 redfish: Upload the firmware blob through HttpPushUri
Create a multipart request to upload the firmware blob

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
e5154d3ac3 redfish: Assume the device is updatable by default
The "Updateable" field may not be available.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
2e0e179298 redfish: Read options from redfish.conf
This commit adds redfish.conf to configure the IP and username/password
in case those are not available in SMBIOS and the EFI variables.

Since we can configure the IP in the conf file, the environment
variable, FWUPD_REDFISH_URI, is removed.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
27986ebf3e redfish: Generate IDs for redfish devices
Generate IDs for redfish devices and skip the devices without a
proper GUID.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
213bdf0637 redfish: Fetch the inventory collection
All inventory members are in the inventory collection.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
ce8aa4f84a redfish: Always use Basic Auth
Although SoupAuthManager can create a proper SoupAuth from the
WWW-Authenticate header, some redfish implementations didn't provide
such header, and we would get a 401 response in the end.

In DSP0266, it mentions that "HTTP BASIC authentication as defined by
RFC7235 shall be supported", so it shall be safe to use Basic Auth
by default.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
95ee874b2e redfish: Remove the json object of Links
UpdateService is in the root json object, so we don't need the Links
json object.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
701b46bbb2 redfish: Adjust the first redfish path
Change the redfish path from "/redfish/v1" to "/redfish/v1/" so that we
don't have to handle 308 redirect.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
3456238f0a redfish: Detect the HPE DeviceClass
DeviceClass in Oem/Hpe indicates the type of device in the HPE machine.
In case SoftwareId is absent, we can use DeviceClass instead.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
ad594286b2 redfish: Check "Updateable" and "SoftwareId" before using them
Although "Updateable" is defined in SoftwareInventory schema since
redfish v1.0.0, some machines(*) didn't support the field.

"SoftwareId" is defined in SoftwareInventory schema since v1.1.0, so
it probably isn't supported by every redfish machines.

(*) Try "/redfish/v1/UpdateService/FirmwareInventory/1/" with HPE DL380
    Gen 10 in https://ilorestfulapiexplorer.ext.hpe.com/

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Mario Limonciello
7154f63397 trivial: Adjust syntax of varying copyright holders to unify across project 2018-08-05 08:22:23 -05:00
Mario Limonciello
ef6f1d7698 thunderbolt-power: Reset the timer on every TBT add uevent
This should help issues where the TBT controller takes a longer
time to run at cold boot startup.

Refer to https://bugzilla.kernel.org/show_bug.cgi?id=199631 for
more information.
2018-08-04 06:30:52 +01:00
Mario Limonciello
c4afb99620 trivial: thunderbolt: Don't re-use GErrors
In instances that we keep processing (such as warnings) these should
be dedicated error variables.
2018-08-01 06:36:07 +01:00
Mario Limonciello
25d51d1429 thunderbolt: Handle -EAGAIN from the kernel better when reading NVM (Closes #608)
Sometimes during initialization trying to read nvm_version will fail
with -EAGAIN.  In these instances keep trying to read.
2018-08-01 06:36:07 +01:00
Gary Lin
af71145c67 redfish: Fetch the inventory member correctly
In the Members array of FirmwareInventory or SoftwareInventory, each
element of the array only contains the URI to the member. For example:

  "Members":
  [
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/1/"
    },
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/2/"
    },
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/3/"
    }
  ]

We have to get the real member object through the given URI.
2018-07-23 09:19:18 +01:00
Mario Limonciello
e6cda81f8d synapticsmst: Drop the dependency on Dell plugin to populate devices
If the dock information is available then show that in the device name
and restrict the GUIDs created.

If it's not available, then just create GUIDs for all known docks
2018-07-19 11:09:05 -05:00
Mario Limonciello
9fea78eb04 thunderbolt: show ErrorMessage when in safe mode 2018-07-18 16:32:26 -05:00
Mario Limonciello
0e00ed9b13 dell: Show error messages when capsule updates are disabled 2018-07-18 16:32:26 -05:00
Mario Limonciello
d1775bc026 uefi: Populate UpdateError with reasons that the plugin won't run
Previously if missing secure boot binaries, or invalid ESP was created the
plugin would just not load.

Now instead populate UpdateError and remove the updateble flag, but still show
the device in fwupdmgr and fwupdtool.
2018-07-17 14:30:27 +01:00
Mario Limonciello
6c41292bdb trivial: dell: drop blacklist of old systems
The minimum version of libsmbios is now 2.4, so don't include any
code blacklisting running on known failing systems.
2018-07-13 13:04:42 -05:00
Richard Hughes
70c9ab0288 Do not use /usr/bin/env in the shebang line
According to Fedora policy env must not be used as it could be overridden by
values in the PATH.

For details, https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines
2018-07-12 07:08:53 -05:00
Mario Limonciello
e6e2bf9d97 trivial: Allow EFI application path to come from a different root 2018-07-10 14:10:16 -05:00
Mario Limonciello
fd65ddda8a uefi: Rename all intermediary files and UEFI variables to prefix fwupd
fwupdate prefix is used by fwupdate and this will prevent clashes in case
its used instead.
2018-07-10 10:45:39 -05:00
Mario Limonciello
14fad85164 UEFI: Rename UEFI boot entry
1) Drop the path at the end of the title (\fwupdx64.efi)
2) Linux-Firmware-Updater to Linux Firmware Updater

The behavior that required the hacky name has been fixed since shim 10
which is in all the relevant distros now.
3322257e61
2018-07-10 10:45:39 -05:00
Mario Limonciello
44305bbde4 Rename EFI application from fwup<arch>.efi to fwupd<arch>.efi
This will prevent potentially clashing with fwupdate's EFI application
and allow them to remain co-installable.
2018-07-10 10:45:39 -05:00
Gary Lin
aeaf444835 redfish: Amend the retrieval of version
In the redfish emulator, "/redfish/v1" returns "ServiceVersion".
However, in the HPE API explorer(*), it returns "RedfishVersion".
This commit checks both member and print the one that is available.

(*) https://ilorestfulapiexplorer.ext.hpe.com/
2018-07-06 08:48:58 +01:00
Richard Hughes
ba103483fa redfish: Add a plugin that uses the Redfish API
Redfish is an open industry standard specification and schema that helps enable
simple and secure management of modern scalable platform hardware.

This has only ever been tested using an emulator and not on real hardware.
2018-06-29 20:17:45 +01:00
Mario Limonciello
097b5ac996 trivial: colorhug: fix a typo 2018-06-29 11:20:17 -05:00
Richard Hughes
a4c1530a69 thunderbolt: Fix the self tests when using -Db_sanitize=address 2018-06-28 20:55:37 +01:00
Richard Hughes
d6df0040c3 dfu: Fix a potential buffer overflow when applying a patch 2018-06-28 20:55:37 +01:00
Richard Hughes
572b7dbbd6 wacomhid: Fix the name of the self test executable 2018-06-28 19:26:22 +01:00
Richard Hughes
6bc7861c78 thunderbolt: Fix two memory leaks in the self test wrapper 2018-06-28 19:21:49 +01:00
Richard Hughes
f83adbab56 dell: Fix a tiny memory leak in the self test wrapper 2018-06-28 19:08:39 +01:00
Richard Hughes
d3f2878f19 synapticsmst: Fix several small memory leaks during enumeration 2018-06-28 18:16:24 +01:00
Richard Hughes
7ecf0164de uefi: Show the stored capsule filename in fwupdate 2018-06-28 15:51:11 +01:00
Richard Hughes
57df956d7b uefi: Add a libexec tool to mimic the original fwupdate CLI interface 2018-06-28 15:51:11 +01:00
Richard Hughes
04f8f267c5 trivial: Move the guessing of the ESP to common code 2018-06-28 15:51:11 +01:00
Richard Hughes
1ccf35a9e4 dell: Register devices with the uefi plugin rather than using libfwup directly
The device registration allows us to create a 'virtual' device that can accept
capsule updates that is not found in the ESRT.
2018-06-28 15:51:11 +01:00