OpenWrt Forum Archive

Topic: How the LuCI config files in /etc/config function ?

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want some changes in the source code. But I have no idea about how the config files is called in /etc/config/ . How the hostapd call the files in the directory? Or How the settings are applied into the system? Am I clear? Welcome for the discussion.
Is there anyone know some about this ? Please help me with some clue? Thank you in advance.

(Last edited by Wandy on 27 Feb 2014, 04:42)

bluepuma wrote:

Maybe check the UCI documentation


Yeah I have check it but no answer was found. The passage is just some sort of introduction. What I want is how the uci system parse the config file in /etc/config/ and transform all these file into the config files of the system. I found the source code of UCI which is in C. I am reading it. Really a challenge for me.

Config files are transformed from UCI to native via shell scripts. Look in /etc/init.d - you'll find a bunch of scripts that read in UCI config files and output a program-specific config file, or call the program with the right flags.

aport wrote:

Config files are transformed from UCI to native via shell scripts. Look in /etc/init.d - you'll find a bunch of scripts that read in UCI config files and output a program-specific config file, or call the program with the right flags.


Yeah. That is helpful. Thank you so much~

Wandy wrote:
aport wrote:

Config files are transformed from UCI to native via shell scripts. Look in /etc/init.d - you'll find a bunch of scripts that read in UCI config files and output a program-specific config file, or call the program with the right flags.


Yeah. That is helpful. Thank you so much~


I still have some problems reading the scripts. There are some many variables which are upper. Are they global? It is hard to find where they originate from. Any idea about that?

Wandy wrote:
Wandy wrote:
aport wrote:

Config files are transformed from UCI to native via shell scripts. Look in /etc/init.d - you'll find a bunch of scripts that read in UCI config files and output a program-specific config file, or call the program with the right flags.

Yeah. That is helpful. Thank you so much~

I still have some problems reading the scripts. There are some many variables which are upper. Are they global? It is hard to find where they originate from. Any idea about that?

Give a clear refrence to what you talking about. Which script? Which variable?

(usually there are no global variables.)

hnyman wrote:
Wandy wrote:
Wandy wrote:

Yeah. That is helpful. Thank you so much~

I still have some problems reading the scripts. There are some many variables which are upper. Are they global? It is hard to find where they originate from. Any idea about that?

Give a clear refrence to what you talking about. Which script? Which variable?

(usually there are no global variables.)

Thank you for your reply. I am reading the /lib/wifi/*.sh scripts which I think parse the wireless configure file in /etc/config/wireless. But it is hard to catch the process.

Actually, I want to divide the option channel into two,channel1 and channel2 in /etc/config/wireless. Because the 802.11a and 802.11na work in the different frequency as 802.11b/g/ng does. If the wrong frequency is chosen. The router will be down. But the original interface just mix all the frequencies together. I just want to make a change about this. But I need the "channel1" and "channel2" parsed just the option "channel". So I need figure out the parsing process of the configure file by the shell.Then I can make some change and make channel1 and channel2 parsed smoothly. Am I understood?

The discussion might have continued from here.