Linux Kernel Compiling

Discussion in 'Software' started by markit, 11 Feb 2003.

  1. markit

    markit What's a Dremel?

    Joined:
    25 May 2002
    Posts:
    207
    Likes Received:
    0
    I compiled a new kernel but (being a complete newbie at linux) i screwed up, here's the log of the boot: -

    From what i know it would seem that all the modules aren't working, the guide i followed said set a symbolic link to the current kernel ln -s /usr/src/linux-2.5.9 /usr/src/linux however there is no source files for RH 8, does this matter?

    I have the old kernel still running fine and the only reason i wanted to upgrade is so i could connect it to the net as my network card isnt supported in the standard kernal for RH8.
     
  2. dolbz

    dolbz What's a Dremel?

    Joined:
    23 Dec 2002
    Posts:
    31
    Likes Received:
    0
    Well I dont know what guide you followed exactly but it looks like you haven't recompiled properly or have missed out some vital modules for your setup.

    You say RH8 doesn't have any src files. I'm assuming this means that when you isntalled RH then you didn't select the kernel development option?

    Well woteva is going on I'll give a little guide to recompiling the kernel. Note: don't use the RH8 kernel source even if you do have it as it has problems compiling modules. Also I use * in place of the numbers you will have in your kernel so replace with the appropriate version numbers

    1. Download the kernel you want from kernel.org

    2.Assuming you've downloaded the .tar.gz version unpack it by running:

    Code:
    tar zxvf linux-2.*.tar.gz -C /usr/src/
    This will create the kernel directory as /usr/src/linux-2.*

    3. cd to the new kernel dir

    4. run:

    Code:
    make xconfig
    assuming you're running X at this time

    5. Select all the options you need. don't worry if you select the wrong ones because you can always recompile again and knowing exactly what you need comes with time and lots of scouring through the options available

    6. save and exit the config program

    7.Run:

    Code:
    make dep;make clean;make bzImage;make modules;make modules_install
    You can run all those seperately but is a lot easier to bunch them into one command with the semi-colons.

    8. Check the last few lines of output to see whether any errors occured. If they did you might have to check the options you selected.

    9. If not then cd to /usr/src/linux-*/arch/i386/boot

    From here copy the bzImage file to /boot with

    Code:
    cp bzImage /boot/vmlinuz-2.*
    10. Add your new kernel to your boot loader. This can usually be done by just copying the default loading options and sticking your own kernel filename in instead. If you're running LILO make sure you type LILO after editing the conf file.

    11. Reboot into your new kernel and wait for it to go wrong. You can always recompile if you've forgotten something.

    After all this you can redirect your symbolic link which should already exist as /usr/src/linux-2.4 in RH8 to the new kernel source dir. This isn't essential initially so do it after you have booted succesfully


    There ya go hope I've said all that right. probably not knowing me.

    -Dolbz

    EDIT: Do all this as root else you really wont get very far :D Oh and before everyone starts flaming about this not being how they recompile their kernel I know their are otehr ways but this is simple for a newbie to recompiling to follow and it works.
     
    Last edited: 11 Feb 2003
  3. markit

    markit What's a Dremel?

    Joined:
    25 May 2002
    Posts:
    207
    Likes Received:
    0
    this is similar to what i did and it runs fine until the boot. Could it be that a setting file is wrong e.g. in original kernel sound was a module but in this kernel it is not kind of thing?

    i'll try again
     
  4. Kargin

    Kargin Overdose . . .

    Joined:
    18 Sep 2002
    Posts:
    2,374
    Likes Received:
    1
    In the newer RedHat versions (7.3+) when doing all the makes, after you've done make modules_install, you can type in

    make install

    and it'll do all the linking and GRUB configuring for you. Then you just have to open your GRUB config and change timeout, name, etc and otheroptions you may want to alter.


    Also, it appears that your kernel couldn't find the input devices. Make sure those options are set right in the config.

    Also, when you use XConfig (well any of the configs) before you go fiddlign with the options, you ahve to tell it which config file to use, or it will just save it to a temp file, which will be lost when you try to reboot :D

    Your looking for one called open config file or similar, and then you want to open the config file that you need, which is in /usr/src/linux/configs/ I believe, I forget, it's been awhile :p anywayz, your most likely going to need kernel-2.*-i686.config (* denotes your kernel version)

    Also RedHat 8 has problems with compiling the kernel sometimes. They all do, but 8 seems a bit mroe susceptible to it. If it doesn't work, try again. It might work.

    Hope that helps you at all.
     
  5. markit

    markit What's a Dremel?

    Joined:
    25 May 2002
    Posts:
    207
    Likes Received:
    0
    Thanks all and i have tried all your advice but i still think that it is not the kernel but a config program, I only get errors on where ever it expects a module and only when it enters interactive startup (i'm going to try pressing 'I' now i think of it EDIT: Didn't work). is there a file saying what it should do/load as module?

    EDIT: I had a new idea, could it be the compiler giving me the problems? i'm using the gcc that came with RH8?
     
    Last edited: 12 Feb 2003
  6. dolbz

    dolbz What's a Dremel?

    Joined:
    23 Dec 2002
    Posts:
    31
    Likes Received:
    0
    are you sure that you are compiling the right modules into your kernel?

    It wont be the compiler gcc is the standard linux compiler and I'm sure it's tested extensively with many compilers.

    The only time I've had these kind of problems is when I haven't selected the right options in the configuration.

    Is there any chance of posting the config file?
     
  7. Kargin

    Kargin Overdose . . .

    Joined:
    18 Sep 2002
    Posts:
    2,374
    Likes Received:
    1
    Throw RedHat 8 into a bonfire where it belongs and use 7.3 ?

    :D


    Also, what hardware you running ? Everything, monitor, mouse, etc. If it connects to your computer, list it.

    You might have a funny bit of kit that is making RedHat punch itself in the fuzzy round ones. :blah:
     
  8. markit

    markit What's a Dremel?

    Joined:
    25 May 2002
    Posts:
    207
    Likes Received:
    0
    USB Optical M$ Mouse - not found in a new kernel because USB wont start
    Standard UK Keyboard
    HP Deskjet 720C - not found in a new kernel
    ATI Rage Pro (Mach64 based)
    10/100 (Myson MDT8xx chipset) NIC - not detected in either :(
    Aureal vortex 'something can't remember' - detected in both but no drivers yet

    I'm going to go through the whole config later just to check if i missed anything.
     
  9. markit

    markit What's a Dremel?

    Joined:
    25 May 2002
    Posts:
    207
    Likes Received:
    0
    I've decided to stuff Red Hat 8 as it is very incompatible with my kit.

    Anyone suggest a distro good for a webserver, proxy (or routing) and web caching? I've looked at all the Ipcop etc. but they won't run a webserver and their web interface, will they?
     
  10. FreakOnALeash

    FreakOnALeash What's a Dremel?

    Joined:
    16 May 2002
    Posts:
    194
    Likes Received:
    1
    If it is going to be used primarily as a server rather than a desktop pc I'd recommend either FreeBSD or Debian, Gentoo is also worth a look
     
  11. Kargin

    Kargin Overdose . . .

    Joined:
    18 Sep 2002
    Posts:
    2,374
    Likes Received:
    1
    Yeah, Freak 's suggestions are the best, but if you want to stay with RedHat, I'd grab 7.3, has it doesn't have so many problems.


    You might want to try out Slackware as well.

    Chi !
     
Tags:

Share This Page