[Peeweelinux] FAQ: New RedHat, no errors, no bzImage

Barry Gershenfeld [email protected]
Mon, 5 Aug 2002 12:45:25 -0700 (PDT)


So you all saw my lament about building a custom kernel, and
smiled to yourselves, thinking, "He'll find out soon enough".  Well,
he's found out alright; I'd just suggest that if I could get through
this sooner I might have some time to contribute to the project.
Your punishment is you get to read the same answers again.

I post this now because there are always new people always coming by 
and this needs to stay visible.

Problem: Redhat 7.3, "Compile the Kernel" succeeds, but "Load 
File System onto Target" fails.  A little digging reveals that no
kernel image (bzImage) was ever produced.

Reason: "Compile the Kernel" did NOT succeed. 

   Reason: checksum.S did not compile (ok, assemble).

      Reason: gcc version 2.96 is broken.

         Reason: Red Hat distributed it with 7.0 +

Okay, solutions.

First of all, (Ralph,) be aware that the pwlconfig script won't 
catch this!  So don't be mislead.  If you want to check, go on
to the next step  "Create Custom Kernel Package (not rpm!)",
then go back to "Configure Project File System -->",
"Kernel_Custom -->",     then select the kernel you just built, 
and look in the list for /boot/bzImage.  If you only see /boot, 
then you didn't get a kernel.

Next, RedHat supplies an older version of gcc especially for
compiling kernels.  It's called kgcc.  It's an older egcs-2.91.66
compiler that works just fine.  It should already be on your
system.  Try 'which kgcc' and 'kgcc --version' to be sure.  There
is no kgcc.rpm on my disks so I don't know where it came from.
All you need to do now, to use it, is to edit your Makefile.  This is in  

Embedded_Build/kernelbuild/usr/src/linux-2.2.17-13

find the "cc" line:

CC      =$(CROSS_COMPILE)kgcc -D__KERNEL__ -I$(HPATH)

change "cc" to "kgcc" as I have done, 
then compile once again, and things will start to
work.


About that "2.96 is broken" remark.  This was a development
version that should not have been distributed.  The GNU 
folks moved the version up to 2.97 in response and announced
there would never be a stable version of 2.96  (So you'll know
they are all broken).   I remember the discussions at the time
(remember this was almost two years ago) and while I didn't
retain all the kernel-related particulars I do know it 
reinforced my own feelings that I should get a good version
(2.95) and refuse to upgrade it until someone (several 
someones!) announced an "all clear".  

searching on "bzImage" or "checksum" will find similar 
problems and answers like this one.