LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel Compile help (https://www.linuxquestions.org/questions/slackware-14/kernel-compile-help-617926/)

hellasyoda 02-01-2008 07:54 AM

Kernel Compile help
 
Hello. I 'm using slackware 12 and i want to complie a new kernel. I dont have idea how to so i am looking for some full instructions that will help me to compile. I found this link but i dont know if somethings has change.so if u have a better guide feel free to post it:) i dont want to mess up my system again :cry:

Uncle_Theodore 02-01-2008 08:11 AM

It's an excellent guide, and you can use it with a new version of kernel.
The only difference is, you won't be able to get a complete config file to start with. Which kernel are you compiling?

TSquaredF 02-01-2008 08:47 AM

Download Linux Kernel In A Nutshell. It really helped me.
Regards,
Bill

onebuck 02-01-2008 09:31 AM

Hi,

Welcome to Slackware!

Quote:

Originally Posted by hellasyoda (Post 3042374)
Hello. I 'm using slackware 12 and i want to complie a new kernel. I dont have idea how to so i am looking for some full instructions that will help me to compile. I found this link but i dont know if somethings has change.so if u have a better guide feel free to post it:) i dont want to mess up my system again :cry:

The link you provided is a good guide but I prefer Alien_Bob's 'Building a Linux Kernel from source'. A good wiki.

This link and others are available from 'Slackware-Links' .

Bruce Hill 02-01-2008 11:28 AM

Quote:

Originally Posted by hellasyoda (Post 3042374)
Hello. I 'm using slackware 12 and i want to complie a new kernel. I dont have idea how to so i am looking for some full instructions that will help me to compile. I found this link but i dont know if somethings has change.so if u have a better guide feel free to post it:) i dont want to mess up my system again :cry:

I have to disagree with the instructions in that link. Read the README file located in /usr/src/linux/README, and this book mentioned below, and you will find the discrepancies.

The Linux Kernel in a Nutshell book is correct, and I agree with TSquaredF -- it's very good. It's author, Greg Kroah-Hartman, is a present Linux kernel developer. The author of that guide you posted is not. I recommend that you download this book, study it before, and use it as you recompile your kernel.

Read and follow the directions of the README file that comes with the kernel source ... located in ./linux-x.x.x/README after you unpack the new source. It is really very simple to build, configure, and install a kernel from the normal users home directory.

Here's my very simple kernel rebuild guide that works, and I'm going to do just this on a fresh install of Slackware-12.0 on my test box as I type for you ...

Download the latest stable kernel source (2.6.24) from the mirror nearest you. As per Linus Torvalds, and Greg Kroah-Hartman's, instructions make a directory somewhere under your /home/<username> directory to build the kernel. I use /home/mingdao/kernel/ -- you can create it while in your home directory just issue "mkdir kernel". The move your kernel source to there ... i.e., "mv linux-2.6.24.tar.bz2 kernel/" from wherever you downloaded the source. Then change to that directory with "cd kernel/" and untar the source by issuing "tar xvjf linux-2.6.24.tar.bz2". Then change to that directory by issuing "cd linux-2.6.24" You can start with the kernel .config file you're using in your present Slackware kernel. Now that you're in the directory for your kernel source, just issue "cp /boot/config .config" and you will copy the config file from your present kernel into that directory as .config. Now the easiest way to go from here IMO, if you've never rebuilt a kernel, is to issue "make xconfig".

That's going to give you a nice looking GUI where the options and information about them can be easily seen. Since you have used the .config file from your present working kernel, everything you have working in your system will be there. This is the point where you want to use the information in the Linux Kernel in a Nutshell book.

NB: Building your kernel this way, and under the user's home directory, you can keep running your system with nothing to worry about. You don't start X as root or anything and you're not going to even use root until you INSTALL the kernel. That's the only time you'll need root privileges.

After you finish making your choices for the new kernel, save that file from the menu, then close the xconfig window. Now, still as a normal user, issue "make" -- that will take some time. After it finishes, you need to su to root. Issue "su" and then enter root's password. You should still be in the /home/mingdao/kernel/linux-2.6.24/ directory (except your username and not mingdao). Now you have just a few steps to do as root. First, issue "cp System.map /boot/System.map-2.6.24 ; ln -sf /boot/System.map-2.6.24 /boot/System.map" to copy the System.map file to /boot as System.map-kernel-version and update the /boot/System.map symlink. Then issue "make modules_install" to install the modules. Now copy the kernel itself to /boot under some new name, like so: "cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24"
NB: In the configuring of your kernel, if you include support for your root filesystem and hard disk controller as built-in (Y or a check mark), rather than as a module (M or a dot), then you don't need an initrd image. If you have the support for your root filesystem or controller as a module, you should also build an initial ram disk image (initrd). To do this, change to the /boot directory by issuing "cd /boot" and follow the instructions in the file "README.initrd" before proceeding to the next step.

You have now configured, built, and installed you new Linux kernel. Now you need to edit the bootloader so it will be available when you reboot. Use the editor of your choice -- mine is vim. Replace vim with your editor, and issue "vim /etc/lilo.conf" and add the following lines:
Code:

image = /boot/vmlinuz-2.6.24
root = /dev/sda6
label = Slack-2.6.24
read-only # Partitions should be mounted read-only for checking

just after the very first line which reads "# Linux bootable partition config begins" ...
NB: You must replace sda6 with the partition of your root filesystem. It will already be there in your /etc/lilo.conf from the default install.

One more thing we must do to finish ... we must issue "lilo" to reinstall the bootloader.

Now you should be able to reboot and select either your old kernel or the new kernel, so if the one you just built won't boot, you can boot into your old kernel and fix whatever is wrong with your new kernel. Always keep a working kernel in place. It doesn't neccessarily have to be the kernel you installed with, but that one is always left in place on my systems. I think it's good practice, because it's using the original kernel headers and glibc your system was built with.

This was followed, copying and pasting, to recompile a kernel for my test system. Here's some info:
Code:

mingdao@james:~$ ls -l /boot/
total 21028
lrwxrwxrwx 1 root root      37 2008-02-01 05:29 README.initrd -> /usr/doc/mkinitrd-1.1.2/README.initrd
lrwxrwxrwx 1 root root      23 2008-02-02 01:18 System.map -> /boot/System.map-2.6.24
-rw-r--r-- 1 root root 1123514 2008-02-02 01:18 System.map-2.6.24
-rw-r--r-- 1 root root  795880 2007-06-20 04:18 System.map-generic-2.6.21.5
-rw-r--r-- 1 root root  813610 2007-06-20 03:53 System.map-generic-smp-2.6.21.5-smp
-rw-r--r-- 1 root root 1232918 2007-06-20 04:23 System.map-huge-2.6.21.5
-rw-r--r-- 1 root root 1252098 2007-06-20 03:58 System.map-huge-smp-2.6.21.5-smp
-rw-r--r-- 1 root root    512 2008-02-01 05:58 boot.0800
lrwxrwxrwx 1 root root      28 2008-02-01 05:45 config -> config-huge-smp-2.6.21.5-smp
-rw-r--r-- 1 root root  72738 2007-06-20 04:18 config-generic-2.6.21.5
-rw-r--r-- 1 root root  72764 2007-06-20 03:53 config-generic-smp-2.6.21.5-smp
-rw-r--r-- 1 root root  72643 2007-06-20 04:23 config-huge-2.6.21.5
-rw-r--r-- 1 root root  72669 2007-06-20 03:58 config-huge-smp-2.6.21.5-smp
-rw-r--r-- 1 root root    5040 2007-06-10 14:09 diag1.img
-rw------- 1 root root  22016 2008-02-02 01:20 map
lrwxrwxrwx 1 root root      29 2008-02-01 05:45 vmlinuz -> vmlinuz-huge-smp-2.6.21.5-smp
-rw-r--r-- 1 root root 3420024 2008-02-02 01:19 vmlinuz-2.6.24
-rw-r--r-- 1 root root 1937944 2007-06-20 04:18 vmlinuz-generic-2.6.21.5
-rw-r--r-- 1 root root 2087960 2007-06-20 03:53 vmlinuz-generic-smp-2.6.21.5-smp
-rw-r--r-- 1 root root 4097784 2007-06-20 04:23 vmlinuz-huge-2.6.21.5
-rw-r--r-- 1 root root 4417112 2007-06-20 03:58 vmlinuz-huge-smp-2.6.21.5-smp
mingdao@james:~$ uname -a
Linux james 2.6.24-smp #1 SMP PREEMPT Sat Feb 2 01:10:39 CST 2008 i686 AMD Athlon(TM) XP 2200+ AuthenticAMD GNU/Linux

Another "gotcha" to prepare for ... if you use the Nvidia driver, you'll have to reinstall it when you boot into your new kernel. So keep it under /home or somewhere you'll have it available.

shadowsnipes 02-01-2008 01:28 PM

If you ever want to work with kernel sources that are already installed under /usr/src you can do this as a normal user, but you need to specify some more args during the build process.

Here's an exert from the kernel README
Code:

BUILD directory for the kernel:

  When compiling the kernel all output files will per default be
  stored together with the kernel source code.
  Using the option "make O=output/dir" allow you to specify an alternate
  place for the output files (including .config).
  Example:
    kernel source code:        /usr/src/linux-2.6.N
    build directory:          /home/name/build/kernel

  To configure and build the kernel use:
  cd /usr/src/linux-2.6.N
  make O=/home/name/build/kernel menuconfig
  make O=/home/name/build/kernel
  sudo make O=/home/name/build/kernel modules_install install

  Please note: If the 'O=output/dir' option is used then it must be
  used for all invocations of make.

I usually do this when I create new kernels images based upon the kernel version Slackware is installed with. For newer kernel versions, however, I often just put it under a folder in my users home directory (as has been described above).

When using a .config from an older kernel version I usually make oldconfig. I am not completely sure if it is necessary (someone please verify this), but I was always under the impression that it was a good idea if using a .config from a much older kernel version.

I prefer using make menuconfig for configuring kernels.

BCarey 02-01-2008 02:19 PM

Quote:

Originally Posted by Bruce Hill (Post 3042628)
Now that you're in the directory for your kernel source, just issue "cp /boot/config .config" and you will copy the config file from your present kernel into that directory as .config. Now the easiest way to go from here IMO, if you've never rebuilt a kernel, is to issue "make xconfig".

If you are changing kernel versions you should run "make oldconfig" in order to add new options for the new kernel to your old .config.

Brian

hellasyoda 02-01-2008 03:20 PM

Quote:

Originally Posted by Uncle_Theodore (Post 3042395)
Which kernel are you compiling?

The latest stable kernel.Tnx guys for help i will try to compile so may the force be with me:cool:

Bruce Hill 02-01-2008 07:14 PM

Originally posted by shadowsnipes
Quote:

If you ever want to work with kernel sources that are already installed under /usr/src you can do this as a normal user, but you need to specify some more args during the build process.

Here's an exert from the kernel README
Code:

BUILD directory for the kernel:

  When compiling the kernel all output files will per default be
  stored together with the kernel source code.
  Using the option "make O=output/dir" allow you to specify an alternate
  place for the output files (including .config).
  Example:
    kernel source code:        /usr/src/linux-2.6.N
    build directory:          /home/name/build/kernel

  To configure and build the kernel use:
  cd /usr/src/linux-2.6.N
  make O=/home/name/build/kernel menuconfig
  make O=/home/name/build/kernel
  sudo make O=/home/name/build/kernel modules_install install

  Please note: If the 'O=output/dir' option is used then it must be
  used for all invocations of make.

I usually do this when I create new kernels images based upon the kernel version Slackware is installed with. For newer kernel versions, however, I often just put it under a folder in my users home directory (as has been described above).
That is correct. However, in my kernel rebuild guide I never do this, because I never rebuild a kernel with the old Slackware source code. I always use the latest stable kernel, and that's never in the past been the one in a stable Slackware release. Also, there is no need for me to have the new kernel source code in /usr/src/linux-2.6.N.

Originally posted by shadowsnipes
Quote:

When using a .config from an older kernel version I usually make oldconfig. I am not completely sure if it is necessary (someone please verify this), but I was always under the impression that it was a good idea if using a .config from a much older kernel version.

I prefer using make menuconfig for configuring kernels.
To verify for you, it is not necessary to use "make oldconfig" with an old kernel config file to get the new kernel options (but do NOT use a 2.4 or previous version config file with 2.6 sources). You must run something other than "make config" to use it, but there are many choices listed in the README file of the kernel source. Running "make xconfig" will have the new options since your previous config listed with (NEW), as will "make menuconfig". Since someone who hasn't tested this will obviously question it, here are two things for you to read and compare.

First, from the kernel source README file:
Code:

mingdao@silas:~/kernel/linux-2.6.24$ less README
CONFIGURING the kernel:

  Do not skip this step even if you are only upgrading one minor
  version.  New configuration options are added in each release, and
  odd problems will turn up if the configuration files are not set up
  as expected.  If you want to carry your existing configuration to a
  new version with minimal work, use "make oldconfig", which will
  only ask you for the answers to new questions.

It does not say the old options will not be available -- it says it will be minimal work because it will only ask you for the answers to new questions -- which presupposes that the old questions are already answered. If you read the MAKEFILE in the kernel source you will see how they've done this.

Second, using my 2.6.13.4 kernel config file on my laptop from Oct 10, 2005, I ran "make xconfig" and "make oldconfig" and "make menuconfig" on fresh 2.6.24 source. I did not change any options on them, and saved them so that you can diff the files. They are ALL exactly the same, and have all the options you'd get if you ran "make config" and generated and entirely new .config file. Here are those three files for you to diff:
You will notice that nothing is different in those three files except the date.

If I were going to use something other than the X windows based options, it would be preferable to use "make silentoldconfig".

I particularly like the X windows based options because they give you a screen with all the kernel options and their associated HELP on the same screen. There's no need to get help by pressing "Shift+?" like you have to do with all the text based make options. My preference is also xconfig rather than gconfig because it's laid out better and looks nicer (IMO).

Bruce Hill 02-01-2008 07:25 PM

please backup your reproof
 
Originally posted by BCarey
Quote:

If you are changing kernel versions you should run "make oldconfig" in order to add new options for the new kernel to your old .config.

Brian
Please see my above post #9. You should check this for yourself on your own system, to find out you don't have to use "make oldconfig" to get the new options. You can use "make xconfig" as I previously stated, and have done for quite some time now.

If you see something in my guide or post that is incorrect, please supply some evidence to back up your supposition.

shadowsnipes 02-01-2008 10:07 PM

Quote:

Originally Posted by Bruce Hill (Post 3043071)
To verify for you, it is not necessary to use "make oldconfig" with an old kernel config file to get the new kernel options (but do NOT use a 2.4 or previous version config file with 2.6 sources). You must run something other than "make config" to use it, but there are many choices listed in the README file of the kernel source. Running "make xconfig" will have the new options since your previous config listed with (NEW), as will "make menuconfig". Since someone who hasn't tested this will obviously question it, here are two things for you to read and compare.

This makes sense to me. I remember one time where I ran make oldconfig and got interrupted during the long process of selecting choices for the NEW updates. Later I forgot that I hadn't finished it and instead ran make menuconfig. I remember seeing a 'NEW' next to certain options.

Thanks for verifying this. For some reason I had had this belief that make oldconfig not only just shows you the new options, but also reorganizes the config file in a certain way so that it still works. Apparently, others must do this as well.

What would be really nice is if menuconfig and xconfig made the new options stand out even more. Maybe if there was an option to have all the old config options grayed out it would be even easier to quickly scan for new options. Alternatively, or in addition, there could be a separate section for just the NEW config options.

Bruce Hill 02-01-2008 10:27 PM

Originally posted by shadowsnipes:
Quote:

What would be really nice is if menuconfig and xconfig made the new options stand out even more. Maybe if there was an option to have all the old config options grayed out it would be even easier to quickly scan for new options. Alternatively, or in addition, there could be a separate section for just the NEW config options.
Check the kernel source README file for the 11 options ... that's the purpose of "make silentoldconfig":
Code:

        "make oldconfig"  Default all questions based on the contents of
                          your existing ./.config file and asking about
                          new config symbols.
        "make silentoldconfig"
                          Like above, but avoids cluttering the screen
                          with questions already answered.

Really, reading is A Good Thing (TM) that we don't do enough ...

shadowsnipes 02-02-2008 12:19 AM

Quote:

Originally Posted by Bruce Hill (Post 3043227)
Originally posted by shadowsnipes:


Check the kernel source README file for the 11 options ... that's the purpose of "make silentoldconfig":
Code:

        "make oldconfig"  Default all questions based on the contents of
                          your existing ./.config file and asking about
                          new config symbols.
        "make silentoldconfig"
                          Like above, but avoids cluttering the screen
                          with questions already answered.

Really, reading is A Good Thing (TM) that we don't do enough ...

That's not quite the same thing as I was asking for because both of those ask you want you want one by one. That's like saying make menuconfig is like make config.

Bruce Hill 02-02-2008 12:39 AM

Quote:

Originally Posted by shadowsnipes (Post 3043303)
That's not quite the same thing as I was asking for because both of those ask you want you want one by one. That's like saying make menuconfig is like make config.

Sorry, I thought you wanted it to skip the options you'd selected before. That's what it does. Look at this:
Code:

mingdao@silas:~/kernel/linux-2.6.24$ make silentoldconfig
scripts/kconfig/conf -s arch/x86/Kconfig
mingdao@silas:~/kernel/linux-2.6.24$

That's how efficient it is ... it only outputs the selections that are NEW since the previous .config file that I used. In this example, since I already configed 2.6.24 with that .config file, it returned with nothing.

Maybe you just wanted the ncurses (is that what menuconfig is) or X windows menus? Any time you want to run those "make ?config" options you can do so, check what they do, and don't save the file. You'll have your old .config file just as it was. But in the event that you forget and save after running it, no problem ... there will be both .config and .config.old in that directory.

shadowsnipes 02-02-2008 02:48 AM

The big difference with menuconfig and xconfig versus the plain config/oldconfig/silentoldconfig is that with the first two you can look at groups of stuff and in particular look at things in a non-linear fashion. I'm sure most people reading this are thinking "thanks, Captain Obvious", but the point is that it would be nice to have the old config options grayed out (a toggle-able feature, mind you) so the NEW options stand out more. That way it is easier to see how they fit into the groups. In addition, it would be nice to have a "group"/tab/whatever where you see only the NEW options. All of this is only useful in the context of an interface that allows you to change/view config settings in a non-linear fashion. Otherwise, yes, silentoldconfig is the way to go. Personally, I dislike the vanilla config and oldconfig because I don't typically configure a kernel in a completely linear fashion. Sometimes I even change my mind about things during the process...

I hope that clarified what I was going for.

Alien_Hominid 02-02-2008 03:07 AM

Just to add:

http://www.linuxquestions.org/questi...2/#post2970217

hellasyoda 02-04-2008 05:29 AM

how i can check if have these packages?
# You must have the GCC Compiler
# You must have NCurses.

Bruce Hill 02-04-2008 05:54 AM

ls -l /var/log/packages

These are what you should see:
Code:

mingdao@james:~$ ls -l /var/log/packages | grep -i ncurses
-rw-r--r-- 1 root root  53278 2008-02-02 15:37 ncurses-5.6-i486-2
mingdao@james:~$ ls -l /var/log/packages | grep -i gcc
-rw-r--r-- 1 root root  11492 2008-02-02 15:29 gcc-4.1.2-i486-1
-rw-r--r-- 1 root root  186908 2008-02-02 15:29 gcc-g++-4.1.2-i486-1
-rw-r--r-- 1 root root    1475 2008-02-02 15:29 gcc-gfortran-4.1.2-i486-1
-rw-r--r-- 1 root root  92269 2008-02-02 15:29 gcc-gnat-4.1.2-i486-1
-rw-r--r-- 1 root root    3398 2008-02-02 15:30 gcc-java-4.1.2-i486-1
-rw-r--r-- 1 root root    2302 2008-02-02 15:30 gcc-objc-4.1.2-i486-1
-rw-r--r-- 1 root root    659 2008-02-02 15:40 gccmakedep-1.0.2-noarch-1

If you don't have them, you can install them from your Slackware CDs/DVD, or get them from an official Slackware mirror.

onebuck 02-04-2008 07:49 AM

Hi,

Quote:

Originally Posted by hellasyoda (Post 3045428)
how i can check if have these packages?
# You must have the GCC Compiler
# You must have NCurses.

You can also use the 'pkgtool' to view what packages you have.

shadowsnipes 02-04-2008 04:44 PM

Quote:

Originally Posted by Alien_Hominid (Post 3043367)

Very good reference.

okos 02-04-2008 10:28 PM

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.

2. In order to answer the questions about my system in make xconfig should I print everything from KInfoCenter?

3. When reading CHANGES_AND_HINTS.TXT,
Quote:

It is recommended that you use one of the generic kernels (either the plain
kernel-generic or kernel-generic-smp) for daily use. For most systems,
you should use the generic SMP kernel if it will run, even if your system
is not SMP-capable.
At kernel.org I could not find the smp kernel. So should I just use the generic kernel?

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?

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?

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.

Thanks
okos

okos 02-04-2008 10:52 PM

Quote:

Originally Posted by Bruce Hill (Post 3042628)

Here's my very simple kernel rebuild guide that works, and I'm going to do just this on a fresh install of Slackware-12.0 on my test box as I type for you ...

That seems to be a dead link.

Bruce Hill 02-04-2008 11:36 PM

Quote:

Originally Posted by okos (Post 3046356)
That seems to be a dead link.

Maybe you can't get past the Great Chinese Firewall? Please let me know why you think it's dead ... what message do you get?

Kernel rebuild guide shoud work if you can't get the other.

Bruce Hill 02-05-2008 01:16 AM

Originally posted by okos
Quote:

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.

Quote:

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.

Quote:

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

Quote:

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:
Code:

-rw-r--r-- 1 root root 1937944 2007-06-20 04:18 vmlinuz-generic-2.6.21.5
-rw-r--r-- 1 root root 2087960 2007-06-20 03:53 vmlinuz-generic-smp-2.6.21.5-smp
-rw-r--r-- 1 root root 4097784 2007-06-20 04:23 vmlinuz-huge-2.6.21.5
-rw-r--r-- 1 root root 4417112 2007-06-20 03:58 vmlinuz-huge-smp-2.6.21.5-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:
Code:

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)
  generic kernels.

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.

