LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-24-2008, 10:51 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze, CrunchBang Waldorf
Posts: 514

Rep: Reputation: 38
change kernel I'm using


I want to change the kernel I'm using in /boot
I changed the symlinks: System.map, config and vmlinuz to:

Quote:
System.map -> System.map-huge-2.6.21.5
config -> config-huge-2.6.21.5
vmlinuz -> vmlinuz-huge-2.6.21.5
I ran
Code:
bash-3.1# uname -a
and got this:
Quote:
Linux Slack 2.6.21.5-smp #4 SMP Mon Feb 11 17:13:56 CST 2008 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
Why am I still running an smp kernel?
I'm assuming there is more I have to do.

My computer can be buggy at times that's why I thought I would try another kernel.

Thanks for help.
 
Old 06-24-2008, 11:00 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,330

Rep: Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100
Presumably your distro includes all of these kernels in the distro and allows you to choose between them ... which is something you do at boot time, through the boot loader. Not through symlinks.

Exactly how you do this on your distro depends on your distro. But, surely it is documented.
 
Old 06-24-2008, 11:01 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,250

Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
You need to reboot first in order for the new kernel to be used, but I'm assuming you already knew that. Check /etc/lilo.conf -- it is possible that it is pointing to the /boot/vmlinuz-huge-smp-2.6.21.5-smp file directly instead of the /boot/vmlinuz symlink. If it is, change it in /etc/lilo.conf to point to the huge non-smp kernel and run `/sbin/lilo` as root to write the changes to the MBR (and then reboot).

I would, however, recommend trying the generic-smp kernel instead of the huge kernel, and if that fails, the generic non-smp kernel. The generic kernel is recommended in CHANGES_AND_HINTS.TXT included on your install CD/DVD or at your favourite mirror. Using the generic-smp kernel requires creating an initrd (initial ramdisk) since the filesystems and some hard drive controllers are built as modules instead of built into the kernel. See /boot/README.initrd for more information. For a nice script that usually outputs the correct mkinitrd command, see here. For more detailed information on switching to the generic-smp kernel, search the forums -- this has been discussed tons of times. Here's why I'm suggesting it:
Quote:
Originally Posted by CHANGES_AND_HINTS.TXT
Use one of the provided generic kernels for daily use. Do not report
bugs until/unless you have reproduced them using one of the stock
generic kernels. You will need to create an initrd in order to boot
the generic kernels - see /boot/README.initrd for instructions.
Quote:
Originally Posted by CHANGES_AND_HINTS.TXT
As stated earlier, it is recommended that you use one of the generic kernels
rather than the huge kernels; the huge kernels are primarily intended as
"installer" and "emergency" kernels in case you forget to make an initrd.
For most systems, you should use the generic SMP kernel if it will run,
even if your system is not SMP-capable. Some newer hardware needs the
local APIC enabled in the SMP kernel, and theoretically there should not be
a performance penalty with using the SMP-capable kernel on a uniprocessor
machine, as the SMP kernel tests for this and makes necessary adjustments.
Furthermore, the kernel sources shipped with Slackware are configured for
SMP usage, so you won't have to modify those to build external modules
(such as NVidia or ATI proprietary drivers) if you use the SMP kernel.

If you decide to use one of the non-SMP kernels, you will need to follow the
instructions in /extra/linux-2.6.24.5-nosmp-sdk/README.TXT to modify your
kernel sources for non-SMP usage. Note that this only applies if you are
using the Slackware-provided non-SMP kernel - if you build a custom kernel,
the symlinks at /lib/modules/$(uname -r)/{build,source} will point to the
correct kernel source so long as you don't (re)move it.

If you decide to use one of the huge kernels anyway, you will encounter
errors like this:
kobject_add failed for uhci_hcd with -EEXIST, don't try to register
These occur because the respective drivers are compiled statically into the
huge kernels but udev tries to load them anyway. These errors should be safe
to ignore, but if you really don't want them to appear, you can blacklist the
modules that try to load in /etc/modprobe.d/blacklist. However, make sure you
remove them from the blacklist if you ever decide to use the (recommended)
generic kernels.
If you do decide to try a non-smp kernel, either the generic or the huge kernel (though I would recommend the generic kernel), you must patch the kernel sources or else things may fail to compile. See here for more information about that.

