Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Problem building 2.6.23.1 kernel
PostPosted: Tue Nov 13, 2007 9:52 pm 
Offline

Joined: Sat Jun 30, 2007 1:18 am
Posts: 20
Location: Belgrade
Hi!

I've patched successfully 2.6.23.1 vanilla kernel with the latest AT91 patch (for 2.6.22 kernel). But, building that 2.6.23.1 kernel is not going ok. After all, I got very huge kernel image (around 3GB!). Anyone knows how to solve that?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 10:20 am 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
I guess you did something wrong.
please describe the steps you did starting from patching vanilla kernel until the last make.

FYI 2.6.23.1 works perfectly on my AT91SAM9263EK cloned board ;-)

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 6:44 pm 
Offline

Joined: Sat Jun 30, 2007 1:18 am
Posts: 20
Location: Belgrade
Well, here are the steps:

Step 1: patch the kernel (patch -p1 < .../2.6.23-rc3-at91.patch inside kernel tree)
Code:
bole@bole:~/kernel/linux-2.6.23.1$ patch -p1 < ../src/2.6.23-rc3-at91.patch
[..]
patching file arch/arm/mach-ks8695/board-micrel.c
Hunk #1 FAILED at 23.
1 out of 1 hunk FAILED -- saving rejects to file arch/arm/mach-ks8695/board-micrel.c.rej
[..]
patching file drivers/i2c/busses/Kconfig
Hunk #2 succeeded at 616 (offset 1 line).
patching file drivers/spi/atmel_spi.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/spi/atmel_spi.c.rej
patching file include/asm-arm/arch-at91/irqs.h
Hunk #1 succeeded at 45 with fuzz 2 (offset 3 lines).


Step 2: cp ../linux-2.6.22-at91/.config .

Step 3: make ARCH=arm CROSS_COMPILE=arm-linux- uImage
[Of course, config restart asked me a lot of questions :) ]

Code:
 
  [..]
  LD      vmlinux.o
  MODPOST vmlinux.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
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-2.6.23.1
Created:      Fri Nov 16 17:45:18 2007
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    8013208 Bytes = 7825.40 kB = 7.64 MB
Load Address: 0x20008000
Entry Point:  0x20008000
  Image arch/arm/boot/uImage is ready

bole@bole:~/kernel/linux-2.6.23.1$ ls -l arch/arm/boot/Image
-rw-r--r-- 1 bole bole 3227150584 2007-11-16 17:44 arch/arm/boot/Image
bole@bole:~/kernel/linux-2.6.23.1$ ls -lh arch/arm/boot/Image
-rw-r--r-- 1 bole bole 3.1G 2007-11-16 17:44 arch/arm/boot/Image
bole@bole:~/kernel/linux-2.6.23.1$ ls -l vmlinux*
-rwxr-xr-x 1 bole bole 6452096 2007-11-16 17:44 vmlinux
-rw-r--r-- 1 bole bole 6782013 2007-11-16 17:44 vmlinux.o



Note: I have no such problems with 2.6.22 and any other kernel from the past. I've tried with two different toolchains. I've actually tried the same thing with Ronetix's PM9261 patch and the results are pretty much the same.

Maybe you can send me patch between your patched 2.6.23.1 and vanilla one?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 3:31 pm 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
Seems all ok.

Of course you have to use the just created kernel image in
arch/arm/boot/uImage and NOT Image

:D

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 4:25 pm 
Offline

Joined: Sat Jun 30, 2007 1:18 am
Posts: 20
Location: Belgrade
Quote:
Of course you have to use the just created kernel image in
arch/arm/boot/uImage and NOT Image


Really? :)

arch/arm/boot/Image is just not compressed kernel image. And 3GB is just way too big.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 4:44 pm 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
please read carefully
" arch/arm/boot/uImage " :wink:

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 5:22 pm 
Offline

Joined: Sat Jun 30, 2007 1:18 am
Posts: 20
Location: Belgrade
koan wrote:
please read carefully
" arch/arm/boot/uImage " :wink:


Come on! :) Yes, I know that uImage is a file one should use. And I'm using that file, for sure. When compiling 2.6.22 kernel with the same .config file (and using patch from at91), uImage is around 4MB (because of IRFS). When compiling 2.6.23.1 with the same AT91 patch, Image (yes, Image, not uImage) file is larger than 3GB and uImage is around 8MB. I think those almost 3GB is full of zeroes (or something similar and easy to compress).

After all, I'm unable to boot up my AT91SAM9260-EK with 2.6.23.1 uImage file, while I have no problems with 2.6.22, and a lot of others I'm booting that EK for months.

But, I wanted to say that 3GB, even for uncompressed kernel image (Image file), is too much.

Anyway, I've asked if you can send me (or upload somewhere) "your" AT91 patch for 2.6.23.1 kernel. Is that possible?

Greetings


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 5:26 pm 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
I'm using
linux-2.6.23.1$ patch -p1 < ../src/2.6.23-rc3-at91.patch
with minor custom patches for my specific hardware.

So your own must run smoothly too.

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
 Post subject: Re: Problem building 2.6.23.1 kernel
PostPosted: Mon Nov 19, 2007 9:05 pm 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
bole wrote:
I've patched successfully 2.6.23.1 vanilla kernel with the latest AT91 patch (for 2.6.22 kernel).


Hi there

You need to revisit maxim.org.za, and get the really latest at91 patch for the 2.6.23 kernel (which was available on Nov 13th).

Regards.


Top
 Profile  
 
 Post subject: Re: Problem building 2.6.23.1 kernel
PostPosted: Tue Nov 20, 2007 2:36 am 
Offline

Joined: Sat Jun 30, 2007 1:18 am
Posts: 20
Location: Belgrade
blue_z wrote:
You need to revisit maxim.org.za, and get the really latest at91 patch for the 2.6.23 kernel (which was available on Nov 13th).


Thanks for the info. I havent noticed that!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 28, 2007 6:04 pm 
Offline

Joined: Wed Nov 28, 2007 4:06 pm
Posts: 1
Since version 2.6.23 linux started using build id, which is just a kind of dummy version string in ELF binary.

Code:
$ arm-linux-objdump -h vmlinux

vmlinux:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .note.gnu.build-id 00000024  00000000  00000000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_DISCARD
<snip>

This piece of string is useless run-time and objcopy (from vmlinux to arch/arm/boot/Image) is supposed to remove it, but it doesn't.

Code:
$ grep -i OBJCOPYFLAGS arch/arm/Makefile
OBJCOPYFLAGS    :=-O binary -R .note -R .comment -S

Parameters to objcopy (-R .note) do not match the actual section (.note.gnu.build-id), so the build id is never removed, and this leads to 3G+ sized image. You can fix this by editing the line with OBJCOPYFLAGS in arch/arm/Makefile. Just replace the .note with correct section name (which you can see with objdump -h vmlinux, like above).

I haven't tracked down what really causes the mismatch in section names in my (and apparently your) build process when most other people don't seem to run into this. The above however fixes it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: