Re: How to debug: Initramfs unpacking failed: junk in compressed archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 22/10/13 18:41, Jon escribió:
Here is how I generate the ramdisk

mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -e 0x00000000
-n "ramdisk" -d /boot/initramfs-X.YY.Z-foo.fcNN.armv5.img /tmp/uImage

Note the address and entry point are zeros.

On your board's u-boot environment just run the 'bdi' command (board
info) to findout the start addr and size.
You can workout load addr's that make your boot happy.

I would advise loading the ramdisk first, in the begining space of the
memory... then load the kernel.
That way if there is any overlap it will be the ramdisk that is
corrupted, not the  kernel memory.

Regards,
-Jon Disnard

On Tue, Oct 22, 2013 at 4:06 PM, Alex Villací­s Lasso
<a_villacis@xxxxxxxxxxxxx> wrote:
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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (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

_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm


U-Boot > bdinfo
arch_number = 0x0000086D
boot_params = 0xC0000100
DRAM bank   = 0x00000000
-> start    = 0xC0000000
-> size     = 0x10000000
ethaddr     = 08:00:3e:26:0a:13
ip_addr     = 0.0.0.0
baudrate    = 115200 bps
TLB addr    = 0xCFFF0000
relocaddr   = 0xCFF63000
reloc off   = 0x0EEE3000
irq_sp      = 0xCFE32F70
sp start    = 0xCFE32F68
FB base     = 0x00000000
U-Boot >

So it seems that the board has no memory at 0x00000000, only at 0xc0000000 through 0xd00000000. I already noted this in the previous email. Lets try this anyway:

mkimage -A arm -T ramdisk -C none -a 0x00000000 -e 0x00000000 -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

The bootloader accepts the load of the initramfs uImage at 0xc1000000 through the fatload command, but on attempting to boot the kernel with "initrd=0x00000000,8M", it shows the message:

[    0.000000] INITRD: 0x00000000+0x00800000 is not a memory region - disabling initrd

So the kernel will not accept specifying this as the initrd address.

If I specify the uImage load address instead, I get the "junk in compressed archive" message, as before:

AM1808 initialization passed!
Booting TI User Boot Loader
    UBL Version: 1.65
    UBL Flashtype: SPI
Starting SPI Memory Copy...
Valid magicnum, 0x55424CBB, found at offset 0x00010000.
   DONE
Jumping to entry point at 0xC1080000.
[xiameihua] 2012-12-31 PM 16:12
NAND:  No NAND device found!!!
0 MiB
MMC:   davinci: 0
*** Warning - readenv() failed, using default environment

In:    serial
Out:   serial
Err:   serial
ARM Clock : 456000000 Hz
DDR Clock : 150000000 Hz
SF: Unsupported manufacturer ef
 Error - unable to probe SPI flash.
[xiameihua] mac addr : 00 00 00 00 0c 00Net:   phy_act_state = 1
Ethernet PHY: GENERIC(1cc816) @ 0x00
DaVinci-EMAC
Hit any key to stop autoboot:  0
U-Boot > setenv bootargs root=/dev/mmcblk0p2 rw rootwait ip=off initrd=0xc2000000,8M
U-Boot > mmc rescan 0
U-Boot > fatload mmc 0 0xc2000000 initramfs-mcuzone.img
reading initramfs-mcuzone.img

7861793 bytes read
U-Boot > fatload mmc 0 0xc0700000 uImage
reading uImage

3448120 bytes read
U-Boot > bootm c0700000 c2000000
## 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 c2000000 ...
   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: 00000000
   Entry Point:  00000000
   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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (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.000321] Calibrating delay loop... 227.32 BogoMIPS (lpj=1136640)
[    0.080067] pid_max: default: 32768 minimum: 301
[    0.080536] Security Framework initialized
[    0.080665] 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.083512] Initializing cgroup subsys freezer
[    0.083535] Initializing cgroup subsys net_cls
[    0.083553] Initializing cgroup subsys blkio
[    0.083570] Initializing cgroup subsys perf_event
[    0.083938] CPU: Testing write buffer coherency: ok
[    0.084170] ftrace: allocating 18656 entries in 37 pages
[    0.156155] Setting up static identity map for 0xc0469cc0 - 0xc0469d18
[    0.164648] devtmpfs: initialized
[    0.167942] DaVinci: 144 gpio irqs
[    0.169401] atomic64 test passed
[    0.170174] NET: Registered protocol family 16
[    0.206625] da850_evm_usb_init: before cfgchip2=0x0001ef00
[    0.206661] da850_evm_usb_init: after cfgchip2=0x0001af02
[    0.223601] bio: create slab <bio-0> at 0
[    0.225974] SCSI subsystem initialized
[    0.227663] usbcore: registered new interface driver usbfs
[    0.227927] usbcore: registered new interface driver hub
[    0.228518] usbcore: registered new device driver usb
[    0.233448] NetLabel: Initializing
[    0.233490] NetLabel:  domain hash size = 128
[    0.233507] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.233660] NetLabel:  unlabeled traffic allowed by default
[    0.234065] Switching to clocksource timer0_1
[    0.315302] NET: Registered protocol family 2
[    0.315990] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.317319] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.317670] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.317897] TCP: Hash tables configured (established 8192 bind 8192)
[    0.317917] TCP: reno registered
[    0.317953] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.318005] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.318815] NET: Registered protocol family 1
[    0.319689] Unpacking initramfs...
[    0.319779] Initramfs unpacking failed: junk in compressed archive
[    0.354765] Freeing initrd memory: 8192K

_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM (Vger)]     [Linux ARM]     [ARM Kernel]     [Fedora User Discussion]     [Older Fedora Users Discussion]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

Powered by Linux