How do you compile the kernel?
Results 1 to 6 of 6

Thread: How do you compile the kernel?

  1. #1
    Registered User Dark Millennium's Avatar
    Join Date
    Jan 2002
    Location
    Nova Scotia, Canada
    Posts
    440

    How do you compile the kernel?

    Hi guys,

    Long time no post....

    Anyway I just wanted to know how are you supposed to install/compile a kernel.

    I followed daemon's links to the kernel documentation project and followed the steps listed there but it didn't work.

    I kept getting an error about "Unable to mount root file system. Please append a proper label to root=".

    I checked my grub.conf file and am certain it was configured properly.

    The initrd image also seemed to be correct.

    Could someone please tell me, step by step what I'm supposed to do to compile a kernel?

    I'm using redhat 9.0, and I do not use scsi if that makes a difference....

    Thanks for any help you can provide.... I'm also trying to compile kernel 2.4.21...
    The strength of the turbulence is directly proportional to the temperature of you coffee.
    (Gunter's Second Law of Air Travel)

    If a program is useful, it will have to be changed.
    (Laws of Computer Programming, III)

    Thanx to Adept for the Avatar

  2. #2
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    go into kernel src directory

    /usr/src/linux

    type the following

    make mrproper
    make menuconfig (or make xconfig or make xmenuconfig - for Xwindows)
    make dep
    make bzImage
    make modules

    cd /usr/src/linux/arch/i386/boot/
    cp bzImage /boot

    edit lilo.conf ot grub.conf

    you will want to use the menuconig to take out things you dont need and put things in that you will need..

    also never remove your stock kernel, just add another line to your grub and or lilo config file so you can boot from your old kernel as well as your new kernel

  3. #3

  4. #4
    Registered User Dark Millennium's Avatar
    Join Date
    Jan 2002
    Location
    Nova Scotia, Canada
    Posts
    440
    Thanks for the link and the advice...

    I'm at this point a little frustrated with the box but will be giving all this a try asap.

    Thanks again
    The strength of the turbulence is directly proportional to the temperature of you coffee.
    (Gunter's Second Law of Air Travel)

    If a program is useful, it will have to be changed.
    (Laws of Computer Programming, III)

    Thanx to Adept for the Avatar

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    13

    RE: Kernel compilation

    I see a step in a previous post was missed. Try this: cd /usr/src/linux
    make xconfig (gui config) - Select various drivers and modules to suit your needs.

    make dep (checks dependencies)
    make clean (cleans unused items)
    make bzImage (remember the "i" is capitalized)
    make modules (sets the chosen modules)
    make modules_install (installs the modules into the kernel)
    This should take some time so be patient and watch for any driver or module blow-outs due to dependencies or you may have to go back to step 1 and repair the dep's.
    When successfully finished :
    cp /arch/i386/boot/bzImage /boot/vmlinuz-"name". Make sure you name the image to something other than just vmlinuz or it may overwrite your default kernel image.
    After you've done this, edit the /boot/grub/menu.lst with the new kernel info and rerun grub. If you're using lilo, edit the /etc/lilo.conf file and rerun lilo.install the new boot info. Good Luck.

  6. #6
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406

    Re: RE: Kernel compilation

    Originally posted by tazman
    I see a step in a previous post was missed. Try this: cd /usr/src/linux
    make xconfig (gui config) - Select various drivers and modules to suit your needs.

    make dep (checks dependencies)
    make clean (cleans unused items)
    make bzImage (remember the "i" is capitalized)
    make modules (sets the chosen modules)
    make modules_install (installs the modules into the kernel)
    This should take some time so be patient and watch for any driver or module blow-outs due to dependencies or you may have to go back to step 1 and repair the dep's.
    When successfully finished :
    cp /arch/i386/boot/bzImage /boot/vmlinuz-"name". Make sure you name the image to something other than just vmlinuz or it may overwrite your default kernel image.
    After you've done this, edit the /boot/grub/menu.lst with the new kernel info and rerun grub. If you're using lilo, edit the /etc/lilo.conf file and rerun lilo.install the new boot info. Good Luck.
    well I tryed compiling the 2.5 kernel for kicks (I guess its not being worked on anymore) and any-who its pretty neat how you compile it, you basicly just type

    make menuconfig
    make
    make modules_install

    pretty simple...humm to try 2.6

Bookmarks

Posting Permissions

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