While booting AR9331 LZMA error occured

I have make a kernal image for AR9331 board but while boot the image i got LZMA as shown in the uploaded image.

I thought that may be due to size.
Below image shows the details of firmware built.

2

Please let me know to resolve it.

Thanks in advance.

"So what exactly is the firmware?

The boot loader really has no concept of filesystems, it pretty much assumes that the start of the trx data section is executable code. So, at the very start of our firmware is the kernel. But just putting a kernel directly onto flash is quite boring and consumes a lot of space, so we compress the kernel with a heavy compression known as LZMA. Now the start of firmware is code for an LZMA decompress"

https://openwrt.org/docs/techref/flash.layout#broadcom_with_cfe

if you want to build tiny firmware without compiling:
https://openwrt.org/docs/guide-user/additional-software/saving_space

choose only packages you need.

Firmware is the Kernal image bin(openwrt-ar71xx-generic-uImage-lzma.bin) file which i have used to boot the kernal in the board.

How can i resolve LZMA error occurred while booting the kernal. It gives error wile uncompressing the LZMA bin file.

It may be caused by various things. Too large image, packed wrongly, wrong compression parameters, ...

I suggest that you read the previous similar discussions in the forum

https://forum.openwrt.org/search?q=Lzma%20error%201

1 Like

I have done all the changes as given.
But Now I am getting error while booting. The error is shown in blow image.

How can i avoid kernal panic and run the openwrt.

what exactly are you booting ?

kernel is only a part of the openwrt package, you need a (root) file system image too.

or an initramfs-kernel

*********************************************
*   U-Boot 1.1.4  (Oct 10 2017, 11:54:33)   *
*********************************************

AP121 (AR9331) U-Boot for GS-Oolite v1

DRAM:   64 MB DDR2 16-bit
FLASH:  Macronix MX25L128 (16 MB)
CLOCKS: 400/400/200/25 MHz (CPU/RAM/AHB/SPI)

LED off during eth initialization...

uboot> setenv serverip 192.168.8.226
uboot> setenv ipaddr 192.168.9.8
uboot> ping 192.168.8.226
Link down: eth0
Ethernet mode (duplex/speed): 1/1000 Mbps
Using eth1 device

Ping OK, host 192.168.8.226 is alive!

uboot> run firmware_upg
Using eth1 device

Ping OK, host 192.168.8.226 is alive!


TFTP from IP: 192.168.8.226
      Our IP: 192.168.9.8
    Filename: 'firmware.bin'
Load address: 0x80800000
       Using: eth1

     Loading: ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ############################

TFTP transfer complete!

Bytes transferred: 1368664 (0x14e258)
Erase FLASH from 0x9F020000 to 0x9F16FFFF in bank #1
Erasing: #####################

Erased sectors: 21

Copying to FLASH...
Writting at address: 0x9F020000

Done!

OK!
uboot> tftp $loadaddr openwrt-ar71xx-generic-root.squashfs

TFTP from IP: 192.168.8.226
      Our IP: 192.168.9.8
    Filename: 'openwrt-ar71xx-generic-root.squashfs'
Load address: 0x80800000
       Using: eth1

     Loading: ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ############

TFTP transfer complete!

Bytes transferred: 3538944 (0x360000)
uboot> erase 0x9F1A0000 +$filesize
Erase FLASH from 0x9F1A0000 to 0x9F4FFFFF in bank #1
Erasing: #######################################
         ###############

Erased sectors: 54

uboot> cp.b $loadaddr 0x9F1A0000 $filesize
Copying to FLASH...
Writting at address: 0x9F1A0000

Done!

uboot> setenv bootargs "console=ttyATH0,115200 root=31:02 mtdparts=ar7240-nor0:128k(u-boot),1536k(kernel),6400k(rootfs),64k(config),64k(ART)"
uboot> run bootcmd
Booting image at: 0x9F020000

   Image name:   MIPS OpenWrt Linux-4.14.221
   Created:      2021-02-15  15:22:37 UTC
   Image type:   MIPS Linux Kernel Image (lzma compressed)
   Data size:    1368600 Bytes = 1.3 MB
   Load address: 0x80060000
   Entry point:  0x80060000

Uncompressing kernel image... OK!
## Bootargs: console=ttyATH0,115200 root=31:02 mtdparts=ar7240-nor0:128k(u-boot),1536k(kernel),6400k(rootfs),64k(config),64k(ART)
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in MB, 64
Starting kernel...

[    0.000000] Linux version 4.14.221 (ubuntu@ubuntu2004) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11306-c4a6851c72)) #0 Mon Feb 15 15:22:37 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x47c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyATH0,115200 root=31:02 mtdparts=ar7240-nor0:128k(u-boot),1536k(kernel),6400k(rootfs),64k(config),64k(ART) mem=64M rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 59972K/65536K available (3089K kernel code, 175K rwdata, 804K rodata, 276K init, 200K bss, 5564K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000014] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007564] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.092168] pid_max: default: 32768 minimum: 301
[    0.096970] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102936] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.113104] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.121148] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.127616] NET: Registered protocol family 16
[    0.133170] MIPS: machine is Generic AR71XX/AR724X/AR913X based board
[    0.163219] clocksource: Switched to clocksource MIPS
[    0.168318] NET: Registered protocol family 2
[    0.172380] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.177836] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.183893] TCP: Hash tables configured (established 1024 bind 1024)
[    0.190123] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.195565] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.201849] NET: Registered protocol family 1
[    0.212866] Crashlog allocated RAM at address 0x3f00000
[    0.218513] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.233180] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.237432] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.267032] io scheduler noop registered
[    0.269403] io scheduler deadline registered (default)
[    0.275636] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.280952] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a AR933X UART
[    0.289622] console [ttyATH0] enabled
[    0.289622] console [ttyATH0] enabled
[    0.296407] bootconsole [early0] disabled
[    0.296407] bootconsole [early0] disabled
[    0.306800] libphy: Fixed MDIO Bus: probed
[    0.313369] NET: Registered protocol family 17
[    0.316676] 8021q: 802.1Q VLAN Support v1.8
[    0.341970] VFS: Cannot open root device "31:02" or unknown-block(31,2): error -6
[    0.348072] Please append a correct "root=" boot option; here are the available partitions:
[    0.356352] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[    0.365607] Rebooting in 1 seconds..
▒

*********************************************
*   U-Boot 1.1.4  (Oct 10 2017, 11:54:33)   *
*********************************************

AP121 (AR9331) U-Boot for GS-Oolite v1

DRAM:   64 MB DDR2 16-bit
FLASH:  Macronix MX25L128 (16 MB)
CLOCKS: 400/400/200/25 MHz (CPU/RAM/AHB/SPI)

LED off during eth initialization...

Booting image at: 0x9F020000

   Image name:   MIPS OpenWrt Linux-4.14.221
   Created:      2021-02-15  15:22:37 UTC
   Image type:   MIPS Linux Kernel Image (lzma compressed)
   Data size:    1368600 Bytes = 1.3 MB
   Load address: 0x80060000
   Entry point:  0x80060000

Above is the full process i am following.
I am booting kernal and squashfs

is that really correct ?
I think root=LABEL=openwrt could work, but you might need to figure out what the partition id/label is for the root_fs.