Preload new software version on existing image


We have an existing img that we’d like to update from time to time so when we build a new batch of devices, they would not need to upgrade (or would need a smaller upgrade) as they come online.

We tried to do the cli preload command on an existing image but it appears to have doubled in size.

Is there a way to do a new preload on existing image? or remove a preloaded app to allow up to load a new one into the image?

Thank you - very much appreciated.

Hey there, could you give a bit more detail about your use case? When you say existing image, do you mean an image you have already preloaded?

In the case where I wanted to create an up to date preloaded image I would start with the raw image again (i.e. a fresh balenaOS image without any application preloaded) and run the preload operation again. I don’t believe we have any method available to remove the preload from an image or to update the app contained within it but maybe @pdcastro might know! If you’re preloading the same application onto an image that you’ve already done it once it doesn’t sound like we’re doing the correct thing if the image doubles in size.

I would start with the raw image again

That’s right, the recommendation is to always start with a fresh, not-previously-preloaded image when running balena preload. For example, keep a fresh, not-preloaded .orig image file around that you can make copies of before preloading, e.g.:

$ cp my-app-image.img.orig my-app-image.img
$ balena preload my-app-image.img

To obtain a new fresh copy of an image, you can use balena os download or go through the process of adding a device through the web dashboard. If helpful, documentation can be found at Preloading and Preregistering.

Having said that, I am also aware of the following issue, which includes a hint about the --additional-space flag: Preloaded OS several times larger than expected · Issue #2043 · balena-io/balena-cli · GitHub