Quote:

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-2.6.21.5-smp.

Yes, that kernel .config file, located at /usr/src/linux-2.6.21.5/.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:
Code:

# Serial ATA (prod) and Parallel ATA (experimental) drivers
#
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_SATA_AHCI=y
CONFIG_SATA_SVW=y
CONFIG_ATA_PIIX=y
CONFIG_SATA_MV=y
CONFIG_SATA_NV=y
CONFIG_PDC_ADMA=y
CONFIG_SATA_QSTOR=y
CONFIG_SATA_PROMISE=y
CONFIG_SATA_SX4=y
CONFIG_SATA_SIL=y
CONFIG_SATA_SIL24=y
CONFIG_SATA_SIS=y
CONFIG_SATA_ULI=y
CONFIG_SATA_VIA=y
CONFIG_SATA_VITESSE=y
CONFIG_SATA_INIC162X=m
CONFIG_SATA_INTEL_COMBINED=y
CONFIG_SATA_ACPI=y

There is no reason to have a driver for anything but my VIA chipset (CONFIG_SATA_VIA=y) in there.

Quote:

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.
Thanks
okos
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.

hellasyoda 02-05-2008 03:55 AM

Quote:

Originally Posted by Bruce Hill (Post 3046396)
Maybe you can't get past the Great Chinese Firewall? Please let me know why you think it's dead ... what message do you get?