[edit]I should add that you should probably keep the huge kernel as an option in lilo.conf in case you mess up your initrd, so you can still boot into your system. I personally have two kernel stanzas -- one for the huge-smp and generic-smp kernels. The relevant section of my lilo.conf is shown below:
Code:
image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Generic
  read-only  # Partitions should be mounted read-only for checking

image = /boot/vmlinuz-huge-smp-2.6.21.5-smp
  root = /dev/sda1
  label = Huge
  read-only
Note that /dev/sda1 above should be changed to point to the root partition of your Slackware installation.[/edit]

Last edited by T3slider; 06-24-2008 at 11:14 PM.
 
Old 06-24-2008, 11:08 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,250

Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
Quote:
Originally Posted by sundialsvcs
Presumably your distro includes all of these kernels in the distro and allows you to choose between them ... which is something you do at boot time, through the boot loader. Not through symlinks.

Exactly how you do this on your distro depends on your distro. But, surely it is documented.
This is almost never true, as far as I know. You can choose a kernel at the bootloader (assuming each desired kernel has an entry in lilo.conf if you use LILO or menu.lst if you use GRUB -- which is not true in Slackware), but in order for that choice to be consistent across reboots (ie the default option, or just an extra option in general if the kernel was not already an option in lilo.conf or menu.lst -- as is the case with Slackware), AT LEAST an edit of lilo.conf or menu.lst is required (or changing a symlink in order for lilo.conf or menu.lst to point to the correct kernel if one of the kernel options points to the symlink). By default, in Slackware, lilo.conf points to /boot/vmlinuz, which is a symlink to /boot/vmlinuz-huge-smp-2.6.21.5-smp. By changing the symlink to /boot/vmlinuz-huge-2.6.21.5, it *is* a valid way to change the kernel that is used upon a reboot. However, the fact that it's not working suggests that lilo.conf is not pointing to the vmlinuz symlink, but instead directly to the kernel image (however, not knowing all of the information, I could be wrong here).
 
Old 06-26-2008, 06:47 AM   #5
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze, CrunchBang Waldorf
Posts: 514

Original Poster
Rep: Reputation: 38
I made an initrd with the following:

Code:
root@Slack:/boot# mkinitrd -c -k 2.6.21.5-smp -m ext3 -f ext3 -r /dev/hda5
and received the following warning:
Warning: LBA32 addressing assumed

This is what I wrote in lilo.conf:
Quote:
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
initrd = /boot/initrd.gz
root = /dev/hda5
label = generic-smp
read-only # Partitions should be mounted read-only for checking

