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.
make config : Ask me all options from the new kernel source.
make defconfig : It will auto answer the defaults for each options in new kernel source.
make oldconfig : Ask me the new options that is not present in current kernel.
make olddefconfig : It will auto answer the defaults for new options.
make menuconfig : Text baseed GUI to make some tweaks in .config file.
If I run olddefconfig and run make menuconfig and make some changes then save, it will take effect on .config the olddefconfig produced or it will create new config file?
It will take effect on .config the olddefconfig produced. That is if you copied your old .config into the new /use/src/linux directory and then ran the above commands.
It will take effect on .config the olddefconfig produced. That is if you copied your old .config into the new /use/src/linux directory and then ran the above commands.
Thanks. So it is safe to run olddefconfig/oldconfig rather than config/defconfig?
It is indeed safe to run olddefconfig. I typically run make silentoldconfig. My typical flow would be to:
1. backup my current .config
2. Change the symbolic link from my old kernel to my new kernel directory
3. cd into the new kernel directory
4. Copy the old .config into the new kernel directory
5. Make silentoldconfig or make olddefconfig
And then if you need to add options. Run make menuconfig->adjust/add options->save and then you are good to compile. Hopefully I didn’t sidestep your question too much.
It is indeed safe to run olddefconfig. I typically run make silentoldconfig. My typical flow would be to:
1. backup my current .config
2. Change the symbolic link from my old kernel to my new kernel directory
3. cd into the new kernel directory
4. Copy the old .config into the new kernel directory
5. Make silentoldconfig or make olddefconfig
And then if you need to add options. Run make menuconfig->adjust/add options->save and then you are good to compile. Hopefully I didn’t sidestep your question too much.
Wow nice, I am doing same thing as you. I'm glad to found out lol. Thanks!
There are even more (there were somewhere a readme I read a few years ago in the kernel directory)
Quote:
make nconfig
Quote:
make xconfig
I usually emerge new gentoo-sources
set the symlink to /usr/src/linux new
cd /usr/src/linux
zcat /proc/config.gz > .config (reduces a copy error)
make oldconfig
nano .config (to change the version string, as it is faster in my eyes, could be also done with menuconfig)
make --jobs 8 && make --jobs 8 modules_install (8 threads, so 8 jobs for make)
copy files, adapt bootloader by hand.
emerge nvidia-drivers (rebuild gpu driver)
reboot box and test new kernel
I think nconfig is the same as menuconfig. It just means "use ncurses for the menu". xconfig is graphical as is gconfig. I think xconfig is for KDE and gconfig for gtk-based desktops like gnome and xfce.
You should never just use config. It's only there for historical reasons, to show people what building a kernel used to be like in the bad old days. It asks hundreds of questions, and if (in a moment of inattention or tiredness) you give the wrong answer to any one of them, you have to go back again to the beginning. You can't just go back and change the error like you can in the menu-based methods.
Most-importantly, the kernel configuration parameters are stored in a hidden file, named (IIRC ...) .config.
You should make it your business to make an un-hidden, locked, backup copy of this file, say in /root, each and every time you make a configuration change ... or, "just because."
I-f ... ... you have this information, and know that it is always current, you can do nice things like ... restore a known-good configuration instantly, or use the diff command to conclusively identify the changes between any one and any other.
Most-importantly, the kernel configuration parameters are stored in a hidden file, named (IIRC ...) .config.
You should make it your business to make an un-hidden, locked, backup copy of this file, say in /root, each and every time you make a configuration change ... or, "just because."
I-f ... ... you have this information, and know that it is always current, you can do nice things like ... restore a known-good configuration instantly, or use the diff command to conclusively identify the changes between any one and any other.
Thanks for the tip. I will surely put it in my mind.
zcat /proc/config.gz > .config (reduces a copy error)
as there can not be any copy errors. And why else should I keep that option than enabled in the kernel
even when you build test kernels, it is kinda easy to know which was the last known good config.
I also tried keeping .config in unencrypted boot, but that is also a hassle. And most of the time I forgot to copy that .config file over to boot and name it properly
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.