| Rev | Author | # | Line |
|---|---|---|---|
| 27 | AristotlePagaltzis | 1 | !!! Updating the [Kernel] SourceCode without reconfiguring from scratch |
| 2 | |||
| 3 | Download and unpack the latest [Kernel] TarBall (ie from [http://kernel.org/]). Copy the <tt>.config</tt> file from the previous [Kernel]'s directory to the fresh one. From the new directory, run <tt>make oldconfig</tt> to pick up the old configuration, then <tt>make menuconfig</tt> to change any options for the new [Kernel]. | ||
| 4 | |||
| 5 | To update the symlink: | ||
| 6 | |||
| 7 | <pre> | ||
| 8 | ls -l /usr/src/linux | ||
| 9 | rm /usr/src/linux | ||
| 10 | cd /usr/src | ||
| 11 | ln -s linux-''version'' linux | ||
| 12 | </pre> | ||
| 13 | |||
| 14 | DebianLinux users will want to read KernelPackageNotes for information on using make-kpkg(1) to build a [Kernel] [Deb]. If not, they can follow the same steps, using | ||
| 15 | |||
| 16 | <pre> | ||
| 17 | apt-cache search kernel-source # to find out the latest version | ||
| 18 | apt-get kernel-source-''version'' | ||
| 19 | </pre> | ||
| 20 | |||
| 21 | to download the latest source. | ||
| 28 | CraigBox | 22 | |
| 23 | !!! Updating your source tree to the latest version | ||
| 24 | |||
| 25 | patch-2.6.17 applies against 2.6.16, so if you have 2.6.16.n, you'll have to first remove the 2.6.16.n patch. | ||
| 26 | |||
| 27 | Use [ketchup|http://kerneltrap.org/node/2976], a [Python] utility to handle this patching for you. | ||
| 28 | |||
| 29 | A good command line for [NZ] users: | ||
| 30 | |||
| 31 | <pre> | ||
| 32 | ketchup -G -k ftp://ftp.nz.kernel.org/pub/linux/kernel -r 2.6 | ||
| 33 | </pre> | ||
| 34 | |||
| 35 | Only use <tt>-G</tt> if you trust the mirror! | ||
| 27 | AristotlePagaltzis | 36 | |
| 23 | AristotlePagaltzis | 37 | !!! Compiler Version |
| 38 | |||
| 25 | AristotlePagaltzis | 39 | The [Kernel] can be sensitive to the version of [GCC] in use. F.ex. 2.4 and early 2.6 kernels did not work with [GCC] 3.x. They contained the following snippet in <tt>README</tt>: |
| 20 | DanielLawson | 40 | |
| 41 | <verbatim> | ||
| 42 | COMPILING the kernel: | ||
| 43 | |||
| 44 | - Make sure you have gcc 2.95.3 available. gcc 2.91.66 (egcs-1.1.2) may | ||
| 45 | also work but is not as safe, and *gcc 2.7.2.3 is no longer supported*. | ||
| 46 | </verbatim> | ||
| 47 | |||
| 48 | OTOH kernels since about 2.6.15 require [GCC] 3.x. Read the file to find the versions of compilers and other tools you need. Make sure to check the <tt>README</tt> and <tt>Documentation/Changes</tt> files to find out which version you need. Of course you always read the compile instructions for software you download, right? :) | ||
| 49 | |||
| 31 | IanMcDonald | 50 | To compile a kernel with a specific compiler, you can say eg. <tt>make CC=gcc-2.95 bzImage</tt> to make the <tt>bzImage</tt> target using the <tt>gcc-2.95</tt> compiler. See also [DistCC] |
| 20 | DanielLawson | 51 | |
| 27 | AristotlePagaltzis | 52 | !!! Linking fails with <tt>bootsplash</tt> compiled into your kernel |
| 20 | DanielLawson | 53 | |
| 23 | AristotlePagaltzis | 54 | Compiling aborts with the following message: |
| 20 | DanielLawson | 55 | |
| 25 | AristotlePagaltzis | 56 | <verbatim> |
| 57 | LD .tmp_vmlinux1 | ||
| 58 | drivers/built-in.o(.text+0xa898a): In function `splash_getraw': | ||
| 59 | : undefined reference to `con2fb_map' | ||
| 60 | drivers/built-in.o(.text+0xa918c): In function `splash_verbose': | ||
| 61 | : undefined reference to `con2fb_map' | ||
| 62 | drivers/built-in.o(.text+0xa9670): In function `splash_status': | ||
| 63 | : undefined reference to `con2fb_map' | ||
| 64 | drivers/built-in.o(.text+0xa97a4): In function `splash_read_proc': | ||
| 65 | : undefined reference to `con2fb_map' | ||
| 66 | drivers/built-in.o(.text+0xa997d): In function `splash_write_proc': | ||
| 67 | : undefined reference to `con2fb_map' | ||
| 68 | make: *** [.tmp_vmlinux1] Error 1 | ||
| 69 | </verbatim> | ||
| 20 | DanielLawson | 70 | |
| 31 | IanMcDonald | 71 | You need to have framebuffer console support compiled in. It can't be a module! Set <tt>CONFIG_FRAMEBUFFER_CONSOLE=y</tt> in the <tt>.config</tt>. NB This sounds like a one off bug that has probably been long fixed. |
| 20 | DanielLawson | 72 | |
| 73 | !!! ModuleInitTools | ||
| 74 | |||
| 23 | AristotlePagaltzis | 75 | Starting with 2.5.51, modules have a different format. The extension has also changed from <tt>.o</tt> to <tt>.ko</tt>, for kernel object. To work with modules, you need a completely rewritten set of module tools (modprobe(8), insmod(8), lsmod(8)), collectively called <tt>module-init-tools</tt>. They can coexist with the 2.4.x-specific tools. __Note, however__ that <tt>module-init-tools</tt> no longer reads <tt>modules.conf</tt> and instead uses a new file called modprobe.conf(5) which has a different syntax. <tt>man 5 modprobe.conf</tt> will be your friend here. It's possible to set <tt>modprobe.conf</tt> to handle modules for both 2.4.x and 2.5.x kernels, which is pretty cool if you're a dual-booter. |
| 20 | DanielLawson | 76 | |
| 23 | AristotlePagaltzis | 77 | !!! nVidia and LinuxKernel 2.6 |
| 20 | DanielLawson | 78 | |
| 23 | AristotlePagaltzis | 79 | [nVidia drivers|http://www.nvidia.com/linux] version 1.0-6106 and up support all 2.4 and 2.6 kernels, including kernels with the new 2.6 option for 4k stacks. |
| 30 | BenStaz | 80 | |
| 81 | !!! Kconfig files | ||
| 82 | |||
| 83 | These are kernel configuration files. When the kernel configuration application is run, it reads the main kernel configuration file, located in /source/dir/arch/<your architecture>/Kconfig. This main configuration file then includes other configuration files from the different subdirectories in the kernel directory tree. | ||
| 20 | DanielLawson | 84 | |
| 31 | IanMcDonald | 85 | Don't edit these Kconfig files directly unless you are doing [KernelDevelopment]. These files are driven from .config file mentioned earlier in this article. |
| 20 | DanielLawson | 86 | |
| 31 | IanMcDonald | 87 | In the 2.4 series, you could read <tt>Documentation/Configure.help</tt> to get the equivalent information. |
| 20 | DanielLawson | 88 | |
| 23 | AristotlePagaltzis | 89 | !!! See also |
| 20 | DanielLawson | 90 | |
| 23 | AristotlePagaltzis | 91 | * TroubleshootingStartUp has help for some problems while booting kernels |
| 92 | * KernelTweaking | ||
| 93 | * [Safe remote kernel install howto | http://groups.google.com/group/fa.linux.kernel/msg/75497a47b0dd2b6b] describes a strategy for testing a new kernel on a remote machine without shutting yourself out even if it doesn't work | ||
| 20 | DanielLawson | 94 | |
| 95 | ---- | ||
| 96 | CategoryKernel |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 5 times)