[UFO Chicago] kernel building, quick and dirty

BrianT.Grant BrianT.Grant
Thu, 26 Jul 2001 10:03:21 -0500


On Mon, 2 Jul 2001 16:03:31 -0500
"Peter A. Peterson II" <pedro@tastytronic.net> wrote:

> Quoting Peter A. Peterson II:
> > WHat happens?
> 
> You might have to install slang, or menuconfig or soemthing. Look at the
> error messages and then use apt-cache search <foobar> to see the
> filename. THen try apt-cache show <bash> to see the blurb on the
> package. You'll probably have to install the bin86 binary at somepoint,
> and i'm not sure what package that's in. But that's good, because you
> can look for it:
> 
> apt-cache search bin86 (shows any packages with bin86 in the blurb)
> apt-cache show packagename to show you what package actually contains
> bin86. (bin86 is an assembler compiler, fyi).
> 
> You might have to install other packages for compilation as we go along.
> 

I don't recall whether I had to install any additional packages.  I'm fairly certain that once I got to the point at which Pedro suggests make menuconfig that it worked.

> Once you do make menuconfig and set everything the way you like it (use
> the HELP function A LOT, it's very good), exit out, saving your
> configuration (it will ask you), and then do:
> 
> make dep
> make clean
> make bzImage
> 

Pete is right; the HELP function is VERY GOOD.  I was pleasantly surprised at the amount of practically applicable info contained in menuconfig.  I had spent about an hour or so reading through help info before I finally decided I would just load up Stel's .config file.  This didn't turn out to be such a great idea, however.  Both make dep and make clean ran fine - as far as I could tell - but make bzImage errored out quite early.  My problem was the result of Stel's .config file having been from kernel 2.4.2, and I was working with 2.4.5.  Well, at this point, I wasn't too interested in wading through that entire list of items in menuconfig again, so I just went in and activated the necessary Advanced Power Management (APM) components that I wanted/needed  and went through make dep, make clean, and make bzImage.  Make bzImage took MUCH longer this time and completed successfully.  A quick look at the HOWTO told me that I needed to copy the file /usr/src/linux/arch/i386/boot/bzImage into a location where LILO would find it.  LILO was currently using /boot/vmlinuz-2.2.17, so I cp bzImage /boot/vmlinuztest.  

> These three steps will probably not go smoothly the first time, but
> that's why I told you all that other garbage up there.
> 

Right, again.  

> THen, once you get through that, do
> 
> make modules
> and then
> make modules_install (or maybe it's modules-install, i don't know, and
> this is the quick and dirty version).
> 

mkdir: cannot create directory ?/lib/modules/2.4.5?: Permission denied
make: *** [_modinst_] Error 1

after doing a mkdir /lib/modules/2.4.5, I ran make modules_install again and got the same error.  This time, I tried running sudo make modules_install.  That seemed to work just fine.  

> NEXT: PLAYING WITH LILO (AND NOT GETTING YOUR EYE POKED OUT)!
> 
> pedro

Now, I'm going to jump ahead of Pete here for a minute.  I've been dealing with LILO from day one of my interaction with Linux, partially because the first machine I ran Linux on was a PC that also had to run Win'95 in order for my wife to use apps for her schooling.  A guy I work with pointed me to a nice, little LILO tutorial that I've used on several occasions.  The site - http://www.control-escape.com - seems to have a few, decent, plain-English beginners' tutorials.  Here is what my lilo.config file looked like:  

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
compact
prompt
timeout=100
image=/boot/vmlinuztest
	label=test
	root=/dev/hda3
	read-only

image=/boot/vmlinuz-2.2.17
	label=debian
	root=/dev/hda3
	read-only

other=/dev/hda1
	label=win2k

Even if you don't dual-boot w/Linux & another operating system, you can use LILO to choose which kernel you want to boot with.  For example, in one of my subsequent kernel builds, the test kernel simply wouldn't load.  In such a case, I just rebooted the machine and chose the "debian" option (see the above "label" lines) instead of the "test" option.  

Well, thats it.  Since then, I've recompiled my kernel a couple times in order to get sound, USB, and the ever-important Netatalk working; I love being able to mount my home directory from my Mac.  As a side note, I've been using Linux on this laptop as my workstation for about three weeks now.  I have just about everything I need on it, which is a very rewarding feeling.  

Brian Grant