Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 340021 - extract-ikconfig does not work although CONFIG_IKCONFIG=y
Summary: extract-ikconfig does not work although CONFIG_IKCONFIG=y
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://git.kernel.org/?p=linux/kernel...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2010-10-07 07:46 UTC by Justin Lecher (RETIRED)
Modified: 2010-11-12 12:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/usr/src/linux/.config (.config,59.66 KB, text/plain)
2010-10-07 07:46 UTC, Justin Lecher (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2010-10-07 07:46:06 UTC
I cannot extract the config from a stored kernel image

# ./scripts/extract-ikconfig /boot/linux-2.6.35-gentoo-r9
extract-ikconfig: Cannot find kernel config.

# zgrep CONFIG_IKCONFIG /proc/config.gz 
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

# uname -r
2.6.35-gentoo-r9
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2010-10-07 07:46:37 UTC
Created attachment 249814 [details]
/usr/src/linux/.config

kernel config
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2010-10-07 07:47:31 UTC
[I] sys-kernel/gentoo-sources
     Available versions:  
	(2.6.16-r13)	2.6.16-r13!b!s
	(2.6.27-r8)	2.6.27-r8!b!s
	(2.6.27-r10)	(~)2.6.27-r10!b!s
	(2.6.28-r6)	(~)2.6.28-r6!b!s
	(2.6.29-r5)	2.6.29-r5!b!s
	(2.6.29-r6)	(~)2.6.29-r6!b!s
	(2.6.32-r7)	2.6.32-r7!b!s
	(2.6.32-r15)	(~)2.6.32-r15!b!s
	(2.6.32-r16)	(~)2.6.32-r16!b!s
	(2.6.32-r17)	(~)2.6.32-r17!b!s
	(2.6.32-r18)	(~)2.6.32-r18!b!s
	(2.6.32-r19)	(~)2.6.32-r19!b!s
	(2.6.33-r2)	2.6.33-r2!b!s
	(2.6.33-r3)	(~)2.6.33-r3!b!s
	(2.6.34-r1)	2.6.34-r1!b!s
	(2.6.34-r6)	2.6.34-r6!b!s
	(2.6.34-r7)	(~)2.6.34-r7!b!s
	(2.6.34-r8)	(~)2.6.34-r8!b!s
	(2.6.34-r9)	(~)2.6.34-r9!b!s
	(2.6.34-r10)	(~)2.6.34-r10!b!s
	(2.6.34-r11)	(~)2.6.34-r11!b!s
	(2.6.35-r4)	(~)2.6.35-r4!b!s
	(2.6.35-r5)	(~)2.6.35-r5!b!s
	(2.6.35-r6)	(~)2.6.35-r6!b!s
	(2.6.35-r7)	(~)2.6.35-r7!b!s
	(2.6.35-r8)	(~)2.6.35-r8!b!s
	(2.6.35-r9)	(~)2.6.35-r9!b!s
	(2.6.35-r10)	(~)2.6.35-r10!b!s
	{build deblob symlink ultra1}
     Installed versions:  2.6.35-r8(2.6.35-r8)!b!s(13:43:20 24/09/10)(-build -deblob -symlink) 2.6.35-r9(2.6.35-r9)!b!s(20:37:44 27/09/10)(-build -deblob -symlink) 2.6.35-r10(2.6.35-r10)!b!s(09:00:00 07/10/10)(-build -deblob -symlink)
     Homepage:            http://dev.gentoo.org/~mpagano/genpatches
     Description:         Full sources including the Gentoo patchset for the 2.6 kernel tree

Comment 3 George Kadianakis (RETIRED) gentoo-dev 2010-10-07 11:06:55 UTC
Weird.

I can't reproduce this in my 2.6.34-gentoo-r6 and it seems like all the relevant files (kernel/configs.c and scripts/extract-ikconfig) haven't been changed since 2.6.32 or so.

Would you like to report this upstream at bugzilla.kernel.org?
If you do so, please post back your bugzilla entry URL.

Thanks!
Comment 4 Gef 2010-10-07 12:14:44 UTC
I can reproduce that with zen-sources, from zen-stable.git (v2.6.35.6-8292-g9f7b777).
Comment 5 Mike Pagano gentoo-dev 2010-10-07 12:40:50 UTC
Worked fine for me on gentoo-sources-2.6.35-r8
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2010-10-07 16:32:52 UTC
Could you attach some working configs. perhaps we can find a difference, because that there is another option needed beside the IKCONFIG things.
Comment 7 Gef 2010-10-07 16:46:26 UTC
(In reply to comment #6)
> Could you attach some working configs. perhaps we can find a difference,
> because that there is another option needed beside the IKCONFIG things.
> 

Ok, found it (I think). As OP, I switched from default CONFIG_KERNEL_GZIP to CONFIG_KERNEL_LZMA. Downside is that ./scripts/extract-ikconfig relies on a gzip'ed bzimage: see invocation of zcat:

----8<------------8<------------8<------------8<------------8<--------
    34	# Initial attempt for uncompressed images or objects:
    35	dump_config "$img"
       
    36	# That didn't work, so decompress and try again:
    37	tmp=/tmp/ikconfig$$
    38	trap "rm -f $tmp" 0
    39	for	pos in `tr "$gz1\n$gz2" "\n$gz2=" < "$img" | grep -abo "^$gz2"`
    40	do
    41		pos=${pos%%:*}
    42		tail -c+$pos "$img" | zcat 2> /dev/null > $tmp
    43		dump_config $tmp
    44	done
----8<------------8<------------8<------------8<------------8<--------

/proc/config.gz is of course still usable for running kernel though, as long as CONFIG_IKCONFIG_PROC is set.
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2010-10-07 16:53:26 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Could you attach some working configs. perhaps we can find a difference,
> > because that there is another option needed beside the IKCONFIG things.
> > 
> 
> Ok, found it (I think). As OP, I switched from default CONFIG_KERNEL_GZIP to
> CONFIG_KERNEL_LZMA. Downside is that ./scripts/extract-ikconfig relies on a
> gzip'ed bzimage: see invocation of zcat:
> 

That's exactly what I also found out. Bug or feature? Perhaps better to report upstream.
Comment 9 George Kadianakis (RETIRED) gentoo-dev 2010-10-07 18:32:00 UTC
Heh, interesting!

Theoretically it's a bug and scripts/extract-ikconfig should be changed to support all compression algorithms that the kernel supports.
Comment 10 Justin Lecher (RETIRED) gentoo-dev 2010-10-16 08:13:11 UTC
Upstream bug has a working patch now.
Comment 11 Justin Lecher (RETIRED) gentoo-dev 2010-11-01 07:29:57 UTC
This is now commit 532cf2907ac3b9c2345d76251764f4f4e602c921 in mainline
Comment 13 Mike Pagano gentoo-dev 2010-11-11 19:16:32 UTC
This will be in the next release of gentoo-sources-2.6.36
Comment 14 Mike Pagano gentoo-dev 2010-11-12 12:24:54 UTC
Released in gentoo-sources-2.6.36-r1.