Trouble Booting via initramfs - Free Electrons

I've been working my way through the Free Electrons Beagle Labs [1].
They are a good way to learn all that goes on when booting up and
running a BeagleBoard. However I've hit a snag.

Instructions are given for building a kernel that boots via
initramfs. When the OE kernel boots it uses a separate partition on
the SD card for the root file system. When you use initramfs the
separate partition isn't needed. Rather the whole root file system is
contained in a cpio file that is compiled in the kernel.

Unfortunately I haven't been able to get it to work. [2] shows the
output of the boot sequence.

I have two questions.
1. Why isn't it working.
2. What process should I follow to solve the problem?

Question 2 is the more important one. I want to teach my students a
process they can follow that help them solve the common (and not so
common) problems. However I don't know enough of the process to help
myself.

Thanks for your help...

--Mark

[1] http://free-electrons.com/blog/beagle-labs/
[2]
Texas Instruments X-Loader 1.4.2 (Dec 18 2009 - 21:57:52)
Reading boot sector
Loading u-boot.bin from mmc

U-Boot 2009.11-00134-g87d93a1-dirty (Dec 18 2009 - 22:17:30)

OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Board revision Ax/Bx
Die ID #5ac400030000000004013f8901001001
Hit any key to stop autoboot: 0
OMAP3 beagleboard.org # mmc init
mmc1 is available
OMAP3 beagleboard.org # fatload mmc 0 80000000 uImage
reading uImage

2437136 bytes read
OMAP3 beagleboard.org # bootm 80000000
## Booting kernel from Legacy Image at 80000000 ...
   Image Name: Linux-2.6.33-rc1-06876-ga468c91-
   Image Type: ARM Linux Kernel Image (uncompressed)
   Data Size: 2437072 Bytes = 2.3 MB
   Load Address: 80008000
   Entry Point: 80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux.............................................................
................................................................................
............. done, booting the kernel.
Linux version 2.6.33-rc1-06876-ga468c91-dirty (yoder@vmware-ubuntu)
(gcc version
4.3.2 (crosstool-NG-1.4.2) ) #6 Thu Dec 24 03:36:17 EST 2009
CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3 Beagle Board
Memory policy: ECC disabled, Data cache writeback
OMAP3430/3530 ES3.0 (l2cache iva sgx neon isp )
SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x100000
Built 1 zonelists in Zone order, mobility grouping on. Total pages:
32512
Kernel command line: console=ttyS2,115200n8 console=tty0 root=/dev/
mmcblk0p2 rw
rootfstype=ext3 rootwait omapfb.mode=dvi:1024x768MR-16@60
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 124856KB available (3368K code, 293K data, 1136K init, 0K
highmem)
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is enabled.
NR_IRQS:402
Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
Reprogramming SDRC clock to 332000000 Hz
GPMC revision 5.0
IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
Total of 96 interrupts on 1 active controller
OMAP GPIO hardware version 2.5
OMAP clockevent source: GPTIMER12 at 32768 Hz
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop... 478.91 BogoMIPS (lpj=1867776)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
Found NAND on CS0
Registering NAND on CS0
OMAP DMA hardware revision 4.0
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz
twl4030: PIH (irq 7) chaining IRQs 368..375
twl4030: power (irq 373) chaining IRQs 376..383
twl4030: gpio (irq 368) chaining IRQs 384..401
regulator: VUSB1V5: 1500 mV normal standby
regulator: VUSB1V8: 1800 mV normal standby
regulator: VUSB3V1: 3100 mV normal standby
twl4030_usb twl4030_usb: Initialized TWL4030 USB module
regulator: VMMC1: 1850 <--> 3150 mV at 3000 mV normal standby
regulator: VDAC: 1800 mV normal standby
regulator: VDVI: 1800 mV normal standby
regulator: VSIM: 1800 <--> 3000 mV at 1800 mV normal standby
i2c_omap i2c_omap.3: bus 3 rev3.12 at 100 kHz
Switching to clocksource 32k_counter
musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
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
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
JFFS2 version 2.2. (NAND) B) 2001-2006 Red Hat, Inc.
msgmni has been set to 244
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
omapfb: configured for panel omap3beagle
omapfb: DISPC version 3.0 initialized
Console: switching to colour frame buffer device 128x48
omapfb: Framebuffer initialized. Total vram 1572864 planes 1
omapfb: Pixclock 61714 kHz hfreq 57.5 kHz vfreq 74.2 Hz
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a ST16654
serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a ST16654
serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a ST16654
console [ttyS2] enabled
brd: module loaded
loop: module loaded
usbmon: debugfs is not available
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
i2c /dev entries driver
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
Power Management for TI OMAP3.
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev
1
regulator_init_complete: incomplete constraints, leaving VDVI on
regulator_init_complete: incomplete constraints, leaving VDAC on
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Freeing init memory: 1136K
mmc0: new high speed SD card at address 1145
mmcblk0: mmc0:1145 SD02G 1.83 GiB
mmcblk0: p1

