LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 07-27-2009, 07:21 AM   #1
luklem
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
Problem using cramfs as rootfs in SDRAM


Hello,

I'm developing for the TI OMAP L-137 EVM development board. During this development I'm able to get my rootfs via NFS. In the end-product the rootfs has to be in the form of a cramfs image in SDRAM.

For some reason the Kernel is unable locate my init in the cramfs. When I provide an init (via u-boot) the Kernel is still unable to start.

I would like to debug this problem but I don't know where to start.
  • Can anyone point me in a direction where the source of my problem could lie?
  • Does anyone know where I can obtain extra debug information in order to get a better understanding of the problem?
  • I don't understand this message "checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd" can this have anything to do with my problem?
  • Is it possible to test the rootfs when my board is running from NFS?

rootfs
The rootfs I'm using consists of busybox-1.8.2 cross compiled for ARM and some extra folder and files. The filesystem is build using mkcramfs-1.1 with the following command line:
Code:
mkcramfs -n MXSP -l -D $DNODES ./workdir/ uRamdisk.gz
-n : Just holds the name of the fs
-l : Build for a little Endian system
-D : Device nodes added to /dev since the fs is read-only
./workdir : files copied for the _install directory of Busybox and personally added files
Device nodes
Code:
# name      type  mode  uid gid major minor start inc count

/dev/watchdog   c 755 0 0 10  130 - - -

/dev      d 755 0 0 - - - - -

/dev/pts    d 755 0 0 - - - - -
/dev/ttyp   c 755 0 0 3 0 0 1 10
/dev/ram    c 755 0 0 1 1 0 0 -

/dev/ttyS0    c 755 0 0 4 64  - - -
/dev/ttyS1    c 755 0 0 4 65  - - -

/dev/loop   b 755 0 0 7 0 0 1 2

/dev/log    c 755 0 0 - - - - -
/dev/console    c 755 0 0 5 1 - - -
/dev/zero   c 755 0 0 1 5 - - -
/dev/null   c 755 0 0 1 3 - - -
/dev/ptyp   c 755 0 0 2 0 0 1 10
/dev/rtc    c 755 0 0 10  135 - - -
/dev/mtd    c 755 0 0 90  0 0 2 10
/dev/mtdblock   b 755 0 0 31  0 0 1 10
/dev/urandom    c 755 0 0 1 9 - - -
/dev/random   c 755 0 0 1 8 - - -
/dev/mem    c 755 0 0 1 1 - - -
Kernel
The Linux kernel has version 2.6.18 and is patched until Montavista patch 2030.

I've added the following Kernel switches to enable the rootfs in RAM.
Code:
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
CONFIG_BLK_DEV_INITRD=y
CONFIG_RAMFS=y
CONFIG_CRAMFS=y
Logs
This is the information I see when the Kernel is launched. I've made the important messages bold.
Code:
U-Boot 1.3.3-svn3 (Jul 15 2009 - 09:52:30)
 
I2C:   ready
DRAM:  64 MB
In:    serial
Out:   serial
Err:   serial
ARM Clock : 300000000 Hz
More than one PHY detected.
Hit any key to stop autoboot:  0
U-Boot > tftp 0xc1180000 uRamdisk.gz
TFTP from server 10.3.3.62; our IP address is 10.3.3.57
Filename 'uRamdisk.gz'.
Load address: 0xc1180000
Loading: #################################################################
         #################################################################
         #####
done
Bytes transferred = 688128 (a8000 hex)
U-Boot > tftp 0xc0010000 uImage
TFTP from server 10.3.3.62; our IP address is 10.3.3.57
Filename 'uImage'.
Load address: 0xc0010000
Loading: #################################################################
         #################################################################
         #################################################################
         ################################################
done
Bytes transferred = 1240760 (12eeb8 hex)
U-Boot > setenv bootargs 'console=ttyS2,115200n8 initrd=0xc1180000,4M rw ip=off root=/dev/ram0 rootfstype=cramfs mem=64M '
U-Boot > bootm 0xc0010000
## Booting kernel from Legacy Image at c0010000 ...
   Image Name:   Linux-2.6.18_pro500SVNREV
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1240696 Bytes =  1.2 MB
   Load Address: c0008000
   Entry Point:  c0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
 
Starting kernel ...
 
