OpenWrt Forum Archive

Topic: Why error "XZ-compressed data is corrupt" arises ?

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I add a new device support on openwrt trunk for broadcom BCM958522ER,
Of course I write the image file to the spi flash and boot it,


below is my issue: my cpu is BCM958522ER which is the same series with 4708 as well, 32MB spi-nor flash,
###my dts file is :
/*
* Broadcom BCM470X / BCM5301X ARM platform code.
* DTS for xxxx-xxxx
*
* xxxxx@gmail.com
*
* Licensed under the GNU/GPL. See COPYING for details.
*/

/dts-v1/;

#include "bcm4708.dtsi"

/ {
    compatible = "xxx,xxx8883", "brcm,bcm4708";
    model = "888 Networking Technology 8883 (BCM4708)";

    chosen {
        bootargs = "console=ttyS0,115200 earlyprintk";
    };

    memory {
        reg = <0x00000000 0x08000000
               0x88000000 0x18000000>; /* 128MB + 128MB = 256MB */
    };

    chipcommonA {
        uart0: serial@0300 {
            status = "okay";
        };

        uart1: serial@0400 {
            status = "okay";
        };
    };

};








the log :
###boot log: (I updated the xxx-squashfs.trx to the flash)

Hit any key to stop autoboot:  0
Checking TRX Image at addr 1e200000 ...
   Uncompressing  ... Primary TRX image OK
kernel args : console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Booting from Primary Partition
kernel_args console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Start addr 00008000 machid 127f Parmameter addr 00100000 ...

Starting kernel ...
Uncompressing Linux...

XZ-compressed data is corrupt

-- System halted




I want to know why this error arise, please help me!
any hints will be appreciated.

(Last edited by banglang.huang on 10 Mar 2015, 02:46)

banglang.huang wrote:

I add a new device support on openwrt trunk for broadcom BCM958522ER,
Of course I write the image file to the spi flash and boot it,


below is my issue: my cpu is BCM958522ER which is the same series with 4708 as well, 32MB spi-nor flash,
###my dts file is :
/*
* Broadcom BCM470X / BCM5301X ARM platform code.
* DTS for xxxx-xxxx
*
* xxxxx@gmail.com
*
* Licensed under the GNU/GPL. See COPYING for details.
*/

/dts-v1/;

#include "bcm4708.dtsi"

/ {
    compatible = "xxx,xxx8883", "brcm,bcm4708";
    model = "888 Networking Technology 8883 (BCM4708)";

    chosen {
        bootargs = "console=ttyS0,115200 earlyprintk";
    };

    memory {
        reg = <0x00000000 0x08000000
               0x88000000 0x18000000>; /* 128MB + 128MB = 256MB */
    };

    chipcommonA {
        uart0: serial@0300 {
            status = "okay";
        };

        uart1: serial@0400 {
            status = "okay";
        };
    };

};








the log :
###boot log: (I updated the xxx-squashfs.trx to the flash)

Hit any key to stop autoboot:  0
Checking TRX Image at addr 1e200000 ...
   Uncompressing  ... Primary TRX image OK
kernel args : console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Booting from Primary Partition
kernel_args console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Start addr 00008000 machid 127f Parmameter addr 00100000 ...

Starting kernel ...
Uncompressing Linux...

XZ-compressed data is corrupt

-- System halted




I want to know why this error arise, please help me!
any hints will be appreciated.



I have ported the source code in openwrt 12.09 successfully, but
the error is same with above.

Does arm cortex-a9 require lzma-loader binary file?

banglang.huang wrote:

I add a new device support on openwrt trunk for broadcom BCM958522ER,
Of course I write the image file to the spi flash and boot it,

below is my issue: my cpu is BCM958522ER which is the same series with 4708 as well, 32MB spi-nor flash,
###my dts file is :
/*
* Broadcom BCM470X / BCM5301X ARM platform code.
* DTS for xxxx-xxxx
*
* xxxxx@gmail.com
*
* Licensed under the GNU/GPL. See COPYING for details.
*/

/dts-v1/;

#include "bcm4708.dtsi"

/ {
    compatible = "xxx,xxx8883", "brcm,bcm4708";
    model = "888 Networking Technology 8883 (BCM4708)";

    chosen {
        bootargs = "console=ttyS0,115200 earlyprintk";
    };

    memory {
        reg = <0x00000000 0x08000000
               0x88000000 0x18000000>; /* 128MB + 128MB = 256MB */
    };

    chipcommonA {
        uart0: serial@0300 {
            status = "okay";
        };

        uart1: serial@0400 {
            status = "okay";
        };
    };
};

the log :
###boot log: (I updated the xxx-squashfs.trx to the flash)

