Wiki:help/howtos/development/developer_information/package_development_start/<package>_conf

<package>_conf

This is an optional script to generate a config file (e.g. <package>.conf) that the package expects as argument containing the configuration parameters.

In the build environment located at:

~/freetz-trunk/make/files/root/etc/default.<package>/<package>_conf

on router located at:

/mod/etc/default.<package>/<package>_conf


The config data (e.g. <package>.conf) will be created as part of the rc.<package> script, before the daemon is started according the following guideline.

  1. If script /tmp/flash/<package>_conf exist it will be used to generate <package>.conf
  2. else the script /etc/default.<package>/<package>_conf is executed which will generate <package>.conf
  3. If the optional /tmp/flash/<package>.conf.extra exist add it to the generated <package>.conf

if exist goto 3
most often the case
 

(not seen yet)

(not seen yet)

Lets look at an existing freetz package.
We can do this easily on the build environment.
For this lets select the package radvd.

On the build environment:

cd ~/freetz-trunk/make/radvd/files/root/etc/default.radvd/

We need to export some variables that the script expects:

export RADVD_ADDRESS='a:b:c::1/64'
export RADVD_CLIENTS='fe80::aaaa:bbbb:cccc:dddd'
export RADVD_ENABLED='yes'
export RADVD_FORWARD='no'
export RADVD_INTERFACE='lan'
export RADVD_MTU='0'
export RADVD_PREFIX='x:y:z::/64'
export RADVD_SETIPV6='yes'

Now we can execute the <package>_conf:

./radvd_conf

This should generate the following on standard out:

interface lan
{
        AdvSendAdvert on;
        AdvLinkMTU 0;
        prefix x:y:z::/64
        {

        };
        clients
        {
        fe80::aaaa:bbbb:cccc:dddd;
        };
};

This is what Radvd expects as config file.

Using find ./*/files/root/etc/default.*/ -name *_conf from ~/freetz-trunk/make gives you a list of all scripts already included in freetz.
Use these as example for creating your own script.

zuletzt geändert vor 4 Jahren Zuletzt geändert am 26.01.2014 19:49:04