Uncompressing Linux.................................................................................... done, booting the kernel.
Linux version 2.6.18_pro500SVNREV (luklem@MainControllerBox) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #1 PREEMPT Wed Jul 15 11:19:06 CEST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: DaVinci DA8XX EVM
Memory policy: ECC disabled, Data cache writethrough
DA830 variant 0x0
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Real-Time Preemption Support (C) 2004-2006 Ingo Molnar
Built 1 zonelists.  Total pages: 16384
Kernel command line: console=ttyS2,115200n8 initrd=0xc1180000,4M rw ip=off root=/dev/ram0 rootfstype=cramfs mem=64M
WARNING: experimental RCU implementation.
PID hash table entries: 512 (order: 9, 2048 bytes)
Clock event device timer0_0 configured with caps set: 07
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 58096KB available (2036K code, 536K data, 160K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd
Freeing initrd memory: 4096K
NET: Registered protocol family 16
DaVinci: 128 gpio irqs
Generic PHY: Registered new driver
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 4, 65536 bytes)
TCP bind hash table entries: 1024 (order: 2, 28672 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
JFFS version 1.0, (C) 1999, 2000  Axis Communications AB
JFFS2 version 2.2. (NAND) (SUMMARY)  (C) 2001-2006 Red Hat, Inc.
yaffs Jul 15 2009 11:14:38 Installing.
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
LTT : ltt-facilities init
LTT : ltt-facility-core init in kernel
DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
Serial: 8250/16550 driver $Revision: 1.90 $ 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO map 0x1c42000 mem 0xfec42000 (irq = 25) is a 16550A
serial8250.0: ttyS1 at MMIO map 0x1c20400 mem 0xfed0c000 (irq = 53) is a 16550A
serial8250.0: ttyS2 at MMIO map 0x1d0d000 mem 0xfed0d000 (irq = 61) is a 16550A
RAMDISK driver initialized: 1 RAM disks of 16384K size 1024 blocksize
netconsole: not configured, aborting
Davinci EMAC MII Bus: probed
DaVinci EMAC: Unable to read MAC from EEPROM, no I2C support in kernel.
MAC address is deadbeaf
TI DaVinci EMAC Linux version updated 4.0
Creating 3 MTD partitions on "Windbond spi nand flash":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00024000 : "U-Boot Environment"
0x00024000-0x00400000 : "Linux"
dm_spi.0: davinci SPI Controller driver at 0xc485c000 (irq = 20) use_dma=1
dm_spi.1: davinci SPI Controller driver at 0xc485e000 (irq = 56) use_dma=1
rtc-da8xx rtc-da8xx.0: rtc intf: proc
rtc-da8xx rtc-da8xx.0: rtc intf: dev (254:0)
rtc-da8xx rtc-da8xx.0: rtc core: registered rtc-da8xx as rtc0
rtc-da8xx rtc-da8xx.0: TI DA8xx Real Time Clock driver.
oprofile: using timer interrupt.
IPv4 over IPv4 tunneling driver
Initializing XFRM netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc-da8xx rtc-da8xx.0: setting the system clock to 2000-01-01 04:58:38 (946702718)
Time: timer0_1 clocksource has been installed.
Clock event device timer0_0 configured with caps set: 08
Switched to high resolution mode on CPU 0
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 672KiB [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 160K
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
When I provide an init via U-Boot this does not solve my problem
Code:
rtc-da8xx rtc-da8xx.0: setting the system clock to 2000-01-01 06:51:51 (946709511)
RAMDISK: cramfs filesystem found at block 0
Time: timer0_1 clocksource has been installed.
Clock event device timer0_0 configured with caps set: 08
Switched to high resolution mode on CPU 0
RAMDISK: Loading 672KiB [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 160K
Failed to execute /bin/ash.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
Please let me know if there is information missing or when you have general question/remarks.

Thank you in advance.
 
Old 07-28-2009, 12:18 PM   #2
luklem
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Problem solved

I've managed to fix the problem. I forgot to add the libraries to the cramfs workdir. No libraries where included in the rootfs and for that reason applications failed to launch.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Boot CD problem with rootfs.gz xokaido Linux - General 4 12-30-2008 05:25 AM
Problem mounting root cramfs on s3c2410 board swapnilborg Linux - Newbie 0 02-25-2008 04:59 AM
SDRAM/FLASH access through linux saheelahamed Linux - Software 0 10-17-2007 04:55 AM
Bad idea to add new sdram? silentwhispers Linux - Hardware 10 08-24-2004 08:51 PM
SDRAM vs. DDR Mux General 6 10-29-2002 01:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration