Discover: fwupd integration
Currently, Discover does most of the general job required for a typical plasma user but it lacks firmware upgrade on devices. This project will integrate the firmware upgrade through fwupd in discover. After addition of this feature, Discover will be able to upgrade the firmware of devices attached to the system (via USB/SOC) on Demand.
Mentors: David Edmundson Aleix Pol
- On demand firmware upgrades via fwupd from Discover.
- Notification Support on New firmware updates.
- Setting UI for new firmware upgrades as per discussion with Discover Team.
Community Bonding Period
During the community bonding period, I started with understanding the code base of discover. I found the way to add this functionality of Integrating fwupd via a new Backend i.e FwupdBackend. I then discussed this with my mentor Aleix and I started Working on this new backend. During this period we also discussed ways of communication and finally landed on emails with occasional video calls via opentok.
Coding Period Phase - I (May 14th to June 10th)
During this period I started by adding a new backend i.e FwupdBackend from a skeleton backend i.e DummyBackend. After adding the skeleton, I had to link the libfwupd with discover via CMake. For Linking, I added a FindLIBFWUPD.cmake so that cmake could find the required libraries. After successfully linking these libraries I proceeded with making the constructor and destructor for making the fwupdclient object to talk to the fwupd daemon. After this, I proceeded with displaying the attached devices discovered via fwupd for checking that client object is able to talk to the fwupd daemon successfully.
Discover Displaying attached devices discovered via fwupd daemon
Coding Period Phase - II (June 11th to July 9th)
During this period I have implemented the following things:
- Firmware Updates Section is Now Cleaner: I have removed the unnecessary things like review backend, and screenshots which are not applicable for these updates. Also now the icons are decided based on the type of device.
- Refresh Remotes is now implemented: Now the metadata of enabled remotes are updating. Currently, the frequency is set to 30 days. These refreshing is like apt-get updates in Ubuntu based systems but for fwupd. The metadata is downloaded into cache directory of discover and then these files are sent to fwupd-daemon. In the attached screenshot you can see the downloaded files in the cache directory. The checksum is downloaded first and if it’s unchanged then only the new file is downloaded.
- Updates are shown on the updates page: The firmware updates are now shown in the update page of discover with all other updates. These updates are categorizing in “System-Updates”. These changes can be seen in the attached screenshot. (Missing string, please see the note!)
- Added Remotes Setting and EULA: Now the remotes can be enabled and disabled in the setting menu of the discover. If the user is enabling the remote then, he has to accept the EULA provided by LVFS. Additionally, the user also requires the root password to enable/disable it. I have also removed the unnecessary options like adding a new remote. Also, for now, I have disabled deleting the remotes.
- Testing Installs on Real Devices: Since I haven’t received the device, I still have to wait to test the code. The code for install is written, but it needs regress testing and improvement.
Note: The Updates shown in the above screenshots are purposely put to visualize the code! I don’t have a device which supports firmware updates by LVFS
Coding Period Phase - III (July 15th to Aug 6th)
In this period, I majorly improved the code and got it merged into the master branch of Discover Software Center. The Phabricator request for the merge is (https://phabricator.kde.org/D14050). It Took a lot of changes for getting it merged in master, Thanks to Aleix and plasma-devel team for pointing out mistakes in the code. After getting it merged, The CI build started to fail, the main reason behind that was some error in findLIBFWUPD.cmake file and dependency issue in the CI system. I was amazed, with the power of CI as it caught a genuine mistake in the code. After fixing that, I added the request for installing the fwupd dependency on the CI system (https://phabricator.kde.org/T9305), I violated some community rule, but finally it got fixed thanks to bcooksley, (link: https://phabricator.kde.org/R857:1b0c2d39907a90bf6854fffafdab3d461fe8e69e), also thanks to adridg for pointing out the issue in my License in the cmake file, I fixed that in the (commit: 03aeb5ba2077c344b5de38ec37858a3603b07733) with some other fixes.
- Fwupd-Integration Merge Commit
- Fix Error in CMake to stop CI build fails
- Fwupd-Backend Spaces fix and variable uniformity
- Fwupd Backend Fwupd-Backend Fix, size, icon information, and cover one corner case
- fwupd discussion forum I recently posted on fwupd discussion forum regarding adding a virtual device to simulate fwupd!
GSoC Proposal Link
IRC: SharmaJiKaBeta , SharmaJiKaBeta_M