From d001f183e0be26f65ebc08c790dbb5d8f5ce55d6 Mon Sep 17 00:00:00 2001 From: gferg <> Date: Mon, 17 Mar 2003 15:25:03 +0000 Subject: [PATCH] updated --- LDP/howto/linuxdoc/Kernel-HOWTO.sgml | 1046 ++++++++++++-------------- 1 file changed, 479 insertions(+), 567 deletions(-) diff --git a/LDP/howto/linuxdoc/Kernel-HOWTO.sgml b/LDP/howto/linuxdoc/Kernel-HOWTO.sgml index 2338f1ce..a3bbf1f1 100644 --- a/LDP/howto/linuxdoc/Kernel-HOWTO.sgml +++ b/LDP/howto/linuxdoc/Kernel-HOWTO.sgml @@ -45,11 +45,12 @@ Al Dev (Alavoor Vasudevan) " name=" alavoor[AT]yahoo.com "> -v4.4, 06 Feb 2003 +v4.7, 15 March 2003 This is a detailed guide to kernel configuration, compilation, upgrades, -and troubleshooting for ix86-based systems. +and troubleshooting for ix86-based systems. Can be useful for other architectures +as well. @@ -68,20 +69,22 @@ You compile Linux kernel for one of following reasons: read the kernel source code and compile with your own hands. No exceptions!! (U.S Dept of Defence compiles the Linux kernel before distributing computers).

- Every country and every Govt. compiles the kernel on site for security. -Every Govt. audits each and every line of kernel before using the computer. + Every country and every Government in the world compiles the kernel on +site for security and integrity. +Every Government/Corporation audits and verifies each and every line of the OS kernel before +using the computer.

- Each and every University in the world compiles the kernel before using + Each and every University in the world compiles the OS kernel before using any computer!

For your education and knowledge of Linux kernel and ofcourse, just for fun!

For very advanced scientific applications - you may need to do kernel compile

- It is an International Law (U.N. charter) - "You cannot use a computer -WITHOUT compiling the kernel". If you disobey this law you will be "punished" + It is an International Law (the U.N. laws) - "You cannot use a computer +WITHOUT compiling the OS kernel". If you disobey this law you will be "punished" with lot of computer problems!! You must compile the kernel with your own hands -and not rely on someone else! +and not rely on someone else to do it for you!!

And for many hundreds of reasons - too numerous to list! @@ -139,14 +142,44 @@ to new kernel tree (may save time, if you want to reuse the old settings). make modules make modules_install make install + make rpm # To build rpm packages configure LILO or GRUB. Optional - make clean (If you want to free up disk space) -See details of above steps in next section.... + +On Redhat, instead of using 'make' commands you can use rpm command to build kernel. +If you want to build binary RPMs (kernel*.i386.rpm), do this: + + Install kernel*.src.rpm + cd /usr/src/redhat/SPECS + rpmbuild -ba kernel*.spec # or rpm -ba kernel*.spec # for old systems + cd /usr/src/redhat/i386; rpm -i kernel*.rpm + + +See details of above steps in the following sections.... + + Minor Upgrading of Kernel

+If you had already built the kernel and you want to upgrade to next patch release, +then you can simply copy the existing config and reuse it. +(For example you have built kernel 2.4.19 and want to upgrade to 2.4.20). +

+For minor upgrades : +You can copy the .config file from your old linux kernel source tree +to new kernel tree (may save time, if you want to reuse the old settings). + + bash# ls -l /usr/src/lin* # You can see that /usr/src/linux is a soft link + bash# cd /usr/src/linux + bash# cp ../linux-old-tree/.config . # Example cp ../linux-2.4.19/.config . + +or alternatively, you can use "make oldconfig" +which default all questions based on the contents of your existing ./.config file. +

+After this, look in the next section to do make and install. - Building Kernel - Explanation of Steps

Details of the steps mentioned in the previous section: @@ -187,8 +220,9 @@ dev86*.rpm on cdrom or from You can copy the .config file from your old linux kernel source tree to new kernel tree (may save time, if you want to reuse the old settings). + bash# ls -l /usr/src/lin* # You can see that /usr/src/linux is a soft link bash# cd /usr/src/linux - bash# cp ../linux-old-tree/.config . + bash# cp ../linux-old-tree/.config . # Example cp ../linux-2.4.19/.config . or alternatively, you can use "make oldconfig" which default all questions based on the contents of your existing ./.config file. @@ -448,8 +482,6 @@ bash# man mkbootdisk Clean: Optional - make clean (If you want to free up disk space)

- - - - Troubleshoot Common Mistakes + + Troubleshooting

- - - The System Hangs at LILO -

