First boot script (for example network settings)


#1

Hi,

is there a way to add a “first boot script” to Resin.io generated image? Some networks require for example static ip and or proxy to be set and on-premises installations would be much easier using a first boot script that asks these parameters from the user.

I know that it is possible to setup networking in the image, but this requires too many steps (if a novice user is considered). Target devices are NUCs without wifi support.


#3

Hi,

Would https://github.com/resin-io/resin-wifi-connect be helpful for you?


#4

There is currently no framework in place to trigger this kind of on-first-boot script.
You could, before executing your feature logic, check for the existence of a valid configuration file in /data and conditionally execute some configuration logic. This /data exists per device, per application, but is persistent between updates.


#6

Nope, sorry. Devices do not have WIFI, so captive WIFI portal is not an option. Of course one could use a usb stick, but that might be somewhat error prone.


#7

@sqweelygig: is it possible to alter host network settings in application, for example, using dbus?


#8

It is possible to set network settings from inside the application. Can you provide a little more detail about your device and its environment? What sort of i/o does it have?


:speech_balloon:


#9

IMO, it’s far easier to use address reservations on the DHCP server rather than setting static addresses on the device. Most DHCP servers I’ve come across support this.
If you’re not familiar, you map a specific IP addresses to a MAC address on the DHCP server. That way, even though the device uses DHCP, it always gets the same address.