snap prepare-image fails with qemu-user-static
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
snap prepare-image with preseed option have to run natively as part of the preseed steps is executing snapd from the image itself. This means cross image build are not possible.
This brings complication how to build images. One of the proposed solutions is use of the emu-user-static
This itself has some other problems as auto binfmts detection is not enabled by default for arm and aarch64 (on x86_64) machines.
So I get following error:
preseeding part fails with:
starting to preseed UC20+ system: /tmp/preseed-
chroot: failed to run command ‘/usr/lib/
error: error running snapd in preseed mode: exit status 127
After enabling auto detecting with following steps: https:/
I get following error:
starting to preseed UC20+ system: /tmp/preseed-
chroot: failed to run command ‘/usr/lib/
error: error running snapd in preseed mode: exit status 126
More testing and this is a bit more complicated, mainly because our chroot is based on core snap. /github. com/kubiko/ snapd/commit/ 7bebc919789e369 6e14eb1df6c45df d70eb20c2b
with the following change I was able to at least start the chroot
https:/
however chroot is still not fully working, it fails when executing other binaries, see log:
2022/06/16 16:25:20.241252 daemon.go:247: started snapd/2. 56+git1056. gdb27d5e (series 16; devmode) ubuntu-core/20 (armhf) linux/5. 4.0-113- generic. unsquashfs: no such file or directory snapd/snap- seccomp: no such file or directory]
2022/06/16 16:25:20.252976 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
2022/06/16 16:25:20.253874 daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
2022/06/16 16:25:20.268111 devicemgr.go:321: no ubuntu-save mount
2022/06/16 16:25:20.554639 devicemgr.go:789: preload verified gadget metadata from seed failed: cannot run unsquashfs: fork/exec /usr/bin/
cannot run daemon: state startup errors: [cannot obtain snap-seccomp version information: fork/exec /usr/lib/