Kernel rebuild guide shoud work if you can't get the other.

The message:
Code:

The connection has timed out
The server at slackwarebox.dyndns.org is taking too long to respond.
The site could be temporarily unavailable or too busy. Try again in a few
moments.
# If you are unable to load any pages, check your computer's network
    connection.

#  If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.

Tnx for help

Bruce Hill 02-05-2008 04:16 AM

The other link should work now ... please try it ... DynDNS had an incorrect IP for my server.

hellasyoda 02-05-2008 05:28 AM

Quote:

Originally Posted by Bruce Hill (Post 3046566)
The other link should work now ... please try it ... DynDNS had an incorrect IP for my server.

Ok it works!

onebuck 02-05-2008 07:10 AM

Hi,

Quote:

Originally Posted by Bruce Hill (Post 3046566)
The other link should work now ... please try it ... DynDNS had an incorrect IP for my server.

Link works for me. Read the guide. Bruce, I would like to link it in 'Slackware-Links' if it's OK?

BTW, I know China' a big country but are you effected by the major winter storm there? I didn't get the city but a major auto plant building collapsed because of the snow load. Crops damaged in tropical region because of snow/cold spell. Wow, We just experienced 'Thunder snow' in Central Illinois, USA. Yes, lightening, thunder with snow. Beautiful but dangerous.

