User Tools

Site Tools


docs:guide-developer:uci-defaults

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
docs:guide-developer:uci-defaults [2016/11/13 17:59]
bobafetthotmail [UCI Defaults]
docs:guide-developer:uci-defaults [2018/06/14 05:13] (current)
hnyman clarify
Line 4: Line 4:
  
 //LEDE// relies on UCI, the //Unified Configuration Interface//,​ to configure its core services. UCI Defaults provides a way to preconfigure your images, using UCI. //LEDE// relies on UCI, the //Unified Configuration Interface//,​ to configure its core services. UCI Defaults provides a way to preconfigure your images, using UCI.
 +
 +To set some system defaults the first time the device boots, create a script in the folder /​etc/​uci-defaults/​
 +
 +All scripts in that folder are automatically executed by /​etc/​init.d/​boot ​
 +  * If they exit with code 0 they are deleted afterwards. ​
 +  * Scripts that exit with non-zero exit code are not deleted and will be re-executed at the next boot until they also successfully exit.
 +
 +In a live router you can see the existing uci-defaults scripts in /​rom/​etc/​uci-defaults , as /​etc/​uci-defaults itself is typically empty (after all scripts have been run ok and have been deleted).
 +
 +uci-defaults scripts can be created by packages or they can be inserted into the build manually as custom files.
  
 ==== Integrating custom settings ==== ==== Integrating custom settings ====
  
-You can preload custom settings by adding batch scripts containing UCI commands into the ''/​files/​etc/​uci-defaults''​ directory. The path is identical for the buildroot and the image generator. The scripts will be run **after** the flashing process - in case of upgrading, that also includes appending the existing configuration to the JFFS2 partition (mounted as ''/​overlay''​).Scripts should not be executable. To ensure your scripts are not interfering with any other scripts, make sure they get executed last by giving them a high prefix (e.g. //​zzzz_customisations//​). A basic script could look like this:+You can preload custom settings by adding batch scripts containing UCI commands into the ''/​files/​etc/​uci-defaults''​ directory. The path is identical for the buildroot and the image generator. The scripts will be run **after** the flashing process - in case of upgrading, that also includes appending the existing configuration to the JFFS2 partition (mounted as ''/​overlay''​). Scripts should not be executable. To ensure your scripts are not interfering with any other scripts, make sure they get executed last by giving them a high prefix (e.g. //​zzzz_customisations//​). A basic script could look like this:
  
 <​code>​ <​code>​
docs/guide-developer/uci-defaults.txt · Last modified: 2018/06/14 05:13 by hnyman