You are not logged in.

#1 2012-05-06 17:21:25

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

[ANN] my tool to compare kernel config file

I'm trying to use lxc(see aur).
The requirement of kernel config is listing in http://lxc.teegra.net/

# name this as lxc.config
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_MM_OWNER=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

I'm using prebuild linux_pf, guess its config file is in aur's config.x86_64.

So, I write a utility name as kernel_config_diff.go
http://pastebin.com/YxqEECBE

and run this command will show which config lines which I should append into config.

# yaourt -S gorun 
kernel_config_diff.go req.config linux_pf.config

BTW, I don't know is there better solution.  I wrote this utility by Google Go because I like it and try to familiar to it.


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

#2 2012-05-06 17:34:00

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [ANN] my tool to compare kernel config file

vimdiff ?

Offline

#3 2012-05-06 18:37:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [ANN] my tool to compare kernel config file

graysky wrote:

vimdiff ?

+1

Why nod simply diff the configs?

Offline

#4 2012-05-06 23:30:27

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

Re: [ANN] my tool to compare kernel config file

Well, lxc.config is describe some config file should modify.

But, original config is a long listing.

So, use vimdiff will let you must view long lines of different.
By this script, I could get a quick view.
And even just append the output of this script into kernel config patch.

Here is my sample output compare to different variant kernel config

$ kernel_config_diff.go lxc.config /var/abs/local/linux/config.x86_64
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_GROUP_SCHED=y
CONFIG_CGROUP_NS=y
# return exit code as 3

$ kernel_config_diff.go lxc.config /var/abs/local/linux-pf/config.x86_64
CONFIG_RT_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_GROUP_SCHED=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_SCHED=y
# return exit code as 7

$ kernel_config_diff.go lxc.config /var/abs/local/linux-ck/config.x86_64
CONFIG_CGROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_GROUP_SCHED=y
CONFIG_CGROUP_NS=y
# return exit code as 7

Last edited by dlin (2012-05-06 23:39:32)


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

#5 2012-05-07 00:11:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [ANN] my tool to compare kernel config file

Ah, so you're comparing some full configs with that requirements for lxc, now I get it.
If you're going to make the changes, why not use sed instead?
https://projects.archlinux.org/svntogit … ages/linux


Some questions about the kernel config:
What happens if you have

CONFIG_FOO=n

and some lines later

CONFIG_FOO=y

?
Is this a valid config or will it confuse things? Which one will "win"? Is 'foo' going to be included in the kernel or not? Can you have

CONFIG_FOO=y

placed anywhere within the config or does it have to be in a particular place?

Offline

#6 2012-05-07 05:05:49

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

Re: [ANN] my tool to compare kernel config file

Karol,

For the case, the program will show

CONFIG_FOO=n # original y

In fact, this program's purpose is just display  requirement of multiple config which is not set or set to another value.
And you are right, for such case, append to end of config file is not proper.


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

Board footer

Powered by FluxBB