Steps to build kernel from linux-2.6.29-mini2440_20090609.tgz

Josema
Hi

I would like to know the steps to build kernel zImage from
linux-2.6.29-mini2440_20090609.tgz,

I have linux o.s and arm-gcc-4.3.2 propertly installed and added to path, I
have decompressed .tgz and now i have linux-2.6.29 folder. What are next
steps?

Thanks is advance and regards

eduardo
Follow the steps described on chapter 5.4 user manual to build your
development environment. Then go to linux-2.6.29 folder and type as root:

To change kernel options:
sudo make menuconfig

To build kernel:
sudo make zImage

After some minutes zImage will be available on ./arch/arm/boot.

Use usbpush (on linux) or dnw (on windows) and send it to your board.
:D

try out and tell us your result.

Josema
Hi Eduardo

I have a Centos 4 and micro2440 sdk 128 MB with 3.4 LCD.

I do this:

1. Uncompress arm-linux-gcc-4.3.2.tgz on / (tar -zxvf ....)
2. Modify my .bash_profile to add /usr/local/arm/bin folder to path
3. Make menuconfig (load config_mini2440_n35 file)
4. Make zImage

In the end i get zImage on ./arch/arm/boot (4 bytes bigger than the
zImage_N35 that i have in my dvd)

Then from windows:

DNW: erase NAND , update supervivi, update kernel (with zImage_N35 from my
dvd), update rootfs (root_qtopia) and works fine.

BUT:

DNW: erase NAND , update supervivi, update kernel (zImage generated by me),
update rootfs (root_qtopia) and the kernel is not launched. I get a log
saying Uncompressing kernel ................. then Loading kernel and it
stops there.

Could you help me please, i need to build my custom kernel. Do you think i
need to do something else?

Thanks in advance and regards

Alexander Reddy Vatti
Hello Eduardo

"Follow the steps described on chapter 5.4 user manual to build your
development environment"


Please give the link of above,becuse i want build kernel linux-2.6.29 for
Mini2440+3.5" LCD

2. Modify my .bash_profile to add /usr/local/arm/bin folder to path
3. Make menuconfig (load config_mini2440_n35 file)

for  2 step.
we have to set the path to /usr/local/arm/bin 
for 3 step.
when i gave make menuconfig, i am unable to load "config_mini2440_n35" file

Please suggest me,to go the things better.

davef
2.  I assume you managed to do step 2
3. make menuconfig will pull in the .config file.  If you want you own
config file then do <make oldconfig> (which I couldn't get to work) or
rename your current config file as something and then make a copy of
config_mini2440_n35 and call it .config.  make menuconfig then will have no
choice but to drag in the contents of config_mini2440_n35.

You better list the steps you are taking in your compilation process as
there could be MANY other things that could go wrong.

Josema
Hi davef, those are my steps

"You better list the steps you are taking in your compilation process as
there could be MANY other things that could go wrong."

On Centos 4, all processes as root user.

[root@KLNETCENTER linux-2.6.29]# uname -a
Linux KLNETCENTER 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:48:03 EST 2007 i686
i686 i386 GNU/Linux



Step 2: modify .bash_profile

PATH=$PATH:$HOME/bin
PATH=$PATH:/usr/local/arm/4.3.2/bin/
export PATH

root@KLNETCENTER ~]$ echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/
usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/arm/4.3.2/bin/:/home/plg/b
in:/usr/local/arm/4.3.2/bin/

[root@KLNETCENTER ~]$ arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld
--enable-languages=c,c++ --enable-shared --enable-symvers=gnu
--enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72'
--with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls
--prefix=/opt/codesourcery
--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc
--with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gn
ueabi/libc
--with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-li
nux-gnueabi-i686-pc-linux-gnu/usr
--with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-l
inux-gnueabi-i686-pc-linux-gnu/usr
--disable-libgomp --enable-poison-system-directories
--with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux
-gnueabi/bin
--with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux
-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)



Step 3:Uncompress linux
[root@KLNETCENTER ~]$ tar -zxvf linux-2.6.29-mini2440_20090609.tgz

Step 4: Copy men_config_n35 to .config and then make menuconfig

Step 5: make
[root@KLNETCENTER linux-2.6.29]# make
  CHK     include/linux/version.h
  Generating include/asm-arm/mach-types.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  CC      kernel/bounds.s
  GEN     include/linux/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/asm/asm-offsets.h
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
....
....
....
....
  CC      kernel/module.o
