Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 421027 - genkernel should read /proc/config.gz too
Summary: genkernel should read /proc/config.gz too
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2012-06-13 19:48 UTC by Toralf Förster
Modified: 2012-07-08 22:13 UTC (History)
0 users

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


Attachments
log (log,7.94 KB, text/plain)
2012-07-01 16:48 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2012-06-13 19:48:47 UTC
just a nice-to-have
Comment 1 Sebastian Pipping gentoo-dev 2012-06-13 21:28:22 UTC
How would you want that data to be integrated?
Comment 2 Toralf Förster gentoo-dev 2012-06-14 11:33:45 UTC
(In reply to comment #1)
> How would you want that data to be integrated?
like this : "--kernel-config=/proc/config.gz " ?
Comment 3 Sebastian Pipping gentoo-dev 2012-06-16 17:25:04 UTC
(In reply to comment #2)
> like this : "--kernel-config=/proc/config.gz " ?

Have you tried

  genkernel --kernel-config=$(zcat /proc/config.gz) ....

?
Comment 4 Sebastian Pipping gentoo-dev 2012-06-16 17:25:41 UTC
(In reply to comment #3)
> Have you tried
> 
>   genkernel --kernel-config=$(zcat /proc/config.gz) ....
> 
> ?

Err,

  genkernel --kernel-config=<(zcat /proc/config.gz) ....

sorry.
Comment 5 Toralf Förster gentoo-dev 2012-06-17 17:42:43 UTC
yes - and don't work.
Comment 6 Sebastian Pipping gentoo-dev 2012-06-17 18:31:42 UTC
(In reply to comment #5)
> yes - and don't work.

Not?  What error do you get?
Comment 7 Toralf Förster gentoo-dev 2012-06-17 19:08:02 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > yes - and don't work.
> 
> Not?  What error do you get?

gah - error is between keyboard and chair - sry.
Comment 8 Toralf Förster gentoo-dev 2012-06-30 07:11:22 UTC
Hhm, maybe it is not solved :yet :
tfoerste@n22 ~/devel/linux $  sudo genkernel --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=<(zcat /proc/config.gz) all
* Gentoo Linux Genkernel; Version 3.4.24_p1
* Running with options: --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=/dev/fd/63 all

* Linux Kernel 3.5.0-rc4-00222-g15b7743 for x86...
* mount: /boot mounted successfully!
* kernel: Using config from /proc/21245/fd/63
*         Previous config backed up to .config--2012-06-30--09-08-44.bak
* kernel: >> Running mrproper...
cp: cannot stat `/proc/21245/fd/63': No such file or directory
* ERROR: Could not copy configuration file!                                                                     
                                                                                                                
* -- Grepping log... --                                                                                         
                                                                                                                
  CLEAN   include/config include/generated arch/um/include/generated arch/x86/include/generated                 
  CLEAN   .config .version include/linux/version.h Module.symvers                                               
* Gentoo Linux Genkernel; Version 3.4.24_p1                                                                     
* Running with options: --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=/dev/fd/63 all                  
                                                                                                                
* ERROR: Could not copy configuration file!
                                                                                                                
* -- End log... --
Comment 9 Sebastian Pipping gentoo-dev 2012-07-01 12:11:18 UTC
I have prepared a so far UNTESTED patch:

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=1cc7c7d8104f10c10cc4d296bfaa232253429c23

You are free to give it a try using something like

  # git clone git://git.overlays.gentoo.org/proj/genkernel.git
  # cd genkernel
  # git checkout -t origin/bug-421027
  # sudo GK_SHARE="$PWD" ./genkernel YOUR PARAMETERS HERE

If you do, please report back.
Comment 10 Toralf Förster gentoo-dev 2012-07-01 15:33:53 UTC
(In reply to comment #9)
> If you do, please report back.

tfoerste@n22 ~/devel/genkernel $ sudo ./genkernel --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=<(zcat /proc/config.gz) --no-clean bzImage 
* Gentoo Linux Genkernel; Version 3.4.36
* Running with options: --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=/dev/fd/63 --no-clean bzImage

grep: /proc/16039/fd/63: No such file or directory
* Linux Kernel 3.5.0-rc5 for x86...
* kernel: Using config from /proc/16046/fd/63
* kernel: --mrproper is disabled; not running 'make mrproper'.
cp: cannot stat `/proc/16046/fd/63': No such file or directory
* ERROR: Could not copy configuration file!

* -- Grepping log... --


Furthermore I tried to apply the patch using epatch (by putting it into /etc/portage/patches/sys-kernel/genkernel) - isseu not solved too.

BTW the sudo has to be putted directly before "./genkernel" - otherwise the system wide found genkernel is used.
Comment 11 Sebastian Pipping gentoo-dev 2012-07-01 16:15:28 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > If you do, please report back.
> 
> tfoerste@n22 ~/devel/genkernel $ sudo ./genkernel
> --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=<(zcat
> /proc/config.gz) --no-clean bzImage 

You'd need to use

  --kernel-config=/proc/config.gz

now rather than

  --kernel-config=<(zcat /proc/config.gz)

So the final command (with the patch) would be

  # sudo GK_SHARE="$PWD" ./genkernel --kernel-config=/proc/config.gz


> BTW the sudo has to be putted directly before "./genkernel" - otherwise the
> system wide found genkernel is used.

Are you referring to the GK_SHARE="$PWD" in between?
In most cases both

  # FOO=bar sudo ....

and

  # sudo FOO=bar ....

both work equally well, but there are differences.  Look at these examples:

  # sudo bash -c 'echo ${DISPLAY}'
  :0.0

  # DISPLAY=foo sudo bash -c 'echo ${DISPLAY}'
  foo

  # sudo DISPLAY=foo bash -c 'echo ${DISPLAY}'
  foo

  # PATH=foo sudo bash -c 'echo ${PATH}'
  bash: sudo: command not found

  # sudo PATH=foo bash -c 'echo ${PATH}'
  foo

Personally, I use the

  # sudo FOO=bar ....

version unless I explicitly want to affect sudo itself.
Comment 12 Toralf Förster gentoo-dev 2012-07-01 16:48:33 UTC
Created attachment 316887 [details]
log

arg - yes.

Ok , the patch works (both the git version and the epatched 3.4.24_p1 version) - so the bug report might be closed as "FIXED in CVS TREE"



Beside that, this works for me:

$> GK_SHARE="$PWD" sudo ./genkernel --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=/proc/config.gz bzImage

where this doesn't work for me (see attached log)

$> sudo GK_SHARE="$PWD" ./genkernel --kerneldir=/home/tfoerste/devel/linux/ --kernel-config=/proc/config.gz bzImage 1>log 2>&1
Comment 13 Sebastian Pipping gentoo-dev 2012-07-08 17:24:44 UTC
(In reply to comment #12)
> Beside that, this works for me:
> 
> $> GK_SHARE="$PWD" sudo ./genkernel --kerneldir=/home/tfoerste/devel/linux/
> --kernel-config=/proc/config.gz bzImage
> 
> where this doesn't work for me (see attached log)
> 
> $> sudo GK_SHARE="$PWD" ./genkernel --kerneldir=/home/tfoerste/devel/linux/
> --kernel-config=/proc/config.gz bzImage 1>log 2>&1

The problem is not related to sudo.  The previous patch was missing "if" at three places ("if [[ foo" rather than "[[ foo") so the working one is actually at fault here.


A fixed patch is on master now:

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=0db56cdc9d5166abaaaf0b23406cf06d775e2bca
Comment 14 Sebastian Pipping gentoo-dev 2012-07-08 22:13:00 UTC
+*genkernel-3.4.37 (08 Jul 2012)
+
+  08 Jul 2012; Sebastian Pipping <sping@gentoo.org> +genkernel-3.4.37.ebuild:
+  Bump to 3.4.37
+