getsolus / discover

KDE and Plasma resources management GUI
https://invent.kde.org/plasma/discover
0 stars 0 forks source link

Drivers Testing #1

Open joebonrichie opened 5 months ago

joebonrichie commented 5 months ago

How to test:

There are two versions of this patch. First one is the https://github.com/getsolus/discover/tree/drivers-appstream branch, that targets Discover v5.15.80. The second one targets v5.15.10, which is the version Solus currently ships and it's only available as a tarball. \ The following steps explain how to install a test release of the modified Discover v5.15.10 .eopkg archive.

  1. On a Solus machine (ideally a virtual machine, I don't take any blame for non-working systems), switch to the Unstable repository by issuing:
    sudo eopkg ar Unstable https://packages.getsol.us/unstable/eopkg-index.xml.xz
    sudo eopkg disable-repo Solus
    sudo eopkg up
  2. Download a Discover .eopkg archive from here https://shared.getsol.us/livingsilver94 and install it.
  3. Launch plasma-discover. You should see some drivers in "Hardware Divers" section.
  4. If no drivers appear specifically for your system in "Drivers For Your Device", you can create a fake driver.

    1. Save the following XML file as /usr/share/app-info/xmls/fakerepo.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <components origin="redaril.me" version="0.8">
      
      <component type="driver">
      <id>me.redaril.nano</id>
      <name>Redaril Nano</name>
      <summary>Fake Nano as a Driver</summary>
      <description>
          <p>
          Fake Nano as a Driver
          </p>
      </description>
      <url type="homepage">http://www.nvidia.com/Download/index.aspx</url>
      <metadata_license>CC0-1.0</metadata_license>
      <project_license>LicenseRef-proprietary:NVIDIA</project_license>
      <pkgname>nano</pkgname>
      
      <developer id="nvidia.com">
          <name>NVIDIA Corporation</name>
      </developer>
      
      <provides>
          <modalias>pci:v00001022d000014DBsv00001022sd00001453bc06sc04i00</modalias>
      </provides>
      </component>
      
      </components>
    2. Run find /sys -name modalias -exec cat {} \;. Choose any modalias you want from the list and replace a few characters with a single *. For example, the modalias above may become pci:v00001022d*14DBsv*sd00001453bc06sc04i00
    3. Replace the modalias above with the one you created.
    4. rm -rf ~/.cache/appstream.
    5. Now relaunch plasma-discover.
livingsilver94 commented 5 months ago

Here are the patches rebased against the currently shipped KDE Discover, in Solus:

Edited. No longer relevant.

livingsilver94 commented 5 months ago

I created a fake "nano" driver (yes, it's based on the nano editor) which matches a modalias I got from my sysfs. I then created a fake appstream repository inside /usr/share/app-info/xmls with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<components origin="redaril.me" version="0.8">

<component type="driver">
  <id>me.redaril.nano</id>
  <name>Redaril Nano</name>
  <summary>Fake Nano as a Driver</summary>
  <description>
    <p>
      Fake Nano as a Driver
    </p>
  </description>
  <url type="homepage">http://www.nvidia.com/Download/index.aspx</url>
  <metadata_license>CC0-1.0</metadata_license>
  <project_license>LicenseRef-proprietary:NVIDIA</project_license>
  <pkgname>nano</pkgname>

  <developer id="nvidia.com">
    <name>NVIDIA Corporation</name>
  </developer>

  <provides>
    <modalias>pci:v00001022d000014DBsv00001022sd00001453bc06sc04i00</modalias>
  </provides>
</component>

</components>

Well, it works!

image

livingsilver94 commented 5 months ago

Oh, it doesn't match modaliases with a wildcard tho. I'll try to fix it.

livingsilver94 commented 5 months ago

Unless I'm completely dumb, glob matching of modaliases is broken in upstream code. Patch provided: https://github.com/ximion/appstream/pull/592

HonorableJudge commented 1 month ago

I need someone to revoke a couple people's Driver's License indefinitely