LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-02-2018, 02:40 AM   #1
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Rep: Reputation: Disabled
Difference of make *config


Please make it clear for me, what is the difference of the ff:

make config
make defconfig

make oldconfig
make olddefconfig
 
Old 01-02-2018, 03:13 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Did you bother to search - this is documented all over the web. Or run "make help".
 
Old 01-02-2018, 04:34 AM   #3
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Did you bother to search - this is documented all over the web. Or run "make help".
I do that. But still can't pin point. Please enlighten me.
 
Old 01-02-2018, 06:46 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Look at the Makefile (generated by ./configure.)

Then, actually read man make, where it talks about "make-targets."

See if you can find the words that you're looking for in the Makefile, and if you can then puzzle-out what they must mean.
 
Old 01-02-2018, 08:48 PM   #5
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Original Poster
Rep: Reputation: Disabled
I did make help. Correct me if I'm wrong.

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?
 
Old 01-02-2018, 09:56 PM   #6
Soitgoes
Member
 
Registered: Oct 2016
Location: Beyond Thunderdome
Distribution: Gentoo
Posts: 67

Rep: Reputation: Disabled
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.
 
Old 01-02-2018, 10:38 PM   #7
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Soitgoes View Post
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?
 
Old 01-02-2018, 10:49 PM   #8
Soitgoes
Member
 
Registered: Oct 2016
Location: Beyond Thunderdome
Distribution: Gentoo
Posts: 67

Rep: Reputation: Disabled
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.

Last edited by Soitgoes; 01-02-2018 at 10:51 PM.
 
Old 01-02-2018, 11:00 PM   #9
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Soitgoes View Post
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!
 
Old 01-02-2018, 11:11 PM   #10
Soitgoes
Member
 
Registered: Oct 2016
Location: Beyond Thunderdome
Distribution: Gentoo
Posts: 67

Rep: Reputation: Disabled
You’re welcome. Hope whatever you are doing works out.
 
Old 01-03-2018, 01:07 AM   #11
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
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

Last edited by _roman_; 01-03-2018 at 01:08 AM.
 
Old 01-03-2018, 02:21 AM   #12
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
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.
 
Old 01-04-2018, 04:09 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
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.
 
Old 01-04-2018, 08:35 PM   #14
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
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.
 
Old 01-04-2018, 10:32 PM   #15
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
I usually use these days from a working kernel

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
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What is the difference between the two config file? luofeiyu Linux - Newbie 2 03-05-2016 11:24 PM
Difference between make mrproper and make clean? hottdogg Slackware 5 03-11-2013 02:31 PM
difference between make bzImage and make vmlinuz? veritas Linux - Newbie 3 11-23-2011 04:45 AM
what is the difference between make distclean and make clean? alice95089 Linux - Software 3 08-28-2008 01:22 AM
What is the difference between 'make oldconfig' and 'make xconfig' davidas Linux - Newbie 2 04-07-2004 03:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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