First time compiling a new kernel

Brad Hards bhards at bigpond.net.au
Mon Jul 8 15:27:29 EST 2002


On Mon, 8 Jul 2002 15:16, Simon Fowler wrote:
> On Mon, Jul 08, 2002 at 03:06:21PM +1000, Brad Hards wrote:
> > On Mon, 8 Jul 2002 14:42, Andreas Bauer wrote:
> > > > Tonight, or possibly tomorrow, I will be upgrading my kernel from
> > > > 2.4.7-10 to 2.4.18 on my RH7.2 machine.
> > >
> > > So, I can recommend to grab the kernel sources, do make xconfig (and
> > > spend some time there), make dep, make, make bzImage, make modules,
> > > make install, make modules_install and finally run lilo or grub.  Be
> > > sure you have selected the correct architecture, otherwise your kernel
> > > won't boot!  Maybe a boot-disk wouldn't hurt either.
> >
> > I think that there is a problem at the "make install" step if you have
> > grub (which I think is the default on RH7.2 - my RH7.2 boxen use it).
> > make install assumes lilo, and won't update grub.conf
>
> As I understand it, make install uses /sbin/installkernel, which
> should be a script - that would be the place to make changes to
> support grub. I wouldn't be surprised if RH's /sbin/installkernel
> already supported grub, actually, if it's the default . . .
There is an arch dependent bit of the makefiles, that on i386 looks like:
<extract of arch/i386/boot/install.sh>
# "make install" script for i386 architecture
#
# Arguments:
#   $1 - kernel version
#   $2 - kernel image file
#   $3 - kernel map file
#   $4 - default install path (blank if root directory)
#

# User may have a custom install script

if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi

# Default install - same as make zlilo

if [ -f $4/vmlinuz ]; then
        mv $4/vmlinuz $4/vmlinuz.old
fi

if [ -f $4/System.map ]; then
        mv $4/System.map $4/System.old
fi

cat $2 > $4/vmlinuz
cp $3 $4/System.map

if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
</extract>

RH installs the following /sbin/installkernel :
<extract>
INSTALL_PATH=/boot

KERNEL_VERSION=$1
BOOTIMAGE=$2
MAPFILE=$3

if [ -f $INSTALL_PATH/vmlinuz-$KERNEL_VERSION ]; then
      mv $INSTALL_PATH/vmlinuz-$KERNEL_VERSION \
              $INSTALL_PATH/vmlinuz.old;
fi

if [ -f $INSTALL_PATH/System.map-$KERNEL_VERSION ]; then
      mv $INSTALL_PATH/System.map-$KERNEL_VERSION \
              $INSTALL_PATH/System.map.old;
fi

cat $BOOTIMAGE > $INSTALL_PATH/vmlinuz-$KERNEL_VERSION
cp $MAPFILE $INSTALL_PATH/System.map-$KERNEL_VERSION

ln -fs vmlinuz-$KERNEL_VERSION $INSTALL_PATH/vmlinuz
ln -fs System.map-$KERNEL_VERSION $INSTALL_PATH/System.map

if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
</extract>

Looks pretty hardcoded to LILO AFAICT...

Brad

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.




More information about the linux mailing list