LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2003, 08:09 AM   #1
mudelf
Member
 
Registered: Sep 2003
Distribution: RedHat 8
Posts: 59

Rep: Reputation: 15
where is Linux Kernel Config after install?


Almost there --- I can recompile the Kernel and get it to boot correctly at start up.
However I have LOADS of start up errors. Obviously this implies that there is lots wrong in
the config file used to recompile the kernel with make menuconfig (or the others).

My question is this ---

I am running RH8 on a Sony Vaio pcg-z600nek Laptop --- and Anaconda got Redhat installed fine from the
discs.

SO I figured for my kernel rebuild I would use the OLD kernel config in the new kernel - if it worked for the old
kernel with things like the default hardware then it seemed logical to assume that these settings could apply to the
new kernel. From here I could expand and experiment having a baseline to return to when things go wrong.

Trouble is I cannot find the config created from the install. I have the config from the source rpm which I
installed AFTER. However I am wondering if there is another - i.e. one which would have been created by
Anaconda WITH the settings I need --- can anyone suggest where this might be? It cant be in /usr/src/linux as this
was made AFTER Redhat was installed, so there has to be another.

Or have I just gone made and lost it completely.


|||---|>Carpe Linexiem<|---|||
 
Old 10-10-2003, 08:20 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
If you have the new kernel source tree in /usr/src/linux you would copy the old kernel config file to /usr/src/linux/.config (even if it's called kernel-config-2.4.16 or whatever - it should be called .config and sit in the root of the tree) and then do a "make oldconfig". You will be prompted for new options not covered in the old config file.

hw
 
Old 10-10-2003, 08:28 AM   #3
mudelf
Member
 
Registered: Sep 2003
Distribution: RedHat 8
Posts: 59

Original Poster
Rep: Reputation: 15
make oldconfig! --> Ok will give it a try right now.

But the question of WHERE is my old config file located still remains - I installed from a CD and made the source tree AFTER from an rpm. So is the config in the source tree built from the rpm reflective of all my odd and obscure system settings?

This make sense?
 
Old 10-10-2003, 01:42 PM   #4
demmylls
Member
 
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404

Rep: Reputation: 30
Compiling or recompiling kernel
===============================

to compile a new kernel we need 4 files that after compilation and needed to be coppied

in to /boot directory.

/usr/src/linux*/arch/i386/boot/bzImage
/usr/src/linux*/vmlinux
/usr/src/linux*/system.map
/boot/initrd*.img (this file must be create using this command after all make
xconfig,make bzImage, make modules, and make modules_install)

Step to be taken to compile a new kernel
----------------------------------------

NOTE: i'm using an example of compiling kernel-2.4.22

Decompress linux-2.4.22.tar.bz2 or linux-2.4.22.tar.gz into
/usr/src/linux-*

# cd /usr/src/linux-2.4.22

For precaution do this,

copy /boot/config-2.4.20-8 to /usr/src/linux-2.4.22
(where config-2.4.20-8 is the old kernel config)

then

linux-2.4.22]# make xconfig

a window will popup and this window is the window that you can turn on or off devices
you wants to use or devices that u don't need.

Click on button "Load Configuration from File" keyin the file name in the "Enter
filename" textbox. this file name is the file name that is the same with config-* that
you have copied it from /boot

after that you can make changes you like to what devices you want of you don't want but
remember this, must turn on this things

Loadable modules support->Enable loadable module support = say yes (recommended)

after you are satisfied select "Save & Exit"

then usr this command to set all the dependencies needed to compile selected devices.

linux-2.4.22]# make dep

after that solving the dependencies you can compile the kernel now using this command

linux-2.4.22]#make bzImage

After kernel compilation finnish do this step that are very important so that you wont
messup you current kernel modules if you are recompiling the same version of kernel you
are running now. Do this below (you can use any text editor to do this in this case i'm
using kwrite to edit "Makefile" that is located in /usr/src/linux-*)

open /usr/src/linux-*/Makefile and im using this command to open that file

linux-2.4.22]# kwrite Makefile

At "EXTRAVERSION = " change it to "EXTRAVERSION = -custom" where custom is the name you
like to put it like 123 or blabla".

You newly compiled modules will be installed in /lib/modules/(kernel version)
So the step above will make the newly compiled modules to install itself into
/lib/modules/2.4.22-custom (in this case i'm using example of kernel-2.4.22)
instead of /lib/modules/2.4.22 which is the current kernel version that i'm running
now.

After safety precaution above you can now do the command below to compile you kernel
modules

linux-2.4.22]# make modules

This will take a long time in my case i'm compiling kernel-2.4.22 and it takes me
30 minutes just to "make modules" under my Pentium 4 1.5 GHz Processor and in this time
you can take a shower or dinner or lunch or anything you like just leave it there
till it finished compiled. then do the command below to install the kernel

linux-2.4.22]# make modules_install

Ok at this point you are done and now you can copy those file just compiled into
/boot

Instaling newly compiled kernel
-------------------------------

