First steps - How to start your first freetz package¶
Info¶
The third example is for package nzbget. NZBget needs a few additional parameters, a small patch, and a library that is already part of Freetz. Also this package requires a lot of CPU and memory resources, and maybe only useful on the most powerful FritzBox models.
Build Environment¶
There are different platforms which you may use to build your package, but usually all involve Linux in some way. Currently Freetz-Linux looks to be the most updated choice.
Just use the latest freetz-linux availble. I used:
- freetz-linux 1.2.1 (with xz added with: sudo apt-get install xz-utils) (from revision 11347 the following is needed: sudo apt-get install libacl1-dev libattr1-dev libcap-dev) (from revision ??? the following is also needed: sudo apt-get install imagemagick)
Very helpful information on make-targets such as menuconfig, toolchain, precompiled, recover etc. may be retrieved in the HowTos section of the Freetz wiki.
Toolchain¶
The toolchain is built automatically with „make“ (see below).
~/freetz-trunk
.In make menuconfig, select your hardware type (e.g. 7170), and after setting the Level of user competence to Expert you can look around in ‚Toolchain options‘, but no changes are normally needed.
$ make menuconfig
Level of user competence (Expert) --->
Hardware type (7170) --->
Firmware language (en - international) --->
Toolchain options --->
No changes needed
Then create your toolchain:
$ make toolchain
(for older revisions:)
FINISHED: toolchain/kernel/ - glibc compiler for the kernel
toolchain/target/ - uClibc compiler for the userspace
(for later revisions:)
FINISHED: new download toolchains can be found in dl/
In order to build your new package manually (without integration in the freetz build system), you should see that your toolchain is also included in the search path.
File Structure¶
Below the file structure used in the build environment (cross-compile environment) e.g. Freetz-linux mentioned earlier.
make menuconfig
and cross-compile steps.make/<package>/Config.inmake/<package>/patches/*make/<package>/<package>.mk
lang
statements, to translate/select the target
language.usr/lib/cgi-bin/<package>/
is used for optional
extra cgi scripts.make/files/root/etc/default.<package>/<package>.cfgmake/files/root/etc/default.<package>/<package>_confmake/files/root/etc/default.<package>/<package>.savemake/files/root/etc/init.d/rc.<package>make/files/root/usr/lib/cgi-bin/<package>.cgimake/files/root/usr/lib/cgi-bin/<package>/*
Examples Binary Package¶
Configuration Handling¶
/var/flash/freetz/
.cat /var/flash/freetz > /var/tmp/config.tar
tar tf /var/tmp/config.tar
/var/tmp/flash
./tmp
is a symbolic-link (symlink) to /var/tmp
, so this makes
/tmp/flash/
is the same as /var/tmp/flash
# ls -al /tmp
lrwxrwxrwx 1 root root 7 Jan 12 01:56 /tmp -> var/tmp
/tmp/flash
is the location where all configuration data is
gathered. A look into this directory should let you recognize the
files also seen with the previous tar tf
command./mod/etc/default.<package>/<package>.cfg
.export <PACKAGE>_<VARIABLE1>=’<value1>’
export <PACKAGE>_<VARIABLE2>=’<value2>’
export <PACKAGE>_<VARIABLE3>=’<value3>’
.
.
.
export < PACKAGE>_<VARIABLEn>=’<valuen>’
/mod/etc/conf/<package>.cfg
/mod/etc/conf/<package>.cfg
containing the actual
values, and /mod/etc/default.<package>/<package>.cfg
with the
default values contain the same parameters, but not necessarily in the
same order.. /mod/etc/conf/<package>.cfg
/tmp/flash
.
This can be seen from the ‘.diff’ extension e.g.
/tmp/flash/<package>.diff
.modconf load <package>
modconf save <package>
modsave
modsave flash
|
Create the data
/mod/etc/conf/<package>.cfg
from the default conf file
/mod/etc/default.<package>/<pac
Create the data
/tmp/flash/<package>.diff from
the default conf file
/mod/etc/default.<package>/<pac
Initiate for each package
‚modconf save‘ and saves the
results located in ‘/tmp/flash’
to tffs (non-volatile memory)
Saves the content of
‘/tmp/flash/’ to tffs
(non-volatile memory)
|
Examples Web-Interface¶
Trouble shooting¶
- If you see during
make
ormake menuconfig
only dots appear you probably started creating a new package stucture, which is still unfinished. Just remove the unfinshed directory. - A failure like checking whether the C compiler (mipsel-linux-gcc -O2
-Wall -fomit-frame-pointer ) works… no
configure: error: installation or configuration problem: C compiler
cannot create executables. most likely point to a wrong PATH
environment setting.
Use
echo $PATH
for trouble shooting. This can be expected if you first manually compiled the package, and than add the package to Freetz and try to create an image, with the previous exports still present. A reboot might be the savest option.