LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 01-13-2011, 10:01 AM   #1
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Rep: Reputation: 49
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,
 
Old 01-13-2011, 10:06 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
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.
 
1 members found this post helpful.
Old 01-13-2011, 10:13 AM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,122

Rep: Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819
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.
 
2 members found this post helpful.
Old 01-13-2011, 10:13 AM   #4
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by sycamorex View Post
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.
I believe I choose the 'huge' kernel. A screen shot of my boot directory is attached (I think) - is it OK?
Attached Images
File Type: png boot.png (194.3 KB, 39 views)
 
Old 01-13-2011, 10:13 AM   #5
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 492
Blog Entries: 1

Rep: Reputation: 55
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

Last edited by TSquaredF; 01-13-2011 at 10:21 AM.
 
1 members found this post helpful.
Old 01-13-2011, 10:18 AM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Quote:
Originally Posted by Robert.Thompson View Post
I believe I choose the 'huge' kernel. A screen shot of my boot directory is attached (I think) - is it OK?
The output of:

Code:
ls -l /boot
would be better in this case as it'll show us more information, but AFAIK the huge one is the default one. That's good. There's less chance that some hardware won't work because some module is not loaded.
 
Old 01-13-2011, 10:21 AM   #7
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 813

Rep: Reputation: 96
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
 
1 members found this post helpful.
Old 01-13-2011, 10:25 AM   #8
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by sycamorex View Post
The output of:

Code:
ls -l /boot
would be better in this case as it'll show us more information, but AFAIK the huge one is the default one. That's good. There's less chance that some hardware won't work because some module is not loaded.
Here it is:

Code:
bash-4.1# ls -l /boot
total 22644
lrwxrwxrwx 1 root root      37 2011-01-06 07:57 README.initrd -> /usr/doc/mkinitrd-1.4.5/README.initrd
lrwxrwxrwx 1 root root      32 2011-01-06 07:56 System.map -> System.map-huge-smp-2.6.33.4-smp
-rw-r--r-- 1 root root 1282716 2010-05-13 01:00 System.map-generic-2.6.33.4
-rw-r--r-- 1 root root 1322225 2010-05-12 22:41 System.map-generic-smp-2.6.33.4-smp
-rw-r--r-- 1 root root 2041855 2010-05-13 01:28 System.map-huge-2.6.33.4
-rw-r--r-- 1 root root 2086543 2010-05-12 23:48 System.map-huge-smp-2.6.33.4-smp
-rw-r--r-- 1 root root     512 2011-01-06 08:14 boot.0800
-rw-r--r-- 1 root root     512 2011-01-06 08:14 boot.0810
-rw-r--r-- 1 root root     209 2011-01-06 08:14 boot_message.txt
lrwxrwxrwx 1 root root      28 2011-01-06 07:56 config -> config-huge-smp-2.6.33.4-smp
-rw-r--r-- 1 root root  108261 2010-05-13 01:00 config-generic-2.6.33.4
-rw-r--r-- 1 root root  108627 2010-05-12 22:41 config-generic-smp-2.6.33.4-smp
-rw-r--r-- 1 root root  108235 2010-05-13 01:28 config-huge-2.6.33.4
-rw-r--r-- 1 root root  108601 2010-05-12 23:48 config-huge-smp-2.6.33.4-smp
-rw-r--r-- 1 root root    5040 2010-02-16 15:44 diag1.img
-rw------- 1 root root   86016 2011-01-06 08:14 map
-rw-r--r-- 1 root root   14174 2010-02-14 20:57 slack.bmp
lrwxrwxrwx 1 root root      29 2011-01-06 07:56 vmlinuz -> vmlinuz-huge-smp-2.6.33.4-smp
-rw-r--r-- 1 root root 2545840 2010-05-13 01:00 vmlinuz-generic-2.6.33.4
-rw-r--r-- 1 root root 2662400 2010-05-12 22:41 vmlinuz-generic-smp-2.6.33.4-smp
-rw-r--r-- 1 root root 5243760 2010-05-13 01:28 vmlinuz-huge-2.6.33.4
-rw-r--r-- 1 root root 5421536 2010-05-12 23:48 vmlinuz-huge-smp-2.6.33.4-smp
bash-4.1#
 
Old 01-13-2011, 10:31 AM   #9
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
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
...
lrwxrwxrwx 1 root root      28 2011-01-06 07:56 config -> config-huge-smp-2.6.33.4-smp
...
lrwxrwxrwx 1 root root      29 2011-01-06 07:56 vmlinuz -> vmlinuz-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.
 
