Zyxel NSA325 - Issue installing latest rootfs
March 16, 2024 02:19PM
Hi,

I'm struggling a bit with the Instructions from this topic - https://forum.doozan.com/read.php?2,12096

As per instructions :
Quote
Note: If this is your first time installation, then you only need rootfs Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (this has kernel linux-6.5.7-kirkwood-tld-1 already installed).

So what I'm doing is to follow the instructions.
- Prepare the usb (ext4)
- extract the Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2
- Prepare step 4a
- Run kwboot , interrupt autoboot and manually try to boot on front usb (using latest uboot, as seen below)
root@onewithforce:/run/media/alex/rootfs/boot# du -sk uInitrd
5656 uInitrd

 
root@onewithforce:~# kwboot  -t -B 115200 /dev/ttyUSB0 -b /home/alex/Downloads/tmpp/uboot.2023.04-tld-1.nsa325.kwb -p
kwboot version 2023.07
Detected kwbimage v0 with NAND boot signature
Patching image boot signature to UART
Sending boot message. Please reboot the target...-
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (520596 bytes)...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 12 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 24 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 31 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 36 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 43 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 55 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 61 % [......................................................................]
 63 % [......................................................................]
 65 % [......................................................................]
 67 % [......................................................................]
 68 % [......................................................................]
 70 % [......................................................................]
 72 % [......................................................................]
 74 % [......................................................................]
 75 % [......................................................................]
 77 % [......................................................................]
 79 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 84 % [......................................................................]
 86 % [......................................................................]
 87 % [......................................................................]
 89 % [......................................................................]
 91 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
 99 % [........                                                              ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:   eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0 

NSA325> 
NSA325> boot
starting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 2 USB Device(s) found
scanning bus xhci_pci for devices... cannot reset port 3!?
2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	60060452  	efa7222f-01	83
loading envs from usb 0 ...
Failed to load '/boot/uEnv.txt'
Can't set block device
Can't set block device
Can't set block device
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
stopping USB..
Unknown command 'ide' - try 'help'
** Bad device specification ide 0 **
Couldn't find partition ide 0:1
Can't set block device
** Bad device specification ide 0 **
Couldn't find partition ide 0:1
Can't set block device
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
resetting ...

I was googling a bit and found a hint here and copied the env file:
root@onewithforce:/run/media/alex/rootfs/boot# cp -a /home/alex/Downloads/tmpp/uboot.2023.04-tld-1.nsa325.environment uEnv.txt
Verified the dts file is correct as well. Now let's give it another try.

Here are the envs before booting:
NSA325> print
arcNumber=4495
baudrate=115200
bootcmd=run bootcmd_uenv; run bootcmd_usb; usb stop; run bootcmd_sata; reset
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot
bootdelay=2
console=ttyS0,115200
default=-a
device=0:1
ethact=egiga0
ethaddr=b6:d0:5e:0f:a1:17
fdtcontroladdr=1fb516e0
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=fatload usb 0:1 0x1c00000 /dts/kirkwood-nsa325.dtb
load_initrd=fatload usb 0:1 0x1100000 /uInitrd
load_uimage=fatload usb 0:1 0x800000 /uImage
machid=118f
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0xc0000(uboot_env)
partition=nand0,2
rootdelay=4
rootfstype=ext4
sata_boot=mw 0x800000 0 1; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootfstype=ext4 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env)
stderr=serial
stdin=serial
stdout=serial
uenv_import=echo importing envs ...; env import -t 0x810000
uenv_load=usb start; setenv uenv_loaded 0; for devtype in usb; do for disknum in 0; do run uenv_read_disk; done; done
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if $devtype part $disknum; then run uenv_read; fi
usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=LABEL=rootfs
ver=U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)\
ZyXEL NSA325 2-Bay Power Media Server

Environment size: 2205/131068 bytes
It shall boot from /boot/uImage and /boot/uInitrd, which were both created in step 4a.
Now trying to boot:

