[WBEL-users] Kernel compile woes

Phil Schaffner Philip.R.Schaffner@NASA.gov
Wed, 05 May 2004 09:11:08 -0400


On Wed, 2004-05-05 at 04:23, Johnny Hughes wrote:
> On Wed, 2004-05-05 at 02:49, Joe Ammann wrote: 
> > On Wed, 2004-05-05 at 08:43, Karl-König Königsson wrote:
> > > Hi all,
> > > 
> > > This is most peculiar... I have done this:
> > > 
> > >    cp /boot/config-2.4.21-9.0.3.EL /usr/src/linux/.config
> > >    cd /usr/src/linux
> > >    make dep && make clean bzImage
> > > 
> > [...]
> > > I'm stumped, to say the least, and don't know really where to start. I, 
> > > naively as it seems, thought that the kernel would compile out of the 
> > > box as it has on other distributions I have used, so I guess I must have 
> > > missed something.
> > > 
> > > Please, what am I doing wrong?
> > 
> > I also had regularly problems compiling Redhat kernels. Normally, the
> > trick is to do a 'make mrproper' first, before copying the config file
> > and doing make oldconfig.
> > 
> > Sometimes, you also need to to 2 (two!) make oldconfig's before
> > compiling. Now please don't ask me why ...
> Also, unless you want to name the kernel 2.4.21-9.0.3.ELcustom edit
> the file /usr/src/linux/Makefile and remove the custom from the
> EXTRAVERSIONS= line ...
> 
> Here is a RHEL guide to rebuild the kernel ....
> 
> https://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-custom-kernel.html
> 
> > CU, Joe
> 
> - Johnny Hughes

Second the above advice about "make mrproper" (have not HAD to do
distclean, but it shouldn't hurt) and "make oldconfig" (and yes,
sometimes the first pass prompts for inputs on unspecified options,
while the second time goes cleanly); however, if you remove "custom" in
the Makefile you will clobber the installed kernel.  I usually change it
to something more descriptive.

My process looks like:

# cd /usr/src/linux-2.4
# make mrproper
# cp [wherever/whatever].config .config [then edit Makefile as desired]
# make oldconfig [respond to any prompts]
# make xconfig [or menuconfig if not in X, tune the kernel/modules]
# (make -j 6 dep && make -j 6 && make -j 6 bzImage && \
 make -j 6 modules && make modules_install && make install) \
 >& /tmp/MakeKernel.log

Check the log, lather, rinse, repeat as needed; check/edit
/boot/grub/grub.conf, reboot.

Omit the "-j 6" for non-smp systems, or adjust for performance tuning -
advice on this seems to vary widely.

Phil