LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-03-2009, 10:45 AM   #1
Do7AN
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 2.6.29.6-smp 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
catkin
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".
Code:
root:/usr/src# cp -pR linux-2.6.29.6 ~c/src
root:/usr/src# cd ~c/src
root:/home/c/src# chown -R c:users linux-2.6.29.6/

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

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

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

# Check for any extra modules
c:~/src/linux-2.6.29.6$ cd /var/log/packages
c:/var/log/packages$ grep -l "lib/modules/$(uname -r)" *
[That identified kernel-modules-smp-2.6.29.6_smp-i686-2 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-2.6.29.6# make modules_install
root:/home/c/src/linux-2.6.29.6# cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.29.6-smp-c1
root:/boot# cd /boot
root:/boot# rm System.map
root:/boot# ln -s System.map-2.6.29.6-smp-c1 System.map

# 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-2.6.29.6-smp  rc.modules-2.6.29.6-smp-c1

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

# 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-2.6.29.6-smp-c1 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/2.6.29.6-smp/kernel/drivers/video/nvidia.ko was missing (why?) so restored it from /lib/modules/2.6.29.6-smp.bu/kernel/drivers/video/nvidia.ko.
 
  


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
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


All times are GMT -5. The time now is 12:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration