Question about /writable being persisted on image dd

Hi all,

lately i ve been working on creating a supposed “flasher gadget” that is sole purpose is to use the snapcraft dump plugin to include a img file inside of it and upon launch utilize cloud-init to dd the image to the disk on device.

This is the grub menu entry of the image that is being dumped and dd’ed.

menuentry "$snap_menuentry" {
    search --label $label --set=writable
    loopback loop ($writable)/system-data/var/lib/snapd/snaps/$snap_kernel    
    linux (loop)/kernel.img $cmdline
    initrd (loop)/initrd.img
}

When i dd the image and restart the device without any usb key attached.
My image works and it boots up, but there is some issues related to it.

This is lsblk output without anything attached to the device:

A82747E7-8A0D-4EF3-ADDD-AEB09D96B316

I think i am having trouble with /writable being persisted and this causes the following:
when i re attach the usb key and boot up, consecutive flashes are no go, the device which is ubuntu core 16 always falls back to booting from disk…

It sounds like the issue here is that you installed Ubuntu Core on a device, and after doing so, it fails to boot using a USB stick afterwards? Did you adjust your BIOS/UEFI boot order settings such that USB devices come before the on disk devices?