How to put new build kernel into Grub

How to put new build kernel into Grub

Post by viva » Thu, 05 Dec 2002 20:26:27



Hi all:

     I have installed RH8.0 with Grub boot loader. I download the src for
linux-kernel 2.4.20. I have successful build the bzImage and System.map into
the /boot directory.

     Then I go to the /etc/grub.conf and modify the file as follow:

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.18-14.img
title Red Hat Linux (2.4.20)
        root (hd0,0)
        kernel /vmlinuz-2.4.20 ro root=LABEL=/ hdc=ide-scsi

Then I try to boot from the new kernel, but fail to work. This is because I
misc the thrid line start with initrd.

I wonder how can I create a initrd-2.4.20.img file from the new kernel
build. Also I have to re-link the System.map to point to the
System.map-2.4.20 file.

Any help or point will be greatly apperciated.

Thanks,
Kevin

 
 
 

How to put new build kernel into Grub

Post by k.. » Fri, 06 Dec 2002 01:21:42



> Hi all:

>      I have installed RH8.0 with Grub boot loader. I download the src for
> linux-kernel 2.4.20. I have successful build the bzImage and System.map into
> the /boot directory.

>      Then I go to the /etc/grub.conf and modify the file as follow:

> default=0
> timeout=10
> splashimage=(hd0,0)/grub/splash.xpm.gz
> title Red Hat Linux (2.4.18-14)
>         root (hd0,0)
>         kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
>         initrd /initrd-2.4.18-14.img
> title Red Hat Linux (2.4.20)
>         root (hd0,0)
>         kernel /vmlinuz-2.4.20 ro root=LABEL=/ hdc=ide-scsi

This looks fine, except that you have vmlinuz. You *did* remember to
change the name from bzImage to vmlinuz, right?

Quote:

> Then I try to boot from the new kernel, but fail to work. This is because I
> misc the thrid line start with initrd.

Use the mkinitrd utility (/sbin/mkinitrd) to create the image:

  /sbin/mkinitrd initrd-img kernel_modules_name

You need to use the name of the modules directory in /lib/modules rather
than the kernel name. In your case it would be something like:
   mkinitrd initrd-2.4.20.img 2.4.20

BTW, I find it's usually easier to build the necessary boot modules directly
into the kernel rather than using an initrd. Except in unusual
circumstances, the modules will never be unloaded so you don't gain
anything by using initrd. Of course, you can (and should) keep other
modules such as sound, usb, video as loadable modules.

- Show quoted text -

Quote:

> I wonder how can I create a initrd-2.4.20.img file from the new kernel
> build. Also I have to re-link the System.map to point to the
> System.map-2.4.20 file.

> Any help or point will be greatly apperciated.

> Thanks,
> Kevin


 
 
 

How to put new build kernel into Grub

Post by Guillaum » Fri, 06 Dec 2002 01:43:02


I don't get it.

Why don't you just issue a 'make install' after compiling your kernel
and modules? It will take care of everything, including the necessary
lines in grub.conf if necessary.

By the way, on RH 8.0, the grub.conf is usually located in
/boot/grub/grub.conf

This is what I do when compiling a new kernel, and it never fails (now
that I got it that you can't compile a kernel under RH 8.0 if your
current language is French :/, but thats another story, so I just change
the language and it works):

copy my old .config
make xconfig (or make menuconfig)
make dep
make bzImage
make modules
make modules_install
make install

I reboot, and there is a new entry in the GRUB menu.

The kernels 2.5.* seem to have a simpler compiling process (no 'make
dep'...), but I haven't succeeded in booting properly with them.
But 2.4.20 works like a charm.

 
 
 

How to put new build kernel into Grub

Post by Paul Lutu » Fri, 06 Dec 2002 03:12:40


/ ...

Quote:> This is what I do when compiling a new kernel, and it never fails (now
> that I got it that you can't compile a kernel under RH 8.0 if your
> current language is French :/, but thats another story, so I just change
> the language and it works):

> copy my old .config
> make xconfig (or make menuconfig)
> make dep

You left out "make clean". A potential source of trouble.

Quote:> make bzImage
> make modules
> make modules_install
> make install

--
Paul Lutus
www.arachnoid.com
 
 
 

How to put new build kernel into Grub

Post by viva » Fri, 06 Dec 2002 11:01:33



Quote:> I don't get it.

> Why don't you just issue a 'make install' after compiling your kernel
> and modules? It will take care of everything, including the necessary
> lines in grub.conf if necessary.

> By the way, on RH 8.0, the grub.conf is usually located in
> /boot/grub/grub.conf

Yes, you are right the /etc/grub.conf is just a symbolic link to the
/boot/grub/grub.conf file.

But anyway thanks for your advise.

Quote:

> This is what I do when compiling a new kernel, and it never fails (now
> that I got it that you can't compile a kernel under RH 8.0 if your
> current language is French :/, but thats another story, so I just change
> the language and it works):

> copy my old .config
> make xconfig (or make menuconfig)
> make dep
> make bzImage
> make modules
> make modules_install
> make install

> I reboot, and there is a new entry in the GRUB menu.

> The kernels 2.5.* seem to have a simpler compiling process (no 'make
> dep'...), but I haven't succeeded in booting properly with them.
> But 2.4.20 works like a charm.

 
 
 

1. Help to boot new kernel with grub -delited the old kernel before tried the new one

Hi.
Can someone help, how to update Grub so I can boot into linux. I
updated the kernel with up2date software on RedHat and followed the
Instructions to delete the old kernel files from /boot and now I can't
boot into anything old or new kernel. What do I do to boot into linux.
And Grub boot loader doesn't let me run any usefull commands. Thank
you. I tried to update Redhat 7.3 so it would let me boot into linux
but that didn't work. Thank you.

2. could not read uiserver.kidl

3. Kernel Panic: Can't mount root - after building new kernel

4. directory inode from file inode?

5. How to increase the kernel vs user memory when building a new kernel

6. 2 NIC Cards and IRQ

7. booting new kernels: lilo/grub problem

8. Apache vs Netscape

9. New Kernel and Grub problem

10. GrUB Hangs after new kernel installed

11. GRUB: adding a new kernel boot entry

12. How to boot new Kernel with Grub -deleted the old files in /boot directory

13. first attempt to compile a new kernel and editing GRUB