okos 02-05-2008 11:23 PM

Guys, thanks for all of the help. Bruce, I appreciate all of the details.

I started reading the book Linux Kernel In a Nutshell last night. Im on chapter 6.

Quote:

Originally Posted by Bruce Hill (Post 3046455)
[I assume you mean you upgraded a new kernel by using a Slackware package.

Actually I followed the link provided by perry. However, I had pretty much no clue on all of the choices in setting up the config.

Bruce, that Kernel Rebuild Guide is now working. I could not get it last night.

I will finish the book and the the rebuild guide before getting started.

Thanks again
Dennis

Bruce Hill 02-05-2008 11:51 PM

Originally posted by onebuck:
Quote:

Hi,



Link works for me. Read the guide. Bruce, I would like to link it in 'Slackware-Links' if it's OK?
Yes, that's fine. Please put the original link since it's my server here with unlimited bandwidth. I'm removing the file from the second link, because that has very limited bandwidth.
Quote:

BTW, I know China' a big country but are you effected by the major winter storm there? I didn't get the city but a major auto plant building collapsed because of the snow load. Crops damaged in tropical region because of snow/cold spell. Wow, We just experienced 'Thunder snow' in Central Illinois, USA. Yes, lightening, thunder with snow. Beautiful but dangerous.
No major storms here ... Kunming is known as "The Land of Eternal Spring." Our temps have been 5C to 20C lately. We had people stranded here because of train and airline cancellations due to the snow, though. You can find us easily on Google maps.

Sounds like you've had worse weather than us ... my wife and daughter want snow ... I've never been in a thunderstorm with snow ... hope you're all okay.

Bruce Hill 02-06-2008 12:08 AM

Originally posted by okos:
Quote:

Guys, thanks for all of the help. Bruce, I appreciate all of the details.

I started reading the book Linux Kernel In a Nutshell last night. Im on chapter 6.


Actually I followed the link provided by perry. However, I had pretty much no clue on all of the choices in setting up the config.

Bruce, that Kernel Rebuild Guide (link removed) is now working. I could not get it last night.

I will finish the book and the the rebuild guide before getting started.

Thanks again
Dennis
Dennis,

That guide you linked above (provided by perry) has some steps which are inconsistent with both the Linux Kernel in a Nutshell book, and the instructions that come with the Linux kernel source in it's README file. I'd compare those before following it verbatim in the future. From reading it a little I can see why you might have had problems with that kernel recompile.

The reason you couldn't get the 2.6-kernel-build.txt last night is probably because my bandwidth there was used up for the day. That's why I'll be removing it from there and just leaving it here.

I'm glad you're being helped by the details. Post if you have more questions ... there are plenty of other guys here more experienced than I, so you should surely get the help you need.

hellasyoda 02-10-2008 02:02 AM

My kernel panic
Code:

No filesystem could mount root tried
kernel panic - not syncing.vfs  unable to mount root fs on unknown - block (22,1)

tnanks

Bruce Hill 02-10-2008 03:17 AM

Quote:

Originally Posted by hellasyoda (Post 3052167)
My kernel panic
Code:

No filesystem could mount root tried
kernel panic - not syncing.vfs  unable to mount root fs on unknown - block (22,1)

tnanks

From post #5:
Quote:

NB: In the configuring of your kernel, if you include support for your root filesystem and hard disk controller as built-in (Y or a check mark), rather than as a module (M or a dot), then you don't need an initrd image. If you have the support for your root filesystem or controller as a module, you should also build an initial ram disk image (initrd). To do this, change to the /boot directory by issuing "cd /boot" and follow the instructions in the file "README.initrd" before proceeding to the next step.
You must have support for your / (root) filesystem built into the kernel. Looks like you don't. That's the most common mistake most of us make when we first start building new kernels.

Boot into your default kernel, and issue:
Code:

df -hT
which will tell you which partitions are mounted where with which filesystems. Such as:
Code:

mingdao@silas:~$ df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda5      jfs    9.3G  4.0G  5.4G  43% /
/dev/sda6      jfs    93M  22M  72M  24% /boot
/dev/sda7      jfs    3.8G  39M  3.7G  2% /var
/dev/sda8      jfs    24G  6.3G  18G  27% /home
/dev/sda1    ntfs    15G  8.4G  6.4G  57% /Windows
/dev/sda2    vfat    19G  13G  6.1G  68% /Shared
192.168.1.11:/home
              nfs    28G  18G  11G  61% /serverhome
192.168.1.11:/backup
              nfs    233G  230G  3.0G  99% /server1
192.168.1.11:/backup2
              nfs    233G  224G  9.0G  97% /server2
mingdao@silas:~$

The / (root) partition, /dev/sda5, on that box is using the JFS filesystem. So in my kernel:
Code:

mingdao@silas:~/kernel/linux-2.6.24.1$ cat .config | grep -i jfs
CONFIG_JFS_FS=y
# CONFIG_JFS_POSIX_ACL is not set
CONFIG_JFS_SECURITY=y
# CONFIG_JFS_DEBUG is not set
CONFIG_JFS_STATISTICS=y

support for JFS is built in (CONFIG_JFS_FS=y).

Rather than rebuild the kernel, you can make an initrd (initial ramdisk) image and use that instead. Then your kernel will boot without you having to rebuild it. Read the instructions in /boot/README.initrd if you want to do that.

hellasyoda 02-11-2008 05:31 AM

Quote:

Rather than rebuild the kernel, you can make an initrd (initial ramdisk) image and use that instead. Then your kernel will boot without you having to rebuild it. Read the instructions in /boot/README.initrd if you want to do that.
i used this method
Thanks for help my new kernels works :)

