Commit Graph

7 Commits (d7d6e055e9d9d9554f59e919f37e0b6cd46b12a1)

Author SHA1 Message Date
Adrian Schmutzler d7d6e055e9 base-files: replace backticks by $(...)
This replaces deprecated backticks by more versatile $(...) syntax.

This does not touch lib/upgrade/nand.sh, as there replacement is
not trivial.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Koen Vandeputte 0f27096100 base-files: also generate configs when current is empty (FS#193)
Before a configuration is generated, an empty file is created to store
it in. (required by UCI)

If something happens during config generation
(power cut, interruption, ..) an empty file exists and it is never
regenerated again, causing some daemons to fail starting
(NTPD, logread, ..)

Fix this by also generating new configs if a critical file
is empty.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Jonas Gorski 780ccbf9f1 base-files: board_detect: allow specifying the generated file
Allow passing a filename to change the location of the generated
board.json.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski e934a129f0 base-files: let config_generate call board_detect
Instead of board_detect generating the config as a side effect, let
config_generate call board_detect as needed.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jo-Philipp Wich b98f78b1c1 base-files: rework config generation logic
Now that config_generate is able to generate the entire /etc/config/system
from scratch we can apply the same logic as used for /etc/config/network;
when the configuration file exists already then do not do anything, else
generate it from the values provided by /etc/board.json .

In order to facilitate that move the file existance checking inside
/bin/config_generate and call it unconditionally from /bin/board_detect.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
John Crispin 9ba6cd186a base-files: fix inverse logic in board_detect script
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42220
10 years ago
John Crispin 562d9f9582 base-files: add a hardware detection layer
this allows targets to use the new uci-default helper which will generate
a file called /etc/board.json. a tool called /bin/config_generate can then
be used to generate the default uci settings.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42185
10 years ago