[wplug] redhat kernel woes

Vanco, Donald VANCOD at PIOS.com
Wed Jun 18 16:16:09 EDT 2003


Keir Josephson wrote:
> Here's what I normally do when I want to cut some fat out of a Red
> Hat kernel. 

<snip>

> 4) # uname -a (check the kernel rev currently running)
> 
> 5) # cp configs/<kernelrev>.config .config (this way your sure to
> have the right config for you current kernel)
> 
> 6) # make oldconfig

	By running a "make oldconfig" you're simply blasting the .config
file you created with the copy above - do one, do the other, but no need to
do both as "the last wins".
	It's pretty interesting to do (vim)diff against a file make with
"make oldconfig" and a "matching" one that resides in the RH configs
directory.  I would have expected them to be pretty much identical, but the
"oldconfig" seems to turn a LOT more things on.  I've never had opportunity
to ask anyone in the know aboot why this might be....

> 7) # make xconfig (this will load up and show you what is available
> in the kernel. Here's where you can take out or put in any module
> that you want to be able to run. Xconfig has nice descriptions of
> what modules are available with that particular kernel. This is also
> good, if you have alot of machines with similar hardware, you can
> save the config to a file and use it across all the machines without
> having to go back and set the options each time.) 

	Wherever possible, much easier to type "make rpm" (and go see a
movie or read a book) and move the RPM as opposed to compiling again and
again.  It will make both kernel and kernel source RPMs - no idea what
options can be passed to alter the output.
 
> 8) # make dep clean bzImage modules modules_install install (this is
> just doing all the make commands at once. Nice if you have to leave
> the machine for awhile, but not too good for checking for errors.
> I've had problems every now and then with the modules_install part as
> well. I don't know if it's just a problem with Red Hat or what, but
> when I would load the config onto another machine, sometimes it would
> install without errors and other times it wouldn't. 

	The most common source for this issue on RH kernel source post RH7.3
is NOT doing a "make mrproper".

> The weird part is
> that the fix is to go back into xconfig, load the file, and change
> one or two items and resave the config. Then run make modules,
> modules_install, etc., and it would work. Maybe it's just a thing
> with xconfig. At any rate, with that kind of fix, all I can say is
> good luck.) 

	Actually - you don't even have to change a thing, just open then
save the file.  There's some bits that apparently get flipped just by
running "make (menu,x)config".  I'd love the know what that's all aboot, but
have never heard of an explanation....

> 9) # mkinitrd -f -v /boot/initrd-[kernel rev].img [kernel rev]

	I would add the "--ifneeded" option, as many times RH kernels are
configed such that initrd images are not a necessity.  If you've turned lots
of stuff off, well, then you may have placed yourself in a "need an initrd"
situation.  I personally run as much of my stuff monolithic as possible
(USB, FireWire, PCMCIS, Network, etc)

> 10) If you use lilo, edit /etc/lilo.conf & add the new kernel as
> another entry. This is a big help if you have problems booting into
> the new kernel, you can boot back into the old one and go back to the
> drawing board. 

	If you're using lilo "make install" is a lot quicker...

> NOTE: I haven't done this with GRUB yet, but I'm
> betting it's not much different.

	Yep  - but sadly "make install" is not GRUB aware.... at least, it
wasn't last time I tried it...

	Overall, my biggest complaint aboot RH kernels is that they turn on
WAY too many modules, but in the end the only result is a longer compile
time, the kernels are still pretty lean.

	Has anyone ever tried "make pdfdocs"?  Every time I've ever tried it
it bombs complaining about the need to install "DocBook Stylesheets" - but
there's not such package for RH that I can find....
	
YMMV
Don



More information about the wplug mailing list