Bruce Hill 02-11-2008 11:54 AM

You are welcome ... so glad you got your first new kernel working!

okos 02-11-2008 11:07 PM

Few questions about kernel settings.
 
I have a dell inspiron 5150 laptop, 512 ram, 60 gb Toshiba disk. nVidia GeForce FX 5200 64M, Mobile Pent 4
I was wondering about a few kernel settings.
1. ACPI or APM or neither.
2. High Resolution Timer support? Y or N
3. SLAB or SLUB

Bruce Hill 02-13-2008 03:45 AM

1 - ACPI
2 - HIGH_RES_TIMERS and NO_HZ and HZ_1000
3 - SLAB

okos 02-14-2008 11:10 PM

Quote:

Originally Posted by Bruce Hill (Post 3055404)
2 - HIGH_RES_TIMERS and NO_HZ and HZ_1000

Hi
Im not sure what you are saying here "NO_HZ and HZ_1000". I assume you are talking about either un-checking the timer frequency or selecting 1000 HZ. It seems that I only have the option of selecting one of the speeds 100,250, 300, or 1000. I dont have the option to deselect timer frequency.

FYI I found lshw quite helpful in finding my computer hardware.

Thanks for your help Bruce Hill

okos

gr8scot 02-18-2008 05:58 AM