copy /usr/src/linux-2.4.22/arch/i386/boot/bzImage
to
/boot and rename bzImage to vmlinuz-2.4.22

copy /usr/src/linux-2.4.22/vmlinux
to
/boot and rename vmlinux to vmlinux-2.4.22

copy /usr/src/linux-2.4.22/System.map
to
/boot and rename it to System-2.4.22.map

After all above you can now make initrd.img file using this command

linux-2.4.22]# mkinitrd /boot/initrd-2.4.22-custom.img 2.4.22-custom
(the command above means make initrd image from /lib/modules/2.4.22-custom and
store the image file in /boot)

NOTE: the 2.4.22-custom is the folder in /lib/modules and if you named the
EXTRAVERSION in /usr/src/linux-2.4.22/Makefile to any other else for example
"blabla" then your make initrd image command will be like this
linux-2.4.22]# mkinitrd-2.4.22-custom.img 2.4.22blabla. this is because when
EXTRAVERSION = blabla modules folder will be /lib/modules/2.4.22blabla and if
EXTRAVERSION = -customXYZ the modules folder will be
/lib/modules/2.4.22-customXYZ. so no matter what is the modules folder name is
you mkinitrd command must be the same with the modules folder name

Configure GRUB or LILO to comply with new kernel
------------------------------------------------

Boot new kernel using LILO
--------------------------

open /etc/lilo.conf

prompt
timeout=50
default=linux
boot=/dev/hda5
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.20-8
label=linux
initrd=/boot/initrd-2.4.20-8.img
read-only
append="root=LABEL=/"
image=/boot/vmlinuz-2.4.22-custom
label=linux kernel-2.4.22-custom
initrd=/boot/initrd-2.4.22-custom.img
read-only
append="root=LABEL=/"
other=/dev/hda1
optional
label=DOS
save this text file


Boot new kernel using GRUB
--------------------------

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this
file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,4)
# kernel /vmlinuz-version ro root=/dev/hda7
# initrd /initrd-version.img
#boot=/dev/hda5
default=1
timeout=10
splashimage=(hd0,4)/grub/splash.xpm.gz
title Red Hat Linux 9 (kernel-2.4.22-custom)
root (hd0,4)
kernel /vmlinuz-2.4.22-custom ro root=LABEL=/
initrd /initrd-2.4.22-custom.img
title Red Hat Linux 9 (kernel-2.4.20-8)
root (hd0,4)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
chainloader +1

save this text file


Congratulation you have successfully finnished your course on compiling linux kernel. If your new kernel runs fine that means, you are nowCcertified Linux Kernel Compiler (CLKCXL) from XtreamLinux.cjb.net. Fro now on you can upgrade kernel on any linux machine.
 
Old 10-14-2003, 02:12 AM   #5
mudelf
Member
 
Registered: Sep 2003
Distribution: RedHat 8
Posts: 59

Original Poster
Rep: Reputation: 15
Thanks for that!

Ok ---> I entered your instructions carefully. I had been making several mistakes notably running Mr Proper when I wanted to use my old configuration (very silly).

Also I wan not using the correct original config file.

After running make modules_install and updating my grub.conf file I rebooted only to get a kernel panic saying that it could not find init.

My grub file was correct and was pointed at / correctly.

Other kernel guides which I have read say that you need to run 'make install' after this stage --- I did this and the process worked and I now have a newly updated kernel.

Thanks again for your help - I could not have done this without it!

However why is there such a discrepency between the use of the command 'make install' --- Is this a Red Hat thing?

When I run make install the only error is a 'damaged binary' which I have no clue about.

I also have a depmod warning about *** unresolved symbols in cypto.lib - any clues about this? At a guess it sounds like crypto is looking in the old modules directory or something did not compile correctly.

Eitherway ---> I can now recompile ...
 
Old 01-29-2004, 04:04 PM   #6
geogecko
LQ Newbie
 
Registered: Dec 2003
Posts: 19

Rep: Reputation: 0
But is there an "original" kernel config file?

I am having the same problem as described, however, I'm not sure that an answer to the original question has been posted.

I have recently installed Red Hat Linux 9.0 from CD. I want to compile a new kernel, based on the one that is currently being used. The problem? There is no config file to begin from, at least, not one that I'm able to find.

Is it hidden somewhere else that I'm not looking?

I basically what to take the configuration from the current kernel that is being used by Red Hat (after a fresh install, no compiling of kernels has taken place yet), and change a couple of things in it, and re-compile it.

Can anyone help me out???
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
please, how to install kernel, config the network? zhuzhu Debian 4 11-16-2005 04:47 PM
General Q re: package install/kernel config keygrip Linux - Software 2 04-09-2004 07:55 AM
**Default Config File for Linux Kernel Problems** geogecko Linux - Software 4 02-12-2004 12:45 PM
locating linux config files and how to modify a bash kernel maelstrombob Linux - Newbie 1 11-18-2003 09:56 PM
Where is Linux Kernel Config Files ? rising_sun Linux - General 5 04-09-2003 08:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:05 PM.

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
Open Source Consulting | Domain Registration