LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   make menuconfig: Do you have to run 'make' every time? (https://www.linuxquestions.org/questions/linux-newbie-8/make-menuconfig-do-you-have-to-run-make-every-time-4175531549/)

linux_walt 01-19-2015 02:57 PM

make menuconfig: Do you have to run 'make' every time?
 
Hello, I'm on my first attempt at configuring a kernel. In the sunxi how-to guide, under 'Tweak config', it says to run this command:
Code:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
This works fine for me (if I leave out:ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-). The editor starts up with a configuration file already loaded.

I noticed though, after exiting the configuration editor, that another command was called after I entered 'make menuconfig':
Code:

~/linux-sunxi$ make menuconfig
scripts/kconfig/mconf Kconfig

If I try running this on its own:
Code:

scripts/kconfig/mconf Kconfig
I just get an empty editor, asking which configuration file to load.

Shouldn't 'make menuconfig' need to be run only once? Is there another command to start the editor with your configuration file already loaded?

btmiller 01-19-2015 04:39 PM

It's been awhile since I've done this, but I think "make oldconfig" is what you're looking for.

jpollard 01-19-2015 04:52 PM

Well... there can be several reasons to run it.

If you are ecompiling the kernel from scratch you need it to build the programs.

If you are recompiling the kernel from the menu then you may have modified/patched the kernel... thus you may have added new options, deleted options, or changed dependencies... and you need to rebuild the programs.

The USUAL sequence (starting from scratch):

get an old configuration that you have used...
make oldconfig - this will use the .config file for initial answers, filling in any missing answers with defaults, and removing options that don't exist.
make menuconfig/xconfig/... - is generally used to edit configurations. I use it to look at what is there, and read about the various options.

linux_walt 01-19-2015 04:53 PM

Hi btmiller, that didn't quite work, but thanks for the input. Here is the result of the command:

Code:

~/linux-sunxi$ make oldconfig
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#

I guess using 'make menuconfig' is really that big a deal, it's very fast anyway. I guess I'm more wondering if it should only be used the first time, or always.

My limited knowledge of Linux makes me think that something is getting 'made', and after that it should not be necessary anymore.

jpollard 01-19-2015 04:57 PM

I believe that is the correct result of running "make oldconfig".

Since there were no other messages, there are no options that were deleted, nor were there options without answers.

NOTE: Once the command runs, the updated .config file remains. If you did have an actual "old configuration" it is now gone. So to start over you would have to copy the "old configuration" to .config first to wipe out what has already been done.

linux_walt 01-19-2015 06:08 PM

Quote:

Originally Posted by jpollard (Post 5303665)
Well... there can be several reasons to run it.

If you are ecompiling the kernel from scratch you need it to build the programs.

If you are recompiling the kernel from the menu then you may have modified/patched the kernel... thus you may have added new options, deleted options, or changed dependencies... and you need to rebuild the programs.

The USUAL sequence (starting from scratch):

get an old configuration that you have used...
make oldconfig - this will use the .config file for initial answers, filling in any missing answers with defaults, and removing options that don't exist.
make menuconfig/xconfig/... - is generally used to edit configurations. I use it to look at what is there, and read about the various options.

Ok thank you for that. Was beginning to have a suspicion that maybe the editor needed 'rebuilt' information, just in case you changed something. I am only guessing, but I think the original configuration data came with the board manufacturer's linux-sunxi archive.

Too many suspicions and guesses though (on my part), obviously need to do some more reading (eg 'make menuconfig' and 'make oldconfig'). In the meantime I'll assume that the 'make' command, in one form or another, needs to be used every time. Thanks to you both.

jpollard 01-20-2015 05:58 AM

It only needs to be done if you are going to change configuration things. Once the configuration is done, you can make code changes pretty much all you want (as long as it doesn't change the Kconfig files :) ) without having to redo the configuration pass.


All times are GMT -5. The time now is 03:06 PM.