-Sympton: After you build the kernel and reboot, the system hangs just before LILO. - -Reason: Probably you did not set the BIOS to pick up the proper Primary Master IDE and -Secondary Slave IDE hard disk partition. - -Solution: Power on the machine and press DEL key to do setup of the BIOS (Basic Input Output system). Select the IDE settings and set proper primary hard disk partition and slave drives. -When the system boots it looks for the primary IDE hard disk and the Master Boot Record partition. -It reads the MBR and starts loading the Linux Kernel from the hard disk partition. - - - - No init found -

-The following mistake is commited very frequently by new users. - -If your new kernel does not boot and you get - - -Warning: unable to open an initial console -Kernel panic: no init found. Try passing init= option to kernel - -The problem is that you did not set the "root=" parameter properly -in the /etc/lilo.conf. In my case, I used root=/dev/hda1 which is -having the root partition "/". You must properly point the root device in your -lilo.conf, it can be like /dev/hdb2 or /dev/hda7. - -The kernel looks for the init command which is located in /sbin/init. -And /sbin directory lives on the root partition. -For details see - - -bash# man init - - - - Lots of Compile Errors -

-The 'make', 'make bzImage', 'make modules' or 'make modules_install' -gives compile problems. -You should give 'make mrproper' before doing make. - -bash# make mrproper - -If this problem persists, then try menuconfig instead of xconfig. -Sometimes GUI version xconfig causes some problems: - -bash# export TERM=VT100 -bash# make menuconfig - - - - - - The 'depmod' gives "Unresolved symbol error messages" -

-When you run depmod it gives "Unresolved symbols". A sample error message -is given here to demonstrate the case: - -bash$ su - root -bash# man depmod -bash# depmod -depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/linear.o -depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/multipath.o -depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid0.o -depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid1.o -depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid5.o - - -Reason: You did not make modules and install the modules after building -the new kernel with "make bzImage". - -Solution: After you build the new kernel, you must do: - -bash$ su - root -bash# cd /usr/src/linux -bash# make modules -bash# make modules_install - - - - - Kernel Does Not Load Module - "Unresolved symbols" Error Messages -

-When you boot kernel and system tries to load any modules and -you get "Unresolved symbol : __some_function_name" then it means -that you did not clean compile the modules and kernel. It is mandatory that -you should do make clean and make the modules. Do this - - - bash# cd /usr/src/linux - bash# make dep - bash# make clean - bash# nohup make bzImage & - bash# tail -f nohup.out (.... to monitor the progress) - bash# make modules - bash# make modules_install - - - - - Kernel fails to load a module -

-If the kernel fails to load a module (say loadable module for network card -or other devices), then you may want to try to build the driver for device -right into the kernel. Sometimes loadable module will NOT -work and the driver -needs to be built right inside the kernel. For example - some network cards do not -support loadable module feature - you MUST build the driver of the network card -right into linux kernel. Hence, in 'make xconfig' you MUST not select loadable -module for this device. - - - - - Loadable modules -

-You can install default loadable modules with - - -The step given below may not be required but is needed ONLY FOR EMERGENCIES where -your /lib/modules files are damaged. If you already have -the /lib/modules directory and in case you -want replace them use the --force to replace the package and -select appropriate cpu architecture. - -For new versions of linux redhat linux 6.0 and later, the kernel modules are -included with kernel-2.2*.rpm. Install the loadable modules and the kernel with - - This will list the already installed package. -bash# rpm -qa | grep -i kernel - -bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i686.rpm -(or) -bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i586.rpm -(or) -bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i386.rpm - - -This is only for old versions of redhat linux 5.2 and before. -Boot new kernel and install the loadable -modules from RedHat Linux "contrib" cdrom - -bash# rpm -i /mnt/cdrom/contrib/kernel-modules*.rpm -....(For old linux systems which do not have insmod pre-installed) - -

- - +Having any problems? See the . Post Kernel Building

@@ -736,29 +621,430 @@ image=/boot/bzImage.myker-firewall.16mar2001 - - - A word on style + Troubleshoot Common Mistakes

