Skip to content

Commit 4a5e360

Browse files
committed
snap: Need separate connection for each hidraw device
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 5615410 commit 4a5e360

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,16 @@ You can find lots of examples in [EXAMPLES.md](./EXAMPLES.md).
4040

4141
#### Snap Interfaces
4242

43-
The snap uses strict confinement. After installing, connect the required interfaces
44-
to allow access to the hardware:
43+
The snap uses strict confinement. Several interfaces (`cros-ec`, `hidraw`) require
44+
store assertions or a gadget snap to provide slots, which are not available on
45+
standard desktop systems. For local testing, install with `--devmode`:
46+
47+
```sh
48+
sudo snap install --dangerous --devmode framework-tool_*.snap
49+
```
50+
51+
When installed from the snap store (with proper assertions), connect the required
52+
interfaces to allow access to the hardware:
4553

4654
```sh
4755
# Required for most functionality (EC communication)

contrib/snap.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,19 @@ snapcraft clean
2424

2525
## Installing Locally
2626

27-
Install the locally built snap (bypasses store signature check):
27+
Several interfaces (`cros-ec`, `hidraw`) require store assertions or a gadget
28+
snap to provide slots, which are not available on standard desktop systems.
29+
For local testing, install with `--devmode` to bypass confinement:
2830

2931
```sh
30-
sudo snap install --dangerous framework-tool_*.snap
32+
sudo snap install --dangerous --devmode framework-tool_*.snap
3133
```
3234

3335
## Connecting Interfaces
3436

35-
The snap uses strict confinement, so hardware interfaces must be connected
36-
manually after install:
37-
38-
```sh
39-
for plug in cros-ec hardware-observe hidraw raw-usb block-devices io-ports-control physical-memory-observe; do
40-
sudo snap connect framework-tool:$plug
41-
done
42-
```
37+
See the [Snap Interfaces](../../README.md#snap-interfaces) section in the README
38+
for the full list of interface connect commands (applicable when installed from
39+
the snap store with proper assertions).
4340

4441
Verify the connections:
4542

snap/snapcraft.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ grade: stable
2525
confinement: strict
2626
compression: lzo
2727

28-
# /dev/cros_ec needs ioctl access, which requires custom-device interface.
29-
# This needs a store assertion for the slot. For local testing use --devmode.
28+
# custom-device needs a store assertion for the slot.
29+
# hidraw slots must be provided by the core or gadget snap.
30+
# For local testing use --devmode to bypass these restrictions.
3031
plugs:
3132
cros-ec:
3233
interface: custom-device

0 commit comments

Comments
 (0)