kernel/module.c: In function 'load_module':
kernel/module.c:2291: warning: label 'free_init' defined but not used
  CC      kernel/kallsyms.o
  CC      kernel/rcuclassic.o
  CC      kernel/utsname_sysctl.o
  CC      kernel/dma-coherent.o
  LD      kernel/built-in.o
....
....
....
  CC      drivers/char/keyboard.o
drivers/char/keyboard.c:1126:2: warning: #warning "Cannot generate rawmode
keyboard for your architecture yet."
  CC      drivers/char/consolemap.o
  CONMK   drivers/char/consolemap_deftbl.c
  CC      drivers/char/consolemap_deftbl.o
  CC      drivers/char/vt.o
  SHIPPED drivers/char/defkeymap.c
  CC      drivers/char/defkeymap.o
  CC      drivers/char/mini2440_leds.o
  CC      drivers/char/mini2440_buttons.o
  CC      drivers/char/mini2440_pwm
....
....
....
  AR      lib/lib.a
  LD      vmlinux.o
  MODPOST vmlinux.o
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  OBJCOPY arch/arm/boot/Image
  Kernel: arch/arm/boot/Image is ready
  AS      arch/arm/boot/compressed/head.o
  GZIP    arch/arm/boot/compressed/piggy.gz
  AS      arch/arm/boot/compressed/piggy.o
  CC      arch/arm/boot/compressed/misc.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 2 modules
  CC      drivers/char/mini2440_hello_module.mod.o
  LD [M]  drivers/char/mini2440_hello_module.ko
  CC      drivers/scsi/scsi_wait_scan.mod.o
  LD [M]  drivers/scsi/scsi_wait_scan.ko
[root@KLNETCENTER linux-2.6.29]#

Step 6: Check zImage (zImage is image generated, zImage_N35 is image form
dvd)

[root@KLNETCENTER linux-2.6.29]# ls -l arch/arm/boot/
total 8040
drwxr-xr-x  2 root root    4096 Mar 24  2009 bootp
drwxr-xr-x  2 root root    4096 Feb 12 08:19 compressed
-rwxr-xr-x  1 root root 4158016 Feb 12 08:19 Image
-rw-r--r--  1 root root    1326 Mar 24  2009 install.sh
-rw-r--r--  1 root root    2901 Mar 24  2009 Makefile
-rwxr-xr-x  1 root root 2022340 Feb 12 08:19 zImage
-rw-r--r--  1 root root 2022344 Jul  8  2009 zImage_N35
[root@KLNETCENTER linux-2.6.29]#

ZImage not working on board:

Using DNW:

supervivi-128M
zImage
root_qtopia-128M

I get this: Starting with switch to NAND:
load Image of Linux...Uncompressing
Linux...........................................................................
.......................................................
done, booting the kernel.

ZImage_N35 (from dvd) working:

Using DNW:

supervivi-128M
zImage_N35
root_qtopia-128M
load Image of Linux...Uncompressing
Linux...........................................................................
.......................................................
done, booting the kernel.
Linux version 2.6.29.4-FriendlyARM (root@tom) (gcc version 4.3.2 (Sourcery
G++ Lite 2008q3-72) ) #2 Wed Jul 8 18:17:16 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: FriendlyARM Mini2440 development board
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
....
....
....
....




Please could you help me? what i missing?

Regards

eduardo
Alexander,

Do what davef said:
"cp ./config_mini2440_n35 ./.config"

This is described on user manual on chapter 5.4.


Josema,

Try:
make clean (or clear, not sure)
cp ./config_mini2440_n35 ./.config
make zImage

Let's see what happen with "default" configuration file.

regards

Josema
Hi Eduardo,

Yes, I have done waht you say:

"cp ./config_mini2440_n35 ./.config"

then make zImage, same result, it is the same process indeed.


Do you think this can be related with i'm using Centos 4 instead of fedora
9? Are you using fedora 9 or a different os?

Regards

jm

eduardo
I don't think so, cause you are using the files from dvd to compile the
kernel.
I'm using ubuntu 8.04, and have no problem with it. The only difference is
that i'm using micro 2440 64mb SDK without lcd.

Josema
Hi Eduardo,

Please could you post the configuration of your system, the files that are
you using and the steps are you following to compile your kernel image?

thanks and regards

josema

skip2816
Hi Eduardo,

here any:
1. Check the size of the zImage. The maximum is a very small bit over 2 Mio
Bytes. Its must fit in the 2. partition. See linux download manual.

2. You have configured to use modules so you have to build (and transfer)
them too.
You can disable the usage of modules. This saves about 100 kb or more.

