Slackware Linux Essentials question - Selecting a Kernel...
Hello:
Slackware 13.1 is installed using the installer defaults and I have do nothing else, that I know of, other than installing wireless. (wicd) (I originally installed lilo to the MBR which did not include LMDE in the menu so I re-installed LMDE and Grub included Windows, Slackware and LMDE in the boot menu, as I wanted.) The book, in section 4.2 talks about 'Selecting a Kernel' I don't understand the 'why' of this section. Slackware is working, right? 'It talks about compiling a Kernal from source' - do I need to do this? Why? Thanks for any guidance, |
At the beginning of the installation you can choose a kernel. Unless you've got some specific reason to do so, you don't need to choose any other kernel or recompile it. The default kernel is fine for the majority of users.
|
The default kernel will be just fine; no, you do not need to compile it (or any other kernel). However, you can, if you want or need to, compile a stripped-down kernel customized for your hardware. As it is, the default is built with modules that load as required but otherwise don't bother you and you'll be able to use it without worrying about it.
The can is so you can learn how (it's not trivial but it's not rocket science either). The basic concept of Linux is that you can do whatever you want to with it; want to learn how to compile a custom kernel? Go for it. So, essentially, leave it alone and enjoy it until the time comes that you really want to dig in and find out what's what and why's why. Hope this helps some. |
1 Attachment(s)
Quote:
|
I used to think that compiling a kernel was a "good thing", & maybe when I started out, it was. But I no longer feel that way. The generic kernel works fine for me, at the slight added cost of making an initrd. I do not use any special hardware (RAID, etc) to boot, so just following the README.initrd in the /boot folder is sufficient. If you do need a bit fancier initrd, Slackware includes Eric's program "/usr/share/mkinitrd/mkinitrd_command_generator.sh", which will produce the proper command line to build a custom initrd.
Edit: I was really outgunned this time. However, using the "huge" kernel is not recommended. You really should switch over to the generic kernel & an initrd. See the "Changes And Hints.TXT" in the root of your install media for the reasons for this. Regards, Bill |
Quote:
Code:
ls -l /boot |
You shouldn't need to compile a kernel unless you want to. You should, however, switch to the generic kernel as Bill already mentioned. I included instructions for this procedure in the following Slackware configuration tutorial:
http://genek.net/LinuxAdventures/ins...ackconfig.html Gene |
Quote:
Code:
bash-4.1# ls -l /boot |
Yes, as you can see:
Code:
lrwxrwxrwx 1 root root 32 2011-01-06 07:56 System.map -> System.map-huge-smp-2.6.33.4-smp System.map, config and vmlinuz are symbolic links to the files belonging to the huge kernel. Once you've installed the system and are happy with it, you can, if you want, switch to the generic one, as suggested by others. |
Quote:
Code:
bash-4.1# ls -l /boot Oops! I didn't run lilo because that instruction is included in the "While We're at it, Let's Ditch the Boot Prompt (not for dual-booters)" section. Now that I have re-booted, is it safe to run lilo now? Thanks, |
Yeah, go ahead and run lilo. Always run lilo after doing anything at all to lilo.conf.
|
Quote:
Code:
bash-4.1# lilo If it matters, I am using a Lenovo X61 laptop. Thanks, |
I forgot that I was waiting for some advice and re-boot and selected Linux_G; here is what I see now:
Code:
bash-4.1# ls -l /boot Thanks, |
Quote:
when I started with Linux I hadn't a clue what all this was about. Debian didn't help because the developers had already done the work for me. Only when I moved to Slackware did I begin to understand. Here's one way to understand it: let's say you have a Windows XP partition and a Slackware partition on your computer. If your Linux kernel hasn't been compiled with NTFS file system support then Slackware won't "see" or mount the Windows partition, meaning you won't be able to copy stuff from your Windows folders to your /home directory. So NTFS file system support must be compiled into the kernel if that's what you want to do. The huge kernel has NTFS compiled in, but the huge kernel has *everything* compiled in, just in case, including support for hardware devices you're unlikely to ever use. Compiling a kernel allows you to trim the huge kernel to your own needs. A generic kernel is usually a kernel where the trimming has been done for you and support for hardware and filesystems and suchlike is compiled in as modules, meaning it's not hard-coded into the kernel but compiled in in such a way that if the hardware is there the driver is loaded and if the hardware is not there then the driver is not loaded. Here's what I do with kernels. I download the vanilla 2.6.37 kernel from kernel.org and extract it to /home/user/build as an ordinary user (it's a good idea to check the integrity of the download first but that's for another thread). Download the kernel (bz2) first and then in a terminal do the following: Code:
mv linux-2.6.37.tar.bz2 /home/user/build Code:
ln -s linux-2.6.37 linux Code:
cd linux Code:
http://mirrors.kernel.org/slackware/slackware-13.1/source/k/ Now I copy that config into the linux directory I created earlier: Code:
cp /home/user/config-generic-smp-2.6.33.4-smp /home/user/build/linux/.config Now I start compiling my new kernel. I already have a 2.6.33.4 kernel config so I can *make oldconfig* to bring my config up to 2.6.37: Code:
make oldconfig Once that's finished you can go through the kernel config to see if it's to your liking. Make sure you're still doing all of this as a normal user, not as root: Code:
make menuconfig Code:
mount As I say, don't go mad changing things here - look around and get comfortable with it first. One thing you can safely do is change your processor family under "Processor type and features" - Core 2/Xeon here. Take your pick. Use the spacebar to select. Now you will get the benefit of a kernel that understands all the intricacies of your processor. Beforehand you just had a kernel with generic processor support. OK that's enough for now. Exit and save your new config. Now you can *make* the new kernel. If you have a multicore CPU you can speed the *make* up a bit with the -j switch. Code:
make -j7 When it's finished you need to *su* to root so that you can install your modules and then your kernel: Code:
su Now if you reboot you have a spanking new kernel, with support for your specific processor compiled in. It might not make a huge difference, but it will make a difference, so it's worth doing. Type the following in a terminal to make sure you've booted up with the new kernel: Code:
uname -a |
You're running the generic kernel now.
|
Quote:
Just one question: How can you tell? |
Quote:
Thanks for all your time and effort - what a great post! I will attempt this later this evening. It is 4:52pm here - shouldn't you be asleep? (please, don't tell me that you are!!!;) ) Rob. |
Quote:
Code:
cat /proc/cmdline |
Hi,
Quote:
Second, third warning by use of the 'vga=normal' in '/etc/lilo.conf'. Do the following with the '/etc/lilo.conf'; Quote:
When you are working on the kernel, be sure to keep a working kernel stanza within the '/etc/lilo.conf' to allow you to recover when needed. :hattip: |
Quote:
|
Quote:
|
Quote:
# cd /root/ # rm System.map # ln -s System.map-generic-smp-2.6.33.4-smp System.map # rm config # ln -s config-generic-smp-2.6.33.4-smp config # rm vmlinuz # ln -s vmlinuz-generic-smp-2.6.33.4-smp vmlinuz Just to make sure all is well also run this to make sure you have initrd setup. # mkinitrd -c -k 2.6.33.4-smp [-m <needed modules here>] Your lilo.conf should have an 'initrd = /boot/initrd.gz' statement in it. Last run lilo and reboot. |
I've modified the tutorial in question to clear up the confusion about running lilo. Sorry, Robert.
|
Quote:
Code:
diff <(zcat /proc/config.gz) /boot/config-generic-smp-2.6.33.4-smp &>/dev/null && echo true || echo false Anyway, the System.map symlink couldn't hurt, so you may want to change that -- but if you want to be 100% positive that you are running the generic-smp kernel, use the first command I mentioned. |
Quote:
Here is my output: Code:
bash-4.1# cat /proc/cmdline |
Quote:
Pls forgive me for being persistent about this but I 'need' to know how you knew that my system was GENERIC... Did you determine that from my 'ls -l /boot' output above, and if so, 'how' do you know? or, Did you know that if I followed your tutorial correctly, that I would be GENERIC? Off-topic comment: Thank you for your great tutorials - ever since I discovered them, I refer to them all the time. I am certain that your efforts are making 'that fog called linux' lift for many readers! |
I knew because you selected Linux_G at your prompt screen, and if you followed my instructions that can only be the generic kernel. I've gone through this process enough times myself to have confidence in it.
Glad you like the tutorials. I'll have another one up soon on file permissions. |
Quote:
|
Quote:
Here is my output now: Code:
bash-4.1# lilo -v -t -b /dev/sda8 Here is my etc/lilo.conf: Code:
Thanks for you time with this, |
Hi,
By using the directive option '-b /dev/your_device' you are not using the 'boot=/dev/sda' within the '/etc/lilo.conf' thus the warning to ignore 'boot entry'. |
Quote:
Using symlinks is standard practice and make things simple. |
Personally, symlinks complicate things. If all you have is one boot option, compile your own kernel, and 'install' it without copying over the files your self, you may end up with a system that doesn't boot and will need a CD to recover.
|
Hi,
Quote:
Quote:
Your system to do as you like but a generic statement as you put it. Not on my system! I'll keep things clean and clear so that when problems do come up then I'll use all the tools available to help diagnosis. :hattip: |
Quote:
|
Quote:
I was replying to this: Quote:
Quote:
One could also name the System.map file System.map-2.6.33.4-smp. At any rate a Linux system should run just fine with out System.map symlinked. I did not advocate doing so I simply said the symlink is not needed. Please feel free to give me some specifics in which the symlink is needed to run Linux, not debug it. Did you know in Slackware klogd does not use System.map, it hasn't for quite some time. From rc.syslog: Code:
echo "/usr/sbin/klogd -c 3 -x" In the for what it is work department; I do symlink System.map to match my kernel. Just for kicks, I am running another Slackware box without the kernel System.map linked, renamed to System.map or using the 'uname -r' suffix. I am keeping the standard Slackware names. |
Quote:
|
All times are GMT -5. The time now is 01:00 AM. |