NSA320 - Arch instalation failed. Bad Magic Number

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

NSA320 - Arch instalation failed. Bad Magic Number

Postby rookpl » Tue Nov 26, 2019 10:46 pm

Hello,

I just bricked my Zyxel NSA320. I tried install Arch Linux and something went wrong.
I connected serial cable, from old Nokia, but I don't know what next. Could somebody help me with this?

Thats what i got from terminal:

$this->bbcode_second_pass_code('', ' __ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__|
** MARVELL BOARD: RD-88F6281A LE

U-Boot 1.1.4 (Nov 9 2012 - 14:55:24) Marvell version: 3.4.19

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CFB00

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM CS[1] base 0x10000000 size 256MB
DRAM Total size 512MB 16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash: 0 kB

CPU : Marvell Feroceon (Rev 1)
//--- stateButtonBit = 3, recovery ---//
Kernel address is 0xc80000.

Streaming disabled
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0, egiga1 [PRIME]
Hit any key to stop autoboot: 0

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found

** Bad partition 1 **
## Booting image at 02000000 ...
Bad Magic Number
NSA320>>')

NSA320>> printenv
$this->bbcode_second_pass_code('', 'bootdelay=2
baudrate=115200
loads_echo=0
eth1addr=00:19:CB:00:51:82
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
nandEcc=1bit
MODEL_ID=DD01
PRODUCT_NAME=NSA-320
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=ZyXEL Communications Corp.
run_diag=yes
ethaddr=28:28:5D:0A:31:C0
arcNumber=3956
bootargs_stock=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/nfs rw init=/init
bootargs_linux=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/sda2 rw rootwait loglevel=8
bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)
bootcmd_stock=setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)
to_stock=setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset
to_linux=setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset
console=100000
=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
CASset=min
ethprime=egiga1
bootargs_root=root=/dev/nfs rw
bootargs_end=:::orion:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
bootcmd='run bootcmd_linux'
stdin=serial
stdout=serial
stderr=serial
nandEnvBase=100000
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=3
netbsd_en=no
vxworks_en=no
disaMvPnp=no
hddPowerCtrl=no
enaAutoRecovery=yes
kernel_addr=0xc80000
pcieTune=no
ethact=egiga1
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/sda2 rw rootwait loglevel=8

Environment size: 2464/131068 bytes')
rookpl
 
Posts: 2
Joined: Tue Nov 26, 2019 10:38 pm

Re: NSA320 - Arch instalation failed. Bad Magic Number

Postby summers » Wed Nov 27, 2019 1:07 pm

Its some time since I had stock uboot on my nsa325 - I went with the new uboot when it came out ...

Anyway just to check its not working, given you have access to the uart try
$this->bbcode_second_pass_code('', 'run bootcmd_linux')
Which I'd expect to give the same answer.

If so what it means is that the OS didn't install properly on the hdd. So easiest is to pull the HDD, plug it into a desk top, then run the commands by hand.

The script that was used to install can be run by hand. I guess you used:

http://dk.mirror.archlinuxarm.org/os/nsa3x0/nsa320-alarm.tar.gz

inside the package you'll find $this->bbcode_second_pass_code('', 'usb_key_func.sh.2')which contains:

$this->bbcode_second_pass_code('', 'fdisk /dev/sda <<EOF
o
n
p
1

+16M

n
p
2


p
w

EOF
echo " * pause for ioctl to re-sync partitions"
sleep 5
###
# make filesystems
echo "- make filesystems"
# ext2 makes u-boot happy.
mkfs.ext2 -L "boot" /dev/sda1
# stock does not know how to make ext4!
mkfs.ext4 -L "rootfs" /dev/sda2

###
# make dirs & mount
echo "- mount destination"
mkdir -p /tmp/boot
mount -t ext2 /dev/sda1 /tmp/boot
mkdir -p /tmp/rootfs
mount -t ext4 /dev/sda2 /tmp/rootfs

###
# prepare the system
# extract the rootfs
echo "- extract rootfs"
tar xzf /mnt/parnerkey/rootfs.tgz -C /tmp/rootfs/

# copy the uImage to the boot partition
echo "- prepare boot partition"
cp -aR /tmp/rootfs/boot/* /tmp/boot/

# always make sure you're sync'd!
sync
')
And thats what you'll need to run by hand ...

Make sure you change sda into whatever the HDD appears of on the desktop ....

Oh yes - me, I'd also "umount" the partitions, with a "sync" before and after.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA320 - Arch instalation failed. Bad Magic Number

Postby rookpl » Fri Nov 29, 2019 9:42 pm

sorry, i had very busy days....

$this->bbcode_second_pass_code('', 'NSA320>> run bootcmd_linux
Unknown command 'run' - try 'help'
NSA320>>')

I also run commands from usb_key_func.sh.2. Disk has 2 partitions now with files, but nothing changes, still bad magic number
rookpl
 
Posts: 2
Joined: Tue Nov 26, 2019 10:38 pm

Re: NSA320 - Arch instalation failed. Bad Magic Number

Postby summers » Sat Nov 30, 2019 7:40 am

Its been some time since I used the old uboot. Your boot script seemed to indicate that. Anyway you can unroll the evniroment variables and so type the boot commands by hand:
$this->bbcode_second_pass_code('', 'setenv bootargs $(bootargs_linux)
ide reset
ext2load ide 0:1 $(loadaddr) /uImage
bootm $(loadaddr)')
What I expect will fail is the ext2load. probably the problem is that the first partition isn't ext2 formatted.

You should be able to check with something like:
$this->bbcode_second_pass_code('', 'ide reset
ext2ls ide 0:1 /')
You'll need to check I've got the ext2ls command right - "help" is your friend.

If ext2ls can't list the boot directory - then thats the problem, uboot can't access to boot directory.

You can swich back to the stock os with
$this->bbcode_second_pass_code('', 'to_stock')
So you at least get access. But you'll need to check how the first partition is formatted. I'll try and did out the command for that, /proc/mounts contains that information, but isn't nicest format ...

OK this should give the partition types:
$this->bbcode_second_pass_code('', 'file -sL /dev/sd*')or$this->bbcode_second_pass_code('', 'blkid /dev/sd*')
You'll need to run both as root ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 5 guests