[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: depmod failure (fwd)



Forgot to CC this to the list.

-- 
G. Branden Robinson
Purdue University
branden@purdue.edu
http://cartoon.ecn.purdue.edu/~branden/

---------- Forwarded message ----------
Date: Sat, 7 Jun 1997 10:49:34 -0500 (EST)
From: branden@apocalypse.sequitur.org
Reply-To: branden@purdue.edu
To: Ralph Winslow <rjw@nac.net>
Subject: Re: depmod failure

On Sat, 7 Jun 1997, Ralph Winslow wrote:

> I've just built a new 2.0.30 kernel from source in stable and as the
> last step ran depmod -a. This produced:
> 
> get_kernel_sys failed: Cannot find Kernel symbols.
> 
> I built as follows:
> 
> cd /usr/src/linux; make mrproper;make menuconfig;make dep;make
> clean;make zlilo;make modules;make modules_install;depmod -a
> 
> I confirmed that /user/src/linux points at kernel-source-2.0.30/.  Any
> clue would be appreciated.

Try leaving out the "make clean" step.  I'm pretty sure the Kernel-HOWTO
mumbles something about having it, but I've never understood why you needed
to cleanup after establishing dependencies.  I've had many a successful
kernel compile with the following technique:

Kernel Compiling for Dummies
By Branden Robinson (branden@purdue.edu)
Version 1.2, Dec 28 1996, 4239 bytes

For Debian users, the "kernel-package" package is supposed to do these
things for you, but I have had rough going with it, especially in the
modules department. The following steps have worked for me on multiple
machines, with various kinds of hardware and booting methods (floppy,
loadlin, lilo). It makes a number of assumptions (i386 architecture,
use of loadable modules, etc.). If anything looks inappropriate for
your setup, make backups and go with your instincts. Always, always,
always make sure you keep a known good booting kernel around on floppy
disk to save your bacon. It also makes sense to compile-in, rather than
modularize, things that are crucial to your system's operation. This
always includes the binary format you use, ELF or a.out, and I think
(can someone clarify?) it also includes the filesystem type of the root
disk, often ext2fs (a.k.a. e2fs); for your personal sanity compile
in things you can't live without (like your network card and mouse,
for example), until you're willing and ready to take the plunge with
modularizing as much of the kernel as you can.

I would appreciate feedback on this document.  I was thinking of adding a
longer, more explanatory section after the quick recipe version, but some
people seem to like this file short and sweet.  What do you think?

*) if upgrading and if possible, preserve your old kernel sources 
   (if your /usr/src/linux is a symlink to the old sources, remove the
   link *before* extracting the tar file to /usr/src, otherwise just
   rename /usr/src/linux)

// if installing a Debian kernel-source package, do that instead of the
   next four steps

*) copy .tgz source file to /usr/src
*) cd /usr/src and untar source file (it sticks itself in /usr/src/linux)
*) mv linux kernel-source-?.?.??
*) ln -s kernel-source-?.?.?? linux

// if you want to preserve the asm and linux libraries that shipped with
   your libc, simply mv them before doing the symlink manipulations below

*) if necessary, cd /usr/include; ln -s asm-i386 asm
*) if necessary, cd /usr/include; ln -s ../src/linux/include/asm-i386
   asm-i386
*) if necessary, cd /usr/include; ln -s ../src/linux/include/linux linux

*) if kernel version the same as current version, mv /lib/modules/?.?.??
   /lib/modules/?.?.??.old
*) cd /usr/src/linux; make mrproper; make
   (config|menuconfig|xconfig); make dep; make (zImage|zlilo); make modules;
   make modules_install
*) check symlink in /lib/modules (current -> /lib/modules/?.?.??),
   fix it if necessary (shouldn't be necessary) (recent kernels don't do this)
*) depmod -a (depmod -a ?.?.?? using new kernel version if applicable)
*) create new /boot :
  A) cd /usr/src/linux; cp System.map /boot/System.map-?.?.??
  B) cd /usr/src/linux; cp arch/i386/boot/zImage /boot/vmlinuz-?.?.??
  C) cd /; if necessary, ln -s boot/System.map-?.?.?? System.map
  D) cd /; if necessary, ln -s boot/vmlinuz-?.?.?? vmlinuz
*) edit /etc/modules appropriately (if you're lucky, "auto" may be all you
   need)
*) edit /etc/conf.modules (/etc/modules.conf on some systems) appropriately
   (for instance, you may need lines like "alias eth0 de4x5" and "options
   de4x5 io=0x0d")
*) rebuild psdatabase with psupdate (creates /boot/psdatabase)
*) check symlink in /etc (psdatabase -> ../boot/psdatabase) (if you didn't
   have one before, don't bother creating it)
*) if necessary, mv /boot/psdatabase /boot/psdatabse-?.?.??
*) cd /boot; if necessary, ln -s psdatabase-?.?.?? psdatabase
*) if you use lilo, check /etc/lilo.conf for correct parameters (esp. things
   like "linear")
*) backup your old kernel image(s) and then put the new ones wherever you
   need them, e.g.:
   cp /usr/src/linux/arch/i386/boot/zImage /dev/fd0
   cp /usr/src/linux/arch/i386/boot/zImage /mnt/win95/Etc/Linux
*) reboot
*) if insmod complains about missing modules (but not "unresolved
   symbols"), try editing /etc/conf.modules and aliasing missing modules
   to off; e.g., "alias net-pf-4 off" or "alias char-major-10 off"
*) in my experience, "unresolved symbols" errors often mean you have
   modules sitting in /lib/modules/?.?.?? that the kernel doesn't expect;
   if you moved your old ones and did a "make modules" and "make
   modules_install" this shouldn't happen...hopefully
*) reboot again and see if it worked

END

Disclaimer: Copyright (C) 1996 Branden Robinson.  This file is freely
redistributable by any means provided it remains intact in its entirety.
Abridging instructions for compiling kernels can really mess people up.

As you can probably tell, I've been thinking about submitting this as a
mini-HOWTO, but I've been wanting to get the input of some kernel gurus
first.

Anyway, following the above steps, I just had my most successful kernel
compile ever, using 2.0.30 from Debian 1.3. Never at any point did the
kernel screech at me about unresolved symbols or (for instance) "the
symbols from 2.0.27 don't match your 2.0.27" (one of the most annoying
errors I've ever seen in Linux, because I don't understand why modules
from the same kernel version would butt heads).

If anyone, especially aforementioned kernel gurus, have any suggestions or
corrections to make, please get in touch with me.

-- 
G. Branden Robinson
Purdue University
branden@purdue.edu
http://cartoon.ecn.purdue.edu/~branden/



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: