Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-03-2009, 10:45 AM   #1
LQ Newbie
Registered: Nov 2006
Location: philadelphia, PA
Distribution: Slackware current
Posts: 27

Rep: Reputation: 15
Re-compiling Kernel

I am running slackware current using the kernel. I am using an HP Compaq 6910p laptop with 4GB of RAM. I would like to continue using the kernel that I have but add HIGHMEM support. I have found many directions on how to compile a new kernel but I would prefer to continue using the version I'm on now. Is there any difference between compiling a new kernel and recompiling my current kernel? I have never need to compile a kernel before and I want to make sure that I do it right as this is my primary computer for work. Sorry if this has already been discussed.
Old 11-03-2009, 11:31 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Here's what I did recently to do something similar (EDAC rather than HIMEM) and building a kernel for the first time -- so I am no expert and others may correct the steps below or have better ideas. The most helpful web page was Alien BOB's WIKI.

The key step is zcat /proc/config.gz > .config to create a config file that will replicate your current kernel. My user name is c, the old kernel had CONFIG_LOCALVERSION="-smp" and the new CONFIG_LOCALVERSION="-smp-c1".
root:/usr/src# cp -pR linux- ~c/src
root:/usr/src# cd ~c/src
root:/home/c/src# chown -R c:users linux-

c:~/src/linux-$ cp -p .config
c:~/src/linux-$ make mrproper
c:~/src/linux-$ zcat /proc/config.gz > .config
c:~/src/linux-$ cp -p .config .config.from_running_kernel
c:~/src/linux-$ make oldconfig
c:~/src/linux-$ make menuconfig &
[GUI stuff to change .config]

# Review changes mad in menuconfig
c:~/src/linux-$ diff .config .config.from_running_kernel

# Build
c:~/src/linux-$ make bzImage modules

# Check for any extra modules
c:~/src/linux-$ cd /var/log/packages
c:/var/log/packages$ grep -l "lib/modules/$(uname -r)" *
[That identified kernel-modules-smp- but I had no
idea what -- if anything -- had to be done to replicate it for the new
kernel so I ignored it, planning to fix any breakage later.  Never did 
encounter any breakage but have not used the new kernel much]

root:/home/c/src/linux- make modules_install
root:/home/c/src/linux- cp arch/x86/boot/bzImage /boot/vmlinuz-
root:/boot# cd /boot
root:/boot# rm
root:/boot# ln -s

# No modules changed so can use old rc.modules but make a backup "in case ..."
root:/etc/rc.d# mv rc.modules rc.modules.aside
root:/etc/rc.d# cp -p  rc.modules-  rc.modules-

# Back up old modules "in case ..." 
root:~# cp -pR /lib/modules/ /lib/modules/

# Added stanza to GRUB's menu (some system-specific details here)
title       Slackware 13.0 (-c1, with EDAC kernel)
root        (hd0,1)
kernel      /vmlinuz-huge-smp- root=/dev/sda6 vga=791 ro
Changed default run level in /etc/inittab from 4 to 3.

After booting the new kernel for the first time, reinstalled the nvidia driver by running the nividia *.run file as root and the VirtualBox modules by /etc/rc.d/rc.vboxdrv setup as root.

Used startx after boot and logon as c to get GUI. After testing GUI OK, Changed default run level in /etc/inittab from 3 to 4.

On reverting to the old kernel, found /lib/modules/ was missing (why?) so restored it from /lib/modules/


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
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 02:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 02:45 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 05:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 06:31 PM > Forums > Linux Forums > Linux - Newbie

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

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