-   Linux - Newbie (
-   -   RE: Newbies - Compiling Kernel for Slackware (

tix 05-17-2011 02:45 PM

RE: Newbies - Compiling Kernel for Slackware
Compiling kernel for Slackware Linux versions 4,7,10,12,13, ...etc - (may also be applicable for other versions of Linux using kernel source)

NOTE TO FLAMERS: Minimize your flames. Teach the newbies. Advocate Linux.

STEP 1: Turn on your computer (LOL!)

Tech: Thank you for calling support how may I help you?
Caller: My computer isn't showing me anything!
-after 20 minutes of troubleshooting-
Tech: Is you computer connected to power socket?
Caller: You mean it has to be connected to power?
Tech: (puts caller on hold)
Caller: Hello? Hello? Anyone there?

STEP 2: At command prompt login (duh!)

Marriage is like a bank account:
you put it in,
you take it out,
then you lose interest.

STEP 3: Change account to super user:
-If logged in as regular user, use "su" command to change to root account
-If already logged in as root then skip step 3.

STEP 4: Go to your kernel source directory
-usually in slackware it is in "/usr/src/linux"
-you will note that "linux" is a link to your kernel source folder

STEP 5: Backup kernel configurations
By default the configuration for your kernel is stored in a file called ".config"
not the period (full stop) "." in front of config, LOL!
Use command "cat" (meeeeoooowwww!) to backup your configuration file:
At command prompt type: "cat .config > myfirstconfigfile"
Which copies (meeeooooowwws!) the contents of ".config" to file called "myfirstconfigfile"

STEP 6 (optional) : Clear your .config file and start with default values
It may sometimes be useful to clear your ".config" when:
-getting kernel errors
-being unable to load kernel modules
-upgrading your kernel

Use command "make mrproper" to clear your config file and start with default values.
Note that all your settings and configurations will be lost!

Procrastinators do it tomorrow.
Physicists do it with charm
Statisticians do it with 95% confidence.

STEP 7: Open kernel configuration tool

(At a pet shop)
Bobby: Give me two of them mice
Cashier: That will be 12 dollars. Just curious, why the mice and not the cats?
Bobby: Well, I was told that my computer has kernels. Must be kernels of corn.
Cashier: (-_~)

Most covenient tool to use for configuration of kernel is menuconfig
Type "make menuconfig"at command prompt

STEP 8: Common Items to Konfigure

Most common configurations you need to change:
1- Processor type - by default Slackware installs with speed of 386 computer.
If you got a Pentium III or AMD K7 then you need to change the processor type

2-Sound drivers - by defualt, your kernel may not load drivers for your sound card
The best driver to use is the ALSA (advanced linux sound architechure driver)

3-Network card drivers - by default you kernel may only support old network cards and may not load drivers for your network card.
This is especially true if you are using 1000Mbps (1 GB) network cards such as Tigon3 or Realtek 8169

4-File systems - by default your kernel may only support ext2 (Slackware 4,7,10) or only ext3 filesystems (Slackware 13)
You may want to compile support for other filesystems such as:

5-Network protocols - by default your kernel supports TCP/IP
You kernel may not support PPP by default and also may not support all functionalities (options) for TCP/IP

6-APM (Advanced Power Management) - if using newer computers you may want to configure support for APM.

As you learn Linux or use different Linux applications, you may need to compile additional features into your kernel :)

STEP 9: Exit and save configuration

A beer bottle is never jealous if it sees
you holding another beer bottle.

STEP 10: Kompile your kernel: (simplified language)

make dep - make dependencies between different parts of your kernel components
make clean - clean up you any stuff lying around when you kernel is compiled
make modules - build your drivers and softwares for getting your sound, network, video, and other stuff to work
make modules_install - install the drivers and softwares for getting your sound, network, video, and other stuff to work
make bzImage - build a kernel image used in booting your new kernel

MOTD: Mirror, mirror on the wall,
who is the pretiest kernel of them all?

You can put all commands in one line:
"make dep && make clean && make modules && make modules_install && make bzImage"

Note the double "&&" istead of single "&"

STEP 11: Re-konfigure lilo (bootloader) to boot your new kernel
At command line issue command "liloconfig" to configure your boot loader.
If you don't configure lilo, then you won't be booting with new kernel having all the fancy new drivers and stuff. LOL!

STEP 12: Enjoy your Slackware linux!

Feel free to add your comments or corrections to this newbie tutorial.
Please add something meaningful and useful for the newbies instead of just flaming :)

acid_kewpie 05-17-2011 03:36 PM

This is NOT the place for tutorials. I'd suggest you get a blog here on your own and place these things there. ALso please don't drag up old threads. You seemed to paste the same long guide into a bunch of 2 year old threads, this isn't a great way to use a forum.

All times are GMT -5. The time now is 08:06 AM.