Is it possible to detect if ubuntu core system is running its first boot?

Hi , I want to do a certain process only during its first boot. How i can detect that it is the first boot?

is it from snapd changes?

There’s a few options available if you’re using a custom gadget snap:

  1. Add a prepare-device hook to your gadget.
  2. Add a cloud.conf file to your gadget with content something like:
    #cloud-config
    datasource_list: [NoCloud]
    runcmd:
      - /snap/mygadget/current/setup.sh
    
    This would then run a script setup.sh bundled as part of the gadget snap on init.
1 Like