LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-26-2005, 12:11 AM   #1
Kermlet
LQ Newbie
 
Registered: Feb 2004
Distribution: Mandrake 10 Official
Posts: 23

Rep: Reputation: 15
Reconfiguring a Kernel


I've read a lot of kernel howtos, and even successfully compiled my own vanilla kernel and gotten it to work, but i have yet to discover whether what i want to do is possible.

I use Mandrake (Mandriva) and I love the provided stock kernel. Lets say I just want to modify a single setting or compile a single service or driver as a module but leave EVERYTHING else the same. Can this be done? Is there a way for me to open up the x kernel config and modify one thing but not modify any other settings as they are currently configured?

i realize I would need to have a separate kernel name and bootloader entity, but other than that it seems like this should be possible. Any help would be appreciated. Thanks!
 
Old 10-26-2005, 12:22 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
You an load any kernel config you have on hand, usually it's saved at /usr/src/kernel/.config, make any changes you want and save it however you want. Then compile to create your new kernel with the new options.
 
Old 10-26-2005, 02:29 PM   #3
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
I do exactly what your asking quite often. To add just one thing to what trickykid says, to be safe I always save my original config file and new config files somewhere outside the kernel source directoy, and with distinctive names, so I can find them easily and load them when I want. When you change even one thing you'll have to go through the whole build procedure. And if you use lilo, don't forget to run /sbin/lilo after copying the new kernel to /boot.
 
Old 11-04-2005, 03:16 AM   #4
Kermlet
LQ Newbie
 
Registered: Feb 2004
Distribution: Mandrake 10 Official
Posts: 23

Original Poster
Rep: Reputation: 15
thank you for your replies, dracolich & trickykid, they were very helpful.

I just configured a couple of kernels but i've had some issues. maybe i'm looking at the wrong .config file?

i went to /usr/src/linux (this is symlinked to /usr/src/linux-2.6.11-2mdk) and copied the .config. I copied the kernel source directory (it happened to be the same one) to my /home directory and dropped in the .config. The first time i compiled a kernel from it, it turned out ext3 support wasn't built into the kernel, and since my root directory runs off ext3 of course i got a kernel panic.

the second time i made sure to fix that, and made a few changes (cpu type, and added support for a network driver module) and X only works with the supplied nv driver, the nvidia drivers wont install on it.

Maybe i'm doing something wrong here? When I dropped my .config into the kernel source, i did

Code:
# /linux-2.6.11-2mdk/make xconfig
when i ran make config, it says "loading defaults found in .config". Was I re-setting everything to default or should that have pulled up all the options from the current config of the kernel i was running? i'm a bit confused : (

Last edited by Kermlet; 11-04-2005 at 12:15 PM.
 
Old 11-05-2005, 09:27 AM   #5
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
The message means it's loaing the .config file, which is the default if you don't tell it to a different file. But...You're saying you made a copy of the .config immediately after unpacking the source? Before configuring it for your machine? If so then if you copy that file back into the source tree it will reset everything to defaults.
When you make changes and exit the config it saves your changes. What I meant before was, after completing the configuration and saving the changes, backup the new file so you can restore it if you fudge things later.

You're right, whatever filesystem your root partition is formatted as has to builtin to the kernel. Why did you copy the src to /home and build it from there? Most programs and drivers that create kernel modules look for the tree in /usr/src/linux. If the kernel hasn't been built it won't work. What you can do, if you want to leave it in /home, is delete the existing /usr/src/linux-2.6.11-2mdk and the /usr/src/linux symlink and symlink what's in /home to /usr/src like this

ln -s /home/name/linux-2.6.11-2mdk /usr/src/linux

Then try building the nvidia driver again.
 
Old 11-08-2005, 02:19 AM   #6
Kermlet
LQ Newbie
 
Registered: Feb 2004
Distribution: Mandrake 10 Official
Posts: 23

Original Poster
Rep: Reputation: 15
Dracolich, thanks for your reply, it cleared up a lot of things for me, especially about the kernel modules being built from the tree in /usr/src/linux. After some fumbling around I decided to totally reinstall Mandrake from scratch. So now I have a freshly installed distribution. The only thing i've done is to go to /usr/src/linux, copy the .config from there, rename it kernelconfig, and place it in my /home directory for safekeeping.

Now it is my understanding this .config is the one used in the kernel i'm currently booting from. Hypothetically i should be able to drop it into a fresh source directory from the kernel-source rpm and build an identical kernel to the one i'm running from. I think I'm making a bad assumption there, because when i look at that kernel .config from my newly installed distribution, just as one example it appears ext3 is selected as a module, not built in. How can that be when my root directory is ext3?

I think the answer is that i need to configure a kernel myself first before i can save it, since the one currently in my /usr/src/linux was only for the installation of the distribution. can you shed some light on this for me? thanks for being so patient, you've been really helpful.
 
Old 11-08-2005, 06:56 AM   #7
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
Quote:
Hypothetically i should be able to drop it into a fresh source directory from the kernel-source rpm and build an identical kernel to the one i'm running from
Hypothetically, yes that would work.

Quote:
it appears ext3 is selected as a module, not built in. How can that be when my root directory is ext3
Does the config you looked at have ext2 builtin with ext3 as a module? That could explain things. ext3 is ext2 with journalling so it can be loaded as ext2 perfectly, it just won't do the journalling thing. However, since ext3 support exists in some form it should work as long as the ext3 type is specified for / in /etc/fstab. Init messages will verify this. Run 'dmesg | grep hda1' and look for something that mentions mounting the drive with a filesystem. Of course if your drive is not hda1 use yours.

Quote:
I think the answer is that i need to configure a kernel myself first before i can save it, since the one currently in my /usr/src/linux was only for the installation of the distribution.
I think you're right. I'm not familiar with Mandrake specifically, but what I have experienced is that a fresh install usually includes a generic kernel that'll boot most hardware configurations. I hear Mandrake (and some others) has excellent hardware detection during the install so maybe it'll automatically include support for specific hardware. I don't know for sure but that's my guess. It's still a good idea to go throught the config and make sure it has support for all your hardware: e.g. scsi devices, usb devices, etc.

Good luck.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help reconfiguring GRUB jbolt Linux - Newbie 7 08-05-2004 01:03 AM
Reconfiguring X in Mandrake 8.2??? mike71ghia Linux - Distributions 1 07-26-2003 02:22 PM
reconfiguring X Lotmr Debian 5 07-05-2003 01:44 AM
reconfiguring the kernel nakkaya Linux - General 4 01-23-2003 04:07 PM
reconfiguring squid via PHP gimme5 Linux - Networking 0 09-09-2001 03:02 PM

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

All times are GMT -5. The time now is 11:23 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