Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto change options in kernel config in script?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Wed Oct 10, 2012 11:11 pm    Post subject: Howto change options in kernel config in script? Reply with quote

Good day, sirs. I want to find way, how automatically change some options in config:

  1. emerge new kernel sources
  2. run script, that automatically changes some options in config file with the correct dependencies, and other keeps in their default state.
  3. make && make modules_install
  4. PROFIT!


I know about allyesconfig/allmodconfig/allnoconfig and environment variable KCONFIG_ALLCONFIG. But, it seems, this commands change default state of other options.
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Thu Oct 11, 2012 12:33 am    Post subject: Reply with quote

`make oldconfig`, once you've got a config to your liking?
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Thu Oct 11, 2012 1:43 am    Post subject: Reply with quote

oldconfig is not recommended when upgrading to new major version (for example, 3.0->3.6), and oldconfig is interactive and ask for new options (I want keep options in their default state for every release)
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Thu Oct 11, 2012 1:50 am    Post subject: Reply with quote

Then use make oldnoconfig. I have never had a problem between releases, which I understand is the norm with only a few exceptions.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Oct 11, 2012 1:51 am    Post subject: Reply with quote

Regarding the interactivity issue, that's what
Code:
make silentoldconfig
is for. :wink:

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Thu Oct 11, 2012 2:15 am    Post subject: Reply with quote

make silentoldconfig does not solve my problem. Some options can change their default state (from "off" to "on" and from "on" to "off", from "experimental" to "ready-to-use" and from "ready-to-use" to "deprecated" ). With oldconfig/silentoldconfig I will need to manually check them all (nightmare!).
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Thu Oct 11, 2012 2:35 am    Post subject: Reply with quote

Well, since the config is just plain text, nothing's stopping you from using awk or perl or something.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Thu Oct 11, 2012 2:43 am    Post subject: Reply with quote

avx wrote:
Well, since the config is just plain text, nothing's stopping you from using awk or perl or something.

How about dependencies?
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Thu Oct 11, 2012 2:52 am    Post subject: Reply with quote

Hm? Read in the file, store the values and act accordingly?

Really, what is your goal? Saving a few kb at best or what?
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Oct 11, 2012 3:09 am    Post subject: Reply with quote

The solution to your problem is simple:
  • Develop a profound and comprehensive knowledge of the kernel and it's configuration nuances.
  • Embed that knowledge in an expert system that thus knows how to handle all of the configuration nuances. Perhaps a language like Lisp or Prolog would be appropriate.
  • Keep updating that knowledge as the kernel changes over time with intense study. Update the expert system as needed.
  • Use that expert system to update your kernel .config each time you emerge a new kernel source package. It'll turn out to be a real time saver.
See? Simple. :wink:

Since I am fundamentally masochistic and don't really want to save all that time, I'll stick to manual kernel configuration updates for myself.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Sun Oct 14, 2012 12:54 am    Post subject: Reply with quote

avx wrote:
Hm? Read in the file, store the values and act accordingly?

It's bad idea. Most of kernel options have dependencies. One option can depends on other. sed/awk can't solve it.

avx wrote:
Really, what is your goal? Saving a few kb at best or what?

I don't like monkey work. Configuring kernel again and again, with the same options - it just a waste of my time, IMHO. I want to automate routine tasks.
Back to top
View user's profile Send private message
pidsley
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2012
Posts: 80

PostPosted: Sun Oct 14, 2012 1:00 am    Post subject: Reply with quote

Chaser Andrey wrote:
I don't like monkey work. Configuring kernel again and again, with the same options - it just a waste of my time, IMHO. I want to automate routine tasks.


How often do you rebuild your kernel? How much time are you willing to spend "automating routine tasks" (learning, coding, debugging, learning more, re-coding, more debugging) vs just configuring a new kernel every few months. If you know some of the options you always use, just write a script to change the config for those, and do the rest by hand. And if you rebuild every time you get new sources, you should never be making a major upgrade (like your 3.0 -> 3.6 example).

Seriously, I've spent more time typing this reply than I spend on "monkey work" configuring a new kernel.

Good luck trying to automate this reliably. Or you could just hire a monkey.
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Sun Oct 14, 2012 1:12 am    Post subject: Reply with quote

Quote:
Most of kernel options have dependencies. One option can depends on other. sed/awk can't solve it
Sure awk, perl and others can do this, provided you can wrap your head around the tasks and options needed and transfer it to code.

This isn't a routine task, at least not on a self-maintained system. Ask the devs of some binary distribution with a default kernel, if they have something like that.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Sun Oct 14, 2012 1:25 am    Post subject: Reply with quote

pidsley wrote:
How often do you rebuild your kernel? How much time are you willing to spend "automating routine tasks" (learning, coding, debugging, learning more, re-coding, more debugging) vs just configuring a new kernel every few months. If you know some of the options you always use, just write a script to change the config for those, and do the rest by hand. And if you rebuild every time you get new sources, you should never be making a major upgrade (like your 3.0 -> 3.6 example).


I have 4 computers with Gentoo, and I am trying to upgrade Gentoo at least twice a month.
Back to top
View user's profile Send private message
pidsley
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2012
Posts: 80

PostPosted: Sun Oct 14, 2012 1:39 am    Post subject: Reply with quote

Chaser Andrey wrote:
pidsley wrote:
How often do you rebuild your kernel?

I have 4 computers with Gentoo, and I am trying to upgrade Gentoo at least twice a month.

And you rebuild the kernel every time you upgrade? Why? If you do, you should never be making a major upgrade, and make oldconfig should be fine. If you stick with the latest stable kernel, you should not need to rebuild the kernel every two weeks, and you should be able to configure by hand in a few minutes when you get new sources. I haven't built a Gentoo kernel since 3.3.8, and I update my machines once a week.

But I can see that you will not be convinced, even though you've been offered several solutions. Comparing your responses to this thread and your previous threads, I see a pattern...
Back to top
View user's profile Send private message
Chaser Andrey
n00b
n00b


Joined: 07 Nov 2010
Posts: 16

PostPosted: Sun Oct 14, 2012 1:51 am    Post subject: Reply with quote

pidsley wrote:
And you rebuild the kernel every time you upgrade? Why?


I just install latest kernels.

pidsley wrote:
If you do, you should never be making a major upgrade, and make oldconfig should be fine.

Chaser Andrey wrote:
make silentoldconfig does not solve my problem. Some options can change their default state (from "off" to "on" and from "on" to "off", from "experimental" to "ready-to-use" and from "ready-to-use" to "deprecated" ). With oldconfig/silentoldconfig I will need to manually check them all (nightmare!).
Back to top
View user's profile Send private message
pidsley
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2012
Posts: 80

PostPosted: Sun Oct 14, 2012 2:56 am    Post subject: Reply with quote

Chaser Andrey wrote:
I just install latest kernels.

The latest stable kernel is 3.3.8, as I pointed out in my last post. I'm tired of arguing with you. Good luck.
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Sun Oct 14, 2012 12:32 pm    Post subject: Reply with quote

You must have really weird systems. I've got 9 machines at home, all running ~testing, all updated daily, some even running git-kernels and still I need <5 mins per day to update all of them and keep'em in a working state.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun Oct 14, 2012 12:42 pm    Post subject: Reply with quote

Five systems here with similar experiences. Furthermore, "make oldconfig" almost always works perfectly.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum