/[gentoo]/xml/htdocs/doc/en/kernel-upgrade.xml
Gentoo

Diff of /xml/htdocs/doc/en/kernel-upgrade.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/kernel-upgrade.xml,v 1.3 2005/04/06 14:36:19 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/kernel-upgrade.xml,v 1.4 2005/05/23 18:35:47 swift Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5<guide link="/doc/en/kernel-upgrade.xml"> 5<guide link="/doc/en/kernel-upgrade.xml">
6<title>Gentoo Linux Kernel Upgrade Guide</title> 6<title>Gentoo Linux Kernel Upgrade Guide</title>
7<author title="Author"> 7<author title="Author">
15 15
16<!-- The content of this document is licensed under the CC-BY-SA license --> 16<!-- The content of this document is licensed under the CC-BY-SA license -->
17<!-- See http://creativecommons.org/licenses/by-sa/2.0 --> 17<!-- See http://creativecommons.org/licenses/by-sa/2.0 -->
18<license/> 18<license/>
19 19
20<version>0.1.2</version> 20<version>0.1.3</version>
21<date>2005-04-06</date> 21<date>2005-05-23</date>
22 22
23<chapter> 23<chapter>
24<title>Introduction</title> 24<title>Introduction</title>
25<section> 25<section>
26<body> 26<body>
31install the kernel source for you, but then it is up to you to step in and 31install the kernel source for you, but then it is up to you to step in and
32compile the new kernel before any changes will take effect. 32compile the new kernel before any changes will take effect.
33</p> 33</p>
34 34
35<p> 35<p>
36Although this guide is targetted at users upgrading from one kernel release 36Although this guide is targeted at users upgrading from one kernel release
37to another, it will also be useful for users migrating from one kernel 37to another, it will also be useful for users migrating from one kernel
38package to another. 38package to another.
39</p> 39</p>
40 40
41<p> 41<p>
46</body> 46</body>
47</section> 47</section>
48</chapter> 48</chapter>
49 49
50<chapter> 50<chapter>
51<title>Why upgrade kernel?</title> 51<title>Why upgrade the kernel?</title>
52<section> 52<section>
53<body> 53<body>
54 54
55<p> 55<p>
56Generally, upgrading from one minor kernel release to the next won't bring any 56Generally, upgrading from one minor kernel release to the next won't bring any
57major differences. Reasons for upgrading kernel are generally either to take 57major differences. There are several reasons to upgrade the kernel. One is to
58advantage of a specific new feature or driver, to be protected against a 58take advantage of a specific new feature or driver; another is to be protected
59security vulnerability, or just to maintain an up-to-date and healthy system. 59against a security vulnerability, or just to maintain an up-to-date and healthy
60system.
60</p> 61</p>
61 62
62<p> 63<p>
63Even if you choose not to update to every new kernel revision, it is 64Even if you choose not to update to every new kernel revision, it is
64recommended that you at least upgrade from time to time. It is strongly 65recommended that you at least upgrade from time to time. It is strongly
102# <i>emerge -u gentoo-sources</i> 103# <i>emerge -u gentoo-sources</i>
103</pre> 104</pre>
104 105
105<p> 106<p>
106The kernel sources will then be installed into a subdirectory of 107The kernel sources will then be installed into a subdirectory of
107<path>/usr/src</path>. In the above example, my new kernel sources will be 108<path>/usr/src</path>. In the above example, the new kernel sources will be
108installed at <path>/usr/src/linux-2.6.9-gentoo-r2</path>. 109installed at <path>/usr/src/linux-2.6.9-gentoo-r2</path>.
109</p> 110</p>
110 111
111</body> 112</body>
112</section> 113</section>
122<path>/usr/src/linux</path>. This should point to the sources of the 123<path>/usr/src/linux</path>. This should point to the sources of the
123kernel you are running. 124kernel you are running.
124</p> 125</p>
125 126
126<p> 127<p>
127In this case, we need to update the symbolic link to point at the kernel 128In any case, we need to update the symbolic link to point at the kernel
128sources that we are about to upgrade to. Continuing our example: 129sources that we are about to upgrade to. Continuing our example:
129</p> 130</p>
130 131
131<pre caption="Updating the /usr/src/linux softlink"> 132<pre caption="Updating the /usr/src/linux softlink">
132# <i>cd /usr/src</i> 133# <i>cd /usr/src</i>
144 145
145<p> 146<p>
146For either of these options, you should refer to the instructions given in the 147For either of these options, you should refer to the instructions given in the
147<uri link="http://www.gentoo.org/doc/en/handbook/index.xml">Gentoo 148<uri link="http://www.gentoo.org/doc/en/handbook/index.xml">Gentoo
148Handbook</uri> relating to <e>Configuring the Kernel</e> and <e>Configuring 149Handbook</uri> relating to <e>Configuring the Kernel</e> and <e>Configuring
149the Bootloader</e>. A quick summary is provided here. 150the Bootloader</e>. Below is an outline of the required actions:
150</p> 151</p>
151 152
152</body> 153</body>
153</section> 154</section>
154<section> 155<section>
180</pre> 181</pre>
181 182
182<p> 183<p>
183For more info, follow the 184For more info, follow the
184<uri link="http://www.gentoo.org/doc/en/genkernel.xml">Gentoo Linux Genkernel 185<uri link="http://www.gentoo.org/doc/en/genkernel.xml">Gentoo Linux Genkernel
185Guide</uri>, or refer to the handbook. 186Guide</uri>, or refer to the <uri link="/doc/en/handbook/index.xml">Gentoo
187Handbook</uri>. Many of the options can be set in the configuration file for
188<uri link="/doc/en/genkernel.xml">genkernel</uri>,
189<path>/etc/genkernel.conf</path>.
186</p> 190</p>
187 191
188</body> 192</body>
189</section> 193</section>
190<section> 194<section>
199# <i>cd /usr/src/linux</i> 203# <i>cd /usr/src/linux</i>
200# <i>make menuconfig</i> 204# <i>make menuconfig</i>
201</pre> 205</pre>
202 206
203<p> 207<p>
204Select the options required for your hardware and operating environment. Refer 208Select the options required for your hardware and operating environment. For
205to the <e>Gentoo Handbook</e> for additional guidance on this. 209additional information on kernel configuration, refer to the chapter entitled
210<e>Configuring the Kernel</e> of the <uri
211link="/doc/en/handbook/index.xml">Gentoo Handbook</uri>.
206</p> 212</p>
207 213
208<p> 214<p>
209Next, compile your kernel and copy it over to your boot partition. Again, 215Next, compile your kernel and copy it over to your boot partition. Again,
210follow the handbook instructions here, but don't forget to mount your /boot 216follow the <uri link="/doc/en/handbook/index.xml">Gentoo Handbook</uri>
211partition first! In the initial installation, you would have already mounted 217instructions outlined in the chapter on <e>Configuring the Bootloader</e>. If
212this at a much earlier stage. 218<path>/boot</path> is a separate partition, ensure it is mounted before copying
219the compiled kernel to this directory! Failing to do so would keep you from
220booting the system with your new kernel.
213</p> 221</p>
214 222
215<pre caption="Compiling and installing the new kernel"> 223<pre caption="Compiling and installing the new kernel">
216# <i>make &amp;&amp; make modules_install</i> 224# <i>make &amp;&amp; make modules_install</i>
217# <i>mount /boot</i> 225# <i>mount /boot</i>
220</pre> 228</pre>
221 229
222<p> 230<p>
223Finally, you should update your bootloader config, adding an entry for the 231Finally, you should update your bootloader config, adding an entry for the
224new kernel (don't delete the old one just yet!) and unmount the 232new kernel (don't delete the old one just yet!) and unmount the
225<path>/boot</path> partition. Again, refer to the handbook for instructions 233<path>/boot</path> partition. Again, refer to the
226here. 234<uri link="/doc/en/handbook/index.xml">Gentoo Handbook</uri>
235for detailed instructions on this procedure.
227</p> 236</p>
228 237
229</body> 238</body>
230</section> 239</section>
231</chapter> 240</chapter>
235<section> 244<section>
236<body> 245<body>
237 246
238<p> 247<p>
239If you use any kernel modules that are not included in the kernel source tree 248If you use any kernel modules that are not included in the kernel source tree
240but are provided elsewhere in portage (e.g. Nvidia or ATI graphics drivers), 249but are provided elsewhere in portage (e.g. NVIDIA or ATI graphics drivers),
241then you must reinstall these on every kernel upgrade. This is as simple as 250then you must reinstall these after upgrading the kernel. This is as simple as
242re-merging the packages involved. Refer again to the 251re-merging the packages involved. For more information, refer to the chapter on
243<uri link="http://www.gentoo.org/doc/en/handbook/index.xml">Gentoo 252<e>Configuring the Kernel</e> in the <uri
244Handbook</uri> <e>Configuring the Kernel</e> chapter for more info here. 253link="/doc/en/handbook/index.xml">Gentoo Handbook</uri>.
245Re-merging these packages will ensure they build against the source tree at 254To ensure these packages will build against the source tree at
246<path>/usr/src/linux</path> - therefore they will actually being installed 255<path>/usr/src/linux</path>, first uninstall the packages, then re-emerge them.
247for the kernel we just compiled. 256If old sources for these packages are kept by portage, this uninstall/re-emerge
257procedure will make sure that they are rebuilt to work with the new kernel.
248</p> 258</p>
249 259
250</body> 260</body>
251</section> 261</section>
252</chapter> 262</chapter>
256<section> 266<section>
257<body> 267<body>
258 268
259<p> 269<p>
260Next, close all applications and reboot your system. If you followed the above 270Next, close all applications and reboot your system. If you followed the above
261instructions correctly, you will see an entry for your new kernel on your 271instructions correctly, the bootloader menu should include an entry for the
262bootloader. Select the new kernel and let the system boot. 272new kernel. Select the new kernel and let the system boot.
263</p>
264
265<p> 273</p>
266Hopefully, your system will boot without problem and you can log in and start 274
267working as usual. If everything is working, then the upgrade is complete at 275<p>
268this stage. 276Hopefully, your system successfully boots with the new kernel, and you can log
277in to resume whatever you were doing. If this is the case, then the upgrade is
278complete.
269</p> 279</p>
270 280
271<p> 281<p>
272If you have made a mistake and your system will not boot into the new kernel, 282If you made a mistake and the system fails to boot with the new kernel, reboot
273then you can simply reboot and boot into your previous working kernel. You can 283the system and select the entry from the bootloader that corresponds to the
274then restart from the <uri link="#install">Configuring, compiling, and 284last known working kernel. You can then restart from the <uri link="#install">
275installing the new kernel</uri> stage - making the appropriate changes to 285Configuring, compiling, and installing the new kernel</uri> stage -- making
276correct your mistake. In some cases (e.g. you just missed a network driver) 286the appropriate changes to correct your mistake. In some cases, you might not
277then you might not even need to reboot to do this. 287even need to reboot to do this (e.g. you missed a driver for an audio device,
288ethernet adapter, etc.)
278</p> 289</p>
279 290
280</body> 291</body>
281</section> 292</section>
282</chapter> 293</chapter>
286<section> 297<section>
287<body> 298<body>
288 299
289<p> 300<p>
290You may have noticed, that when installing the sources for your newer kernel, 301You may have noticed, that when installing the sources for your newer kernel,
291the sources for your existing kernel were not removed. This is by-design and 302the sources for your existing kernel were not removed. This is by design -- it
292allows you to easily switch between running different kernels. 303allows you to easily switch between running different kernels.
293</p> 304</p>
294 305
295<p> 306<p>
296Switching between multiple kernels is as simple as leaving the kernel sources 307Switching between multiple kernels is as simple as leaving the kernel sources
311 322
312<p> 323<p>
313Continuing on from the last section, you may be happy with your new kernel and 324Continuing on from the last section, you may be happy with your new kernel and
314not have any need to keep older kernel versions around. To easily remove all 325not have any need to keep older kernel versions around. To easily remove all
315sources for a particular kernel except for the newest one, you can take 326sources for a particular kernel except for the newest one, you can take
316advantages of emerge's <e>prune</e> option. Continuing the example using 327advantage of the <e>prune</e> option available through <c>emerge</c>. Continuing
317gentoo-sources: 328the example using <c>gentoo-sources</c>:
318</p> 329</p>
319 330
320<pre caption="Pruning old versions"> 331<pre caption="Pruning old versions">
321# <i>emerge -P gentoo-sources</i> 332# <i>emerge -P gentoo-sources</i>
322</pre> 333</pre>
336 347
337<p> 348<p>
338Finally, you can mount your <path>/boot</path> partition and remove the 349Finally, you can mount your <path>/boot</path> partition and remove the
339<path>bzImage</path> and <path>System.map</path> files for the kernel(s) 350<path>bzImage</path> and <path>System.map</path> files for the kernel(s)
340you are pruning. You should also edit your bootloader config so that it 351you are pruning. You should also edit your bootloader config so that it
341no longer references this kernel. 352no longer references such kernel(s).
342</p> 353</p>
343 354
344</body> 355</body>
345</section> 356</section>
346</chapter> 357</chapter>
351<body> 362<body>
352 363
353<p> 364<p>
354It is sometimes possible to save time by re-using the configuration file from 365It is sometimes possible to save time by re-using the configuration file from
355your old kernel when configuring the new one. Note that this is generally 366your old kernel when configuring the new one. Note that this is generally
356unsafe - too many changes between every kernel release for this to be a 367unsafe -- too many changes between every kernel release for this to be a
357reliable upgrade path. 368reliable upgrade path.
358</p> 369</p>
359 370
360<p> 371<p>
361The only situation where this is appropriate is when upgrading from one Gentoo 372The only situation where this is appropriate is when upgrading from one Gentoo

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20