FAQ: [#6404] can't generate uImage with buildroot(2010)

Document created by Aaronwu Employee on Sep 11, 2013
Version 1Show Document
  • View in full screen mode

[#6404] can't generate uImage with buildroot

Submitted By: Vivi Li

Open Date

2010-12-12 23:34:36     Close Date

2011-01-20 01:26:45

Priority:

Medium     Assignee:

Mike Frysinger

Status:

Closed     Fixed In Release:

N/A

Found In Release:

2011R1     Release:

Category:

N/A     Board:

N/A

Processor:

ALL     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Rejected

Uboot version or rev.:

    Toolchain version or rev.:

2010R1-RC4

App binary format:

N/A     

Summary: can't generate uImage with buildroot

Details:

 

when I use buildroot to build kernel on bfin platform, uImage can't be generated, only rootfs.initramfs and vmImage are generated. Config file for buildroot is attached.

 

--

set -e; \

        t=`bfin-linux-uclibc-gcc  -print-file-name=libc.a`; \

        t=`dirname $t`/../..; \

        for i in $t/lib/*so*; do \

                i=`readlink -f "$i"`; \

                soname=`bfin-linux-uclibc-readelf -d "$i" | sed -n '/(SONAME)/s:.*[[]\(.*\)[]].*:\1:p'`; \

                /usr/bin/install -D $i /home/test/work/cruise/checkouts/buildroot/output/target/lib/$soname; \

        done

set -e; \

        t=`bfin-uclinux-gcc  -mid-shared-library -print-file-name=libc`; \

        if [ -f $t -a ! -h $t ] ; then \

                /usr/bin/install -D $t /home/test/work/cruise/checkouts/buildroot/output/target/lib/lib1.so; \

        fi

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/include /home/test/work/cruise/checkouts/buildroot/output/target/usr/lib/pkgconfig /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/aclocal

find /home/test/work/cruise/checkouts/buildroot/output/target/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f

find /home/test/work/cruise/checkouts/buildroot/output/target/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/gdb

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/man /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/man

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/info /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/info

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/doc /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/doc

rm -rf /home/test/work/cruise/checkouts/buildroot/output/target/usr/share/gtk-doc

rmdir /home/test/work/cruise/checkouts/buildroot/output/target/usr/share 2>/dev/null

make: [target-finalize] Error 1 (ignored)

find /home/test/work/cruise/checkouts/buildroot/output/target -type f -perm +111 '!' -name 'libthread_db.so*' | \

                xargs bfin-uclinux-strip --remove-section=.comment --remove-section=.note 2>/dev/null || true

find /home/test/work/cruise/checkouts/buildroot/output/target/lib/modules -type f -name '*.ko' | \

                xargs -r bfin-uclinux-strip --remove-section=.comment --remove-section=.note --strip-unneeded --remove-section=.comment --remove-section=.note

mkdir -p /home/test/work/cruise/checkouts/buildroot/output/target/etc

# Mandatory configuration file and auxilliary cache directory

# for recent versions of ldconfig

touch /home/test/work/cruise/checkouts/buildroot/output/target/etc/ld.so.conf

mkdir -p /home/test/work/cruise/checkouts/buildroot/output/target/var/cache/ldconfig

if [ -x "bfin-uclinux-ldconfig" ]; \

        then \

                bfin-uclinux-ldconfig -r /home/test/work/cruise/checkouts/buildroot/output/target; \

        else \

                /sbin/ldconfig -r /home/test/work/cruise/checkouts/buildroot/output/target; \

        fi

/sbin/ldconfig: /lib/lib1.so is not an ELF file - it has the wrong magic bytes at the start.

 

echo 2010.11-rc1-00087-g2123317 > /home/test/work/cruise/checkouts/buildroot/output/target/etc/br-version

>>>   Generating root filesystem image rootfs.initramfs

if [ ! -e /home/test/work/cruise/checkouts/buildroot/output/target/init ]; then ln -sf sbin/init /home/test/work/cruise/checkouts/buildroot/output/target/init; fi

rm -f /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

touch /home/test/work/cruise/checkouts/buildroot/output/build/.fakeroot.00000

cat /home/test/work/cruise/checkouts/buildroot/output/build/.fakeroot* > /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

echo "chown -R 0:0 /home/test/work/cruise/checkouts/buildroot/output/target" >> /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

echo "/home/test/work/cruise/checkouts/buildroot/output/host/usr/bin/makedevs -d target/generic/device_table.txt /home/test/work/cruise/checkouts/buildroot/output/target" >> /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

echo "  /bin/sh fs/initramfs/gen_initramfs_list.sh -u 0 -g 0 /home/test/work/cruise/checkouts/buildroot/output/target > /home/test/work/cruise/checkouts/buildroot/output/images/rootfs.initramfs" >> /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

chmod a+x /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

/home/test/work/cruise/checkouts/buildroot/output/host/usr/bin/fakeroot -- /home/test/work/cruise/checkouts/buildroot/output/build/_fakeroot.fs

rootdir=/home/test/work/cruise/checkouts/buildroot/output/target

table='target/generic/device_table.txt'

>>>   Rebuilding kernel with initramfs

# Remove the previously generated initramfs which was empty,

# to make sure the kernel will actually regenerate it.

rm -f -f /home/test/work/cruise/checkouts/buildroot/output/build/linux-custom/usr/initramfs_data.cpio*

# Build the kernel.

PATH="/home/test/work/cruise/checkouts/buildroot/output/host/bin:/home/test/work/cruise/checkouts/buildroot/output/host/usr/bin:/home/test/work/cruise/checkouts/buildroot/output/host/usr/sbin/:/home/test/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-elf/bin:/opt/uClinux/bfin-linux-uclibc/bin" PERLLIB="/home/test/work/cruise/checkouts/buildroot/output/host/usr/lib/perl" /usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=blackfin INSTALL_MOD_PATH=/home/test/work/cruise/checkouts/buildroot/output/target CROSS_COMPILE=bfin-uclinux- LZMA="/home/test/work/cruise/checkouts/buildroot/output/host/usr/bin/lzma" O="/home/test/work/cruise/checkouts/buildroot/output/build/linux-custom" -C "/home/test/work/cruise/checkouts/buildroot/output/build/linux-2.6.x" vmImage

make[1]: Entering directory `/home/test/work/cruise/checkouts/buildroot/output/build/linux-2.6.x'

  Using /home/test/work/cruise/checkouts/buildroot/output/build/linux-2.6.x as source for kernel

  GEN     /home/test/work/cruise/checkouts/buildroot/output/build/linux-custom/Makefile

  CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

  CALL    /home/test/work/cruise/checkouts/buildroot/output/build/linux-2.6.x/scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  GEN     usr/initramfs_data.cpio

  AS      usr/initramfs_data.o

  LD      usr/built-in.o

  LD      vmlinux.o

  MODPOST vmlinux.o

  GEN     .version

  CHK     include/generated/compile.h

  UPD     include/generated/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/blackfin/boot/vmlinux.bin

  GZIP    arch/blackfin/boot/vmlinux.bin.gz

  UIMAGE  arch/blackfin/boot/vmImage.gz

Image Name:   bf537-2.6.36.1-ADI-2011R1-pre-sv

Created:      Mon Dec 13 12:21:00 2010

Image Type:   Blackfin Linux Kernel Image (gzip compressed)

Data Size:    896378 Bytes = 875.37 kB = 0.85 MB

Load Address: 00001000

Entry Point:  001880fc

make[1]: Leaving directory `/home/test/work/cruise/checkouts/buildroot/output/build/linux-2.6.x'

# Copy the kernel image to its final destination

cp /home/test/work/cruise/checkouts/buildroot/output/build/linux-custom/arch/blackfin/boot/vmImage /home/test/work/cruise/checkouts/buildroot/output/images

rm -f /home/test/work/cruise/checkouts/buildroot/output/build/.fakeroot*

--

 

Follow-ups

 

--- Mike Frysinger                                           2010-12-13 02:40:53

the vmImage is the uImage

 

--- Vivi Li                                                  2010-12-14 22:51:22

Yeah, I tried it but it can't boot saying there is no filesystem to mount root.

 

--

Linux version 2.6.36.1-ADI-2011R1-pre-svn9518 (test@linux-vivi) (gcc version

4.3.5 (ADI-2010R1-RC4) ) #13 Mon Dec 13 12:20:53 CS0

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00107ee8

  rodata    = 0x00107ee8-0x0015ec98

  bss       = 0x0015f000-0x0016f63c

  data      = 0x0016f63c-0x00180000

    stack   = 0x0017e000-0x00180000

  init      = 0x00180000-0x0019a000

  available = 0x0019a000-0x03800000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 0

Reset caused by Software reset

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 14224

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000

earlyprintk=serial,uart0,57600 console=ttyBF0,57600

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 55136k/65536k RAM, (104k init code, 1051k kernel code, 481k

data, 1024k dma, 7740k reserved)

Hierarchical RCU implementation.

        RCU-based detection of stalled CPUs is disabled.

        Verbose stalled-CPUs detection is disabled.

NR_IRQS:138

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (36 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

Switching to clocksource bfin_cs_cycles

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

debug-mmrs: setting up Blackfin MMR debugfs

msgmni has been set to 107

io scheduler noop registered (default)

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1,

mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: eth0: Blackfin on-chip Ethernet MAC driver, Version 1.1

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-07 20:48:42 UTC (593322)

dma_alloc_init: dma_page @ 0x0211b000 - 256 pages at 0x03f00000

List of all partitions:

No filesystem could mount root, tried:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Hardware Trace:

   0 Target : <0x00107ca4> { _dump_stack + 0x0 }

     Source : <0x00107d2c> { _panic + 0x50 } CALL pcrel

   1 Target : <0x00107d2c> { _panic + 0x50 }

     Source : <0x00107e78> { _printk + 0x14 } RTS

   2 Target : <0x00107e74> { _printk + 0x10 }

     Source : <0x00010efa> { _vprintk + 0x166 } RTS

   3 Target : <0x00010eee> { _vprintk + 0x15a }

     Source : <0xffa00d3a> { __common_int_entry + 0xda } RTI

   4 Target : <0xffa00cd8> { __common_int_entry + 0x78 }

     Source : <0xffa00b14> { _return_from_int + 0x58 } RTS

   5 Target : <0xffa00b14> { _return_from_int + 0x58 }

     Source : <0xffa00aea> { _return_from_int + 0x2e } IF !CC JUMP pcrel

   6 Target : <0xffa00abc> { _return_from_int + 0x0 }

     Source : <0xffa00cd4> { __common_int_entry + 0x74 } JUMP.L

   7 Target : <0xffa00cd2> { __common_int_entry + 0x72 }

     Source : <0xffa0038e> { _asm_do_IRQ + 0x6a } RTS

   8 Target : <0xffa00386> { _asm_do_IRQ + 0x62 }

     Source : <0x00014482> { __local_bh_enable + 0x3a } RTS

   9 Target : <0x00014448> { __local_bh_enable + 0x0 }

     Source : <0x00014ac8> { ___do_softirq + 0xa4 } JUMP.L

  10 Target : <0x00014ac0> { ___do_softirq + 0x9c }

     Source : <0x00014ab4> { ___do_softirq + 0x90 } IF CC JUMP pcrel

  11 Target : <0x00014aa6> { ___do_softirq + 0x82 }

     Source : <0x00033784> { _rcu_bh_qs + 0x14 } RTS

  12 Target : <0x00033770> { _rcu_bh_qs + 0x0 }

     Source : <0x00014aa2> { ___do_softirq + 0x7e } JUMP.L

  13 Target : <0x00014a9a> { ___do_softirq + 0x76 }

     Source : <0x0003409c> { _rcu_process_callbacks + 0x30 } RTS

  14 Target : <0x00034098> { _rcu_process_callbacks + 0x2c }

     Source : <0x00033f34> { _rcu_do_batch + 0x130 } RTS

  15 Target : <0x00033f2c> { _rcu_do_batch + 0x128 }

     Source : <0x00033e16> { _rcu_do_batch + 0x12 } IF CC JUMP pcrel

Stack info:

SP: [0x0201bf24] <0x0201bf24> /* kernel dynamic memory (maybe

user-space) */

FP: (0x0201bfe4)

Memory from 0x0201bf20 to 0201c000

0201bf20: 00000000 [00130928] 00107d30  02076000  00130928  001643bf  001643bf

001643bf

0201bf40: 0201bf6c  0016acb8  00180a6c  02076000  02076000  00192e9c  0201bf7c

00130834

0201bf60: 00000000  00000000  0201bf80  0201bf7c  0201bf7c  0004f0c4  0015f064

6e6b6e75

0201bf80: 2d6e776f  636f6c62  2c30286b  02002930  00180b1a  0015f064  00000000

00000000

0201bfa0: 00180c4c  0015f064  00192e54  00000000  00000000  00000000  00000000

001801e2

0201bfc0: 00196374  00196374  00000000  00000000  001801f6  00196374  00196374

00000000

0201bfe0: 00000000 (00000000)<000014a6> 00000000  00000000  00000000

ffffffff  00000006

Return addresses in stack:

   frame  1 : <0x000014a6> { _kernel_thread_helper + 0x6 }

--

 

--- Mike Frysinger                                           2010-12-16 07:08:20

there should have been an initramfs in there.  my default builds have one:

  rm -rf output

  make bf548-ezkit_defconfig

  make

...

Image Name:   bf548-2.6.36.2-ADI-2011R1-pre-gd

Created:      Tue Dec 14 15:54:30 2010

Image Type:   Blackfin Linux Kernel Image (gzip compressed)

Data Size:    5036102 Bytes = 4918.07 kB = 4.80 MB

Load Address: 00001000

Entry Point:  002a7e04

 

--- Vivi Li                                                  2010-12-17 05:20:27

OK, I'll try again.

 

Another problem, I can't use git pull as it always asks for password.

--

test@linux-vivi:~/work/cruise/checkouts/buildroot> git pull

anonymous@firewall-sources.blackfin.uclinux.org's password:

Permission denied, please try again.

anonymous@firewall-sources.blackfin.uclinux.org's password:

--

 

--- Mike Frysinger                                           2010-12-17 08:32:48

so put in the password, or use the git:// tree instead of ssh://.  why arent you

using the shanghai mirror anyways ?

 

--- Sonic Zhang                                              2010-12-19 22:47:36

What is the password of anonymous? We tried abc@anysite, but fail to go forward.

 

--- Mike Frysinger                                           2010-12-20 03:17:07

it's documented on all of our checkout pages -- "anonymous"

 

--- Sonic Zhang                                              2010-12-21 05:29:46

Vivi, I can build bootable Linux uImage for bf537-stamp with attached config

file. Please apply my 2 patches and copy the bf537-stamp_defconfig file to

buildroot.

 

--- Vivi Li                                                  2011-01-20 01:26:45

uImage can be generated.

Close this bug.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.buildroot    application/octet-stream    15576    Vivi Li

bf537-stamp_defconfig    application/octet-stream    17096    Sonic Zhang

0001-buildroot-download-Add-option-to-download-SVN-or-GI.patch    text/x-patch    3129    Sonic Zhang

0002-buildroot-linux-Add-options-to-checkout-Linux-kerne.patch    text/x-patch    4465    Sonic Zhang

Outcomes