Linux Kernel Compilation issues ...

I am seeing errors when I am trying to compile my own linux kernel.

To start with, I downloaded the source from
http://code.google.com/p/beagleboard/wiki/BeagleSourceCode and did the
following commands in 2.6_kernel/ directory

make CROSS_COMPILE=arm-none-linux-gnueabi- distclean
<Works fine>

make CROSS_COMPILE=arm-none-linux-gnueabi- omap3_beagle_defconfig
<Gives errors ...
scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or
directory
.and so on...
....

2.6_kernel/sys directory is indeed not available. Did the tar ball
miss the sys directory?

Any help is greatly appreciated.

-Sreekanth

What system are you compiling from? Can you share your environment
variables?

I am compiling it in Ubuntu Linux. Linux is running on a VM on my
Window's PC.

I am compiling on Ubuntu Linux. Below are my env variables.

sreekanth@sreekanth-ubuntu:~$ env
GPG_AGENT_INFO=/tmp/seahorse-M2BaoH/S.gpg-agent:5426:1
SHELL=/bin/bash
DESKTOP_STARTUP_ID=
TERM=xterm
XDG_SESSION_COOKIE=55f0be6803582c079fed074048a4351f-1221538705.529646-1623721675
GTK_RC_FILES=/etc/gtk/gtkrc:/home/sreekanth/.gtkrc-1.2-gnome2
WINDOWID=48234588
USER=sreekanth
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.
7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:
SSH_AUTH_SOCK=/tmp/keyring-bHQHHC/ssh
GNOME_KEYRING_SOCKET=/tmp/keyring-bHQHHC/socket
SESSION_MANAGER=local/sreekanth-ubuntu:/tmp/.ICE-unix/5316
USERNAME=sreekanth
PATH=/home/sreekanth/Desktop/jdk1.6.0_07/jre/bin:/home/sreekanth/
CodeSourcery/Sourcery_G++_Lite/bin:/usr/local/sbin:/usr/local/bin:/usr/
sbin:/usr/bin:/sbin:/bin:/usr/games
DESKTOP_SESSION=default
GDM_XSERVER_LOCATION=local
PWD=/home/sreekanth
LANG=en_US.UTF-8
GNOME_KEYRING_PID=5314
GDM_LANG=en_US.UTF-8
GDMSESSION=default
HISTCONTROL=ignoreboth
SHLVL=1
HOME=/home/sreekanth
GNOME_DESKTOP_SESSION_ID=Default
LOGNAME=sreekanth
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/
dbus-0EeEhIRnCv,guid=309ae39c202c252908c7e00948cf3393
LESSOPEN=| /usr/bin/lesspipe %s
WINDOWPATH=7
DISPLAY=:0.0
LESSCLOSE=/usr/bin/lesspipe %s %s
COLORTERM=gnome-terminal
XAUTHORITY=/home/sreekanth/.Xauthority
_=/usr/bin/env
sreekanth@sreekanth-ubuntu:~$

In ubuntu I believe build-essential should take care of that..

sudo apt-get install build-essential

This solved my inital compile issues. Now I am having problem with
mkimage when building the Linux Image. I am seeing the below message.
Looks like mkimage is called with wrong options in the Makefile?

  LD arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE arch/arm/boot/uImage
/usr/bin/mkimage [OPTIONS]

Options:
-f <MD5 name> Specify an input MD5 file. MD5s must be in
jigdo's
                     pseudo-base64 format
-j <jigdo name> Specify the input jigdo file
-t <template name> Specify the input template file
-m <item=path> Map <item> to <path> to find the files in the
mirror
-M <missing name> Rather than try to build the image, just check
that
                     all the needed files are available. If any are
missing,
                     list them in this file.
-v Make the output logging more verbose
-l <logfile> Specify a logfile to append to.
                     If not specified, will log to stderr
-o <outfile> Specify a file to write the ISO image to.
                     If not specified, will write to stdout
-q Quick mode. Don't check MD5sums. Dangerous!
-s <bytenum> Start byte number; will start at 0 if not
specified
-e <bytenum> End byte number; will end at EOF if not specified
-z Don't attempt to rebuild the image; simply print
its
                     size in bytes
  Image arch/arm/boot/uImage is ready
sreekanth@sreekanth-ubuntu:~/Beagle/2.6_kernel$

All figured out. I was using mkimage that is not the correct
"mkimage". Follow this thread for more details
http://lists.debian.org/debian-embedded/2006/07/msg00065.html.

You need "mkimage" that is compiled in u-boot tree. Below is the link
for that http://free-electrons.com/doc/linux_omap/img23.html.

Now I can compile the uImage :slight_smile:

-Sreekanth

This took a little bit of testing to track down, but it looks like you
have ubuntu's jigit installed which is providing an incompatible
version of mkimage for creating a beagleboard compatible u-boot
uImage.

First remove jidit: sudo apt-get remove jigit

(and verify /usr/bin/mkimage doesn't exist anymore..)

Download beagleboard u-boot:
wget -nc http://beagleboard.googlecode.com/files/u-boot_beagle_revb.tar.gz

UnTar:
tar -xf u-boot_beagle_revb.tar.gz

Build just the native mkimage tool in u-boot (hence CROSS_COMPILE=<blank> ...)
cd u-boot/
make CROSS_COMPILE= distclean
make CROSS_COMPILE= omap3530beagle_config
make CROSS_COMPILE= tools

Add mImage to path:
PATH=/home/<user>/u-boot/tools:"${PATH}"

Follow your previous instructions and now rebuild the kernel: "make
CROSS_COMPILE=arm**** uImage"