I build an appliance image for a Raspberry Pi-based device without keyboard input, based on a slightly customized Ubuntu Core 18 gadget. The appliance does not have internet access until the user plugs in LAN / provides WiFi credentials via a hotspot setup. My gadget configures snapd
with a refresh timer of 03:00-05:00/3
– i.e. max. three times between 03-05am. However, snapd auto-refreshes snaps outside that window in the following scenario:
- image is used on Raspberry Pi devices → no real-time clock
- image is built with and outdated version of a snap → would be refreshed by snapd
- image is pre-booted (see below for details) without internet access → no NTP / time sync opportunity
- during setup, I set the system time from the user’s browser time → system time jumps from whenever the image was created to the current timestamp
Is it expected behavior for snapd to refresh immediately, even if the current time is not in the 3-5am window? I guess it comes down to this sudden clock jump and Epoch timestamps, but want to confirm this hunch.
Follow-up: Would this still occur if the image is not pre-booted, but otherwise identical (outdated snap, system clock off by days/weeks until provided during setup)
Reasons for pre-booting
At the moment, I run the first boot on one of our Pis, check if everything went ok and then dd
the final image from that installation. I know that pre-booting images is not supported and may have all sorts of side effects. Main reason is that our average user base would pull the plug during the initialization because it
- takes ~12min to complete
- shows a few error messages during snap installation (kiosk browser website is not yet available etc.) * and might fail in rare cases
- I want to enable swap, as there’s no automated way to do that AFAIK (Prepare-device hook questions | https://snapcraft.io/docs/supported-interfaces)