Permission Request for "custom-device" for "alienware-cli"

This is a request to be able to read and write ‘custom-device’ for access to the filesystem under ‘/sys/devices/platform/alienware-wmi/hdmi/’ and '/sys/devices/platform/alienware-wmi/rgb_zones/’ for the alienware-cli application.

The point of this application is to be able to give command line access to check and set the state of the HDMI port (passthrough from HDMI in port -> HDMI out port or PC -> HDMI out) and the LED lights RGB values for Alienware PCs on Linux. This needs read and write access, without write access connected the application is pointless, but just to this one part of the filesystem which only works on Alienware machines.

The custom-device interface is currently only able to be slotted by gadget snaps - and if an app snap plugs the interface it needs to have a corresponding slot provided by a gadget snap. As such it is not possible for an application snap to use custom-device to access arbitrary device files - there is some plans to try and make this available for regular application snaps to use in the future but currently this is not supported.

Instead a better option at this time would be to use system-files to get access to these paths.

Thank you Alex, I will take a look at that, do you think I would be able to get Auto-Connect on write for that once I have made the change?

That has been done. Let me know if you are happy with that

Hi, my build has been rejected without any information, could I get some guidance on this as to what is wrong? I thought that I was doing what was requested.

log in to dashboard.snapcraft.io, go to your snap and pick the last revision (there should be a red exclamation mark next to it). if you scroll down you should be able to expand the results of the upload check …

So a couple things - the current snap yaml has the following:

plugs:
  alienware-system-files:
    interface: system-files
    write:
    - /sys/devices/platform/alienware-wmi/hdmi/*
    - /sys/devices/platform/alienware-wmi/rgb_zones/*

As per the usual conventions, such a system-files plug should instead be called sys-devices-platform-alienware-wmi so that it is more obvious to users what is being granted - and note it is invalid to use the * glob - instead you can just leave these with a trailing / which is interpreted to mean all files within this directory, ie. this should be changed to:

plugs:
  sys-devices-platform-alienware-wmi:
    interface: system-files
    write:
    - /sys/devices/platform/alienware-wmi/hdmi/
    - /sys/devices/platform/alienware-wmi/rgb_zones/

+1 from me for the use of such a named system-files plug.

Thank you, that was helpful

Alex

Not adding the * glob gives me the following error that I cannot find information online: invalid path: /sys/devices/platform/alienware-wmi/rgb_zones/ lint-snap-v2_system-files_path (write)

Is this because this is not a valid path on the build server? Is it because there are two paths?

Alec

Oh sorry, my mistake - you need to remove the trailing /:

plugs:
  sys-devices-platform-alienware-wmi:
    interface: system-files
    write:
    - /sys/devices/platform/alienware-wmi/hdmi
    - /sys/devices/platform/alienware-wmi/rgb_zones

Thank you, just back to the human review requirement now.

+1 from me as well for granting auto-connect of system-files with write access to /sys/devices/platform/alienware-wmi/hdmi and /sys/devices/platform/alienware-wmi/rgb_zones since this is needed for the app to properly operate as explained. +2 votes for, 0 votes against. This is now live.

Thank you Snapcrafters!