-All the chapters from this here are written by -. -Text that looks like this is either something that appears on -your screen, a filename, or something that can be directly typed in, such as a -command, or options to a command (if you're looking -at a plain-text file, it doesn't look any different). Commands and other -input are frequently quoted (with ` '), which causes the following -classic punctuation problem: if such an item appears at the end of a sentence -in quotes, people often type a `.' along with the command, because the -American quoting style says to put the period inside of the quotation -marks. Even though common sense (and unfortunately, this assumes that the -one with the ``common sense'' is used to the so-called American style of -quotation) should tell one to strip off the -punctuation first, many people simply do not remember, so I will place -it outside the quotation marks in such cases. In other words, when -indicating that you should type ``make config'' I would write -`make config', not `make config.' + + The System Hangs at LILO

+Sympton: After you build the kernel and reboot, the system hangs just before LILO. + +Reason: Probably you did not set the BIOS to pick up the proper Primary Master IDE and +Secondary Slave IDE hard disk partition. + +Solution: Power on the machine and press DEL key to do setup of the BIOS (Basic Input Output system). Select the IDE settings and set proper primary hard disk partition and slave drives. +When the system boots it looks for the primary IDE hard disk and the Master Boot Record partition. +It reads the MBR and starts loading the Linux Kernel from the hard disk partition. + + + + No init found +

+The following mistake is commited very frequently by new users. + +If your new kernel does not boot and you get - + +Warning: unable to open an initial console +Kernel panic: no init found. Try passing init= option to kernel + +The problem is that you did not set the "root=" parameter properly +in the /etc/lilo.conf. In my case, I used root=/dev/hda1 which is +having the root partition "/". You must properly point the root device in your +lilo.conf, it can be like /dev/hdb2 or /dev/hda7. + +The kernel looks for the init command which is located in /sbin/init. +And /sbin directory lives on the root partition. +For details see - + +bash# man init + + + + Lots of Compile Errors +

+The 'make', 'make bzImage', 'make modules' or 'make modules_install' +gives compile problems. +You should give 'make mrproper' before doing make. + +bash# make mrproper + +If this problem persists, then try menuconfig instead of xconfig. +Sometimes GUI version xconfig causes some problems: + +bash# export TERM=VT100 +bash# make menuconfig + + + + + + The 'depmod' gives "Unresolved symbol error messages" +

+When you run depmod it gives "Unresolved symbols". A sample error message +is given here to demonstrate the case: + +bash$ su - root +bash# man depmod +bash# depmod +depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/linear.o +depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/multipath.o +depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid0.o +depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid1.o +depmod: *** Unresolved symbols in /lib/modules/version/kernel/drivers/md/raid5.o + + +Reason: You did not make modules and install the modules after building +the new kernel with "make bzImage". + +Solution: After you build the new kernel, you must do: + +bash$ su - root +bash# cd /usr/src/linux +bash# make modules +bash# make modules_install + + + + + Kernel Does Not Load Module - "Unresolved symbols" Error Messages +

+When you boot kernel and system tries to load any modules and +you get "Unresolved symbol : __some_function_name" then it means +that you did not clean compile the modules and kernel. It is mandatory that +you should do make clean and make the modules. Do this - + + bash# cd /usr/src/linux + bash# make dep + bash# make clean + bash# nohup make bzImage & + bash# tail -f nohup.out (.... to monitor the progress) + bash# make modules + bash# make modules_install + + + + + Kernel fails to load a module +

+If the kernel fails to load a module (say loadable module for network card +or other devices), then you may want to try to build the driver for device +right into the kernel. Sometimes loadable module will NOT +work and the driver +needs to be built right inside the kernel. For example - some network cards do not +support loadable module feature - you MUST build the driver of the network card +right into linux kernel. Hence, in 'make xconfig' you MUST not select loadable +module for this device. + + + + + Loadable modules +

+You can install default loadable modules with - + +The step given below may not be required but is needed ONLY FOR EMERGENCIES where +your /lib/modules files are damaged. If you already have +the /lib/modules directory and in case you +want replace them use the --force to replace the package and +select appropriate cpu architecture. + +For new versions of linux redhat linux 6.0 and later, the kernel modules are +included with kernel-2.2*.rpm. Install the loadable modules and the kernel with + + This will list the already installed package. +bash# rpm -qa | grep -i kernel + +bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i686.rpm +(or) +bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i586.rpm +(or) +bash# rpm -U --force /mnt/cdrom/Redhat/RPMS/kernel-2.2.14-5.0.i386.rpm + + +This is only for old versions of redhat linux 5.2 and before. +Boot new kernel and install the loadable +modules from RedHat Linux "contrib" cdrom + +bash# rpm -i /mnt/cdrom/contrib/kernel-modules*.rpm +....(For old linux systems which do not have insmod pre-installed) + +

+ + +make clean

+If your new kernel does really weird things after a routine kernel upgrade, +chances are you forgot to make clean before compiling the new +kernel. Symptoms can be anything from +your system outright crashing, strange I/O problems, to crummy +performance. Make sure you do a make dep, too. +

+ +Huge or slow kernels

+If your kernel is sucking up a lot of memory, is too large, +and/or just takes forever to compile even when you've got your new +Quadbazillium-III/4400 working on it, you've probably got lots of unneeded +stuff (device drivers, filesystems, etc) configured. If you don't use it, +don't configure it, because it does take up memory. +The most obvious symptom of kernel bloat is extreme swapping in and out of +memory to disk; if your disk is making a lot of noise and it's not one of +those old Fujitsu Eagles that sound like like a jet landing when turned +off, look over your kernel configuration. +

+ +You can find out how much memory the kernel is using by taking the +total amount of memory in your machine and subtracting from it the +amount of ``total mem'' in /proc/meminfo or the output of the command +`free'. +

+ +The parallel port doesn't work/my printer doesn't work

+Configuration options for PCs are: First, under the category `General Setup', +select `Parallel port support' and `PC-style hardware'. Then under +`Character devices', select `Parallel printer support'. +

+Then there are the names. Linux 2.2 names the printer devices differently +than previous releases. The upshot of this is that if you had an lp1 +under your old kernel, it's probably an lp0 under your new one. +Use `dmesg' or look through the logs in /var/log to find +out. +

+ +Kernel doesn't compile

+ +If it does not compile, then it is likely that a patch failed, or your +source is somehow corrupt. Your version of gcc also might not +be correct, or could also be corrupt (for example, the include files +might be in error). Make sure that the symbolic links which +Linus describes in the README are set up correctly. In general, if +a standard kernel +does not compile, something is seriously wrong with the system, and +reinstallation of certain tools is probably necessary. +

+ +In some cases, gcc can crash due to hardware problems. The error +message will be something like ``xxx exited with signal 15'' and it will +generally look very mysterious. I probably would not mention this, except +that it happened to me once - I had some bad cache memory, and the compiler +would occasionally barf at random. Try reinstalling gcc first if you +experience problems. You should only get suspicious if your kernel compiles +fine with external cache turned off, a reduced amount of RAM, etc. +

+ +It tends to disturb people when it's suggested that their hardware has +problems. Well, I'm not making this up. There is an FAQ for it -- it's at +http://www.bitwizard.nl/sig11/. +

+ +New version of the kernel doesn't seem to boot

+ +You did not run LILO, or it is not configured correctly. One thing that +``got'' me once was a problem in the config file; it said `boot = +/dev/hda1' +instead of `boot = /dev/hda' (This can be really annoying at first, +but once you have a working config file, you shouldn't need to +change it.). +