I compiled my kernel any weeks ago. The transfer to my micro2440 failed
some times. I did repeat and all was right.

Its is a good idea to walk thru the menuconfig. Not all preselections seams
very usefull. 

skip

davef
Just learnt this week, after compilation do:

<make ARCH=arm V=1>

And look through the results.


Good luck.

davef
Everybody sure they are using a cross-compiler?

Josema
Hi all,

In the end the issue is related to Centos 4. Same steps on Fedora 9 work
fine.

So these are the steps to build the kernel, hope it helps to people that
could have the same problem on other linux distributions:


Step 1: Install fedora 9
Step 2: Install cross compiler, copy arm-linux-gcc-4.3.2.tgz to / and
decompress(tar -zxvf arm-linux-gcc-4.3.2.tgz)
Step 3: modify .bash_profile (or .bashrc), add next lines, 

PATH=$PATH:$HOME/bin
PATH=$PATH:/usr/local/arm/4.3.2/bin/
export PATH

logout and login again to apply changes

Step 4: check your path:

root@localhost ~]$ echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/

usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/arm/4.3.2/bin/:/home/plg/b

in:/usr/local/arm/4.3.2/bin/

Step 5: Check cross compiler
[root@localhost ~]$ arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld
--enable-languages=c,c++ --enable-shared --enable-symvers=gnu
--enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72'
--with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls
--prefix=/opt/codesourcery
--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc
--with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gn

ueabi/libc
--with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-li

nux-gnueabi-i686-pc-linux-gnu/usr
--with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-l

inux-gnueabi-i686-pc-linux-gnu/usr
--disable-libgomp --enable-poison-system-directories
--with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux


-gnueabi/bin
--with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux


-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)



Step 6:Uncompress linux distribution
[root@localhost ~]$ tar -zxvf linux-2.6.29-mini2440_20090609.tgz

Step 7: Copy men_config_n35 (or the config file you want) to .config and
then make

You get zImage on arch/arm/boot/zImage

Regards

jm

MMS
hay
i have problem with in making zImage
-----------------------------------------------------------
[root@localhost linux-2.6.29]# make zImage
scripts/kconfig/conf -s arch/arm/Kconfig
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  CHK     include/linux/compile.h
  CC      drivers/video/console/vgacon.o
drivers/video/console/vgacon.c: In function 'vgacon_startup':
drivers/video/console/vgacon.c:510: error: 'PCIMEM_BASE' undeclared (first
use in this function)
drivers/video/console/vgacon.c:510: error: (Each undeclared identifier is
reported only once
drivers/video/console/vgacon.c:510: error: for each function it appears
in.)
drivers/video/console/vgacon.c: In function 'vgacon_do_font_op':
drivers/video/console/vgacon.c:1068: error: 'PCIMEM_BASE' undeclared (first
use in this function)
make[3]: *** [drivers/video/console/vgacon.o] Error 1
make[2]: *** [drivers/video/console] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
--------------------------------------------------------------

please any help

thx in advance

Jone Hung
Hi, I using zImage_w35 kernel for Freindly mini2440. I want to control GPIO
(CON4) but when I try open GPIO port then error. I was found GPIO file in
/sys/class/gpio path but no exits. I was config kernel and then make zImage
but error, as:
----------------------------------
drivers/video/console/vgacon.c: In function 'vgacon_startup':
drivers/video/console/vgacon.c:508: error: 'PCIMEM_BASE' undeclared (first
use in this function)
drivers/video/console/vgacon.c:508: error: (Each undeclared identifier is
reported only once
drivers/video/console/vgacon.c:508: error: for each function it appears
in.)
drivers/video/console/vgacon.c: In function 'vgacon_do_font_op':
drivers/video/console/vgacon.c:1068: error: 'PCIMEM_BASE' undeclared (first
use in this function)
make[3]: *** [drivers/video/console/vgacon.o] Error 1
make[2]: *** [drivers/video/console] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
------------------------------------
Help me debug error.
Thanks and regard!

nikita
i m facing the problem during compile the kernel
after menuconfig i n the kernel i did amake & facing this problem.
give me the solution

  /home/ubuntu/easyarm/work/linux-2.6.29/scripts/gen_initramfs_list.sh:
Cannot open 'ubuntu/easyarm/work/rootfs'
make[1]: *** [usr/initramfs_data.cpio.gz] Error 1
make: *** [usr] Error 2

sujith
i am facing the problem during comple the kernal.i am copy
config_mini2440_w35 to .config file,but i am facing some problem please
help me how to rectify the problem? please send me the steps for how to
build kernal in mini2440 board?