Hit any key to stop autoboot:  0
Checking TRX Image at addr 1e200000 ...
   Uncompressing  ... Primary TRX image OK
kernel args : console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Booting from Primary Partition
kernel_args console=ttyS0,115200 ubi.mtd=5 root=ubi0:rootfs ro rootflags=sync rootfstype=ubifs user_debug=31
Start addr 00008000 machid 127f Parmameter addr 00100000 ...

Starting kernel ...
Uncompressing Linux...

XZ-compressed data is corrupt

-- System halted
---------------------------------------------------------------------------------

I want to know why this error arise, please help me!
any hints will be appreciated.

There is a breakthrough, the xxx.trx file is not ok while the zImage-xxx.lzma can work.
But still remains lots of work to be done.

the target platform *.dts file should be like this:

/dts-v1/;

#include "bcm4708.dtsi"

/ {
    compatible = "via,vnt5903", "brcm,bcm4708";
    model = "VIA Networking Technology 5903 (BCM4708)";

    chosen {
        bootargs = "console=ttyS0,115200 earlyprintk";
    };

    memory {
        reg = <0x00000000 0x08000000
                   0x88000000 0x08000000>;
/* 128MB + 128MB = 256MB */
    };

    chipcommonA {
        uart0: serial@0300 {
            status = "okay";
        };

        uart1: serial@0400 {
            status = "okay";
        };
    };
};

below information is the log from zImage.xxxx.lzma:

u-boot> tftp 0x4000000 test.kernel
Using bcmiproc_eth-0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.199
Filename 'test.kernel'.
Load address: 0x4000000
Loading: #################################################################
     #################################################################
     #################################################################
     ##########################################################
done
Bytes transferred = 1294250 (13bfaa hex)
u-boot> boot_vmlinuz 0x4000000 0x13bfaa
   Uncompressing  from 4000000 to 8000 len 13bfaa ...
## Starting application at 0x00008000 ...
Uncompressing Linux...00000800 000386ea  done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.14.32 (banglang@Ubuntu-Linux) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r44592) ) #64 SMP Tue Mar 31 19:03:29 HKT 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: VIA Networking Technology 5903 (BCM4708)
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 7 pages/cpu @c6bd9000 s6848 r8192 d13632 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65280
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 earlyprintk
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 255988K/262144K available (2630K kernel code, 99K rwdata, 724K rodata, 154K init, 234K bss, 6156K reserved, 131072K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc034edb4   (3356 kB)
[    0.000000]       .init : 0xc034f000 - 0xc0375ac0   ( 155 kB)
[    0.000000]       .data : 0xc0376000 - 0xc038eea0   ( 100 kB)
[    0.000000]        .bss : 0xc038eea0 - 0xc03c9984   ( 235 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000016] sched_clock: 64 bits at 500MHz, resolution 2ns, wraps every 2199023255552ns
[    0.008406] Calibrating delay loop... 1987.37 BogoMIPS (lpj=9936896)
[    0.071139] pid_max: default: 32768 minimum: 301
[    0.076009] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.082768] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090614] CPU: Testing write buffer coherency: ok
[    0.095886] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.101729] Setting up static identity map for 0x124f0 - 0x12524
[    0.109594] CPU1: failed to boot: -38
[    0.113389] Brought up 1 CPUs
[    0.116453] SMP: Total of 1 processors activated (1987.37 BogoMIPS).
[    0.122947] CPU: All CPU(s) started in SVC mode.
[    0.136212] NET: Registered protocol family 16
[    0.141338] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.150445] L310 cache controller enabled
[    0.154559] l2x0: 16 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x0a150000, Cache size: 512 kB
[    0.168355] bio: create slab <bio-0> at 0
[    0.173916] Switched to clocksource arm_global_timer
[    0.180593] NET: Registered protocol family 2
[    0.185610] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.192705] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.199175] TCP: Hash tables configured (established 1024 bind 1024)
[    0.205672] TCP: reno registered
[    0.209005] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.214959] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.221513] NET: Registered protocol family 1
[    0.227153] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.233945] bounce pool size: 64 pages
[    0.237950] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.243909] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.253904] msgmni has been set to 243
[    0.258698] io scheduler noop registered
[    0.262721] io scheduler deadline registered (default)
[    0.268329] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.275513] 18000300.serial: ttyS0 at MMIO 0x18000300 (irq = 117, base_baud = 6250000) is a 16550

[  messy code ]
[  ......messy code......]
[  ..................messy code  ..................]
[  ..............................messy code ..............................]
[  ..........................................messy code ..........................................]

(Last edited by banglang.huang on 1 Apr 2015, 04:06)

The discussion might have continued from here.