[ar7] add Titan MTD partitionning support (#6632)
[openwrt.git] / docs / working.tex
1 The following section gives some tips and tricks on how to use efficiently
2 OpenWrt on a regular basis and for daily work.
3
4 \subsection{Compiling/recompiling components}
5
6 The buildroot allows you to recompile the full environment or only parts of it
7 like the toolchain, the kernel modules, the kernel or some packages.
8
9 For instance if you want to recompile the toolchain after you made any change to it
10 issue the following command:
11
12 \begin{Verbatim}
13 make toolchain/{clean,compile,install}
14 \end{Verbatim}
15
16 Which will clean, compile and install the toolchain. The command actually expands to the
17 following:
18
19 \begin{Verbatim}
20 make[1] toolchain/clean
21 make[2] -C toolchain/kernel-headers clean
22 make[2] -C toolchain/binutils clean
23 make[2] -C toolchain/gcc clean
24 make[2] -C toolchain/uClibc clean (glibc or eglibc when chosen)
25 \end{Verbatim}
26
27 Of course, you could only choose to recompile one or several of the toolchain components
28 (binutils, kernel-headers gcc, C library) individually.
29
30 The exact same idea works for packages:
31
32 \begin{Verbatim}
33 make package/busybox/{clean,compile,install}
34 \end{Verbatim}
35
36 will clean, compile and install buysbox (if selected to be installed on the final rootfs).
37
38 Supposing that you made changes to the Linux kernel, but do not want to recompile everything,
39 you can recompile only the kernel modules by issuing:
40
41 \begin{Verbatim}
42 make target/linux/compile
43 \end{Verbatim}
44
45 To recompile the static part of the kernel use the following command:
46
47 \begin{Verbatim}
48 make target/linux/install
49 \end{Verbatim}
50
51 \subsection{Using quilt inside OpenWrt}
52
53 OpenWrt integrates quilt in order to ease the package, kernel and toolchain
54 patches maintenance when migrating over new versions of the software.
55
56 Quilt intends to replace an old workflow, where you would download the new
57 source file, create an original copy of it, an a working copy, then try to
58 apply by hand old patches and resolve conflicts manually. Additionnaly, using
59 quilt allows you to update and fold patches into other patches easily.
60
61 Quilt is used by default to apply Linux kernel patches, but not for the other
62 components (toolchain and packages).
63
64 \subsubsection{Using quilt with kernel patches}
65
66 Assuming that you have everything setup for your new kernel version:
67 \begin{itemize}
68 \item \texttt{LINUX\_VERSION} set in the target Makefile
69 \item config-2.6.x.y existing
70 \item patches-2.6.x.y containing the previous patches
71 \end{itemize}
72
73 Some patches are likely to fail since the vanilla kernel we are patching
74 received modifications so some hunks of the patches are no longer applying.
75 We will use quilt to get them applying cleanly again. Follow this procedure
76 whenever you want to upgrade the kernel using previous patches:
77
78 \begin{enumerate}
79 \item make target/linux/clean (removes the old version)
80 \item make target/linux/compile (uncompress the kernel and try to apply patches)
81 \item if patches failed to apply:
82 \item cd build\_dir/linux-target/linux-2.6.x.y
83 \item quilt push -a (to apply patches where quilt stopped)
84 \item quilt push -f (to force applying patches)
85 \item edit .rej files, apply the necessary changes to the files
86 \item remove .rej files
87 \item quilt refresh
88 \item repeat operation 3 and following until all patches have been applied
89 \item when all patches did apply cleanly: make target/linux/refresh
90 \end{enumerate}
91
92 Note that generic (target/linux/generic-2.6/linux-2.6.x/) patches can be found in
93 \texttt{build\_dir/linux-target/linux-2.6.x.y/patches/generic} and platform specific
94 patches in \texttt{build\_dir/linux-target/linux-2.6.x.y/patches/platform}.
95
96 \subsubsection{Using quilt with packages}
97
98 As we mentionned earlier, quilt is enabled by default for kernel patches, but not for
99 packages. If you want to use quilt in the same way, you should set the QUILT environment
100 variable to 1, e.g:
101
102 \begin{Verbatim}
103 make package/buysbox/{clean,compile} QUILT=1
104 \end{Verbatim}
105
106 Will generate the patch series file and allow you to update patches just like we described
107 before in the kernel case. Note that once all patches apply cleanly you should refresh them
108 as well using the following command:
109
110 \begin{Verbatim}
111 make package/buysbox/refresh QUILT=1
112 \end{Verbatim}
This page took 0.049343 seconds and 5 git commands to generate.