root/trunk/freewrt/target/target.tex

Revision 3712, 3.0 kB (checked in by n0-1, 9 months ago)

Enhanced the documentation for the target/ part of the ADK.

Yes, this is incomplete and there is a bunch of TODO's. But
as nobody reads the developer-handbook anyway, this should not
be of any problem. ;)

Line 
1 \section{Target Compilation}
2
3 The following section will discuss how kernel and root filesystem are being
4 created and packed into appropriate formats for use with each target device.
5
6 \subsection{Kernel Compilation}
7
8 \subsubsection{General Kernel Cross Compiling Guide}
9
10 The Linux kernel supports being cross compiled for various architectures. For a
11 list of currently supported machine types, see the \file{arch/} subdirectory of
12 the kernel sources.
13
14 There are some prerequisites that need to be fulfilled:
15 \begin{itemize}
16         \item the directory containing the cross-toolchain must be contained in
17                 your \$\{PATH\} environment variable (best choice is at last position)
18         \item \command{make} needs to be called with \code{ARCH=MYARCH} as
19                 parameter, while \code{MYARCH} must be substituted with the
20                 destined architecture
21         \item if necessary, one can also specify \code{CROSS\_COMPILE=PFX} as
22                 additional argument to \command{make}, where \code{PFX} is
23                 something like \code{mipsel-linux-} (defaults to
24                 \code{\$\{ARCH\}-linux-})
25 \end{itemize}
26
27 Then configuring and compiling is straight forward:
28 \begin{Verbatim}[label=kernel cross compiling]
29 $ make ARCH=mips menuconfig
30 [...]
31 $ make ARCH=mips
32 \end{Verbatim}
33
34 \subsubsection{How The ADK Builds A Kernel}
35
36 \begin{itemize}
37 \item destined kernel version via makefile include from inside \file{target/linux/\$\{BOARD\}-2.\{4,6\}/Makefile}
38 \item kernel .config creation:  \file{target/Makefile}
39 \item howto update the static kernel config
40 \item kernel compilation (output of files, etc.)
41 \end{itemize}
42
43 \subsection{Image Creation}
44
45 \begin{itemize}
46 \item different image formats
47 \item image creation process for each format
48 \item kernel vs. nokernel targets
49 \end{itemize}
50
51 \subsection{Adding A New Kernel Version}
52
53 FreeWRT supports using a different kernel version for each target device. This
54 way it is possible to update the kernel used for one's favourite device without
55 (possibly) breaking all others using the same kernel major.
56
57 \begin{enumerate}
58         \item create a new subdirectory
59                 \file{target/linux/generic-\$\{KERNEL\_VERSION\}}
60         \item copy over and adapt a \file{Makefile} from one of the existing
61                 subdirectories, basically updating the MD5 sum (the ADK fetches
62                 the \file{tar.bz2} version)
63         \item update \$\{UNAME\_R\} for your device in \file{rules.mk}
64         \item make sure
65                 \file{target/linux/\$\{BOARD\}-\$\{KERNEL\_MAJOR\}/Makefile}
66                 includes the right files
67         \item update the static kernel config provided for your device
68                 %TODO: hint to the docs about it in this file, using \ref
69 \end{enumerate}
70
71 %\subsection{Updating The Static Kernel Config For A Device}
72
73 %\subsection{Adding A New Target Device}
74
75 % - target/linux/bla-2.X/{Config.in,Makefile} erstellen
76 % - target/linux/bla-2.X/patches befuellen (meistens)
77 % - target/linux/bla-2.X/kernelconfig erstellen (\ref)
78 % - target/Config.in erweitern
79 % - mk/targets.mk erweitern
80 %   - target_template
81 %   - arch-definition (optional)
82 % - target/image/bla erstellen
83 %   - Makefile aus target/image/rb/Makefile (oder so), anpassen
84
Note: See TracBrowser for help on using the browser.