NSA325> boot
starting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 2 USB Device(s) found
scanning bus xhci_pci for devices... cannot reset port 3!?
2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	60060452  	efa7222f-01	83
loading envs from usb 0 ...
2890 bytes read in 12 ms (234.4 KiB/s)
importing envs ...
## Info: input data size = 2896 = 0xB50
loading DTB /boot/dts/kirkwood-nsa325.dtb ...
14414 bytes read in 13 ms (1.1 MiB/s)
loading uImage ...
6223944 bytes read in 82 ms (72.4 MiB/s)
loading uInitrd ...
5791271 bytes read in 78 ms (70.8 MiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-6.7.5-kirkwood-tld-1
   Created:      2024-03-16  18:56:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6223880 Bytes = 5.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-6.7.5-kirkwood-tld-1
   Created:      2024-03-16  18:56:33 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5791207 Bytes = 5.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
stopping USB..
Unknown command 'ide' - try 'help'
** Bad device specification ide 0 **
Couldn't find partition ide 0:1
Can't set block device
** Bad device specification ide 0 **
Couldn't find partition ide 0:1
Can't set block device
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
resetting ...

Some progress, but still not what it should.
Would be appreciated of what steps I'm missing or misunderstood from the initial statement the Debian.bz is all I need for a first installation.
Re: Zyxel NSA325 - Issue installing latest rootfs
March 16, 2024 03:10PM
onewithforce,

Your u-boot envs were already populated with some much older version. So kwboot the latest u-boot 2023.04-tld-1 will not boot into Debian due to envs mismatched.

Try kwboot using uboot.2017.07-tld-1.nsa325.mtd0.kwb. This version would boot into Debian with your current envs.

kwboot is meant to be tested so that you know there is a rescue path. But not to boot all the way into Debian (if it boots to Debian at all, it's a bonus). Perhaps I should have mentioned this clearly in the instruction. Or instruct what to do to make it possible.

At this point, boot into Debian as you currently set up to boot normally, and then go ahead and flash the u-boot 2023.04-tld-1 image and the corresponding envs image for this NSA325.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/16/2024 04:19PM by bodhi.
Re: Zyxel NSA325 - Issue installing latest rootfs
March 17, 2024 03:17AM
Thank you @bodhi. Tried with same steps with older uboot, but did not work.
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0

MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	60060452  	efa7222f-01	83
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
stopping USB..

Reset IDE: ide_preinit failed
** Bad device ide 0 **
** Bad device ide 0 **

Noticed it did not like the FS and in a matter of fact I used ext4, so mkfs.ext2 /dev/sda1 rootfs to make it as the uboot asked.
Redo the usb drive with using 4b as I would be using uboot 2017.

root@onewithforce:/run/media/alex/rootfs# tar xjf  /home/alex/Downloads/Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# cd boot/
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# tar -xjf /home/alex/Downloads/linux-6.7.5-kirkwood-tld-1-bodhi
linux-6.7.5-kirkwood-tld-1-bodhi/         linux-6.7.5-kirkwood-tld-1-bodhi.tar.bz2  
root@onewithforce:/run/media/alex/rootfs/boot# tar -xjf /home/alex/Downloads/linux-6.7.5-kirkwood-tld-1-bodhi
linux-6.7.5-kirkwood-tld-1-bodhi/         linux-6.7.5-kirkwood-tld-1-bodhi.tar.bz2  
root@onewithforce:/run/media/alex/rootfs/boot# tar -xjf /home/alex/Downloads/linux-6.7.5-kirkwood-tld-1-bodhi.tar.bz2 
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# tar -xf linux-dtb-6.7.5-kirkwood-tld-1.tar 
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# 
root@onewithforce:/run/media/alex/rootfs/boot# mv uImage uImage.orig
root@onewithforce:/run/media/alex/rootfs/boot# mv uInitrd uInitrd.orig
root@onewithforce:/run/media/alex/rootfs/boot# cp -a zImage-6.  zImage.fdt

zImage-6.5.7-kirkwood-tld-1  zImage-6.7.5-kirkwood-tld-1  
root@onewithforce:/run/media/alex/rootfs/boot# cp -a zImage-6.7.5-kirkwood-tld-1  zImage.fdt
root@onewithforce:/run/media/alex/rootfs/boot# cat dts/kirkwood-nsa325.dtb >> zImage.fdt
root@onewithforce:/run/media/alex/rootfs/boot# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-6.7.5-kirkwood-tld-1 -d zImage.fdt  uImage
Image Name:   Linux-6.7.5-kirkwood-tld-1
Created:      Sun Mar 17 09:11:36 2024
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    6392038 Bytes = 6242.22 KiB = 6.10 MiB
Load Address: 00008000
Entry Point:  00008000
root@onewithforce:/run/media/alex/rootfs/boot# mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.7.5-kirkwood-tld-1 -d initrd.img-6.7.5-kirkwood-tld-1 uInitrd
mkimage: Can't open initrd.img-6.7.5-kirkwood-tld-1: No such file or directory
root@onewithforce:/run/media/alex/rootfs/boot# mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.7.5-kirkwood-tld-1 -d initrd.img-6.5.7-kirkwood-tld-1 uInitrd
Image Name:   initramfs-6.7.5-kirkwood-tld-1
Created:      Sun Mar 17 09:12:09 2024
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    5791207 Bytes = 5655.48 KiB = 5.52 MiB
Load Address: 00000000
Entry Point:  00000000

Let's give it another try, also usb on the back this time.
Booting :
root@onewithforce:~# kwboot  -t -B 115200 /dev/ttyUSB0 -b /home/alex/Downloads/tmpp/uboot.2017.07-tld-1.nsa325.mtd0.kwb -p
kwboot version 2023.07
Detected kwbimage v0 with NAND boot signature
Patching image boot signature to UART
Sending boot message. Please reboot the target...-
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (502572 bytes)...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  7 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 12 % [......................................................................]
 14 % [......................................................................]
 16 % [......................................................................]
 17 % [......................................................................]
 19 % [......................................................................]
 21 % [......................................................................]
 23 % [......................................................................]
 24 % [......................................................................]
 26 % [......................................................................]
 28 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 55 % [......................................................................]
 57 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 62 % [......................................................................]
 64 % [......................................................................]
 65 % [......................................................................]
 67 % [......................................................................]
 69 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 74 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 89 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
 99 % [.......                                                               ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
NSA325>

env:

NSA325> printenv
arcNumber=4495
baudrate=115200
bootcmd=run bootcmd_uenv; run bootcmd_usb; usb stop; run bootcmd_sata; reset
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot
bootdelay=2
console=ttyS0,115200
default=-a
device=0:1
ethact=egiga0
ethaddr=b6:d0:5e:0f:a1:17
fdtcontroladdr=1fb516e0
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=fatload usb 0:1 0x1c00000 /dts/kirkwood-nsa325.dtb
load_initrd=fatload usb 0:1 0x1100000 /uInitrd
load_uimage=fatload usb 0:1 0x800000 /uImage
machid=118f
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0xc0000(uboot_env)
partition=nand0,2
rootdelay=4
rootfstype=ext4
sata_boot=mw 0x800000 0 1; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootfstype=ext4 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env)
stderr=serial
stdin=serial
stdout=serial
uenv_import=echo importing envs ...; env import -t 0x810000
uenv_load=usb start; setenv uenv_loaded 0; for devtype in usb; do for disknum in 0; do run uenv_read_disk; done; done
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if $devtype part $disknum; then run uenv_read; fi
usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=LABEL=rootfs
ver=U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)\
ZyXEL NSA325 2-Bay Power Media Server

Environment size: 2297/131068 bytes
It does look for /boot/uEnv.txt, which I haven't populated and do assume it would fail. Probably on the next attempt will use envs from old uboot and also from new one. Whole issue is that device is bricked and I have to boot in OS to flash latest uboot as I can't see a way of doing it via serial console.

USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	60060452  	efa7222f-01	83
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
stopping USB..

Reset IDE: ide_preinit failed
** Bad device ide 0 **
** Bad device ide 0 **
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
resetting ...
Kind of expected, let's give it another try with populating vars in /boot .
Used envs from uboot.2016.05-tld-1 , as there was no file for uboot-2017 in the dropbox link.

root@onewithforce:~# cp -a /home/alex/Downloads/tmpp/uboot.201
uboot.2016.05-tld-1.environment      uboot.2017.07-tld-1.nsa325.mtd0.kwb  
root@onewithforce:~# cp -a /home/alex/Downloads/tmpp/uboot.2016.05-tld-1.environment /run/media/alex/rootfs/boot/uEnv.txt
root@onewithforce:~# ls -la /run/media/alex/rootfs/boot/uEnv.txt
-rw-r--r--. 1 alex alex 2773 Jun 12  2016 /run/media/alex/rootfs/boot/uEnv.txt

Let's start once again with uboot 2017 with uEnv from 2016 and have a look:

## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-6.7.5-kirkwood-tld-1
   Created:      2024-03-17   7:11:36 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6392038 Bytes = 6.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-6.7.5-kirkwood-tld-1
   Created:      2024-03-17   7:12:09 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5791207 Bytes = 5.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f587000, end 1fb0cde7 ... OK
   Loading Device Tree to 1f581000, end 1f586851 ... OK
Using machid 0x831 from environment

Starting kernel ...

Everything was good until:

[    7.019022][    T1]  driver: sd
[    7.026621][    T1]   0801        30030226 sda1 efa7222f-01
[    7.026633][    T1] 
[    7.034500][    T1] List of all bdev filesystems:
[    7.039225][    T1]  ext3
[    7.039230][    T1]  ext4
[    7.041882][    T1]  exfat
[    7.044517][    T1]  fuseblk
[    7.047238][    T1]  xfs
[    7.050133][    T1]  f2fs
[    7.052695][    T1] 
[    7.057539][    T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    7.066538][    T1] CPU: 0 PID: 1 Comm: swapper Not tainted 6.7.5-kirkwood-tld-1 #1 af9b82eecabd869882a37de3f6143b1936c0ec09
[    7.077810][    T1] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    7.084812][    T1]  unwind_backtrace from show_stack+0x10/0x14
[    7.090787][    T1]  show_stack from dump_stack_lvl+0x28/0x30
[    7.096577][    T1]  dump_stack_lvl from panic+0xf0/0x324
[    7.102010][    T1]  panic from mount_root_generic+0x1c8/0x2a0
[    7.107878][    T1]  mount_root_generic from prepare_namespace+0x1b8/0x244
[    7.114793][    T1]  prepare_namespace from kernel_init_freeable+0x1b4/0x208
[    7.121900][    T1]  kernel_init_freeable from kernel_init+0x10/0x130
[    7.128387][    T1]  kernel_init from ret_from_fork+0x14/0x28
[    7.134167][    T1] Exception stack(0xa0819fb0 to 0xa0819ff8)
[    7.139944][    T1] 9fa0:                                     00000000 00000000 00000000 00000000
[    7.148856][    T1] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    7.157777][    T1] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    7.165123][    T1] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

