Welcome! Log In Create A New Profile

Advanced

[SOLVED][NSA325v2] Booting from USB hangs after kernel decompression

Posted by Dźwiedziu 
[SOLVED][NSA325v2] Booting from USB hangs after kernel decompression
February 11, 2021 10:37AM
First of all I'm new to this and have a second-hand NAS, so I'm pretty sure I've missed something.

I'm booting from USB, with the 5.2.9 kernel. The boot looks like this:
NSA325> reset                                                                                                                              
resetting ...                                                                                                                              
                                                                                                                                           
                                                                                                                                           
U-Boot 2014.07-tld-4 (Aug 02 2015 - 00:40:12)                                                                                              
ZyXEL NSA325 2-Bay Power Media Server                                                                                                      
                                                                                                                                           
SoC:   Kirkwood 88F6282_??                                                                                                                 
DRAM:  512 MiB                                                                                                                             
WARNING: Caches not enabled                                                                                                                
NAND:  128 MiB                                                                                                                             
In:    serial                                                                                                                              
Out:   serial                                                                                                                              
Err:   serial                                                                                                                              
Net:   egiga0 [PRIME]                                                                                                                      
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
(Re)start 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
4975125 bytes read in 651 ms (7.3 MiB/s)
9713936 bytes read in 708 ms (13.1 MiB/s)
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2020-12-21  13:08:27 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4975061 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
And that's it. I can leave it hanging. I've tried disconnecting the USB-TTL, reconnecting, nothing is printed, but the device is there.
If I'd plug the device to the network no address

In my own troubleshooting I wanted to upgrade u-boot, but I didn't got past kwboot:
❯ kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa325.mtd0.kwb
Sending boot message. Please reboot the target...-
Sending boot image...
4@�����>PC��0������  0 % [+xmodem: Operation canceled

So I'm kind of stuck here.

ENV:
NSA325> env print
CONTRY_TYPE=FF
FEATURE_BIT=00
MODEL_ID=AE03
PRODUCT_NAME=NSA-325v2
VENDOR_NAME=MitraStar Technology Corp.
arcNumber=4495
autoload=no
baudrate=115200
bootargs=console=ttyS0,115200 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) roo
t=LABEL=rootfs loglevel=8
bootargs_end=:::orion:eth0:none
bootargs_linux=console=ttyS0,115200 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs
2) root=LABEL=rootfs loglevel=8
bootargs_root=root=/dev/nfs rw
bootargs_stock=console=ttyS0,115200 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs
2) root=/dev/nfs rw init=/init
bootcmd=run bootcmd_usb
bootcmd_flash=setenv bootargs $bootargs_linux; nand read.e $loadaddr 0x4640000 0xA00000; nand read.e $uinitrdaddr 0x5040000 0xA00000; bootm $loadaddr 0x01100000
bootcmd_ide=setenv bootargs $bootargs_linux; ide reset; ext2load ide 0:1 $loadaddr /boot/uImage; ext2load ide 0:1 $uinitrdaddr /boot/uInitrd; bootm $loadaddr 0x01100000
bootcmd_linux=setenv bootargs $bootargs_linux; nand read.e $loadaddr 0x4640000 0xA00000; nand read.e $uinitrdaddr 0x5040000 0xA00000; bootm $loadaddr 0x01100000
bootcmd_stock=setenv bootargs $bootargs_stock; nand read.e $loadaddr $kernel_addr 0xA00000; bootm $loadaddr
bootcmd_usb=setenv bootargs $bootargs_linux; run usb_init; run usb_boot;
bootdelay=2
bootzcmd_usb=setenv bootargs $bootargs_linux; run usb_init; run usb_bootz;
console=console=ttyS0,115200 mtdparts=orion_nand:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
device=0:1
disL2Cache=no
disL2Prefetch=yes
disaMvPnp=no
enaAutoRecovery=yes
enaCpuStream=no
enaDCPref=yes
enaICPref=yes
enaMonExt=no
enaWrAllo=no
ethact=egiga0
ethaddr=10:7B:EF:FA:37:52
ethmtu=1500
ethprime=egiga0
fdtaddr=0x1c00000
image_multi=yes
image_name=uImage
ipaddr=10.4.52.165
kernel_addr=0x4640000
lcd0_enable=0
lcd0_params=640x480-16@60
loadaddr=0x02000000
loadadr=0x2000000
loads_echo=0
mainlineLinux=yes
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
nandEcc=1bit
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pcieTune1=no
pexMode=RC
rcvrip=169.254.100.100
rootpath=/srv/ubuntu
run_diag=yes
sata_dma_mode=yes
serverip=10.4.52.7
setL2CacheWT=yes
standalone=fsload 0x2000000 $image_name;setenv bootargs $console root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end $mvPhoneConfig; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
to_linux=setenv mainlineLinux yes; setenv bootcmd 'run bootcmd_linux'; saveenv; reset
to_stock=setenv mainlineLinux no; setenv bootcmd 'run bootcmd_stock'; saveenv; reset
uinitrdaddr=0x01100000
usb0Mode=host
usb_boot=mw $loadaddr 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm $loadaddr $uinitrdaddr; else bootm $loadaddr; fi
usb_bootz=mw $loadaddr 0 1; run usb_load_zimage; run usb_load_fdt; if run usb_load_uinitrd; then bootz $loadaddr $uinitrdaddr $fdtaddr; else bootm $loadaddr - $fdtaddr; fi
usb_init=usb start
usb_load_fdt=ext2load usb 0:1 $fdtaddr /dts/kirkwood-nsa325.dtb
usb_load_uimage=ext2load usb $device $loadaddr /uImage
usb_load_uinitrd=ext2load usb $device $uinitrdaddr /uInitrd
usb_load_zimage=ext2load usb $device $loadaddr /vmlinuz
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 3714/131068 bytes



Edited 1 time(s). Last edit at 02/13/2021 06:54AM by Dźwiedziu.
Re: [NSA325v2] Booting from USB hangs after kernel decompression
February 11, 2021 04:39PM
Dźwiedziu,


> In my own troubleshooting I wanted to upgrade
> u-boot, but I didn't got past kwboot:

Yes, your installed u-boot is a bit old, so to run with the new kernel/rootfs, the envs need some adjustment (not necessary with the latest u-boot 2017.07-tld-1). And also best to add earlyprintk to bootargs for troubleshooting purpose.

Power up, interrupt serial console and

setenv bootargs_linux 'console=ttyS0,115200 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=LABEL=rootfs loglevel=8 earlyprintk=serial'
setenv loadaddr 0x800000
setenv uinitrdaddr 0x02100000
and then
boot


Note that since this is older u-boot, you still need to append the DTB to uImage. As described in Step 4 during preparation for Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2. So do Step 4 if you have not done so.

Replace the kirkwood-goflexnet.dtb name below with kirkwood-nsa325.dtb

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: [NSA325v2] Booting from USB hangs after kernel decompression
February 13, 2021 06:31AM
IT'S ALIVE!

I'm contractually obligated to say this, when a first issue is solved, right? ;)
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: