Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34948 - Genkernel should parse logs and show where errors occured
Summary: Genkernel should parse logs and show where errors occured
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 38155
  Show dependency tree
 
Reported: 2003-12-02 20:59 UTC by Aaron Peterson
Modified: 2004-03-21 07:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Peterson 2003-12-02 20:59:58 UTC
I recently tried to redo my kernel to support iptables and dhcpd. 
After many recompiles, I realized that the modules wern't getting installed 
because of some wierd dependancy... one module that I selected depended on 
another that i didn't include... (so there is a bug in the make menuconfig 
too,because it lets me make a non working kernel) 
 
anyway, It would be nice to have the || die portion actually tail the log and 
say... Failed! check the log at /var/log/genkernel 
 

Reproducible: Always
Steps to Reproduce:
1.genkernel --config 
2.turn on some things that need otherthings 
3.don't include other things		 
4. Don't see error message 
5. think it worked 
6. reboot (edit grub.conf in this step) 
 
Actual Results:  
7. have different errors from last time because modules are bad. 

Expected Results:  
spit out an error message: 
Kernel Compilation Failed, 
Check your options, and read /var/log/genkernel 

 
I wasted 16 hours of my life to this problem (well including the fact that it 
always does a make mrproper, which is a different issue... there could be an 
option --fast or such allowing make to use already compiled components)
Comment 1 Dwight Tuinstra 2003-12-16 18:05:57 UTC
This may be a duplicate of bug 35130, "genkernel fail". That bug has a complete kernel config file that generates the problem.

I've been hit by this too. I haven't tracked it down as did the original poster, but the symptom is identical: genkernel exits after making modules and before installing them, and there is nothing in /var/log/genkernel.log indicating why it bailed out.

This is with version 1.8 of genkernel, during a fresh install with 'emerge rsync' run yesterday.
Comment 2 Brad House 2004-01-18 07:46:46 UTC
this is to the original poster:
what genkernel version are you using?

You should be using genkernel 3.0.1 these days, we will not
support genkernel 1.x

also, /var/log/genkernel.log will ALWAYS show you the error.
If the modules did not build, that's not a genkernel problem,
there's nothing genkernel can do about that. It cannot fix
bad kernel sources.
Comment 3 Aaron Peterson 2004-01-19 05:34:05 UTC
The problem is that genkernel only reported on success.

So something could die in the kernel building process... and the user wouldn't know untill he tried to reboot. or run lilo.

I'm always using a version that was released less than a week ago.

I think I've had a kernel fail to compile, and got a bit of an error message... so part of this bug is fixed...

The other part is tailing the log.
just give 5 lines or so of the log.  That should include some sort of message on how to fix it. rather than leaving a novice to read the /var/log/genkernel.log file

Comment 4 Brad House 2004-01-19 06:57:53 UTC
uhh, no.
if that person is such a novice, then the last 5 lines of the log are
going to cause us developers a lot of headaches.  You have no clue
how many people post a tail of a genkernel.log here, and the error is
much further up.  If they're a novice they're not going to figure
out how to fix it themselves.

Also, we'll be providing binary kernel packages in the future for
these people.

This will NEVER NEVER NEVER get added, do NOT reopen.
Comment 5 Aaron Peterson 2004-01-20 05:59:01 UTC
great point about the tail being a bad option.

So... I think there are tools to search for error messages and spit out the area surrounding that

So, I guess research into this has to be done (by me)...

I think grepping for  "In file included"  and then getting the line number...

and then grabbing the line above, and 1/2 page worth of text... should be  enough to help.

an --interactive option would be cool... or on by default... and ask the user if ve wants to debug, put said chunk into  a less window.

also looking for Error 2
could be helpfull.


Note:  I won't be offended by marking my bugs invalid, because marking bugs invalid is a good way to clear the system, and see how serious/willing to help the people are about a bug.   I do wish for a bit more discussion before marking bugs as invalid... but...  We're all busy. 


I don't mean offence by reopening bugs that you close...   I was getting a bit aggitated earlier, but I found a good reason for your behavior, and am attempting to justify mine.


