-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make chip-tool command work without root privileges #17
Comments
A script could be used to bind mount In my option, the best approach to solve this issue is to implement path configuration via environment variables. This needs to be implemented upstream to avoid added snap maintenance complexity. Created an issue for it: project-chip/connectedhomeip#30790 |
I came across the following flag allowing overriding the temp directory of chip tool:
$ sudo chip-tool pairing <...> --storage-directory /var/snap/chip-tool/current/test
...
$ sudo tree /var/snap/chip-tool/
/var/snap/chip-tool/
├── 58
│ └── test
│ ├── chip_tool_config.alpha.ini
│ ├── chip_tool_config.ini
│ └── chip_tool_kvs
├── common
│ └── mnt
│ ├── chip_config.ini
│ ├── chip_counters.ini
│ ├── chip_factory.ini
│ └── chip_tool_config.ini
└── current -> 58
6 directories, 7 files Several other files do still get created at the original path. There are from the SDK, inline with the comment here, apart from the kvs file: chip-tool-snap/snap/snapcraft.yaml Lines 42 to 57 in b6dcc18
|
The
chip-tool
command installed by the snap requires root privileges to function. This is because the storage and config files are written under/mnt
, which is bind mounted on/var/snap/chip-tool/common/mnt/
. This directory is owned by the root user.This also makes it problematic to use the tool independently with different users.
Ideally, the storage and config paths should be user specific (e.g. read from
SNAP_USER_COMMON
). This is currently not easily achievable since the paths are set at compile time.The text was updated successfully, but these errors were encountered: