Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
ok, this is getting frustrating as all get out. Redhat 9.0, current installed kernel is 2.4.20-24. I am using Grub as my boot loader. This is the method I am ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2002
    Posts
    33

    Cant get kernel to compile right


    ok, this is getting frustrating as all get out.

    Redhat 9.0, current installed kernel is 2.4.20-24. I am using Grub as my boot loader.

    This is the method I am using, but I am finding some descrepenices out there. Someone tell me if I am adding too much, missing something, etc.

    1. Download kernel source from kernel.org
    2. cp to /usr/src
    3. unpack
    4. cd <new linux directory>
    5. make mrproper
    6. make menuconfig
    7. Now here is where opinions vary.

    make?
    or
    make modules_install?
    or
    make install?

    Also some bit about a new module configuration file called "modprobe.conf"

    That was the end of one doc.

    Here is another one I tried.

    1. Download kernel source from kernel.org
    2. cp to /usr/src
    3. unpack
    4. cd <new linux directory>
    5. make mrproper
    6. make menuconfig
    7. make bzImage
    8. make modules
    9. make modules_install
    10. mkinitrd /boot/newinitrd.img /<newkernelname>

    Oh yeah, what about editing the "Makefile" in /usr/src/linux to show the "new name of the kernel" you are building???? Is this still necessary???

    What about mkinitrd? Is it necessary???

    What about using VI to edit /etc/grub.conf or /boot/grub/grub.conf???

    In closing, things seem to go ok until "mkinitrd" When I try
    mkinitrd -v /boot/2.6.0.img 2.6.0 it says "2.6.0 is not a directory. Am I missing something, or should I take another approach?

    Any thoughts? What method should I use for RH 9.0 using Grub???

    Thankyou,

    GMAN

  2. #2
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    It seems like the last one you did should be fine but you never copied over the actual kernel. This is what I do (inside the kernel source directory):
    Code:
    make mrproper
    make gconfig &#40;xconfig, menuconfig also works here. it's all the same&#41;
    make bzImage
    make modules
    make modules_install
    cp arch/i386/boot/bzImage /boot/vmlinuz-<version of the kernel>
    cp System.map /boot/System.map-<version of the kernel>
    cp .config /boot/config-<version of the kernel>
    mrproper - handles all the machine related dependencices
    gconfig - GTK editing interface for the kernel
    bzImage - actually compiles the kernel into a bz format
    modules - compiles the modules
    modules_install - installs the modules

    First copy is copying the actual kernel (again, in bz form) to the boot directory. Note the bracket should contain the kernel version i,e: vmlinuz-2.4.23. The other two files are also necessary for copying as well.

    You do NOT need to ever change the makefile that comes with the linux kernel source.

    Now once that's all done, all that is left to do is edit menu.list or grub.conf (which ever one you call it). In mine, the new kernel entry would look something like this:
    Code:
    title Debian GNU/Linux 2.6.0
    root &#40;hd0,1&#41;  # mounts the first IDE, 2nd partition
    kernel /boot/vmlinuz-2.6.0 root=/dev/hda2 ro # load kernel and set root directory
    If you are unfamiliar with GRUB, let us know. I think if you do "make install" rather than "make bzImage", this is automatically taken care of but I've never had any success with it. Perhaps I need to make a soft link in called /etc/grub.conf and link it to /boot/grub/menu.lst. Does anyone hav any thoughts on that?
    The best things in life are free.

  3. #3
    Just Joined!
    Join Date
    Dec 2002
    Posts
    33
    Yeah, that is what I thought too.

    Supposedly with 2.6.0, no more "make dep", some even say "make modules" and "make modules_install".

    "make install" is suppose to take care of all that too now.

    Anyhow, is there still a need to mkinitrd?

    As for Grub, what is the proper method for that?

    yes, /etc/grub.conf is a s link to /boot/grub/grub.conf

    I would assume I just need to edit the file to point to the new kernel.

    Ever heard of vi'ing the "Makefile" in the new linux directory.

    Here is a cut and paste of what I am talking about.

    VERSION = 2
    PATCHLEVEL = 6
    SUBLEVEL = 0
    EXTRAVERSION = <replace this crap with new kernel name>

    Anyhow, I think I will try this tonight:

    make mrproper
    make gconfig (xconfig, menuconfig also works here. it's all the same)
    make bzImage
    make modules
    make modules_install
    cp arch/i386/boot/bzImage /boot/vmlinuz-<version of the kernel>
    cp System.map /boot/System.map-<version of the kernel>
    cp .config /boot/config-<version of the kernel>


    Only thing I am missing now is how to deal with Grub properly.

    Thanks,

    GMAN

  4. #4
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    I'm not too sure about mkinitrd.

    In 2.6, "make dep" is no longer an available option.

    As for GRUB, if you replace one of the steps "make bzImage" and replace it with "make install" it should automatically configure grub.conf as well as copy the System.map and .config files to /boot and renmaing them automatically.

    As for editing the makefile, I'd suggest staying away from it unless you know what you are doing. The makefile is basically an autogenerator that uses gcc to comiple the kernel. I'd leave it alone.
    The best things in life are free.

  5. #5
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    Just a tip you dont need to type make so much this will do
    Code:
    make mrproper menuconfig clean bzImage modules modules_install

  6. #6
    Just Joined!
    Join Date
    Dec 2002
    Posts
    33

    It worked

    Well, that all worked, but now I need to work through some module issues. I have some issues with modutil (I believe) I remember seeing a message about "You might need to install "modutils", which I had done earlier, but I must have missed something.

    Also noticed errors on boot about USB modules failing, etc.

    I'm almost there.

    Thanks,

    GMAN

  7. #7
    Just Joined!
    Join Date
    Dec 2002
    Posts
    33
    Ok, I found this.

    http://thomer.com/linux/migrate-to-2.6.html

    Some of this fits for my module issues and possibly USB issues.

    Another task for later tonight.


    GMAN

  8. #8
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    I'm guessing that you don't have modules-init-tools installed. I believe you need this (as opposed to modutils) for the latest stable kernel 2.6.0.

    USB names have been changed. It's just a matter of loading the right modules (well, if they are modules).
    The best things in life are free.

  9. #9
    Just Joined!
    Join Date
    Dec 2002
    Posts
    33
    well, I actually did have it (0.9.14) but did not run the generate-modprobe.conf script.

    # ./generate-modprobe.conf /etc/modprobe.conf

  10. #10
    Linux Engineer
    Join Date
    Dec 2002
    Location
    New Zealand
    Posts
    766
    not sure abotu 2.6 but in 2.4 the usb2 drivers wel listed as experimanetal, meaning if u selected the option at the start of config for ignore experiment configs, it woudl nto compile usb2 support, causing the boot messages to show them as failed to startup.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •