I’m having an issue I can’t explain when using ‘snap refresh’ related to the state of boot.sel. First, I’m using a Nitrogen i.MX 8M Plus platform with those 2 snaps:
Yesterday I made an update to the kernel (6) and generated a new core20 using ‘ubuntu-image’ as defined here:
The resulting image is working fine. The previous image I had with the previous kernel (5) is also working fine.
However, when trying to ‘snap refresh’ on a system that had the previous kernel (5) installed, the system fails to boot because of a “bad CRC”:
error: fallback kernel snap unusable: cannot open "/run/mnt/ubuntu-boot/uboot/ubuntu/boot.sel": bad CRC 4101280109 != 950455135
When looking into the boot.sel generated by snapd during the refresh, it does include a CRC32 of 4101280109 (0xf474916d) which I can compute again myself:
dd if=boot.sel.update of=boot.sel.update2 bs=4 skip=1 crc32 boot.sel.update2 f474916d
However, it looks like the original boot.sel generated so not use the same method to generate the CRC and clearly snapd computes it differently too. I’m unclear what needs to be done at this stage to fix the corrupted boot.sel but I don’t know where to go from here as snapd should be the one generating the boot.sel in all cases.