I have a custom armhf board with custom gadget and kernel snap. All that assembled with ubuntu-image.
denisnone@localhost:~$ uname -a
Linux localhost.localdomain 4.10.1-dac_cpu+ #1 SMP Tue Apr 25 11:27:22 CEST 2017 armv7l armv7l armv7l GNU/Linux
This is the initial point before refresh:
denisnone@localhost:~$ snap info core
name: core
summary: "snapd runtime environment"
publisher: canonical
contact: snappy-canonical-storeaccount@canonical.com
description: |
The core runtime environment for snapd
type: core
tracking: candidate
installed: 16-2 (1690) 70MB -
refreshed: 2017-04-11 12:29:57 +0000 UTC
channels:
stable: 16-2 (1580) 69MB -
candidate: 16-2 (1690) 70MB -
beta: 16-2 (1805) 71MB -
edge: 16-2 (1823) 70MB -
Running this:
denisnone@localhost:~$ snap refresh core --beta
Then it freezes on this stage:
[|] Setup snap "core" (1805) security profiles (phase 2)
The slash keeps spinning until finally scheduled reboot comes.
It reboots well but:
denisnone@localhost:~$ snap change 38
Status Spawn Ready Summary
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:02Z Download snap "core" (1805) from channel "beta"
Done 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Fetch and check assertions for snap "core" (1805)
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:07Z Mount snap "core" (1805)
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:05Z Stop snap "core" services
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:05Z Remove aliases for snap "core"
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:04Z Make current revision for snap "core" unavailable
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:04Z Copy snap "core" data
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:04Z Setup snap "core" (1805) security profiles
Undone 2017-05-01T13:39:06Z 2017-05-01T13:52:00Z Make snap "core" (1805) available to the system
Error 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Setup snap "core" (1805) security profiles (phase 2)
Hold 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Set automatic aliases for snap "core"
Hold 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Setup snap "core" aliases
Hold 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Start snap "core" (1805) services
Hold 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Clean up "core" (1805) install
Hold 2017-05-01T13:39:06Z 2017-05-01T13:51:59Z Run configure hook of "core" snap if present
......................................................................
Setup snap "core" (1805) security profiles
2017-05-01T13:52:00Z INFO cannot auto connect core:core-support-plug to core:core-support: (plug auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
2017-05-01T13:52:00Z INFO cannot auto connect alsa-utils:alsa to core:alsa: (slot auto-connection), existing connection state "alsa-utils:alsa core:alsa" in the way
2017-05-01T13:52:00Z INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
2017-05-01T13:52:00Z INFO cannot auto connect avahi:network to core:network: (slot auto-connection), existing connection state "avahi:network core:network" in the way
2017-05-01T13:52:00Z INFO cannot auto connect avahi:network-bind to core:network-bind: (slot auto-connection), existing connection state "avahi:network-bind core:network-bind" in the way
2017-05-01T13:52:00Z INFO cannot auto connect avahi:network-control to core:network-control: (slot auto-connection), existing connection state "avahi:network-control core:network-control" in the way
2017-05-01T13:52:00Z INFO cannot auto connect network-manager:network-setup-observe to core:network-setup-observe: (slot auto-connection), existing connection state "network-manager:network-setup-observe core:network-setup-observe" in the way
2017-05-01T13:52:00Z INFO cannot auto connect network-manager:ppp to core:ppp: (slot auto-connection), existing connection state "network-manager:ppp core:ppp" in the way
......................................................................
Make snap "core" (1805) available to the system
2017-05-01T13:40:24Z INFO Requested system restart.
......................................................................
Setup snap "core" (1805) security profiles (phase 2)
2017-05-01T13:40:24Z INFO Waiting for restart...
2017-05-01T13:43:41Z INFO Waiting for restart...
2017-05-01T13:48:41Z INFO Waiting for restart...
2017-05-01T13:51:59Z ERROR cannot finish core installation, there was a rollback across reboot[/details]
Then I issue a second reboot after refresh. But it finishes in initramfs.
[ 3.064006] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 3.097047] EXT4-fs (mmcblk0p3): couldn't mount as ext3 due to feature incompatibilities
[ 3.120599] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
mount: mounting /tmpmnt_writable/system-data/var/lib/snapd/snaps/core_1805.snap on /root failed: No such file or directory
[ 3.200996] UDF-fs: warning (device loop0): udf_fill_super: No partition found (2)
mount: mounting /tmpmnt_kernel/modules on /root/lib/modules failed: No such file or directory
mount: mounting /tmpmnt_kernel/firmware on /root/lib/firmware failed: No such file or directory
[ 3.242151] initrd: mounting /run
mount: mounting tmpfs on /root/run failed: No such file or directory
mount: mounting /tmpmnt_writable on /root/writable failed: No such file or directory
/init: line 9: can't create /root/etc/fstab: nonexistent directory
mount: mounting /root/writable/system-data/etc/systemd/system on /root/etc/systemd/system failed: No such file or directory
mount: mounting /root/writable/system-data/etc/machine-id on /root/etc/machine-id failed: No such file or directory
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/nfs-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: current directory on the same filesystem as the root: error 0
Target filesystem doesn't have requested /lib/systemd/systemd.
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
No init found. Try passing init= bootarg.
BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs)
What we see in snap directory: Only an old core snap:
(initramfs) cd /tmpmnt_writable/system-data/var/lib/snapd/snaps/
(initramfs) ls -al
drwxr-xr-x 11 4096 ..
-rw-r--r-- 2 708608 dac-cpu_x1.snap
-rw-r--r-- 2 4624384 network-manager_167.snap
drwxr-xr-x 2 4096 .
-rw-r--r-- 2 1097728 avahi_36.snap
-rw-r--r-- 2 6074368 alsa-utils_69.snap
-rw-r--r-- 1 70746112 core_1690.snap
-rw-r--r-- 2 67387392 maincontroller_x1.snap
-rw-r--r-- 2 221184 htop_71.snap
-rw-r--r-- 1 4096 classic_17.snap
-rw-r--r-- 1 26292224 dac-cpu-kernel_x1.snap
(initramfs)
Trying to hack it:
(initramfs) mv core_1690.snap core_1805.snap
(initramfs) reboot
And yes it boots, but complains about it:
denisnone@localhost:~$ snap info core
name: core
summary: ""
publisher: canonical
contact: snappy-canonical-storeaccount@canonical.com
description: |
tracking: candidate
installed: (1690) 0B broken
refreshed: 2017-04-25 09:49:16.783809299 +0000 UTC
channels:
stable: 16-2 (1580) 69MB -
candidate: 16-2 (1690) 70MB -
beta: 16-2 (1805) 71MB -
edge: 16-2 (1823) 70MB - [/details]
So basically what it does is harakiri. It can’t cure itself without intervention.
And interesting fact: I couldn’t get core snap refreshed not even once. And not only force refresh leads to death, but also when a new version of core comes out in a particular tracking channel. (No surprise) What can cause the problem? Kernel? Gadget? ubuntu-image?
I have a raspi3 and it switches cores and channels smoothly on it’s official image. It still hangs on “Setup snap “core” () security profiles (phase 2)”. But after reboot it’s on a new core snap.
The kernel is a zesty kernel from official Ubuntu repository from master branch. It couldn’t get xenial kernel working on my board, besides I need some improvements incorporated in linux 4.6-4.8, so 4.4 is not an option for me.