You want 'make oldsilentmenuconfig'
 
Quote:

Originally Posted by shadowsnipes (Post 3043363)
The big difference with menuconfig and xconfig versus the plain config/oldconfig/silentoldconfig is that with the first two you can look at groups of stuff and in particular look at things in a non-linear fashion. I'm sure most people reading this are thinking "thanks, Captain Obvious", but the point is that it would be nice to have the old config options grayed out (a toggle-able feature, mind you) so the NEW options stand out more. That way it is easier to see how they fit into the groups. In addition, it would be nice to have a "group"/tab/whatever where you see only the NEW options. All of this is only useful in the context of an interface that allows you to change/view config settings in a non-linear fashion. Otherwise, yes, silentoldconfig is the way to go. Personally, I dislike the vanilla config and oldconfig because I don't typically configure a kernel in a completely linear fashion. Sometimes I even change my mind about things during the process...

I hope that clarified what I was going for.

It was clear. What's working well at the moment for me is to try 'make' with output to a file:
'make > ../out'

Besides reading as 'makeout', this causes all the 'works, OK' output to a text file one directory above the working directory, so only errors are displayed in the terminal. This way I don't have to dig through hundreds of rows of uneventful messages to find the few problems I want to fix by running 'make gconfig' again. IMO it's better as-is than 'greying out' options I might just decide I want to change, for example because I notice that I want to add support for a peripheral I forgot I had, until I saw an error message from a neighboring directory. Or, what have you. It's just another mundane example of giving us more options, and how that works better as you become aware of more of your options.

