Avoiding a preloaded image device restart as soon as it connects

We have a preloaded device that after connecting immediately restarts. We don’t want this behavior for several reasons.

We think this is due to applying a new boot config that it’s getting from balena cloud. several “Applying boot config” (see below).

Question: Is there a way to preload everything and avoid a restart? Or stop or delay the restart?

Applying configuration change {“SUPERVISOR_POLL_INTERVAL”:“900000”,“SUPERVISOR_DELTA”:“1”,“SUPERVISOR_DELTA_VERSION”:“3”}
Applied configuration change {“SUPERVISOR_POLL_INTERVAL”:“900000”,“SUPERVISOR_DELTA”:“1”,“SUPERVISOR_DELTA_VERSION”:“3”}
Applying boot config: {“disable_overscan”:“1”,“gpu_mem”:“256”,“avoid_warnings”:“1”,“disable_splash”:“1”,“dtoverlay”:[“vc4-kms-v3d”],“dtparam”:[“i2c_arm=on”,“spi=on”,“audio=on”]}
Applied boot config: {“disable_overscan”:“1”,“gpu_mem”:“256”,“avoid_warnings”:“1”,“disable_splash”:“1”,“dtoverlay”:[“vc4-kms-v3d”],“dtparam”:[“i2c_arm=on”,“spi=on”,“audio=on”]}
Applying boot config: {}
Applied boot config: {}

Hi, welcome to the forums and sorry for the delayed response. Something you could try is to use a pre-register/pre-load workflow. Using the CLI or dashboard you can pre-register a device and set the right combination of values through environment variables, then using the CLI balena preload <uuid> command you can create an image that will have the right target state as specified from the cloud.
On boot, the device’s preloaded state will match the cloud’s target state so the device will not reboot.
Let us know if the above workflow works for you.