View previous topic :: View next topic |
Author |
Message |
jay l33t
Joined: 08 May 2002 Posts: 980
|
Posted: Sat Jun 01, 2002 5:24 pm Post subject: FAQ: kernel upgrade (and how to avoid unresolved symbols) |
|
|
I am posting this because this question has been asked a few times, so here's the Frequently Given Answer. Please feel free to add more informations, if you have any.
First: Here's a little step-by-step instruction:
1. Backup your old kernel - The first thing you should be aware of, is backing up your old kernel, just in case something gets wrong, so you're able to boot back into your gentoo system.
Code: |
# mount /dev/hda1 /boot
# cp /boot/bzImage /boot/bzImage.r1
# nano -w /boot/grub/menu.lst
|
First you're mounting your boot partition, in our case hda1, then we copy the kernel image into a new location and add a boot option in nano:
Code: |
title=Gentoo Linux
root(hd0,0)
kernel /boot/bzImage root=/dev/hda3 hdc=ide-scsi
title=Gentoo Linux (Backup kernel)
root(hd0,0)
kernel /boot/bzImage.r1 root=/dev/hda3
|
2. Download the kernel you want. Normally this is the latest, so you type:
Code: |
emerge gentoo-souces
|
If you prefer a unpatched kernel, then the vanilla-sources are the right option.
3. Change the Symlink The kernels will be placed into /usr/src and the directory tree of /usr/src/linux still points to your old kernel.
Code: |
bash-2.05a# ls -l /usr/src
total 16
lrwxrwxrwx 1 root root 22 May 30 14:50 linux -> linux-2.4.19-gentoo-r1
drwxr-xr-x 14 root root 4096 May 30 14:36 linux-2.4.18
drwxr-xr-x 15 root root 4096 May 30 14:55 linux-2.4.19-gentoo-r5
drwxr-xr-x 15 root root 4096 May 23 17:50 linux-2.4.19-r1
drwxr-xr-x 7 root root 4096 May 24 02:47 pc
bash-2.05a#
|
In our case we have three kernels, 2.4.18 (the vanilla sources) and 2.4.19-rc1 and rc5. We have to change the symlink to the new rc5 kernel. It should look like this then:
Code: |
bash-2.05a# ls -l /usr/src
total 16
lrwxrwxrwx 2 root root 22 May 30 14:50 linux -> linux-2.4.19-gentoo-r5
drwxr-xr-x 14 root root 4096 May 30 14:36 linux-2.4.18
drwxr-xr-x 15 root root 4096 Jun 1 18:34 linux-2.4.19-gentoo-r5
drwxr-xr-x 15 root root 4096 Jun 1 18:41 linux-2.4.19-r1
drwxr-xr-x 7 root root 4096 May 24 02:47 pc
bash-2.05a#
|
4. Clean the directory then compile the kernel to avoid unresolved symbols later.
Code: |
#cd /usr/src/linux
#cp .config ../
#make mrproper
#cp ../.config ./
#make menuconfig
#make dep && make clean bzImage modules modules_install
#copy /usr/src/linux/arch/i386/boot/bzImage /boot
|
This copies your kernel configuration out of the way, before cleaning up module dependencies. When compiling the kernel I recommend to disable in "Processor Types and Features" the Option "Symmetric Multiprocessor Support" unless you have more than one processor in your system, because this causes problems with nvidia drivers very often.
5. Re-Emerge everything that has added modules to your kernel. This is especially true for the nvidia drivers and alsa sound - if you forget this you'll run again into unresolved symbols.
Code: |
#emerge nvidia-kernels
#emerge alsa
#umount /dev/hdb1
|
Then reboot and test if your new kernel works.
Most common problems:
Q: I have emerged the gentoo-sources and when I try to compile I get this error at the end.
Code: |
init/main.o: In function `smp_init':
init/main.o(.text.init+0x59e): undefined reference to `skip_ioapic_setup'
arch/i386/kernel/kernel.o: In function `broken_pirq':
arch/i386/kernel/kernel.o(.text.init+0x3252): undefined reference to `skip_ioapic_setup'
make: *** [vmlinux] Error 1
|
A: This happens when you try to disable SMP and have used this kernel with SMP before. Do a make mrproper first, before recompiling the kernel.
Q: I get the message "unresolved symbol in module nvnet" and modprobe nvnet fails with the same error message.
A: This is an external driver from nvidia for nforce motherboards. If you recompile ther kernel you have recompile this as well, but make sure that the old modules are removed.
Code: |
make clean
make
make install
|
should do the trick.
Q: I recently upgraded my kernel to r5, which has been working fine. I decided to recompile with the pre-empt patch and low latency, and now when I boot I get many messages like this:
Code: |
Calculating module dependencies ...
Calculating module dependencies failed !!
# depmod
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/adm1021.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/adm1024.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/adm1025.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/adm9240.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/bt869.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/ddcmon.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/ds1621.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/eeprom.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/fscpos.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/fscscy.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/gl518sm.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/gl520sm.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-ali1535.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-ali15x3.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-amd756.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-hydra.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-i801.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-i810.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-isa.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-piix4.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-sis5595.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-via.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-viapro.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/i2c-voodoo3.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/it87.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/lm75.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/lm78.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/lm80.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/lm87.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/ltc1710.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/matorb.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/maxilife.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/mtp008.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/pcf8574.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/pcf8591.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/sis5595.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/thmc50.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/via686a.o
depmod: *** Unresolved symbols in /lib/modules/2.4.19-gentoo/misc/w83781d.o
|
A: This happens when you forget to change the symlink, but compile the new kernel. This will cause to the situation that you boot with the new kernel but loading the old modules from your previous kernel. Change the symlink and recompile the kernel, before copying into the boot partition.
Q: I receive errors that modprobe cannot locate nls_cp437 and nls_iso8859-1 or other modules.
A: This may happen, when you forget to mount your boot partition, before copying your bzImage over. As a result you will have your old kernel booting, and then having your /etc/modules.autoload script trying to load modules that have been compiled only into the new kernel
Q: When i try to emerge nvidia-kernel or compile the sources off of nvidia's website, i can copmile ok but when modprobe tries to load NVdriver, it spits out an error message stating
Code: |
/lib/modules/2.4.18-xfs/kernel/drivers/video/NVdriver: unresolved symbol _mmx_memcpy
/lib/modules/2.4.18-xfs/kernel/drivers/video/NVdriver:
Hint: You are trying to load a module without a GPL compatible license
and it has unresolved symbols. Contact the module supplier for
assistance, only they can help you.
/lib/modules/2.4.18-xfs/kernel/drivers/video/NVdriver: insmod /lib/modules/2.4.18-xfs/kernel/drivers/video/NVdriver failed
/lib/modules/2.4.18-xfs/kernel/drivers/video/NVdriver: insmod NVdriver failed
|
A: This happens, when you try to compile NVDriver on your own before removing the previous nvidia drivers. Do an emerge -unmerge nvidia-kernel, then follow the make mrproper recipe, recompile the kernel and then try to compile the nvidia drivers on your own.
Q: My X server fails to start, and my XFree86 log file contains the error:
"(EE) NVIDIA(0): Failed to initialize the NVdriver kernel module!"
A: If you do a lsmod you'll see that the module NVdriver is not loaded. Either you forgot to add it to the /etc/modules.autoload file, or it cannot loaded due to unresolved symbols.
Q: My x server freezes on start and the logfile has following error:
"(WW) NVIDIA(0): Failed to verify AGP usage!"
A: You have compiled your kernel with SMP support. The nvidia drivers however only support kernels that have this option disabled.
More resources in the net can be found at:
http://www.linuxfromscratch.org/view/3.3/chapter08/kernel.html
http://www.tldp.org/HOWTO/Kernel-HOWTO.html _________________ Do you want your posessions identified? [ynq] (n) |
|
Back to top |
|
|
T2 n00b
Joined: 01 Jun 2002 Posts: 67 Location: Slovenia
|
Posted: Mon Jun 03, 2002 3:04 pm Post subject: |
|
|
Instead of just copying bzImage to /boot one can rename it to some more meaningful name like
Code: | cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.19-pre9_with_apic |
So you can put many different kernel configurations in boot dir, also don't forget to update grub's menu.lst. |
|
Back to top |
|
|
spendabuck Apprentice
Joined: 28 Apr 2002 Posts: 256
|
Posted: Tue Jun 04, 2002 3:32 pm Post subject: |
|
|
what's the code for the symbolic link to change the kernels? |
|
Back to top |
|
|
spendabuck Apprentice
Joined: 28 Apr 2002 Posts: 256
|
|
Back to top |
|
|
leej Apprentice
Joined: 18 May 2002 Posts: 280
|
Posted: Tue Jun 04, 2002 4:05 pm Post subject: |
|
|
If your new kernel source is:
/usr/src/linux-2.4.19-gentoo-r5
Then you would do a:
Code: | ln -s /usr/src/linux-2.4.19-gentoo-r5 /usr/src/linux |
I hope I understood your question correctly! |
|
Back to top |
|
|
spendabuck Apprentice
Joined: 28 Apr 2002 Posts: 256
|
Posted: Tue Jun 04, 2002 4:14 pm Post subject: |
|
|
yes you did thanks. |
|
Back to top |
|
|
fghellar Bodhisattva
Joined: 10 Apr 2002 Posts: 856 Location: Porto Alegre, BR
|
|
Back to top |
|
|
jay l33t
Joined: 08 May 2002 Posts: 980
|
Posted: Sun Jun 09, 2002 8:13 am Post subject: |
|
|
You have to remove first the previous symbolik link. For instance
if linux is the link to your kernel directory
and then set up the new symlink:
Code: | ln -s /usr/src/linux-2xxx /usr/src/linux |
Replace 2xxx with the appropriate numbers for your kernel - ie. 2.4.19-gentoo-r5. _________________ Do you want your posessions identified? [ynq] (n) |
|
Back to top |
|
|
rew n00b
Joined: 28 Aug 2002 Posts: 47 Location: Oregon
|
Posted: Wed Aug 28, 2002 6:21 am Post subject: Correction: nVidia/SMP |
|
|
jay wrote,
Quote: | Q: My x server freezes on start and the logfile has following error:
"(WW) NVIDIA(0): Failed to verify AGP usage!"
A: You have compiled your kernel with SMP support. The nvidia drivers however only support kernels that have this option disabled.
|
I will have to disagree there. I am running the nVidia drivers fine with kernel SMP support enabled.
kernel: vanilla-sources 2.4.19
nvidia-kernel: 1.0.2960-r1
nvidia-glx: 1.0.2960-r1 _________________ linux-2.4.20 i686 SMP
Tyan Tiger MP
Dual Athlon MP 1600+
512MB EEC (1/4)
PNY Verto 64MB - GeForce4 MX 420
'Cheep-ass NIC, CDRW & DVD' |
|
Back to top |
|
|
milothurston Apprentice
Joined: 01 May 2002 Posts: 231 Location: Oxford, England.
|
Posted: Thu Aug 29, 2002 4:47 pm Post subject: |
|
|
Quote: |
I will have to disagree there. I am running the nVidia drivers fine with kernel SMP support enabled.
|
So am I, with dual Xeons and a GeForce4 PCI, also on an older machine with PIII 600s and a TNT2.
I'd be interested to know if the patch below, or an equivalent, is included in the gentoo kernel:
Code: |
--- linux/arch/i386/kernel/setup.c-pre10 Sun Jun 16 21:34:48 2002
+++ linux/arch/i386/kernel/setup.c Sun Jun 16 21:50:53 2002
@@ -71,6 +71,11 @@
* CacheSize bug workaround updates for AMD, Intel & VIA Cyrix.
* Dave Jones <davej@suse.de>, September, October 2001.
*
+ * Short-term fix for a conflicting cache attribute bug in the kernel
+ * that is exposed by advanced speculative caching on new AMD Athlon
+ * processors.
+ * Richard Brunner <richard.brunner@amd.com> and Mark Langsdorf
+ * <mark.langsdorf@amd.com>, June 2002
<snip rest of code>
|
Thanks,
Milo. |
|
Back to top |
|
|
jay l33t
Joined: 08 May 2002 Posts: 980
|
Posted: Thu Aug 29, 2002 5:48 pm Post subject: |
|
|
You're both right. I think the problem appears only if you are using the SMP kernel with only one processor. At least it was mentioned several times in this forum and mailing list and it happened to me too. So I thought that it wouldn't work on a dual processor system as well. But I'm happy to hear that this is wrong. _________________ Do you want your posessions identified? [ynq] (n) |
|
Back to top |
|
|
kybber Apprentice
Joined: 25 Jun 2002 Posts: 228 Location: Trondheim, Norway
|
Posted: Fri Aug 30, 2002 7:25 am Post subject: |
|
|
jay wrote: | You're both right. I think the problem appears only if you are using the SMP kernel with only one processor. |
Nah, I've had SMP enabled since I installed Gentoo a couple of months ago, and I only have one CPU. My nvidia card was working flawlessly using this configuration. A couple of days ago I disabled SMP to fix some APM troubles regarding shutdown, and nvidia still works. The only thing I had to do was to unmerge nvidia-kernel before compiling the new kernel, otherwise I would get an error at make modules_install. Oh, and of course reemerge nvidia-kernel after compiling the kernel.
I am using the newest nvidia-kernel (2960-r1). Maybe the guys at NVidia have fixed this problem in one of the later releases? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Aug 30, 2002 7:44 am Post subject: |
|
|
Also note that as of 1.0.2960-r1, you no longer need to reemerge nvidia-kernel after compiling a new kernel. See this thread for details. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
kybber Apprentice
Joined: 25 Jun 2002 Posts: 228 Location: Trondheim, Norway
|
Posted: Fri Aug 30, 2002 8:04 am Post subject: |
|
|
Ah, that's very nice indeed - thanks for the tip However, this is only valid if you don't do any 'serious' changes to your kernel which require a recompilation of the nvidia-kernel against the other modules/libraries etc., right? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Aug 30, 2002 8:46 am Post subject: |
|
|
kybber wrote: | Ah, that's very nice indeed - thanks for the tip However, this is only valid if you don't do any 'serious' changes to your kernel which require a recompilation of the nvidia-kernel against the other modules/libraries etc., right? |
True. I haven't examined the nvidia sources closely enough to comment on exactly what would be considered "serious", but I would expect if you have done something like changing module versioning, SMP, MTRR, or something of that ilk, you would probably be better off remerging nvidia-kernel afterwards. Basically, remerge it if you have problems. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
RayVan n00b
Joined: 12 Aug 2002 Posts: 40 Location: Houston, Tx
|
Posted: Sat Aug 31, 2002 1:53 am Post subject: |
|
|
The step where you move the /usr/src/linux symlink is incorrect, despite the fact that nearly even distribution gets it wrong. Linus' comments on this point are here.
The brief (and less technical) version is this. The /usr/src/linux symlink is /not/ supposed to point at the current kernel version, and has not been supposed to point there since 1.x versions of the kernel. The /usr/src/linux symlink exists so that gcc can find the kernel headers that glibc was compiled against.
IOW, leave the /usr/src/linux symlink alone unless you recompile glibc against the new kernel version. |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sat Aug 31, 2002 2:10 am Post subject: |
|
|
RayVan wrote: | The step where you move the /usr/src/linux symlink is incorrect, despite the fact that nearly even distribution gets it wrong. Linus' comments on this point are here. |
This quote is only relevant when /usr/include/linux and /usr/include/asm were symlinks to directories in /usr/src/linux. QFingers and I had a discussion about this in here. Linus' quote is not relevant to Gentoo, because in Gentoo, /usr/include/asm and /usr/include/linux are separate directories, maintained by the linux-headers package.
Quote: | The brief (and less technical) version is this. The /usr/src/linux symlink is /not/ supposed to point at the current kernel version, and has not been supposed to point there since 1.x versions of the kernel. The /usr/src/linux symlink exists so that gcc can find the kernel headers that glibc was compiled against. |
Not true for Gentoo, as noted above. /usr/include/asm and /usr/include/linux contain the kernel headers against which libc was compiled. /usr/src/linux does not enter into the equation - symlink or not.
Quote: | IOW, leave the /usr/src/linux symlink alone unless you recompile glibc against the new kernel version. |
I disagree with this. All ebuilds I have looked at that make kernel modules (alsa and nvidia) explicitly require that /usr/src/linux be containing (or pointing to) the sources for the running kernel. I agree with Jay's original advice. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Sep 18, 2002 8:11 am Post subject: |
|
|
zatalian's kernel compilation question has been split into its own thread here. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Thu Sep 19, 2002 7:27 pm Post subject: |
|
|
bkv's question about keeping old kernel sources around has gone here. Please don't post support questions to threads in Documentation, Tips, & Tricks. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
iKiddo Guru
Joined: 27 Jun 2002 Posts: 341 Location: Europe?
|
Posted: Sat Sep 21, 2002 4:00 pm Post subject: |
|
|
jay wrote: | You have to remove first the previous symbolik link. For instance
if linux is the link to your kernel directory
and then set up the new symlink:
Code: | ln -s /usr/src/linux-2xxx /usr/src/linux |
Replace 2xxx with the appropriate numbers for your kernel - ie. 2.4.19-gentoo-r5. |
Can't this be included in the faq of the first post ?!?! otherwise it's very confusing
Code: | #cd /usr/src/linux
#cp .config ../
#make mrproper
#cp ../.config ./
#make menuconfig
#make dep && make clean bzImage modules modules_install
#copy /usr/src/linux/arch/i386/boot/bzImage /boot |
This is also quite confusing: you're trying to copy .config out of the new /usr/src/linux ?? It gives a "file doesn't exist" error here
(I understood what you meant s to do in both cases, but it's not very clear) |
|
Back to top |
|
|
ilovenina n00b
Joined: 02 Oct 2002 Posts: 4
|
Posted: Fri Oct 04, 2002 6:48 pm Post subject: |
|
|
Hi, I am getting unresolved symbols, but I have not upgraded my kernel. this is a fresh install of 1.4.
see my topic
for more info.
Is there anything I can do? Remove my current kernel sources and emerge again? How would I do this safely? Please help... |
|
Back to top |
|
|
nbrown Tux's lil' helper
Joined: 26 Oct 2002 Posts: 140 Location: Somewhere in the NE
|
Posted: Tue Oct 29, 2002 7:00 pm Post subject: Still Getting Unresolved Symbols |
|
|
This guide says that unresolved symbols are a symptom of forgetting to set the symlink correctly, but mine points to my new sources (vanilla) and somehow I'm getting unresolved symbols in my old sources (gentoo). Any ideas on why this is happening? Thanks
Nate |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Oct 30, 2002 1:45 am Post subject: |
|
|
Please don't post questions to threads in the Documentation, Tips and Tricks forum. This is not a support forum. Ask your question somewhere else. I would split it out myself, but it lacks enough context to make sense on its own in its current form. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
|