Now, please excuse me, I'm going to go check whether, after fixing a problem in drivers/net, there are any other errors in the 'make' command that was running when I started this reply.

okos 02-18-2008 11:37 PM

Quote:

Originally Posted by gr8scot (Post 3061213)
It was clear. What's working well at the moment for me is to try 'make' with output to a file:
'make > ../out'

It sounds like a great idea. Could you show the entire command? Please understand Im quite new to Linux.

okos

duryodhan 02-19-2008 03:31 AM

people do make > /dev/null so that only errors are display iirc.

gr8scot 02-21-2008 10:39 AM

/dev/null
 
Quote:

Originally Posted by duryodhan (Post 3062238)
people do make > /dev/null so that only errors are display iirc.

Chuckle, you're so right! I actually wanted to store the output for review because I was getting warnings but not FATAL errors, and didn't think of the obvious answer to that question at the time. Funny.

gr8scot 02-21-2008 10:45 AM

> /directory/filename
 
Quote:

Originally Posted by okos (Post 3062104)
It sounds like a great idea. Could you show the entire command? Please understand Im quite new to Linux.

okos


Sure thing.

In general, you can use the symbol '>' after any command to redirect the output of that command from the terminal to a file, whose location you specify just after '>' so in this case, to mimic the 'C:\...\Desktop\file.txt' you're probably accustomed to in that other operating system, the form is:

