First steps - How to start your first freetz package¶
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.
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)
The toolchain is built automatically with „make“ (see below).
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.
Below the file structure used in the build environment (cross-compile environment) e.g. Freetz-linux mentioned earlier.
make menuconfigand cross-compile steps.
langstatements, to translate/select the target language.
usr/lib/cgi-bin/<package>/is used for optional extra cgi scripts.
cat /var/flash/freetz > /var/tmp/config.tar
tar tf /var/tmp/config.tar
/tmpis a symbolic-link (symlink) to
/var/tmp, so this makes
/tmp/flash/is the same as
# ls -al /tmp
lrwxrwxrwx 1 root root 7 Jan 12 01:56 /tmp -> var/tmp
/tmp/flashis the location where all configuration data is gathered. A look into this directory should let you recognize the files also seen with the previous
export <PACKAGE>_<VARIABLE1>=’<value1>’ export <PACKAGE>_<VARIABLE2>=’<value2>’ export <PACKAGE>_<VARIABLE3>=’<value3>’ . . . export < PACKAGE>_<VARIABLEn>=’<valuen>’
/mod/etc/conf/<package>.cfgcontaining the actual values, and
/mod/etc/default.<package>/<package>.cfgwith the default values contain the same parameters, but not necessarily in the same order.
/tmp/flash. This can be seen from the ‘.diff’ extension e.g.
modconf load <package>
modconf save <package>
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)
- If you see during
make menuconfigonly 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
echo $PATHfor 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.