First Boot
This page documents the provisioning steps that run the first time OpenNMC starts.
Expected Flow
On first boot the system should:
- boot from the active root slot
- create the persistent
userdatapartition after the last root partition - mount
userdata - bind
/homeonto persistent storage underuserdata - provision the onboard ESP32 if it is still blank or unprovisioned
- mark the booted RAUC slot as good once the system is up
The init-script sequence is:
S20userdata-partS21home-on-userdataS25espflashS90rauc-mark-good
BusyBox init runs these scripts in numeric order during system startup.
The first managed login path is the console root account, after which the operator sets the password of the default admin user and can use the web UI.
Data That Should Survive Updates
- datalogger data
- configuration files
- any user content explicitly stored in
userdata /homevia the bind mount on persistent storage
During RAUC slot updates, the following existing data is copied forward into the new rootfs:
/etc/hostname/etc/NetworkManager/etc/ssh/etc/nut/var/lib/seedrng
The user migration hook also preserves managed users, groups, and passwords for local accounts with UID >= 1000.
No additional per-user directories are migrated by the current hooks beyond the account database and copied config paths.
Implementation
userdatais created bysgdisk -N=4 /dev/mmcblk1and formatted as ext4, so its size is the remaining free space after partition 3- the ESP32 flash step is automatic unless the factory-flash script determines the module is already provisioned
- the RAUC slot hook chain is driven by
/etc/rauc/pre-install.sh,/etc/rauc/post-install.sh, and the hooks under/etc/rauc/migrate.d