[kwlug disc.] Kernel Compilation Woes

Damian Gerow dgerow at afflictions.org
Sun Feb 11 21:17:55 EST 2007


(It's been a while since I've done any real Linux work like this, so please
let me know if I've got anything wrong.)

Thus spake Kyle Spaans (3lucid at gmail.com) [11/02/07 20:34]:
: I downloaded the source tarball for the 2.6.20 kernel, unpacked,
: configured, and compiled the kernel without trouble. When it came time
: to install the kernel though, I got a little confused. I had my trusty
: new "Linux Kernel in a nutshell" by Greg Kroah-Hartman to guide me,
: and it pointed to the bzImage that should be in the
: .../arch/i386/boot/ directory. Of course I looked in the
: .../arch/ppc/boot/ directory instead. But to my dismay there was only
: an executable zImage file [plus a few more zImage files ending in
: .pmac, etc]. Am I safe to assume that this is typical for PPC compiled
: kernels? Also in the directory where I unpacked the kernel was an
: executable file name vmLinux. I've seen files in /boot before called
: vmLinuz, but vmLinux? Does this file have anything to do with the
: zImage file in the ppc dir?

Funny, I'd been under the impression that bzImage was simply the kernel
compressed with bzip2, and zImage was the kernel compressed with gzip.
Turns out I'm wrong:

    <http://www.cs.ccu.edu.tw/~lhr89/linux-kernel/Introduction%20to%20Linux%20start-up.pdf>

Either way, zImage is your kernel image, as is bzImage.  Either will work
just fine.

: I was also aware that I needed a ramdisk image, usually with something
: like initrd in it's name [just like one of the files currently in my
: /boot dir]. But I could find no such thing anywhere in the directory
: where I had compiled my kernel. My book wasn't of much help, because
: it either said use a kernel install script that comes with my distro,
: or just move in the kernel image and System.map file. So I used the
: zImage, and System.map files that were in the dir where I had unpacked
: and compiled the kernel. That's all fine, but for a ramdisk image, is
: it OK to use the one from my older kernel when booting the newly
: compiled one? If not, where might I find this file?

The only time you actually need to use initrd is when your boot is dependant
on modules that aren't in the kernel.  As you've compiled the kernel
yourself, I'm going to assume that your required drivers are in the kernel
(where 'required' is stuff like hard drive support, filesystem support,
etc).

I wouldn't try to use an initrd from a previous kernel release.  The drivers
in that image will be wrong, and likely cause you grief.

    <http://en.wikipedia.org/wiki/Initrd>

: Next I easily modified the yaboot config file [the Mac needs a special
: boot loader] to add another line pointing to my new kernel. Upon
: booting it however, I got some errors indicating somewhere along the
: lines of:
: VFS: could not read root partition

I'd guess that you're missing something like the proper HD driver or
filesystem driver.  If it's possible, providing the full post of the dmesg
up to that point will help identify what the problem is.

If your system is hosed, you can always boot from the install CD, open up a
shell, mount the appropriate partition, copy a functional kernel from the CD
to the hard drive, then reboot using that kernel.

: I should also mention that I discovered an "installkernel" script that
: seemed only to copy my zImage and System.map files into /boot while
: renaming the old kernel image and System.map files  - but to no avail.

Yes.  With the 2.6 line of kernels, a 'make install' generally suffices to
install your kernel.  I believe, anyhow.

  - Dmaian


More information about the KWLUG-Disc mailing list