+ + You forgot to run LILO, or system doesn't boot at all

+ +Ooops! The best thing you can do here is to boot off of a floppy disk or +CDROM and +prepare another bootable floppy (such as `make zdisk' would do). +You need to know where your root (/) filesystem is and what type +it is (e.g. second extended, minix). In the example below, you also need +to know what filesystem your /usr/src/linux source +tree is on, its type, and where it is normally mounted.

+ +In the following example, / is /dev/hda1, and the +filesystem which holds /usr/src/linux +is /dev/hda3, normally mounted at /usr. Both are +second extended filesystems. The working kernel image in +/usr/src/linux/arch/i386/boot is called bzImage.

+ +The idea is that if there is a functioning +bzImage, it is possible to use that +for the new floppy. Another alternative, which may or may not work better +(it depends on the particular method in which you messed up your system) is +discussed after the example.

+ +First, boot from a boot/root disk combo or rescue disk, and +mount the filesystem which contains the working kernel image:

+ + + mkdir /mnt + mount -t ext2 /dev/hda3 /mnt + + +If mkdir tells you that the directory already exists, just ignore +it. Now, cd to the place where the working kernel image was. Note +that + +/mnt + /usr/src/linux/arch/i386/boot - /usr = /mnt/src/linux/arch/i386/boot + +Place a formatted +disk in drive ``A:'' (not your boot or root disk!), dump +the image to the disk, and configure it for your root filesystem:

+ + + cd /mnt/src/linux/arch/i386/boot + dd if=bzImage of=/dev/fd0 + rdev /dev/fd0 /dev/hda1 + + +cd to / and unmount the normal /usr filesystem:

+ + cd / + umount /mnt + + +You should now be able to reboot your system as normal from this floppy. +Don't forget to run lilo (or whatever it was that you did wrong) after +the reboot!

+ +As mentioned above, there is another common alternative. If you +happened to have a working kernel image in / (/vmlinuz +for example), you can use that for a boot disk. Supposing all of the above +conditions, and that my kernel image is /vmlinuz, just make these +alterations to the example above: change +/dev/hda3 to /dev/hda1 (the / filesystem), +/mnt/src/linux to +/mnt, and if=bzImage to if=vmlinuz. The +note explaining how to derive /mnt/src/linux may be ignored. +

+ +Using LILO with big drives (more than 1024 cylinders) can cause problems. +See the LILO mini-HOWTO or documentation for help on that. +

+ +It says `warning: bdflush not running'

+ +This can be a severe problem. Starting with a kernel release +after 1.0 (around 20 Apr 1994), a program called `update' which +periodically flushes out the filesystem buffers, was upgraded/replaced. Get +the sources to `bdflush' +(you should find it where you got your kernel source), and install it (you +probably want to run your system under the old kernel while doing this). It +installs itself as `update' and after a reboot, the new kernel +should no longer complain. +

+ +I can't get my IDE/ATAPI CD-ROM drive to work

+Strangely enough, lots of people cannot get their ATAPI drives working, +probably because there are a number of things that can go wrong. +

+If your CD-ROM drive is the only device on a particular IDE +interface, it must be jumpered as ``master'' or ``single.'' Supposedly, +this is the most common error. +

+Creative Labs (for one) has put IDE interfaces on their sound cards now. +However, this leads to the interesting problem that while some people only +have one interface to being with, many have two IDE interfaces built-in to +their motherboards (at IRQ15, usually), so a common practice is to make the +soundblaster interface a third IDE port (IRQ11, or so I'm told). +

+This causes problems with linux in that versions 1.2.x don't support a third +IDE interface (there is support in starting somewhere in the 1.3.x series +but that's development, remember, and it doesn't auto-probe). To get around +this, you have a few choices.

+

+If you have a second IDE port already, chances are that you are not using +it or it doesn't already have two devices on it. Take the ATAPI drive off +the sound card and put it on the second interface. You can then disable the +sound card's interface, which saves an IRQ anyway. +

+If you don't have a second interface, jumper the sound card's interface +(not the sound card's sound part) as IRQ15, the second interface. It should +work. +

+ +It says weird things about obsolete routing requests

+ +Get new versions of the route program and any other programs +which do route manipulation. +/usr/include/linux/route.h (which is actually a file in +/usr/src/linux) has changed. +

+ +Firewalling not working in 1.2.0

+Upgrade to at least version 1.2.1. +

+ +``Not a compressed kernel Image file''

+Don't use the vmlinux file created in /usr/src/linux as +your boot image; [..]/arch/i386/boot/bzImage is the right +one. +

+ +Problems with console terminal after upgrade to 1.3.x

+Change the word dumb to linux in the console termcap +entry in /etc/termcap. You may also have to make a terminfo entry. +

+ + Can't seem to compile things after kernel upgrade

+The linux kernel source includes a number of include files (the things that +end with .h) which are referenced by the standard ones in +/usr/include. They are typically referenced like this (where +xyzzy.h would be something in /usr/include/linux): + + #include + +Normally, there is a link called linux in /usr/include to +the include/linux directory of your kernel source +(/usr/src/linux/include/linux in the typical system). If this link +is not there, or points to the wrong place, most things will not compile at +all. If you decided that the kernel source was taking too much room on the +disk and deleted it, this will obviously be a problem. Another way it might +go wrong is with file permissions; if your root has a umask +which doesn't allow other users to see its files by default, and you +extracted the kernel source without the p (preserve filemodes) +option, those users also won't be able to use the C compiler. Although you +could use the chmod command to fix this, it is probably easier to +re-extract the include files. You can do this the same way you did the +whole source at the beginning, only with an additional argument:

+ + blah# tar zxvpf linux.x.y.z.tar.gz linux/include + +Note: ``make config'' will recreate the /usr/src/linux +link if it isn't there. +

+ +Increasing limits

+The following few example commands may be helpful to those +wondering how to increase certain soft limits imposed by the kernel: + +echo 4096 > /proc/sys/kernel/file-max +echo 12288 > /proc/sys/kernel/inode-max +echo 300 400 500 > /proc/sys/vm/freepages + +

+ + + Cloning of Linux Kernels

+You may want to build a Linux kernel on a system and then you may want to +mass deploy to many identical hardware PCs. To make it easy to install +your newly built kernel on hundreds of other systems, you may want to +package it in RPMs (Redhat) or DEB package (Debian) or just tar.gz files. + + + Build a kernel rpm package with rpmbuild -ba kernel*.spec +

+ Check that the kernel*.rpm generated has all the files in +/lib/modules/2.x.x-y directory. Otherwise you may want to tar gzip the +directory /lib/modules/2.x.x-y and take it to destination machines. +

+ Check that your kernel package has /boot/initrd-2.x.x-y.img file, +otherwise you may want to tar gzip and take it to destination machines. +

+ And other files in /boot which are not in the kernel*.rpm package. +

+ + + + + + + @@ -766,7 +1052,7 @@ indicating that you should type ``make config'' I would write Important questions and their answers

-All the chapters from this here are written by +All the chapters from this chapter onwards are written by . What does the kernel do, anyway?

@@ -850,7 +1136,7 @@ transfer the kernel image to the slower machine. Getting the source

-You can obtain the source via anonymous ftp from ftp.kernel.org in +You can obtain the source via anonymous ftp from in /pub/linux/kernel/vx.y, where x.y is the version (eg 2.2), and as mentioned before, the ones that end with an odd number are development releases and may be unstable. @@ -859,9 +1145,9 @@ is the version number. The sites also typically carry ones with a suffix of .bz2, which have been compressed with bzip2 (these files will be smaller and take less time to transfer).

-It's best to use ftp.xx.kernel.org where xx is your -country code; examples being ftp.at.kernel.org for Austria, -and ftp.us.kernel.org for the United States. +It's best to use where xx is your +country code; examples being for Austria, +and for the United States.

Unpacking the source

@@ -895,7 +1181,7 @@ Carry out the instructions when appropriate -- symbolic links that should be in place, removal of stale .o files, etc.

If you have a .bz2 file and the bzip2 program (read about it at -http://www.muraroa.demon.co.uk/), do this: +), do this:

bz2cat linux-x.y.z.tar.bz2 | tar xvf - @@ -1115,8 +1401,8 @@ necessary.)

If you are serious about sound card support, have a look at both the free -drivers at http://www.linux.org.uk/OSS/ and the commercial -Open Sound System at http://www.opensound.com/. +drivers at and the commercial +Open Sound System at .

Other configuration options

@@ -1453,263 +1739,6 @@ paste text between virtual consoles and do other things with a large variety of mouse types.

-Some pitfalls

- -make clean

-If your new kernel does really weird things after a routine kernel upgrade, -chances are you forgot to make clean before compiling the new -kernel. Symptoms can be anything from -your system outright crashing, strange I/O problems, to crummy -performance. Make sure you do a make dep, too. -

- -Huge or slow kernels

-If your kernel is sucking up a lot of memory, is too large, -and/or just takes forever to compile even when you've got your new -Quadbazillium-III/4400 working on it, you've probably got lots of unneeded -stuff (device drivers, filesystems, etc) configured. If you don't use it, -don't configure it, because it does take up memory. -The most obvious symptom of kernel bloat is extreme swapping in and out of -memory to disk; if your disk is making a lot of noise and it's not one of -those old Fujitsu Eagles that sound like like a jet landing when turned -off, look over your kernel configuration. -

- -You can find out how much memory the kernel is using by taking the -total amount of memory in your machine and subtracting from it the -amount of ``total mem'' in /proc/meminfo or the output of the command -`free'. -

- -The parallel port doesn't work/my printer doesn't work

-Configuration options for PCs are: First, under the category `General Setup', -select `Parallel port support' and `PC-style hardware'. Then under -`Character devices', select `Parallel printer support'. -

-Then there are the names. Linux 2.2 names the printer devices differently -than previous releases. The upshot of this is that if you had an lp1 -under your old kernel, it's probably an lp0 under your new one. -Use `dmesg' or look through the logs in /var/log to find -out. -

- -Kernel doesn't compile

- -If it does not compile, then it is likely that a patch failed, or your -source is somehow corrupt. Your version of gcc also might not -be correct, or could also be corrupt (for example, the include files -might be in error). Make sure that the symbolic links which -Linus describes in the README are set up correctly. In general, if -a standard kernel -does not compile, something is seriously wrong with the system, and -reinstallation of certain tools is probably necessary. -

- -In some cases, gcc can crash due to hardware problems. The error -message will be something like ``xxx exited with signal 15'' and it will -generally look very mysterious. I probably would not mention this, except -that it happened to me once - I had some bad cache memory, and the compiler -would occasionally barf at random. Try reinstalling gcc first if you -experience problems. You should only get suspicious if your kernel compiles -fine with external cache turned off, a reduced amount of RAM, etc. -

- -It tends to disturb people when it's suggested that their hardware has -problems. Well, I'm not making this up. There is an FAQ for it -- it's at -http://www.bitwizard.nl/sig11/. -

- -New version of the kernel doesn't seem to boot

- -You did not run LILO, or it is not configured correctly. One thing that -``got'' me once was a problem in the config file; it said `boot = -/dev/hda1' -instead of `boot = /dev/hda' (This can be really annoying at first, -but once you have a working config file, you shouldn't need to -change it.). -

- - You forgot to run LILO, or system doesn't boot at all

- -Ooops! The best thing you can do here is to boot off of a floppy disk or -CDROM and -prepare another bootable floppy (such as `make zdisk' would do). -You need to know where your root (/) filesystem is and what type -it is (e.g. second extended, minix). In the example below, you also need -to know what filesystem your /usr/src/linux source -tree is on, its type, and where it is normally mounted.

- -In the following example, / is /dev/hda1, and the -filesystem which holds /usr/src/linux -is /dev/hda3, normally mounted at /usr. Both are -second extended filesystems. The working kernel image in -/usr/src/linux/arch/i386/boot is called bzImage.

- -The idea is that if there is a functioning -bzImage, it is possible to use that -for the new floppy. Another alternative, which may or may not work better -(it depends on the particular method in which you messed up your system) is -discussed after the example.

- -First, boot from a boot/root disk combo or rescue disk, and -mount the filesystem which contains the working kernel image:

- - - mkdir /mnt - mount -t ext2 /dev/hda3 /mnt - - -If mkdir tells you that the directory already exists, just ignore -it. Now, cd to the place where the working kernel image was. Note -that - -/mnt + /usr/src/linux/arch/i386/boot - /usr = /mnt/src/linux/arch/i386/boot - -Place a formatted -disk in drive ``A:'' (not your boot or root disk!), dump -the image to the disk, and configure it for your root filesystem:

- - - cd /mnt/src/linux/arch/i386/boot - dd if=bzImage of=/dev/fd0 - rdev /dev/fd0 /dev/hda1 - - -cd to / and unmount the normal /usr filesystem:

- - cd / - umount /mnt - - -You should now be able to reboot your system as normal from this floppy. -Don't forget to run lilo (or whatever it was that you did wrong) after -the reboot!

- -As mentioned above, there is another common alternative. If you -happened to have a working kernel image in / (/vmlinuz -for example), you can use that for a boot disk. Supposing all of the above -conditions, and that my kernel image is /vmlinuz, just make these -alterations to the example above: change -/dev/hda3 to /dev/hda1 (the / filesystem), -/mnt/src/linux to -/mnt, and if=bzImage to if=vmlinuz. The -note explaining how to derive /mnt/src/linux may be ignored. -

- -Using LILO with big drives (more than 1024 cylinders) can cause problems. -See the LILO mini-HOWTO or documentation for help on that. -

- -It says `warning: bdflush not running'

- -This can be a severe problem. Starting with a kernel release -after 1.0 (around 20 Apr 1994), a program called `update' which -periodically flushes out the filesystem buffers, was upgraded/replaced. Get -the sources to `bdflush' -(you should find it where you got your kernel source), and install it (you -probably want to run your system under the old kernel while doing this). It -installs itself as `update' and after a reboot, the new kernel -should no longer complain. -

- -I can't get my IDE/ATAPI CD-ROM drive to work

-Strangely enough, lots of people cannot get their ATAPI drives working, -probably because there are a number of things that can go wrong. -

-If your CD-ROM drive is the only device on a particular IDE -interface, it must be jumpered as ``master'' or ``single.'' Supposedly, -this is the most common error. -

-Creative Labs (for one) has put IDE interfaces on their sound cards now. -However, this leads to the interesting problem that while some people only -have one interface to being with, many have two IDE interfaces built-in to -their motherboards (at IRQ15, usually), so a common practice is to make the -soundblaster interface a third IDE port (IRQ11, or so I'm told). -

-This causes problems with linux in that versions 1.2.x don't support a third -IDE interface (there is support in starting somewhere in the 1.3.x series -but that's development, remember, and it doesn't auto-probe). To get around -this, you have a few choices.

-

-If you have a second IDE port already, chances are that you are not using -it or it doesn't already have two devices on it. Take the ATAPI drive off -the sound card and put it on the second interface. You can then disable the -sound card's interface, which saves an IRQ anyway. -

-If you don't have a second interface, jumper the sound card's interface -(not the sound card's sound part) as IRQ15, the second interface. It should -work. -

- -It says weird things about obsolete routing requests

- -Get new versions of the route program and any other programs -which do route manipulation. -/usr/include/linux/route.h (which is actually a file in -/usr/src/linux) has changed. -

- -Firewalling not working in 1.2.0

-Upgrade to at least version 1.2.1. -

- -``Not a compressed kernel Image file''

-Don't use the vmlinux file created in /usr/src/linux as -your boot image; [..]/arch/i386/boot/bzImage is the right -one. -

- -Problems with console terminal after upgrade to 1.3.x

-Change the word dumb to linux in the console termcap -entry in /etc/termcap. You may also have to make a terminfo entry. -

- - Can't seem to compile things after kernel upgrade

-The linux kernel source includes a number of include files (the things that -end with .h) which are referenced by the standard ones in -/usr/include. They are typically referenced like this (where -xyzzy.h would be something in /usr/include/linux): - - #include - -Normally, there is a link called linux in /usr/include to -the include/linux directory of your kernel source -(/usr/src/linux/include/linux in the typical system). If this link -is not there, or points to the wrong place, most things will not compile at -all. If you decided that the kernel source was taking too much room on the -disk and deleted it, this will obviously be a problem. Another way it might -go wrong is with file permissions; if your root has a umask -which doesn't allow other users to see its files by default, and you -extracted the kernel source without the p (preserve filemodes) -option, those users also won't be able to use the C compiler. Although you -could use the chmod command to fix this, it is probably easier to -re-extract the include files. You can do this the same way you did the -whole source at the beginning, only with an additional argument:

- - blah# tar zxvpf linux.x.y.z.tar.gz linux/include - -Note: ``make config'' will recreate the /usr/src/linux -link if it isn't there. -

- -Increasing limits

-The following few example commands may be helpful to those -wondering how to increase certain soft limits imposed by the kernel: - -echo 4096 > /proc/sys/kernel/file-max -echo 12288 > /proc/sys/kernel/inode-max -echo 300 400 500 > /proc/sys/vm/freepages - -

- -Note for upgrade to version 2.0.x, 2.2.x

-Kernel versions 2.0.x and 2.2.x introduced quite a bit of changes for kernel -installation. The file Documentation/Changes in the 2.0.x source -tree contains information that you should know when upgrading to either of -these versions. You will most likely need to upgrade several key packages, -such as gcc, libc, and SysVInit, and perhaps alter some system files, so -expect this. Don't panic, though. -

Modules

Loadable kernel modules can save memory and ease configuration. The scope @@ -1836,10 +1865,8 @@ result will not be what you expect. Russell Nelson (nelson@crynwr.com) summarizes the changes in new kernel releases. These are short, and you might like to look at them before an upgrade. They are available with anonymous ftp from -ftp.emlist.com in pub/kchanges or through the URL - - http://www.crynwr.com/kchanges - + in pub/kchanges or through the URL +

Other relevant HOWTOs that might be useful

@@ -1856,121 +1883,6 @@ before an upgrade. They are available with anonymous ftp from BogoMips mini-HOWTO: in case you were wondering -Misc

- -Author

- -The author and maintainer of the Linux Kernel-HOWTO is Brian Ward - - -. Please send me any comments, additions, -corrections (Corrections are, in particular, the most important to me.). -

- -You can take a look at my `home page' at one of these URLs: - - http://www.math.psu.edu/bri/ - http://blah.math.tu-graz.ac.at/~bri/ - -

- -Even though I try to be attentive as possible with mail, please remember -that I get a lot of it every day, so it may take a little time to -get back to you. Especially when emailing me with a question, please try -extra hard to be clear and detailed in your message. If you're writing -about non-working hardware (or something like that), I need to know what -your hardware configureation is. If you report an error, don't just say -``I tried this but it gave an error;'' I need to know what the error was. -I would also like to know what versions of the kernel, gcc, and libc you're -using. If you just tell me you're using this-or-that distribution, it won't -tell me much at all. I don't care if you -ask simple questions; remember, if you don't ask, you may never get an -answer! I'd like to thank everyone who has given me feedback. -

-If your question does not relate to the kernel, or is in some language that -I don't understand, I may not answer. -

- -If you mailed me and did not get an answer within a resonable amount of -time (three weeks or more), then chances are that I accidentally deleted your -message or something (sorry). Please try again. -

- -I get a lot of mail about thing which are actually hardware problems or -issues. That's OK, but please try to keep in mind that I'm not familiar -with all of the hardware in the world. I use AMD processors, Adaptec and -Sybios SCSI controllers, and IBM SCSI disks. -

- -Version -0.1 was written on October 3, 1994. This document is available in -SGML, PostScript, TeX, roff, and plain-text formats. -

- -To do

-The ``Tips and tricks'' section is a little small. I hope to expand on it -with suggestions from others.

-So is ``Additional packages.''

-More debugging/crash recovery info needed.

- -Contributions

-A small part of Linus' README (kernel hacking options) is inclusive. -(Thanks, Linus!) -

-uc@brian.lunetix.de (Ulrich Callmeier): patch -s and xargs.

-quinlan@yggdrasil.com (Daniel Quinlan): corrections and -additions in many sections.

-nat@nat@nataa.fr.eu.org (Nat Makarevitch): mrproper, tar -p, many -other things

-boldt@math.ucsb.edu (Axel Boldt): collected descriptions of -kernel configuration options on the net; then provided me with the list

-lembark@wrkhors.psyber.com (Steve Lembark): multiple boot -suggestion

-kbriggs@earwax.pd.uwa.edu.au (Keith Briggs): some corrections and -suggestions

-rmcguire@freenet.columbus.oh.us (Ryan McGuire): makeables -additions

-dumas@excalibur.ibp.fr (Eric Dumas): French translation

-simazaki@ab11.yamanashi.ac.jp (Yasutada Shimazaki): Japanese translation

-jjamor@lml.ls.fi.upm.es (Juan Jose Amor Iglesias): Spanish translation

-mva@sbbs.se (Martin Wahlen): Swedish translation

-jzp1218@stud.u-szeged.hu (Zoltan Vamosi): Hungarian translation

-bart@mat.uni.torun.pl (Bartosz Maruszewski): Polish translation

-donahue@tiber.nist.gov (Michael J Donahue): typos, winner of the -``sliced bread competition''

-rms@gnu.ai.mit.edu (Richard Stallman): -``free'' documentation concept/distribution notice

-dak@Pool.Informatik.RWTH-Aachen.DE (David Kastrup): NFS thing

-esr@snark.thyrsus.com (Eric Raymond): various tidbits

- -The people who have sent me mail with questions and problems have also been -quite helpful. -

- -Copyright notice, License, and all that stuff

-Copyright © Brian Ward, 1994-1999.

-Permission is granted to make and distribute copies of this manual provided -the copyright notice and this permission notice are preserved on all -copies.

- -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the derived -work is distributed under the terms of a permission notice identical to -this one. Translations fall under the catagory of ``modified versions.'' -

- -Warranty: None.

- -Recommendations: -Commercial redistribution is allowed and encouraged; however, it is -strongly recommended that the redistributor contact the author before the -redistribution, in the interest of keeping things up-to-date (you could -send me a copy of the thing you're making while you're at it). Translators -are also advised to contact the author before translating. The printed -version looks nicer. Recycle.

- - Other Formats of this Document