Snap on Arch/Liri OS

zyga
mborzecki
backlog

#1

Hey, tried to install snapd on Liri OS, which is based on Arch.
I followed the guide on the Arch wiki to set it up.
The /snap directory is present.
Unfortunately I ran into issues similar to those reported in this thread:
Snaps would install, even ones with classic confinement. Trying run snap run hello-world or any other snap resulted in the following error message, though:

cannot locate core snap: no such file or directory

As I saw that snapd is looking for the ID from /etc/os-release I tried to change it to arch (from lirios). This solved the error.
Now snapd was looking for snaps in /var/lib/snapd/snap, but ln -s /snap /var/lib/snapd/snap fixed that.

All error messages are gone now, but trying to snap run hello-world or any other snap package just silently hangs.

I’m myself fairly new to Arch but is there anything I can do to try/help debug/fix those issues? Thanks :slight_smile:


#2

@zyga This looks like the same issue you resolved with Manjaro?


#3

Yes. I’ll make a PR shortly


#4

Hey @TimSueberkrueb

Could you please try to rebuild the snapd package with a patch proposed here https://github.com/snapcore/snapd/pull/3957 and see what you get?

Please use https://github.com/snapcore/snapd/releases/download/2.27.5/snapd-2.27.5-1-arch-srcpkg.tar.gz as the base source package (just update it to 2.27.6 and drop that patch).

Unfortunately we cannot update the stale package in Arch directly (arch trusted users are needed to help us with that).


#5

Hey, @zyga thanks very much for the quick response!
I think the ID is lirios, not liri. Here’s the /etc/os-release:

NAME="Liri OS"
ID=lirios
PRETTY_NAME="Liri OS"
ANSI_COLOR="0;36"
HOME_URL="https://liri.io"
BUG_REPORT_URL="https://github.com/lirios/lirios/issues"

#6

Ah thank you! I pushed the updated patch over that PR (and the ISO just finished downloading)


#7

I will try to build it as you described now but it will probably take me some time (as I said I’m fairly new to Arch :)).


#8

@zyga I get those errors: http://paste.ubuntu.com/25592841/ when running makepkg.


#9

Ah, those are already fixed in master.

Can you add one more patch pleae: https://github.com/snapcore/snapd/pull/3888/commits/7474da4cb83e6e87b7c7eb2601b9368806f23c42


#10

@zyga hooray :smiley:

sudo snap install hello
snap run hello

Works! Let me try some other snaps. Thanks a lot!


#11

@zyga I cannot install classic snaps. What would we have to do to enable classic snaps on Liri OS?


#12

You’d have to make a small tweak where snaps are installed in /snap.

Please look at cmd/autogen.sh, arch passes --with-snap-mount-dir=, for Liri copy the arch line but remove that override. Remove that from packaging (when ./configure is called)

Please look at cmd/dirs.go and remove lirios from the list that uses the override.

That should be it, give it a try and let me know :slight_smile:


#13

Thanks for your help :slight_smile: I tried that and installed snap install --beta --classic snapcraft. Trying to start it however leads to the error message: execv failed: No such file directory.


#14

Can you try something else (e.g. atom). Also, can you please show.

SNAP_CONFINE_DEBUG=yes /snap/bin/atom

#15
$ SNAP_CONFINE_DEBUG=yes /snap/bin/atom
DEBUG: security tag: snap.atom.atom
DEBUG: executable:   /usr/lib/snapd/snap-exec
DEBUG: confinement:  classic
DEBUG: base snap:    core
DEBUG: skipping sandbox setup, classic confinement in use
DEBUG: creating user data directory: /home/tim/snap/atom/36
DEBUG: loading bpf program for security tag snap.atom.atom
DEBUG: read 64 bytes from /var/lib/snapd/seccomp/bpf//snap.atom.atom.bin
DEBUG: raising privileges to load seccomp profile
DEBUG: dropping privileges after loading seccomp profile
DEBUG: execv(/usr/lib/snapd/snap-exec, /usr/lib/snapd/snap-exec...)
DEBUG:  argv[1] = atom
execv failed: No such file or directory

#16

This looks good so far. Is /usr/lib/snapd/snap-exec present?


#17

@zyga ._. no it’s not, odd.


#18

Hmm, can you list the files you have in the package please? Did you derive it from the 2.27.5 package that was present in the github release page?


#19

Yeah, I tried to follow your instructions. Here’s the list of files: http://paste.ubuntu.com/25606354/.


#20

Looking at that I don’t see the snap-exec binary. Can you publish your packaging somewhere to compare with the Arch package I made earlier please?