Lines 21-28
Link Here
|
21 |
|
21 |
|
22 |
<license/> |
22 |
<license/> |
23 |
|
23 |
|
24 |
<version>1.0</version> |
24 |
<version>1.1</version> |
25 |
<date>March 14, 2004</date> |
25 |
<date>March 26, 2004</date> |
26 |
|
26 |
|
27 |
<chapter> |
27 |
<chapter> |
28 |
<title>Overview</title> |
28 |
<title>Overview</title> |
Lines 86-91
Link Here
|
86 |
</section> |
86 |
</section> |
87 |
</chapter> |
87 |
</chapter> |
88 |
<chapter> |
88 |
<chapter> |
|
|
89 |
<title>Advantages</title> |
90 |
<section> |
91 |
<body> |
92 |
|
93 |
<p> |
94 |
You may be asking yourself, "Why should I bother?" The problem that inspired |
95 |
this functionality was in fact an issue with kernel module ebuilds like |
96 |
nvidia-kernel or hostap-driver. These ebuilds need to use the kernel build |
97 |
system to compile, however building them would require updating files in |
98 |
<path>/usr/src/linux</path>, and fail because of sandbox violations. |
99 |
</p> |
100 |
|
101 |
<note> |
102 |
Gentoo's <b>sandbox</b> is system that prevents portage from writing to the live |
103 |
filesystem until the final merge step of the package installation. |
104 |
</note> |
105 |
|
106 |
<p> |
107 |
Several dependant steps can be taken to resolve this issue. In short, kernel |
108 |
builds must output all of their files to a different location when they are |
109 |
compiled, and later external module compiles must <b>also</b> do this, only they |
110 |
output to some subdirectory of the temporary build location. By letting the |
111 |
modules output their built files into the permitted build location, those nasty |
112 |
sandbox errors are prevented. |
113 |
</p> |
114 |
|
115 |
</body> |
116 |
</section> |
117 |
</chapter> |
118 |
<chapter> |
89 |
<title>Enabling koutput</title> |
119 |
<title>Enabling koutput</title> |
90 |
<section> |
120 |
<section> |
91 |
<body> |
121 |
<body> |
Lines 117-123
Link Here
|
117 |
</p> |
147 |
</p> |
118 |
|
148 |
|
119 |
<pre caption="Prepare environment with config-kernel"> |
149 |
<pre caption="Prepare environment with config-kernel"> |
120 |
# <i>config-kernel --output-dir=/home/joe/kernels</i> |
150 |
# <i>config-kernel --output-dir /home/joe/kernels</i> |
121 |
</pre> |
151 |
</pre> |
122 |
|
152 |
|
123 |
<p> |
153 |
<p> |
Lines 128-134
Link Here
|
128 |
</p> |
158 |
</p> |
129 |
|
159 |
|
130 |
<pre caption="Prepare environment with config-kernel"> |
160 |
<pre caption="Prepare environment with config-kernel"> |
131 |
# <i>config-kernel --output-dir=default</i> |
161 |
# <i>config-kernel --output-dir default</i> |
132 |
</pre> |
162 |
</pre> |
133 |
|
163 |
|
134 |
<p> |
164 |
<p> |
Lines 138-150
Link Here
|
138 |
</p> |
168 |
</p> |
139 |
|
169 |
|
140 |
<pre caption="Converting a current kernel"> |
170 |
<pre caption="Converting a current kernel"> |
141 |
# <i>config-kernel --make-koutput=/usr/src/linux-2.6.3</i> |
171 |
# <i>config-kernel --make-koutput /usr/src/linux-2.6.3</i> |
142 |
</pre> |
172 |
</pre> |
143 |
|
173 |
|
144 |
<p> |
174 |
<p> |
145 |
The above command converts the kernel found in <path>/usr/src/linux-2.6.3</path> |
175 |
The above command converts the kernel found in <path>/usr/src/linux-2.6.3</path> |
146 |
to outputting to a different directory. If the output directory has been set |
176 |
to outputting to a different directory. If the output directory has been set |
147 |
previously with <c>--output-dir=foo</c>, then that prefix will be used. |
177 |
previously with <c>--output-dir /some/path</c>, then that prefix will be used. |
148 |
Otherwise, the Gentoo default of <path>/var/tmp/kernel-output/KV</path> will be |
178 |
Otherwise, the Gentoo default of <path>/var/tmp/kernel-output/KV</path> will be |
149 |
used. |
179 |
used. |
150 |
</p> |
180 |
</p> |
Lines 182-187
Link Here
|
182 |
</tr> |
212 |
</tr> |
183 |
</table> |
213 |
</table> |
184 |
|
214 |
|
|
|
215 |
<p> |
216 |
This change of location is important. Two processes are largely affected by this |
217 |
new file location, copy a kernel config into the proper location when updating |
218 |
kernel sources, and copying a newly compiled bzImage into <path>/boot</path>. In |
219 |
particular, when copying your .config, it's important to remember that you need |
220 |
to copy it from the kernel output location of the original into the kernel |
221 |
output location of the new kernel. To demonstrate how a kernel upgrade would be |
222 |
performed using koutput, an example upgrade from vanilla-sources-2.6.4 to |
223 |
vanilla-sources-2.6.5 is depicted: |
224 |
</p> |
225 |
|
226 |
<note> |
227 |
Here, we assume the output prefix is set to <path>/var/tmp/kernel-output</path> |
228 |
and that both kernel sources are already installed |
229 |
</note> |
230 |
|
231 |
<pre caption="Kernel Upgrade with koutput"> |
232 |
# <i>cp /var/tmp/kernel-output/2.6.4/.config /var/tmp/kernel-output/2.6.5/</i> |
233 |
<comment>Copy our .config into the new output directory</comment> |
234 |
# <i>config-kernel --set-symlink 2.6.5</i> |
235 |
# <i>cd /usr/src/linux</i> |
236 |
<comment>Move into our new source tree</comment> |
237 |
# <i>make oldconfig</i> |
238 |
# <i>make && make modules_install</i> |
239 |
<comment>Compile our new kernel and modules</comment> |
240 |
# <i>mount /boot</i> |
241 |
# <i>cp /var/tmp/kernel-output/2.6.5/arch/i386/boot/bzImage /boot/</i> |
242 |
# <i>umount /boot</i> |
243 |
<comment>Install the new kernel image</comment> |
244 |
</pre> |
245 |
|
246 |
<p> |
247 |
For kernel modules building against kernels using the new system, nothing more |
248 |
should be required beyond emerging the desired kernel module package as usual. |
249 |
At the time of this writing, there are still some kernel modules being converted |
250 |
over to the new setup, or still in testing phase. If the stable version of a |
251 |
kernel module fails, try installing the <b>~arch</b> version first: |
252 |
</p> |
253 |
|
254 |
<pre> |
255 |
# <i>ACCEPT_KEYWORDS='~x86' emerge foo</i> |
256 |
<comment>The above command installs the testing version of the foo package</comment> |
257 |
</pre> |
258 |
|
259 |
<p> |
260 |
If this still fails, please open a bug at <uri |
261 |
link="http://bugs.gentoo.org">http://bugs.gentoo.org</uri>, and the kernel |
262 |
module ebuild will be updated to the new system as soon as possible. |
263 |
</p> |
264 |
|
185 |
</body> |
265 |
</body> |
186 |
</section> |
266 |
</section> |
187 |
</chapter> |
267 |
</chapter> |