as always, I'll take an unpopular bug as a reminder/incentive for me to work on it.
*****************

 LD [M]  fs/exportfs/exportfs.o
  CC [M]  crypto/ucl_compress.o
In file included from /usr/include/features.h:295,
                 from /usr/include/limits.h:26,
                 from include/ucl/uclconf.h:46,
                 from include/ucl/ucl.h:39,
                 from crypto/ucl_compress.c:22:
/usr/include/sys/cdefs.h:183:1: warning: "__attribute_pure__" redefined
In file included from include/linux/compiler.h:16,
                 from include/linux/init.h:5,
                 from crypto/ucl_compress.c:19:
include/linux/compiler-gcc3.h:22:1: warning: this is the location of the previous definition
In file included from /usr/include/features.h:295,
                 from /usr/include/limits.h:26,
                 from include/ucl/uclconf.h:46,
                 from include/ucl/ucl.h:39,
                 from crypto/ucl_compress.c:22:
/usr/include/sys/cdefs.h:192:1: warning: "__attribute_used__" redefined
In file included from include/linux/compiler.h:16,
                 from include/linux/init.h:5,
                 from crypto/ucl_compress.c:19:
include/linux/compiler-gcc3.h:17:1: warning: this is the location of the previous definition
cp /usr/lib/libucl.a crypto/
cp: cannot stat `/usr/lib/libucl.a': No such file or directory
make[1]: *** [crypto/libucl.a] Error 1
make: *** [crypto] Error 2
make: *** Waiting for unfinished jobs....
  CC [M]  fs/hfs/balloc.o
  CC [M]  fs/intermezzo/cache.o
  CC [M]  fs/hfs/bdelete.o
Comment 6 Aaron Peterson 2004-02-11 23:14:36 UTC
poking through man grep reveals:

       -B NUM, --before-context=NUM
              Print NUM lines of leading context before matching lines.  Places a
              line containing -- between contiguous groups of matches.
       -A NUM, --after-context=NUM
              Print NUM lines of trailing context after matching lines.  Places a
              line containing -- between contiguous groups of matches.

the most common error messages are similar to:


In file included from
and 


make[number]:

make[1]: *** [crypto/libucl.a] Error 1
make: *** [crypto] Error 2
make: *** Waiting for unfinished jobs....

The other things is that failure of some modules is "ok" as in not required to continue..

There perhaps should be a "trudge ahead" option and a genkernel --resume option
will post a new bug for those... 

and I'm looking into this, I just need to learn bash scripting a bit better and maybe sommore awk sed or grep...
Comment 7 Aaron Peterson 2004-03-01 23:41:25 UTC
This will be fixed in my branch of genkernel in about a week or so..

http://www.student.northpark.edu/pemente/sed/sed1line.txt

 # print the line immediately before a regexp, but not the line
 # containing the regexp
 sed -n '/regexp/{g;1!p;};h'

 # print the line immediately after a regexp, but not the line
 # containing the regexp
 sed -n '/regexp/{n;p;}'

 # print 1 line of context before and after regexp, with line number
 # indicating where the regexp occurred (similar to "grep -A1 -B1")
 sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h
Comment 8 Aaron Peterson 2004-03-16 02:58:39 UTC
I'm thinking about having the error message give additional advice...  like say: 
The kernel compiled, but the initrd compile failed... you have these options:

1) fix the initrd configuration found in ...blah
     then run genkernel initrd 
     then genkernel busybox
2) you might need to change (blah option.. in which case you can:
    rerun genkernel with --no-mrproper --no-clean to make it go faster

Of course I don't know the sound advice... but I sure hate waiting for a half hour between kernel compiles just to find that something failed.

also,

I'm getting pretty sick of genkernel telling me too, my patch set changed the error message:

* DO NOT REPORT KERNEL COMPILE FAILURES AS GENKERNEL BUGS!
*
* Report real genkernel bugs to bugs.gentoo.org
Comment 9 Tim Yamin (RETIRED) gentoo-dev 2004-03-21 07:39:20 UTC
Automatic log grepping for problems on errors is now in; try out genkernel-3.0.2_rc1.