Click to See Complete Forum and Search --> : Help with Kernel build please :)


NeilBlue
01-10-2001, 03:09 PM
Hello,

I have Mandrake 7.2 and I am trying to build the latest 2.4 kernel. I have followed the instructions and have unpacked the tarball in my user directory, and am trying to do 'make bzImage'. However I get the messages:

"
/home/neil/linux/include/asm/hw_irq.h: In function `x86_do_profile':
/home/neil/linux/include/asm/hw_irq.h:198: `current' undeclared (first use in this function) /home/neil/linux/include/asm/hw_irq.h:198: (Each undeclared identifier is reported only once /home/neil/linux/include/asm/hw_irq.h:198: for each function it appears in.)
In file included from /home/neil/linux/include/asm/string.h:296,
from /home/neil/linux/include/linux/string.h:21,
from /home/neil/linux/include/linux/fs.h:23,
from /home/neil/linux/include/linux/capability.h:17,
from /home/neil/linux/include/linux/binfmts.h:5,
from /home/neil/linux/include/linux/sched.h:9,
from /home/neil/linux/include/linux/mm.h:4,
from /home/neil/linux/include/linux/slab.h:14,
from /home/neil/linux/include/linux/malloc.h:4,
from /home/neil/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
"
etc...

Please could anyone explain what this means or how to fix it.

Thank you
Neil Blue

mdwatts
01-10-2001, 07:46 PM
Did you do all the steps between the untar and make bzImage?

I've never compiled a kernel yet, but I don't think the sources are supposed to be in your home directory. Should be in /usr/linux/... I believe is correct.

demian
01-10-2001, 07:51 PM
You have to extract the tarball in /usr/src and it will create a subdir called linux. BE CAREFUL many distro set up a symbolic link /usr/src/linux that points to the latest kernel source dir (or to the version your glibc has been compiled against). Remove this link first. Otherwise you'll overwrite lots of stuff that you really need.

NeilBlue
01-11-2001, 06:18 AM
The document says not to do this:

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:

gzip -cd linux-2.4.XX.tar.gz | tar xvf -

Replace "XX" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.

Neil

nopun
01-11-2001, 09:02 AM
I suspect something else happened beforehand to trigger this (a missing .h file?). A trick I like to use it to type

make bzImage >foo.tmp 2>&1

This will output all messages and errors to file foo.tmp, which you can review at your leisure. Go back to where things first started going wrong and address problems from there.

Edit: but then again I could be being dumb - I usually work in console mode. If you are using xterm or something you can scroll back and take a look that way.

[This message has been edited by nopun (edited 11 January 2001).]

demian
01-11-2001, 09:14 AM
That's why I told you to put the link away before extracting. Anyway you can extract wherever you want but then you have to move the linux dir in which you extracted it to /usr/src/linux-<version> to compile the kernel. If you don't do that you'll have to edit the makefile to tell the compiler where your include files are.
So again:
[list=A]
extract the tarball (do it where you want to but if you do it in /usr/src mind the link)
Copy the stuff to /usr/src/linux-<version>
cd to /usr/src/linux-<version>
Do a make mrproper; make [x|menu]conmfig; make dep; make bzImage; make modules; make modules_install
copy arch/i386/boot/bzImage to /boot/vmlinuz-<version> or whatever name you like
copy System.map to /boot/System.map
add entry to /etc/lilo.conf (in case you use lilo)
make sure the old kernel image is also bootable in case somthing goes wrong

Hope this helps...

treatment
01-11-2001, 11:27 AM
Please click and review the

<A HREF="http://www.linuxnewbie.org/nhf/intel/compiling/kernelcomp.html" TARGET=_blank>
The Kernel: Configuration and Compilation NHF V1.2 </A>

Shad
01-11-2001, 12:17 PM
Just a side point, I have been compiling new kernels for seven months, and I never bother extracting it to /usr/src. I will copy the resulting dir there, but only after I have been completely successfull compiling and installing the new kernel.

------------------
Just a Tuna in the Sea of Life

bobarian
01-11-2001, 02:07 PM
Mandrake comes with gcc 2.95.2. I don't think that one is really supposed to compile the 2.4.0 kernel correctly.

NeilBlue
01-12-2001, 06:31 PM
Do you know where I can get gcc-2.91.66 please, (pref as an RPM) http://www.linuxnewbie.org/ubb/smile.gif

cheers
Neil

NeilBlue
01-14-2001, 12:58 PM
Hello,

Thank you for the help, I have now managed to compile the kernel. I noted a few things on the way.

1) I compiled it in /usr/src/linux.

2) I couldn't get hold of gcc-2.91.66, so I used gcc 2.95.2 which comes with MD7.2.

3) When I first set the config processor to athlon k7 I got some undeclared identifiers. So I compiled it as an i686, which worked and then later I was able to compile it with the K7 processor option.

4) I had to change the PPP setting to be build into the kernel to get it to work

5) Now using the new kernel I find that my Mandrake startup is in the wrong video mode (that is too low), and using the vga=788 setting doesn't seem to fix this.

Cheers
Neil