Originally posted by okos
I have a few questions regarding kernel compile.
1. What are the steps to make sure my original kernel is kept in tack. Though I backed up my info, I am concerned about messing things up.
Your original kernel is in /usr/src/linux-x.x.x.x/, with the kernel image copied to /boot/vmlinuz-linux-x.x.x.x/ and symlinked to /boot/vmlinuz. Leave all that alone, and your original kernel stays intact. That in itself is another very good reason to build the kernel under you home directory ... just as Linus Torvalds still says in 2008, and as Greg Kroah-Hartman wrote in Linux Kernel in a Nutshell.
2. In order to answer the questions about my system in make xconfig should I print everything from KInfoCenter?
I haven't the slightest idea what KInfoCenter is -- but I issued "Alt+F2" and typed "kinfocenter" and it popped up. Only looking briefly, it appears to have good info, but incomplete info; and maybe a difficult layout. If it prints easily, you could use it. It would be better for you to get the Linux Kernel in a Nutshell
book and read it. He covers how to get the information about your hardware in it. I've put all the pdf files into one, so that it's easier to read through it. (If anyone would like the book in that format, email me and I'll post it for downloading.) Chapter 7 Customizing a Kernel covers how to get your hardware information.
3. When reading CHANGES_AND_HINTS.TXT,
At kernel.org I could not find the smp kernel. So should I just use the generic kernel?
There is no such thing as "smp kernel" source. Slackware has enabled SMP (Symmetric multi-processing support) in it's kernel, and labeled those kernels with -smp. If you only have one processor, or a single core processor, there is no benefit to enabling SMP in the kernel. From kernel.org use linux-2.6.24.tar.bz2
4. Other sites I read suggestions not to use the huge kernel? What is the difference? Is there alot of extras added to suit most computers?
Yes, there are a lot
of extras added so that it will run on most computers. Slackware-12.0 installs four kernels:
-rw-r--r-- 1 root root 1937944 2007-06-20 04:18 vmlinuz-generic-184.108.40.206
-rw-r--r-- 1 root root 2087960 2007-06-20 03:53 vmlinuz-generic-smp-220.127.116.11-smp
-rw-r--r-- 1 root root 4097784 2007-06-20 04:23 vmlinuz-huge-18.104.22.168
-rw-r--r-- 1 root root 4417112 2007-06-20 03:58 vmlinuz-huge-smp-22.214.171.124-smp
The huge one's have almost every driver you could need to get your system up and running built into them. The generic one's have almost every driver you could need as modules, which means you'll need an initrd (initial ramdisk) image to boot one of those kernels. As stated above, smp simply means symmetric multi-processing, which is support for more than one CPU, or CPU core.
Slackware's documentation says:
As stated earlier, it is recommended that you use one of the generic kernels
rather than the huge kernels; the huge kernel is primarily intended as
an "installer" and "emergency" kernel in case you forget to make an initrd.
However, if you do use one of the huge kernels, you will likely encounter
errors like this:
kobject_add failed for uhci_hcd with -EEXIST, don't try to register
These occur because the respective drivers are compiled statically into the
huge kernels but udev tries to load them anyway. These errors should be safe
to ignore, but if you really don't want them to appear, you can blacklist the
modules that try to load in /etc/modprobe.d/blacklist. However, make sure you
remove them from the blacklist if you ever decide to use the (recommended)
What I am teaching you to do in this guide is build your own kernel. I think it would be nice for everyone to build their own kernel. Look at all the helpful links you've been given; build a kernel and leave it in your home directory; run that kernel and see how it works. It took me a lot of time building kernels before I could get one that was best for my hardware, ran well, booted quickly, and had some modules for possible future use. Now it's easy, each of the 5 computers (and multiple installs) on this LAN gets a custom kernel, and I build custom kernels for the computers I build and sell.
5. When I installed slackware 12 from disk, I selected the default kernel. Did it compile to fit my system hardware? If I use the .config it contains all of the settings for my current kernel. Including all of the extras that are not necessary for my system. Is that correct?
All four of those kernels were compiled before Slackware-12.0 was finally released. They are simply installed onto your computer. They are also not guaranteed to work with your computer, but more than likely they will for most things. The default kernel, if you just press Enter and don't make another selection, is huge-smp-126.96.36.199-smp.
Yes, that kernel .config file, located at /usr/src/linux-188.8.131.52/.config, contains all of the settings (configurations) for your current kernel. Yes, including all of the extras that are not necessary for your system. For instance, I have only one SATA drive in this computer, but that Slackware kernel has drivers for all these:
# Serial ATA (prod) and Parallel ATA (experimental) drivers
# CONFIG_ATA_NONSTANDARD is not set
There is no reason to have a driver for anything but my VIA chipset (CONFIG_SATA_VIA=y) in there.
I did upgrade to a new kernel once before and had no errors. However, I noticed a drastic drop in performance. It took much longer to boot. I ended up reinstalling the entire system to correct things.
I assume you mean you upgraded a new kernel by using a Slackware package. What my guide does is teach you how to compile your own kernel. You can do it using a previous kernel .config (configuration) file, such as the one located at /boot/config in your Slackware OS, or a .config file you keep from a custom kernel you built yourself. Installing a kernel via a Slackware package is not the same thing as compiling your own kernel. There are basically four steps to recompiling a kernel: configuring, building, compiling, and installing the kernel.
As for the drop in performance, there is no way anyone can tell you now since you don't have the information ... and I'm not posing any guesses.
To learn more about the Slackware kernels, and philosophy, please read the Slackware-12.0 RELEASE_NOTES and CHANGES_AND_HINTS files.
I hope I've answered your questions satisfactorily, and you will be inspired to build a custom kernel for your PC. You should always
keep the kernel your system was installed with, for more than one reason. If your new kernel fails to boot, you can restart and boot into that good, working kernel you installed with and build your custom kernel again.