Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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.
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 : (
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.