Linux kernel installation

By Mictlantecuhtli
Feb 6, 2004
Topic Status:
Not open for further replies.
  1. Ok.. here's how I installed kernel 2.6.2 to new Mandrake 9.2 installation.

    Download the kernel source from www.kernel.org.

    [​IMG]

    Uncompress it to somewhere you want. You might want to use GUI tools for uncompressing, I use tar:

    tar jxf ~/Documents/linux-2.6.2.tar.bz2

    Of course you need to replace ~/Documents with the appropriate directory if the package is elsewhere.

    Now, from the kernel source directory, read Documentation/Changes, especially chapter "Current Minimal Requirements".

    If you don't have the necessary tools for compiling, you need to install them (doh). Usually they come with "development" packages. Check with the suggested commands in console.

    Next step is to configure the kernel.

    make xconfig will give you a graphical screen to choose options from:

    [​IMG]

    make menuconfig will do the same in textmode.

    When you're done, save and exit.

    make will then compile the kernel.

    This will take a while, depending on your computer's speed.

    Then follows the installation:

    sudo make modules_install install

    Or if you're already logged in as root, omit sudo.

    [​IMG]

    Once that is done, it's time to check that bootloader configuration was successful. "make install" adds the new kernel automatically to /etc/lilo.conf and/or /boot/grub/menu.lst if those exist.

    You should see something like this in /etc/lilo.conf:

    Code:
    image=/boot/vmlinuz-2.6.2
    	label=262
    	root=/dev/hda1
    	read-only
    	optional
    	vga=normal
    	append=" devfs=mount hdc=ide-scsi acpi=ht splash=silent"
    
    The installer doesn't (always) update symlinks in /boot, so you might want to update them manually:

    cd /boot
    ln -sf config-2.6.2 config
    ln -sf kernel.h-2.6.2 kernel.h
    ln -sf System-map-2.6.2 System.map


    initrd.img and vmlinuz symlinks should be correct already.

    Then, if using LILO, run /sbin/lilo.

    Reboot and enjoy.
  2. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    Nice!

    I read somewhere that you needed to upgrade certain XF86 components to work properly with 2.6..... is this true?

    How is performance ? (I've only compiled development versions of the kernel, and never booted with them often.)
  3. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Topic Starter Posts: 4,916   +9

    At least in Mandrake 9.2, I didn't need to upgrade any components of XFree86. Performance is poor in my opinion, there are strange slowdowns every now and then (I compiled the kernel with 'pre-emptive' option). I don't think it's because of CPU power, I have two ~1.5 GHz Pentium IIIs. For now, I'll rather use 2.4.22.

    Installing 2.6.2 in Red Hat 9.0 was trickier and I'm still having some problems with modules. First of all, procps and module-init-tools need updating:

    Download procps from http://procps.sourceforge.net/ , compile & install with make && make install.

    Download module-init-tools from ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools (I used 3.0-pre9).

    ./configure
    make
    ./generate-modprobe.conf /etc/modprobe.conf

    If you're using devfs, copy modprobe.devfs to /etc.

    depmod 2.6.2


    In /sbin,
    mv depmod depmod.old
    mv insmod insmod.old
    mv insmod.static insmod.static.old
    mv lsmod lsmod.old
    mv modprobe modprobe.old
    mv rmmod rmmod.old


    Now, from module-init-tools source directory, copy depmod, insmod, insmod.static, lsmod, modprobe and rmmod to /sbin.

    Make the kernel as previously instructed.

    This way kernel installs fine and boots without error messages, but some modules still won't install with insmod. For example, I compiled ALSA with emu10k1 module, but cat /proc/modules didn't show it.

    If anyone of you know why, I'd like to know.
  4. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    I am sure that I have tried installing 2.6 on Fedora Core 1 and it was fine. It got a couple of things failing on boot but I assume that these could be fixed or are probably things that you don't use anyway.

    I will be putting another motherboard in my machine soon (its machine two's turn to be the server for a while) and I will be reinstalling Linux on that so I will try this then.... Probably next weekend.
  5. Spike

    Spike Newcomer, in training Posts: 2,371

    very nice! Thanks!

    I jst downloaded the kernel from your link. I had a download speed of over 400 KB's per second, with a 512 KB connection! I've never had that before! I think I might get to like this linux lark. lol:grinthumb
  6. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    Hehehhe well... yes... its fun.
  7. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    Important article on linux 2.6 kernel compiling here:

    http://www.linuxdevices.com/articles/AT3855888078.html

  8. Spike

    Spike Newcomer, in training Posts: 2,371

    OK. I tried earlier to do this by the method posted. Right at the end of the install, after it had added to lilo, I got an error message. something about there being no "dep" file.

    I tried to run the command it then suggested where apon I got the same message again, and on further inspection I found that had no image file for 2.6.2 in the boot folder!

    From what I've read, there's no need to "make dep" with 2.6.2, and so I ask the question, whats going on here? lol

    Hopefully, if I can understand whats going on (or if I'm told what to do to stop it happening again!) I can get it right next time, and I won't have to reinstall linux. lol

    Incidentally, now that I've reinstalled linux, I have my sound working. I guess I've either gained a little in experience, or I fiddled with the sound system on the last installation to destruction!

    I have more information to post here in the form of URL's to other sites (namely, in a thread where I sought immediate help last night desperately trying to avoid killing the installation. ah well! :) which I will edit into this post later.

    I really wish I knew what happened and how to avoid it.

    Edit: http://justlinux.com/forum/showthread.php?threadid=121973

    I also tried thi next thread and followed installation instructions there. I think I might have done something wrong where he wrote "type "sbin/lilo"", because when I rebooted, all I got from it was a series of dots at the top of a black screen with a flashing cursor next to them...

    http://www.linuxquestions.org/questions/showthread.php?s=&threadid=73436
  9. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Topic Starter Posts: 4,916   +9

    The command is /sbin/lilo, it should output the options it adds to boot menu.
  10. Didou

    Didou Bowtie extraordinair! Posts: 5,899

  11. Nodsu

    Nodsu Newcomer, in training Posts: 9,431

    I recommend 2.6 kernel for anyone who is having problems with responsivness under 2.4 kernel.

    I can do heavy compression and play mp3s at the same time and still have instant keyboard input and smooth mouse cursor.

    Module autoloading does not work properly for me under 2.6. I have to manually load NIC and sound modules in rc.local to make them work.
  12. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    Oh there's no doubt that its a much better kernel than 2.4. But you have to make it work with your Linux, and that might mean (in some cases) upgrading some other components as well.

    Or you could always wait until Fedora Core 2 or something comes out, or Suse Linux 9.1.

    If you are a beginner, its probably not best, unless you are prepared to reinstall your Linux if it goes wrong. If you have Drive Image or Norton Ghost, make an image first before trying to upgrade.

    However, compiling a kernel by hand isn't THAT BAD and you can have several kernels installed at one time, each pickable from LILO or GRUB or whatever, so that you can try out 2.6 but not overwrite your 2.4 kernel.
  13. Spike

    Spike Newcomer, in training Posts: 2,371

    ok. I tried again. No joy. Everything went pretty much by the book this time, but it still somehow went pearshaped!

    I rebooted, lilo started, booted to the new kernel, and nothing but a black screen where linux should be booting.

    I restarted the computer, nothing but a black screen where the original kernel should have booted.

    Once more, reinstalled. I think I'll wait for Mandrake 10. This is getting rediculous.

    This is a little too much for one (ie. ME) so new to linux.
     
  14. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

  15. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Topic Starter Posts: 4,916   +9

    Well, 2.6.3 is working fine here with my self-made Linux, but it didn't like Red Hat 9.0 much. Or maybe Red Hat didn't like it. Maybe the latter.
    Code:
    /root>uname -a
    Linux micslinux 2.6.3 #13 Tue Feb 24 05:21:37 EET 2004 i686 unknown unknown GNU/Linux
    /root>w
     00:18:05 up 4 days, 18:34,  2 users,  load average: 1.33, 1.12, 1.07
    USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
    root     tty1      Tue05    4days  4days  0.00s /bin/sh ./setiscript
    root     tty2      22:53    1:24m  0.00s  0.00s /bin/sh /usr/X11R6/bin/startx -- -nolisten tcp
    
    
  16. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    Get Fedora Core 2 and you get 2.6 no problem.

    2.6 is great. Things are much faster in general and Linux handles so much well in Xwindows, etc.
  17. me(who else?)

    me(who else?) Newcomer, in training Posts: 433

    Help! I compiled the 2.6.8.1 kernel, and followed all the directions from the guides, but when I boot the new kernel it says that the bzImage cannot be found, despite the fact that it's in the boot folder. Here's my config file:

    Attached Files:

    • grub.txt
      File size:
      682 bytes
      Views:
      8
  18. Didou

    Didou Bowtie extraordinair! Posts: 5,899

    It is easier if you tell us what distribution you're using.
  19. me(who else?)

    me(who else?) Newcomer, in training Posts: 433

    SOrry, I'm running Red Hat 9.
  20. Nodsu

    Nodsu Newcomer, in training Posts: 9,431

    Well.. Go and see if that bzImage is actually in boot directory and that you haven't typoed anything.

    Also, what guide did you follow?
  21. me(who else?)

    me(who else?) Newcomer, in training Posts: 433

  22. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    AFAIK, the 2.4 kernel comes with RH9, not the 2.6 kernel. I think RH9 will not boot with a 2.6 kernel without errors, even if the kernel build was fine. If you want a new kernel, you will have to build from 2.4 source.

    If you want to use 2.6 source code to build a 2.6 kernel and boot from that, download Fedora Core 2 and upgrade your RH9 to that.


    However, if you are getting an error loading bzImage, then you have incorrectly install the kernel. Please take us through what you did. And use 2.4 source for RH9. Maybe try again, and if you still get problems post back here with each step you did.

    Installing a new kernel is easy so just let us know the steps you took (post commands if possible.) But if you following everything in that guide, then most like you have a mistake in your grub or lilo config.
  23. me(who else?)

    me(who else?) Newcomer, in training Posts: 433

    So I should d/l the 2.4 kernel and patch it to 2.6, or is it going to be utterly impossible to do? Oh well, I guess I'll stick with 2.4. I was going to compile ACPI into the kernel for my laptop, I guess I'll see if it's available in 2.4
  24. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    If its RH9, I would stick with 2.4.
  25. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Topic Starter Posts: 4,916   +9

    So you have two partitions of RH9?

    That grub.conf file shows 2.6.8.1 installation being in the second partition, is that correct?

    In addition, having kernel parameter "root=LABEL=/" can cause problems too if you have two Linux partitions with the same name (it'd try to boot from the first one).
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.