Let's make another attempt from scratch.

root@onewithforce:~# mkfs.ext2 /dev/sda 
mke2fs 1.47.0 (5-Feb-2023)
Found a dos partition table in /dev/sda
Proceed anyway? (y,N) y
Creating filesystem with 7507812 4k blocks and 1880480 inodes
Filesystem UUID: 22375fc6-5699-4487-9c3b-6f641b2be4fc
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done   

root@onewithforce:~# e2label /dev/sda rootfs
root@onewithforce:~# 
root@onewithforce:~# cd /run/media/alex/rootfs/
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# tar xjf  /home/alex/Downloads/Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# 
root@onewithforce:/run/media/alex/rootfs# cp -a /home/alex/Downloads/tmpp/uboot.2016.05-tld-1.environment /run/media/alex/rootfs/boot/uEnv.txt
root@onewithforce:/run/media/alex/rootfs# ls -la /run/media/alex/rootfs/boot/uEnv.txt
-rw-r--r--. 1 alex alex 2773 Jun 12  2016 /run/media/alex/rootfs/boot/uEnv.txt
root@onewithforce:/run/media/alex/rootfs#

Another fail :(

Felling lost with it. It might be a good idea to drop all of the vars once booted and paste all from the file and see if it makes any difference.
Re: Zyxel NSA325 - Issue installing latest rootfs
March 17, 2024 04:23AM
Update 2:
Booted with older kwboot image, reflashed again and now all good.
It's being a long 'fight' and time I had to use serial for debugging :)

Great work on supporting such old devices! Thank you.

Update:

Managed to flash latest uboot, but seems like screwed up the envs.

U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... NAND read from offset c0000 failed -74
*** Warning - readenv() failed, using default environment

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:   
Warning: ethernet-controller@72000 (eth0) using random MAC address - ba:02:61:ee:f9:07
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0 
starting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 2 USB Device(s) found
scanning bus xhci_pci for devices... cannot reset port 3!?
2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra Fit
            Type: Removable Hard Disk
            Capacity: 29327.3 MB = 28.6 GB (60062500 x 512)
... is now current device
Scanning usb 0:1...
Found U-Boot script /boot/boot.scr
1260 bytes read in 8 ms (153.3 KiB/s)
## Executing script at 00200000
Bad data crc
SCRIPT FAILED: continuing...

Device 0: unknown device
ethernet-controller@72000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.1.47 (578 ms)
Using ethernet-controller@72000 device
terminal: Success

Flashed mtd0 with env.img , while it was listed as mtd1. Any quick way to restore it , besides the boot.csr which did not work ?

Apparently needed a coffee.
I was trying to do a dummy things without much of a brain activity.
All good now, hopefully will not screw up the flash and update to latest kernel.

debian
192.168.1.42 
ZyXEL NSA325
Linux version 6.5.7-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #2 PREEMPT Wed Oct 18 21:14:11 PDT 2023
Debian 12.2



Edited 2 time(s). Last edit at 03/17/2024 07:58AM by onewithforce.
Re: Zyxel NSA325 - Issue installing latest rootfs
March 17, 2024 01:19PM
onewithforce,

Congrats !

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: