I am working on this davinci-based ARMv5 board. This board runs Fedora 15 armv5tel with a kernel package I compiled myself for the board. The boot SD contains a FAT partition with the uImage kernel, and a ext4 filesystem that contains the root filesystem.
Up to now, I can run the kernel and boot the system without an initramfs by adding "root=/dev/mmcblk0p2 rw rootwait" to the kernel command line. So far, it works fine.
[root@elx ~]# cat /proc/cpuinfo
Processor : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 227.32
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5
Hardware : DaVinci DA850/OMAP-L138/AM18x EVM
Revision : 0000
Serial : 0000000000000000
Now, I want to change the filesystem layout. I want to put all of /usr in a separate partition, and mount this read-only. For this, I want to boot the board using an initramfs. So, I ran the following command with the FAT partition mounted on /uboot:
[root@avillacis arm]# mkimage -A arm -T ramdisk -C none -a 0xc2000000 -n "mcuzone-initramfs-3.5.6-1.fc17" -d /run/media/alex/rootfs/boot/initramfs-3.5.6-1.elastixarm.fc17.armv5tel.mcuzone.img /run/media/alex/BOOT/initramfs-mcuzone.img
Image Name: mcuzone-initramfs-3.5.6-1.fc17
Created: Tue Oct 22 14:23:48 2013
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 7861729 Bytes = 7677.47 kB = 7.50 MB
Load Address: c2000000
Entry Point: c2000000
BTW, the kernel uImage is set to load at 0xc0008000. The board has system RAM from 0xc0000000 to 0xd0000000.
In the bootloader, after a few experiments, I found out that, while it will load the initramfs uImage, the bootlader will not add an ATAG describing the initramfs in any way. I checked:
[root@elx ~]# hexdump -C /proc/atags
00000000 05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00 |......AT........|
00000010 00 00 00 00 03 00 00 00 07 00 41 54 00 00 00 00 |..........AT....|
00000020 04 00 00 00 02 00 41 54 00 00 00 10 00 00 00 c0 |......AT........|
00000030 13 00 00 00 09 00 41 54 72 6f 6f 74 3d 2f 64 65 |......ATroot=/de|
00000040 76 2f 6d 6d 63 62 6c 6b 30 70 32 20 72 77 20 72 |v/mmcblk0p2 rw r|
00000050 6f 6f 74 77 61 69 74 20 69 70 3d 6f 66 66 20 69 |ootwait ip=off i|
00000060 6e 69 74 72 64 3d 30 78 63 30 38 30 30 30 30 30 |nitrd=0xc0800000|
00000070 2c 37 38 36 31 37 32 39 00 00 00 00 00 00 00 00 |,7861729........|
00000080 00 00 00 00 |....|
00000084
Therefore, I am forced to specify the initramfs location via a initrd= kernel parameter. However, I am getting this "junk in compressed archive" and the initramfs gets ignored. I am not sure why the initramfs becomes invalid. The bootloader loads the
uImage at 0xc1000000 and extracts the contents at 0xc2000000, 16 MiB higher, and way past the places where the kernel is extracted. Specifying the exact byte size instead of 8M makes no difference. I tried to use the keepinitrd boot parameter, but once I
get to a prompt, I do not find a place where I can inspect the initramfs as seen by the kernel. I ran "gzip -t" on the original initramfs, and it checks out fine. Could you give me suggestions on how to debug this?
U-Boot > setenv bootargs root=/dev/mmcblk0p2 rw rootwait ip=off initrd=0xc2000000,8M; mmc rescan 0; fatload mmc 0 0xc0700000 uImage; fatload mmc 0 0xc1000000 initramfs-mcuzone.img; bootm c0700000 c1000000;
reading uImage
3448120 bytes read
reading initramfs-mcuzone.img
7861793 bytes read
## Booting kernel from Legacy Image at c0700000 ...
Image Name: mcuzone-3.5.6-1.fc17
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3448056 Bytes = 3.3 MiB
Load Address: c0008000
Entry Point: c0008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at c1000000 ...
Image Name: mcuzone-initramfs-3.5.6-1.fc17
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 7861729 Bytes = 7.5 MiB
Load Address: c2000000
Entry Point: c2000000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.5.6-1.elastixarm.fc17.armv5tel.mcuzone (palosanto(a)rpmbuild-arm.elastix.palosanto.com) (gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC) ) #1 Fri Mar 29 07:20:14 ECT 2013
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: DaVinci DA850/OMAP-L138/AM18x EVM
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] BUG: mapping for 0xffff0000 at 0xfffe0000 out of vmalloc space
[ 0.000000] DaVinci da850/omap-l138/am18x variant 0x1
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait ip=off initrd=0xc2000000,8M
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] allocated 524288 bytes of page_cgroup
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 256MB = 256MB total
[ 0.000000] Memory: 243340k/243340k available, 18804k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0622f68 (6252 kB)
[ 0.000000] .init : 0xc0623000 - 0xc066adbc ( 288 kB)
[ 0.000000] .data : 0xc066c000 - 0xc06c6a90 ( 363 kB)
[ 0.000000] .bss : 0xc06c6ab4 - 0xc079e6bc ( 864 kB)
[ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:245
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000320] Calibrating delay loop... 227.32 BogoMIPS (lpj=1136640)
[ 0.080067] pid_max: default: 32768 minimum: 301
[ 0.080536] Security Framework initialized
[ 0.080666] SELinux: Initializing.
[ 0.081482] Mount-cache hash table entries: 512
[ 0.083324] Initializing cgroup subsys cpuacct
[ 0.083374] Initializing cgroup subsys memory
[ 0.083479] Initializing cgroup subsys devices
[ 0.083511] Initializing cgroup subsys freezer
[ 0.083534] Initializing cgroup subsys net_cls
[ 0.083553] Initializing cgroup subsys blkio
[ 0.083569] Initializing cgroup subsys perf_event
[ 0.083937] CPU: Testing write buffer coherency: ok
[ 0.084169] ftrace: allocating 18656 entries in 37 pages
[ 0.156178] Setting up static identity map for 0xc0469cc0 - 0xc0469d18
[ 0.164684] devtmpfs: initialized
[ 0.168005] DaVinci: 144 gpio irqs
[ 0.169473] atomic64 test passed
[ 0.170251] NET: Registered protocol family 16
[ 0.206674] da850_evm_usb_init: before cfgchip2=0x0001ef00
[ 0.206709] da850_evm_usb_init: after cfgchip2=0x0001af02
[ 0.223659] bio: create slab <bio-0> at 0
[ 0.226056] SCSI subsystem initialized
[ 0.227728] usbcore: registered new interface driver usbfs
[ 0.227984] usbcore: registered new interface driver hub
[ 0.228572] usbcore: registered new device driver usb
[ 0.233488] NetLabel: Initializing
[ 0.233532] NetLabel: domain hash size = 128
[ 0.233550] NetLabel: protocols = UNLABELED CIPSOv4
[ 0.233703] NetLabel: unlabeled traffic allowed by default
[ 0.234102] Switching to clocksource timer0_1
[ 0.315460] NET: Registered protocol family 2
[ 0.316158] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.317484] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.317834] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.318060] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.318080] TCP: reno registered
[ 0.318117] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.318168] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.318977] NET: Registered protocol family 1
[ 0.319845] Unpacking initramfs...
[ 0.319937] Initramfs unpacking failed: junk in compressed archive
[ 0.354933] Freeing initrd memory: 8192K
[ 0.356001] EMAC: RMII PHY configured, MII PHY will not be functional
[ 0.358747] audit: initializing netlink socket (disabled)
[ 0.358942] type=2000 audit(0.330:1): initialized