1 members found this post helpful.
Old 01-13-2011, 03:27 PM   #10
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by sycamorex View Post
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
...
lrwxrwxrwx 1 root root      28 2011-01-06 07:56 config -> config-huge-smp-2.6.33.4-smp
...
lrwxrwxrwx 1 root root      29 2011-01-06 07:56 vmlinuz -> vmlinuz-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.
I followed Gene's tutorial and now I have this:

Code:
bash-4.1# ls -l /boot
total 24316
lrwxrwxrwx  1 root root      37 2011-01-06 07:57 README.initrd -> /usr/doc/mkinitrd-1.4.5/README.initrd
lrwxrwxrwx  1 root root      32 2011-01-06 07:56 System.map -> System.map-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root 1282716 2010-05-13 01:00 System.map-generic-2.6.33.4
-rw-r--r--  1 root root 1322225 2010-05-12 22:41 System.map-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root 2041855 2010-05-13 01:28 System.map-huge-2.6.33.4
-rw-r--r--  1 root root 2086543 2010-05-12 23:48 System.map-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root     512 2011-01-06 08:14 boot.0800
-rw-r--r--  1 root root     512 2011-01-06 08:14 boot.0810
-rw-r--r--  1 root root     209 2011-01-06 08:14 boot_message.txt
lrwxrwxrwx  1 root root      28 2011-01-06 07:56 config -> config-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root  108261 2010-05-13 01:00 config-generic-2.6.33.4
-rw-r--r--  1 root root  108627 2010-05-12 22:41 config-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root  108235 2010-05-13 01:28 config-huge-2.6.33.4
-rw-r--r--  1 root root  108601 2010-05-12 23:48 config-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root    5040 2010-02-16 15:44 diag1.img
drwxr-xr-x 11 root root    4096 2011-01-13 14:59 initrd-tree
-rw-r--r--  1 root root 1707397 2011-01-13 14:59 initrd.gz
-rw-------  1 root root   86016 2011-01-06 08:14 map
-rw-r--r--  1 root root   14174 2010-02-14 20:57 slack.bmp
lrwxrwxrwx  1 root root      29 2011-01-06 07:56 vmlinuz -> vmlinuz-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root 2545840 2010-05-13 01:00 vmlinuz-generic-2.6.33.4
-rw-r--r--  1 root root 2662400 2010-05-12 22:41 vmlinuz-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root 5243760 2010-05-13 01:28 vmlinuz-huge-2.6.33.4
-rw-r--r--  1 root root 5421536 2010-05-12 23:48 vmlinuz-huge-smp-2.6.33.4-smp
bash-4.1#
The only problem is that I cannot tell whether I am still HUGE or if I have become GENERIC - can you tell me how to know?

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,

Last edited by Robert.Thompson; 01-13-2011 at 03:32 PM. Reason: additional info
 
Old 01-13-2011, 03:46 PM   #11
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 813

Rep: Reputation: 96
Yeah, go ahead and run lilo. Always run lilo after doing anything at all to lilo.conf.
 
1 members found this post helpful.
Old 01-13-2011, 03:56 PM   #12
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by 2handband View Post
Yeah, go ahead and run lilo. Always run lilo after doing anything at all to lilo.conf.
I got some msg's:

Code:
bash-4.1# lilo
Warning: LBA32 addressing assumed
Warning: Unable to determine video adapter in use in the present system.
Warning: Video adapter does not support VESA BIOS extensions needed for
  display of 256 colors.  Boot loader will fall back to TEXT only operation.
Added Windows *
Added Linux_G
Added Linux
3 warnings were issued.
bash-4.1#
Should I still re-boot or have I screwed something up?

If it matters, I am using a Lenovo X61 laptop.

Thanks,

Last edited by Robert.Thompson; 01-13-2011 at 03:58 PM. Reason: addaitional info
 
Old 01-13-2011, 04:26 PM   #13
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 13.37 -32 Bit
Posts: 578

