Snapd causes corruption on upgrade

Thanks a lot for the image. I looked at it using the fatcat tools and it looks like the issue is similar to: How to figure out why ubuntu core keeps restarting

Here is the outcome:

# fatcat  /dev/mapper/loop12p1  -l /
Listing path /
Directory cluster: 2
f 30/4/2018 14:18:20  UBOOT.ENV                      c=18534 s=131072 (128K)
f 0/0/1980 00:00:00  uboot.env                      c=10376 s=131072 (128K)

When I look at the two files I see:

uboot.env (lower-case):

# fatcat /dev/mapper/loop12p1 -R 10376|strings|grep snap_
loadinitrd=load ${target} ${devnumber}:${partition} ${initrd_addr} ${snap_kernel}/${initrd_file}; setenv initrd_size ${filesize}
loadkernel=load ${target} ${devnumber}:${partition} ${loadaddr} ${snap_kernel}/${kernel_file}
snap_core=core_4409.snap
snap_kernel=pi2-kernel_51.snap
snap_mode=trying
snap_try_core=core_4489.snap
snap_try_kernel=pi2-kernel_52.snap

uboot.env (upper case):

snap_core=core_4409.snap
snap_kernel=pi2-kernel_51.snap
snap_mode=try
snap_try_core=core_4489.snap
snap_try_kernel=pi2-kernel_52.snap

This mismatch explains why the automatic rollback is not working.