image = /boot/vmlinuz-huge-smp-2.6.21.5-smp
root = /dev/hda5
label = huge-smp
read-only
# Linux bootable partition config ends
When I boot lilo it boots the generic-smp kernel, but it doesn't give an option to boot the huge-smp.
(I am chainloading lilo with grub from my Debian install. Don't think that would make a difference).

Will running the generic kernel limit my access to drivers?

Quote:
If you decide to use one of the non-smp kernels, you will need to follow the instructions in /extra/linux-2.6.24.5-nosmp-sdk/README.TXT to modify your kernel sources for non-smp usage.
I read the instructions about running a non smp kernel. I'm not sure what to do. Do I need to compile one or could I use vmlinuz-generic-2.6.21.5 from the /boot directory?

Thanks for help.
 
Old 06-26-2008, 11:31 AM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,250

Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
Quote:
Originally Posted by JosephS
and received the following warning:
Warning: LBA32 addressing assumed
That warning is safe. If you want to get rid of it, you should put "lba32" in the global section of your lilo.conf (see `man lilo.conf` for more information). It just means that it is defaulting to lba32 since you didn't specify it yourself.
Quote:
Originally Posted by JosephS
When I boot lilo it boots the generic-smp kernel, but it doesn't give an option to boot the huge-smp.
(I am chainloading lilo with grub from my Debian install. Don't think that would make a difference).
That is very strange. Try running `/sbin/lilo` again and make sure it adds both generic-smp and huge-smp. Your lilo.conf entry looks fine for both, so it should allow you to select either one. You could try pressing Tab at the LILO boot prompt to see what happens. You should post your entire lilo.conf in case something strange is happening at the top.
Quote:
Originally Posted by JosephS
Will running the generic kernel limit my access to drivers?
No. All of the drivers are still available -- most of them are just compiled as modules that need to be loaded into the running kernel. This is usually done automatically for most modules, but you can manually load a module using `modprobe modulename`. If you want a module to be loaded at every boot that isn't being loaded automatically, you can add an entry to /etc/rc.d/rc.modules-2.6.21.5-smp.
Quote:
Originally Posted by JosephS
I read the instructions about running a non smp kernel. I'm not sure what to do. Do I need to compile one or could I use vmlinuz-generic-2.6.21.5 from the /boot directory?
I would recommend that you stick with the generic-smp kernel anyway (as you are doing now, it appears), but if you insist on using the generic, non-smp kernel, you can do so without compiling anything. You would add an entry in lilo.conf for /boot/vmlinuz-generic-2.6.21.5, and create an initrd as before. The following line would probably work:
Code:
# mkinitrd -c -k 2.6.21.5 -m ext3 -f ext3 -r /dev/hda5
After booting into the system with the non-smp kernel, if you still insist on using it, you would have to follow these instructions to patch the kernel sources to the non-smp kernel. This does NOT require you to compile anything. You may also need to install the non-smp kernel headers package (the document linked above says that it *may* be required), so I would do it anyway. You would need to download the linux-2.6.21.5-smp-to-nosmp.diff.gz and patch-to-non-smp.sh files to a directory, navigate to that directory in a terminal, and run the following:
Code:
# ./patch-to-non-smp.sh
That will reconfigure your sources for the non-smp kernel. Again, no compiling is needed. To install the kernel headers package, download kernel-headers-2.6.21.5-i386-2.tgz and run the following:
Code:
# installpkg kernel-headers-2.6.21.5-i386-2.tgz

Last edited by T3slider; 06-26-2008 at 11:34 AM.
 
Old 06-27-2008, 07:21 AM   #7
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze, CrunchBang Waldorf
Posts: 514

Original Poster
Rep: Reputation: 38
Thanks for help.

I found why I wasn't getting the choice of kernels to boot. I had to uncomment #prompt

I think I will stick with the generic-smp. I think my problems are probably related to something else besides the kernel. I will probably
re-install (upgrade to 12.1) and see if that helps.

Can I use the initrd I made on an install of slackware 12.1?
 
Old 06-27-2008, 11:25 AM   #8
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,250

Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
Quote:
Originally Posted by JosephS
Can I use the initrd I made on an install of slackware 12.1?
Unfortunately, no. The initrd is set up to use the modules for a specific kernel (in this case the 2.6.21.5-smp kernel modules located at /lib/modules/2.6.21.5-smp). You can, however, use the same command to generate the initrd, substituting 2.6.21.5-smp for 2.6.24.5-smp, as shown below:
Code:
# mkinitrd -c -k 2.6.24.5-smp -m ext3 -f ext3 -r /dev/hda5
That will automatically overwrite the old initrd (because the -c flag is used) and the only change you would have to make in /etc/lilo.conf would be changing the "image =" line to reflect the location of the new kernel (image = /boot/vmlinuz-generic-smp-2.6.24.5-smp). The same should be done with the entry for the huge-smp kernel, of course (and don't forget to run /sbin/lilo after editing lilo.conf).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Kernel from 2.4 to 2.6 guillermo Linux - General 2 12-11-2007 01:57 PM
pacman -Su, kernel upgrade, kernel panic, change distro? jkh Arch 35 03-10-2006 01:14 AM
Change from stock 2.4 kernel to 2.6 kernel jrbush82 Slackware 6 02-11-2006 07:05 AM
How to change from 2.4 to 2.6 kernel? Rory in Toronto Mandriva 9 04-04-2004 12:43 AM


All times are GMT -5. The time now is 05:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration