Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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 was wondering where there is a mechanism that would allow me to compile the kernel with old features "set" rather than me going through every single lines and enable the old settings in the new kernel configuration. Let's say I have the following directories:
/usr/src/kernel-2.6.1
/usr/src/kernel-2.6.30
Kernel 2.6.1 is the old kernel with its .config and all. If I use `oldconfig' switch while I am in `/usr/src/kernel-2.6.30', how does it know that it should load the settings from `/usr/src/kernel-2.6.1/.config'? Or does it fetch the currently compiled kernel's settings from somewhere else?
If you have a .config file then it will use that. If you don't, then I believe it will fetch the config file for the running kernel from /boot/config-`uname -r` and create a new .config.
If you have a .config file then it will use that. If you don't, then I believe it will fetch the config file for the running kernel from /boot/config-`uname -r` and create a new .config.
Thank you for the reply. So let me get this straight; if I copy .config from some old kernel (i.e. `/usr/src/kernel-2.6.1/.config) in to my latest kernel directory, it loads that .config with all the old options set... but does it also include the new features in the latest kernel as well? Or by copying the old .config file into the new kernel's src directly, it would simply use the old features and introduces "no" new features for configuration? Or the `make' process somehow uses the old settings and incorporates the new features into this old .config file that I have migrated to the new kernel's src directory?
P.S. Obviously, here, I am referring to the same major versions (i.e. 2.6.1 with say 2.6.12 and NOT 2.4.19 with 2.6.19, or does it really matter?).
If you copy in your old .config file and run make oldconfig it will use your old settings and prompt you for the settings that apply to the new version. The README file with the kernel sources has some variations on oldconfig that you could also use.
What gilead said, but I believe that "make oldconfig" will be run for you if you don't run it. It makes for quite a nuisance to have your make paused asking you for the values of new flags. Just run it and be done with it.
Ok, so if `make oldconfig' is executed "without" any existing .config in the src directory, you might as well compiling a kernel from the scratch -- no old settings are used. But if there is an old .config copied from somewhere, then as gilead said, the new features are asked consecutively which is tedious. I would rather just simply copy the old .config into the src directory, then run `make menuconfig' and browse around although not a smart way to dish out new features.
jschiwal mentioned that there is a .config file from the last kernel compilation under `/proc' which I don't seem to be having unless it is one of those features that you must enable in the kernel configuration during compilation. Frankly, I copy one to `/boot' just in case.
Also Quakeboy02 is right about the `make oldconfig' as being the "default" make command -- it runs that option, if you may call it that, automatically by default.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.