Comment 2 for bug 1978939

Revision history for this message
Ondrej Kubik (ondrak) wrote :

I made progress to at least start the choor with following change:
https://github.com/kubiko/snapd/commit/7bebc919789e3696e14eb1df6c45dfd70eb20c2b
however this fails later on when snapd tries to run mount and unsquashfs binaries

patch.go:64: Patching system state level 6 to sublevel 3...
daemon.go:247: started snapd/2.56+git1056.gdb27d5e (series 16; devmode) ubuntu-core/20 (armhf) linux/5.4.0-113-generic.
main.go:129: system does not fully support snapd: cannot mount squashfs image using "squashfs": fork/exec /usr/bin/mount: no such file or directory
daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
devicemgr.go:321: no ubuntu-save mount
devicemgr.go:789: preload verified gadget metadata from seed failed: cannot run unsquashfs: fork/exec /usr/bin/unsquashfs: no such file or directory
cannot run daemon: state startup errors: [cannot obtain snap-seccomp version information: fork/exec /usr/lib/snapd/snap-seccomp: no such file or directory]
error: error running snapd in preseed mode: exit status 1

So only way here to really get it working would be mounting binfmt_misc
mount binfmt_misc -t binfmt_misc <chroot>/proc/sys/fs/binfmt_misc/
and then making qemu-*-static available inside the chroot. Bad thing it needs to be at the path set in binfmt_misc, so without wrecking host machine this would mean /usr/bin/qemu-*-static
but since chroot root is base snap, it's read only, so not really sure what is the right approach here....