Skip to content
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 Snap execute commands in the system #74

Open
guyluz11 opened this issue Oct 11, 2020 · 1 comment
Open

Make Snap execute commands in the system #74

guyluz11 opened this issue Oct 11, 2020 · 1 comment
Labels
enhancement New feature or request hacktoberfest Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ hacktoberfest 2020 Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ help wanted Extra attention is needed

Comments

@guyluz11
Copy link
Member

guyluz11 commented Oct 11, 2020

Currently we install inside the snap (package manager) the WiringNP (an GPIO access library for NanoPi to control the device pins).
This is blocking us from supporting more devices with different GPIO access library like the one for Raspberry Pi WiringPi.

Edit: the rest of the issue is no longer the plan for the fix, jump to here for the correct plan on how to fix this.

So we want to link the gpio inside the snap into the gpio library outside of it that installed by default on these devices.
This way when running the gpio in the terminal inside our software in the snap it will just call the gpio outside and work because they will be linked.

The gpio is executable that we can use from the terminal.

I have created a "new topic" in the snapcraft.io
https://forum.snapcraft.io/t/running-executable-that-located-out-side-of-the-snap/20492

This is our snapcraft.yaml file.

If you have any questions, or want to reproduce the process to test if you fixed it please contact me in our Discord server

@guyluz11 guyluz11 added enhancement New feature or request hacktoberfest Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ hacktoberfest 2020 Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ help wanted Extra attention is needed labels Oct 11, 2020
@guyluz11
Copy link
Member Author

As pointed out in the forum we cannot point the gpio inside the snap into the gpio outside of it due to Snap’s security confinement.

We will go with answer number two by ogra:

"
use two parts i.e. wiringpi-rpi, wiringpi-nano and install them into different locations inside the snap ($SNAP/lib/wiringpi-rpi, $SNAP/lib/wiringpi-nano) …

then use a command-chain wrapper to detect which device you are on (using the hardware-observe interface and read from /proc/cpuinfo) to adjust LD_LIBRARY_PATH to contain the specific dir for the device …
"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ hacktoberfest 2020 Support Hacktoberfest open source event https://hacktoberfest.digitalocean.com/ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant