LinuxQuestions.org
Visit Jeremy's Blog.
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-18-2011, 07:06 PM   #1
AustinMarton
Member
 
Registered: May 2007
Location: New Zealand
Distribution: Ubuntu
Posts: 88

Rep: Reputation: 16
Question How to automatically use alternative config file for make menuconfig?


Hi there,

The config file that is used for our kernel make is pulled from another location (arch/.../configs/ instead of just .config). This means that every time I do 'make menuconfig' I have to select 'Load alternative config' and then paste in the location.

Is there anyway to change the default config location for menuconfig OR some script that could start menuconfig with that config file?

Could potentially save me a lot of time

Thanks,
Austin.
 
Old 01-18-2011, 07:33 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Are you saying that you are in your kernel source directory and then copy the config file that you want to use to ./.config and then make menuconfig and it does not use the config that you copied to .config?

Code:
cp /path/to/config-file .config
make menuconfig
 
Old 01-18-2011, 07:50 PM   #3
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi Austin,

Quote:
Is there anyway to change the default config location for menuconfig OR some script that could start menuconfig with that config file?
I'm trying to figure out what it is you want to do, so a few examples from me first...

Usually when I configure a new kernel I base it on the old config file found in /boot
..which is the status of my running kernel.

I do this with...

/usr/src/linux is a link to my new kernel file... /usr/src/2.6.37-tmb-0.rc5.1mdv

I make the link by first removing the old kernel link...and creating a new one pointing to the new sources.
Code:
sudo rm -rf /usr/src/linux
sudo ln -s /usr/src/2.6.37-tmb-0.rc5.1mdv /usr/src/linux
then...
Code:
cd /usr/src/linux
make oldconfig
This usually brings up a pile of questions/options that have either changed or are new.
(between the old kernel config and the new kernel options.)

does this look like your situation?

Regards Glenn

Last edited by GlennsPref; 01-18-2011 at 07:53 PM. Reason: absolute addresses are good!
 
Old 01-19-2011, 01:58 PM   #4
AustinMarton
Member
 
Registered: May 2007
Location: New Zealand
Distribution: Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 16
Thanks for your replies. I think I should have mentioned that I am developing for an embedded application, not trying to recompile the kernel I am running.

To compile the kernel for the target I call make linux from the parent directory of the linux source. This makefile uses the config file located: linux/arch/arm/configs/myconfigfile. I can't change this.

When I want to change the kernel options I have to go to the linux directory, call make menuconfig, select Load an Alternative Configuration File, and enter the location linux/arch/arm/configs/myconfigfile. This is the step that I would like to automate.

I would have hoped you could just call something like make menuconfig linux/arch/arm/configs/myconfigfile but that function does seem to exist. I tried making a simbolic link between linux/arch/arm/configs/myconfigfile and linux/.config but when I run make menuconfig, instead of opening it, it just overwrites that link with a file of the same name.

I hope that makes more sense. I know it is a rather specific problem. I appreciate you having a think about it.
 
Old 01-19-2011, 02:37 PM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
You got me!

How about a script that automates the whole process.

Afterall the .config file is just a text file.

Why use menuconfig or xconfig at all?

If you know where everything is, and it doesn't change too often, a shell script may be a viable alternative.

within a script you may use grep to find and sed to edit the file, possibly with vi.

I'm still learning about these tools, sorry I don't have a solution.

but I hope this helps.

Regards Glenn

ps. a guide I have been using for scripting with sed, grep awk and vi.

IBM,
http://www.ibm.com/developerworks/vi...for+a+new+user

and linuxtopia,
http://www.linuxtopia.org/online_boo...faq/index.html

Last edited by GlennsPref; 01-19-2011 at 02:46 PM. Reason: ref. links
 
Old 08-15-2013, 03:10 PM   #6
cread57
LQ Newbie
 
Registered: Aug 2013
Posts: 1

Rep: Reputation: Disabled
Try KCONFIG_CONFIG=

Quote:
I would have hoped you could just call something like make menuconfig linux/arch/arm/configs/myconfigfile
Try this:
make menuconfig KCONFIG_CONFIG=linux/arch/arm/configs/myconfigfile
 
1 members found this post helpful.
  


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
Running make menuconfig results in text file is busy. jerel4565 Linux - Kernel 2 07-18-2009 10:40 PM
Menuconfig+load alternate config file option gauravholey Linux - Kernel 1 07-03-2009 01:51 AM
make menuconfig/config/xconfig problems when try building for ARM target kondrara Linux - Software 0 11-28-2007 04:58 AM
Problems compiling a Kernel (make config/menuconfig) Janusz11 Slackware 5 08-15-2005 04:40 PM
Mapping the items in .config to the menu in make menuconfig alice95089 Linux - Software 1 03-12-2005 06:55 AM

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

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