Skip to content

<package>_conf

JBBgameich edited this page May 1, 2018 · 3 revisions

<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 | > if exist goto 3\ | (not seen yet) | | /tmp/flash/<pa | > most often the | | | ckage>_conf | > case\ | (not seen yet) | | exist it will be | >   | | | used to generate | | | | <package>.c | | | | onf | | | | 2. else the script | | | | /etc/default.< | | | | package>/<packa | | | | ge>_conf | | | | is executed which | | | | will generate | | | | <package>.c | | | | onf | | | | 3. If the optional | | | | /tmp/flash/<pa | | | | ckage>.conf.extra | | | | exist add it to | | | | the generated | | | | <package>.c | | | | onf | | | +-----------------------+-----------------------+-----------------------+

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.\

Clone this wiki locally