I've been working my way through the Free Electrons Beagle Labs [1].
They are a good way to learn all that goes on when booting up and
running a BeagleBoard. However I've hit a snag.

I've only glimpsed over the tut, but I think your boot args are not right.
See below

Instructions are given for building a kernel that boots via
initramfs. When the OE kernel boots it uses a separate partition on
the SD card for the root file system. When you use initramfs the
separate partition isn't needed. Rather the whole root file system is
contained in a cpio file that is compiled in the kernel.

Unfortunately I haven't been able to get it to work. [2] shows the
output of the boot sequence.

I have two questions.
1. Why isn't it working.
2. What process should I follow to solve the problem?

Question 2 is the more important one. I want to teach my students a
process they can follow that help them solve the common (and not so
common) problems. However I don't know enough of the process to help
myself.

Thanks for your help...

--Mark

[1] http://free-electrons.com/blog/beagle-labs/
[2]
Texas Instruments X-Loader 1.4.2 (Dec 18 2009 - 21:57:52)
Reading boot sector
Loading u-boot.bin from mmc

U-Boot 2009.11-00134-g87d93a1-dirty (Dec 18 2009 - 22:17:30)

OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Board revision Ax/Bx
Die ID #5ac400030000000004013f8901001001
Hit any key to stop autoboot: 0
OMAP3 beagleboard.org # mmc init
mmc1 is available
OMAP3 beagleboard.org # fatload mmc 0 80000000 uImage
reading uImage

2437136 bytes read
OMAP3 beagleboard.org # bootm 80000000
## Booting kernel from Legacy Image at 80000000 ...
Image Name: Linux-2.6.33-rc1-06876-ga468c91-
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2437072 Bytes = 2.3 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux.............................................................
................................................................................
............. done, booting the kernel.
Linux version 2.6.33-rc1-06876-ga468c91-dirty (yoder@vmware-ubuntu)
(gcc version
4.3.2 (crosstool-NG-1.4.2) ) #6 Thu Dec 24 03:36:17 EST 2009
CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3 Beagle Board
Memory policy: ECC disabled, Data cache writeback
OMAP3430/3530 ES3.0 (l2cache iva sgx neon isp )
SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x100000
Built 1 zonelists in Zone order, mobility grouping on. Total pages:
32512
Kernel command line: console=ttyS2,115200n8 console=tty0 root=/dev/
mmcblk0p2 rw
rootfstype=ext3 rootwait omapfb.mode=dvi:1024x768MR-16@60

This says your rfs is on partition2 and is an ext3 rfs. That does not
sound good for initramfs.
It's been a while since I did an initramfs, but I recall that the
documentation in the kernel tree explains things (and otherwise
definitely google can help you out)

FM

I've poked around Document/filesystems/ramfs-rootfs-initramfs.txt and
don't find anything about kernel parameters. The ones you saw are the
defaults from U-boot. The tutorial didn't say any other parameters
needed to be used.

Is there a way to have the kernel tell me more about why it stopped?

--Mark

Mark A. Yoder wrote:

Is there a way to have the kernel tell me more about why it stopped?

Freeing init memory: 1136K
mmc0: new high speed SD card at address 1145
mmcblk0: mmc0:1145 SD02G 1.83 GiB
mmcblk0: p1
      
It looks like it might have mounted your root filesystem, and if so that
means it isn't a kernel problem per se--- the problem is either purely
user-side, or in a user-kernel interaction. It could be that your
kernel is configured for EABI, but your userspace is built as OABI. Or
vise-versa. Make sure your kernel is configured to support both.

b.g.