[command] > /home/[yourusername]/Desktop/file

Note: Extensions are not generally necessary in Linux. I believe there are a couple exceptions, in software ported from Windows, but native Linux apps associate programs to files by the content, not the filename extension, so you can call log files confusing-error.log, or log.frustrating, or dear.diary, if it's that kind of a log. Welcome to Linux.

okos 02-22-2008 11:21 PM

Thanks a bunch for the response and the learning lesson;).
okos

okos 02-23-2008 12:54 AM

After two weeks on working to configure my new kernel I ran into a slight snag. For some reason I don't have the option to boot the new kernel in lilo. Here is my lilo.conf file.

Quote:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hdc
#compact # faster, but won't work on all systems.
prompt
timeout = 300
# VESA framebuffer console @ 1024x768x256
vga = 773
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
#my linux kernel
image = /boot/vmlinuz-2.6.24
root = /dev/hdc5
label = Slack-2.6.24

#Slack distribution kernel
image = /boot/vmlinuz
root = /dev/hdc5
label = Slack
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/hdc1
label = XP
# map-drive = 0x80
# to = 0x81
# map-drive = 0x81
# to = 0x80
table = /dev/hdc
# Windows bootable partition config ends
I followed Bruce Hill's instructions on installing a new 2.6 kernel.

duryodhan 02-23-2008 02:08 AM

did you run lilo after editing lilo.conf ?

okos 02-23-2008 02:43 PM

Quote:

Originally Posted by duryodhan (Post 3066976)
did you run lilo after editing lilo.conf ?

Thanks yea I figured it out shortly after posting. I wanted to delete my post but it seems I only have the ability to edit my post. Yea I had to run lilo. I should not be so quick ask. I should first try to figure it out myself.

Thanks
okos

okos 02-24-2008 05:28 PM

Many thanks
 
I want to thank you guys for your help.
Ive been able to successfully upgrade to the kernel 2.6.24.

As a reminder, if you use nVidia video drivers, download the latest version and be ready to install it after booting the new kernel.

There were a few other drivers I had to reinstall including Madwifi and the hsfmodem driver.
FYI I found a FREE driver for my Conexant hsf modem here. Instead of paying $19.99 to linuxant.

To sum it up, Ive learned alot from the following links:

Bruce Hill's instructions on compiling a new kernel.

evilDagmar was very informative on the compiling commands.

and last but not least,Linux Kernel in a Nutshell.

These are all a must read prior to compiling a new kernel.
Thanks again!


All times are GMT -5. The time now is 10:10 PM.