I've just uploaded a fix for this to the 18-armhf and 18-arm64 branches of the pi-gadget repo (tested on 3B+ and 3B, moving card between machines and confirming boot still operates but MAC address, and serial#, both change). Here's the commit for 18-armhf which I've cherry-picked over to the 18-arm64 branch:
This won't affect core20 which uses a rather different mechanism to core18 for boot state storage (doesn't re-write the entire environment, just stores a minimal separate state). I'll look into what we can do for core16 (I've just checked the image and my assumption from looking at the boot environment is that it's very likely the exact same thing).
I've just uploaded a fix for this to the 18-armhf and 18-arm64 branches of the pi-gadget repo (tested on 3B+ and 3B, moving card between machines and confirming boot still operates but MAC address, and serial#, both change). Here's the commit for 18-armhf which I've cherry-picked over to the 18-arm64 branch:
https:/ /github. com/snapcore/ pi-gadget/ commit/ d837f0cfcdc84b9 2b3de8a380bafd1 4e55e65f6a
This won't affect core20 which uses a rather different mechanism to core18 for boot state storage (doesn't re-write the entire environment, just stores a minimal separate state). I'll look into what we can do for core16 (I've just checked the image and my assumption from looking at the boot environment is that it's very likely the exact same thing).