Original Poster
Rep: Reputation: 49
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
total 24360
lrwxrwxrwx  1 root root      37 2011-01-06 07:57 README.initrd -> /usr/doc/mkinitrd-1.4.5/README.initrd
lrwxrwxrwx  1 root root      32 2011-01-06 07:56 System.map -> System.map-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root 1282716 2010-05-13 01:00 System.map-generic-2.6.33.4
-rw-r--r--  1 root root 1322225 2010-05-12 22:41 System.map-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root 2041855 2010-05-13 01:28 System.map-huge-2.6.33.4
-rw-r--r--  1 root root 2086543 2010-05-12 23:48 System.map-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root     512 2011-01-06 08:14 boot.0800
-rw-r--r--  1 root root     512 2011-01-06 08:14 boot.0810
-rw-r--r--  1 root root     209 2011-01-06 08:14 boot_message.txt
lrwxrwxrwx  1 root root      28 2011-01-06 07:56 config -> config-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root  108261 2010-05-13 01:00 config-generic-2.6.33.4
-rw-r--r--  1 root root  108627 2010-05-12 22:41 config-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root  108235 2010-05-13 01:28 config-huge-2.6.33.4
-rw-r--r--  1 root root  108601 2010-05-12 23:48 config-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root    5040 2010-02-16 15:44 diag1.img
drwxr-xr-x 11 root root    4096 2011-01-13 14:59 initrd-tree
-rw-r--r--  1 root root 1707397 2011-01-13 14:59 initrd.gz
-rw-------  1 root root  131072 2011-01-13 15:53 map
-rw-r--r--  1 root root   14174 2010-02-14 20:57 slack.bmp
lrwxrwxrwx  1 root root      29 2011-01-06 07:56 vmlinuz -> vmlinuz-huge-smp-2.6.33.4-smp
-rw-r--r--  1 root root 2545840 2010-05-13 01:00 vmlinuz-generic-2.6.33.4
-rw-r--r--  1 root root 2662400 2010-05-12 22:41 vmlinuz-generic-smp-2.6.33.4-smp
-rw-r--r--  1 root root 5243760 2010-05-13 01:28 vmlinuz-huge-2.6.33.4
-rw-r--r--  1 root root 5421536 2010-05-12 23:48 vmlinuz-huge-smp-2.6.33.4-smp
bash-4.1#
Am I GENERIC or HUGE and how do I know?

Thanks,
 
Old 01-13-2011, 04:31 PM   #14
gezley
Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware-64, Crux-64, NetBSD-64
Posts: 570

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Robert.Thompson View Post
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,
Hi Robert:

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
cd /home/user/build
tar -xjvf linux-2.6.37.tar.bz2
For ease of use I then symlink (shortcut, in Windows-speak) the new linux-2.6.37 directory that has just been created:

Code:
ln -s linux-2.6.37 linux
Now I change into the new linux directory:

Code:
cd linux
I then get my hands on a config file for the generic kernel. Use your browser to go to the following address:

Code:
http://mirrors.kernel.org/slackware/slackware-13.1/source/k/
The generic-smp config will do nicely. What this means is that I now have a configuration file for a generic linux-2.6.33.4 kernel which means most of the guesswork has already been done for me. I want to use that as a template to help me configure the newer 2.6.37 kernel.

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
Make sure you copy it as .config - the dot is important.

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
It's safe to accept the default answers here - there will be quite a lot so just keep pressing Enter as this is your first go.

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
Now you get a tree where you can make your changes - don't go too mad here but just have a look through it to see what's going on. Have a look at file systems for example and see if NTFS is compiled in. If it's hard-coded into the kernel it will have a star and if it's compiled in as a module it will have the letter M. A module is fine because your Slackware only needs NTFS on-demand. Your Slackware root filesystem is a different matter - if it is formatted as ext4 then you MUST compile the ext4 filesystem into your kernel so that the system boots. In other words, a star, not the letter M, beside ext4. If it's ext3, then a star beside ext3. If you don't know what your root filesystem is, go to another terminal and type this:

Code:
mount
You will see what your / directory is mounted as. Make sure filesystem support for this and other partitions is compiled in - if in doubt, put a star beside ext4, ext3, xfs, and jfs. But you're intelligent enough to know by now what's going on eh?

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
This will take a while.

When it's finished you need to *su* to root so that you can install your modules and then your kernel:

Code:
su
make modules_install
make install
The last step will update your lilo so that the new kernel will be selected automatically at boot. The more experienced users here will probably tell me this is a bad way to go about kernel configuration because it leaves me with no backup if things go wrong, so it's important not to make any radical changes until you know what you're doing when you're configuring.

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
Voila. You're good to go. Hope this helps.
 
1 members found this post helpful.
Old 01-13-2011, 04:38 PM   #15
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 813

Rep: Reputation: 96
You're running the generic kernel now.
 
1 members found this post helpful.
  


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
How can I get and install build-essentials and kernel-headers using wget? zoanie Linux - Embedded & Single-board computer 4 11-17-2009 04:41 PM
New Slackware Essentials book for 10.0? tripwire45 Slackware 4 08-04-2004 01:29 PM
Slackware Linux Essentials <--- is this a good book ? intense Slackware 2 03-26-2004 12:51 PM
boot essentials for new kernel andrewstr Linux - Software 0 03-03-2004 02:09 PM
Question about selecting opetion in menuconfig when compiling a new kernel ICO Linux - General 1 01-22-2004 10:13 AM


All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
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