NSA320 Arch Linux Install Failure

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

NSA320 Arch Linux Install Failure

Postby artical » Mon May 07, 2018 2:07 pm

Hi

New to the forum and Linux, this is my first real project with Linux, so please go gentle on me for asking noob questions...

so after following the install instruction: From Here from the main website to install ArchLinux I get an error when the NAS restarts. I have looked through numerous posts on the forums but cannot seem to find a solution all though there are lots of posts that look very similar in terms of the issue defined, This One is identical in terms of output on the serial port, but I haven't connected the 3.3v on the serial port, so the resolution for user that doesn't work for me.

I have a 3TB sata drive (WD30EZRX) attached in the first bay (with a second I want to install, but thought i'd get one working first) and have formatted it manually using gparted per this post, but I still get the same error. in fact the error comes whether I have a drive installed or not, which makes me think its not related to the drive at all.

before I look at doing extreme things, like reflashing the uboot, per this post which also seems fairly complicated, but seems to indicate that the uboot better supports booting of USB/SATA, but still not sure this will resolve the issue for me, I thought I would post here and ask for some advice from folks more knowledgeable than me.

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

U-Boot 1.1.4 (Mar 23 2011 - 16:09:39) Marvell version: 3.4.19

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

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
')

The printenv output is:
$this->bbcode_second_pass_code('', 'NSA320>> printenv
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=FC:F5:28:30:09:F0
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
')
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby summers » Mon May 07, 2018 2:51 pm

From uboot try doing
$this->bbcode_second_pass_code('', 'ide reset
ext2ls ide 0:1')
And see if you can see your /boot file system. My guess is that uboot can't see your file system ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA320 Arch Linux Install Failure

Postby artical » Mon May 07, 2018 10:14 pm

so i tried running the commands as suggested and get the following error:

$this->bbcode_second_pass_code('', '
NSA320>> ide reset

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
Device 0 @ 0 0:
Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 764436.4 MB = 746.5 GB (1565565872 x 512)

NSA320>> ext2ls ide0:1
Usage:
ext2ls - list files in a directory (default /)

NSA320>> ext2ls ide 0:1
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - ide 0:1 **
NSA320>>
')

it looks like there is something wrong with the partitions on the drive so am going to try deleting all the partitions and going through that setup again and seeing where that will get me.

will post an update once i have completed this.
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby artical » Fri May 11, 2018 7:41 pm

Hi Summers,

I have now completed the reformat of the HDD and have also update the uBoot to version 2017.07-tld-1 :D. This has had some success but i am still not able to boot, although the drive is now being seen when the boot does occur.

$this->bbcode_second_pass_code('', '
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC: Kirkwood 88F6281_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... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

Partition Map for IDE device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000800 0x000087ff "boot"
attrs: 0x0000000000000000
type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
type: system
guid: 355d3db3-ec5c-42d3-85b6-b9518cabc57c
2 0x00008800 0x15d509fff "rootfs"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
type: linux
guid: dc750c37-2c9b-4407-be44-9f8518a0882d
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
device ide 0:1
1 bytes read in 13 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
4600064 bytes read in 771 ms (5.7 MiB/s)
loading uInitrd ...
** File not found /boot/uInitrd **
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
** File not found /boot/dts/kirkwood-nsa320.dtb **
Unknown command 'bootm0x800000' - try 'help'
resetting ...


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC: Kirkwood 88F6281_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
NSA320>
')

when i then try to the commands suggested i can now see the folders on the drives

$this->bbcode_second_pass_code('', 'NSA320> ide reset

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
NSA320> ext2ls ide 0:1
<DIR> 1024 .
<DIR> 1024 ..
<DIR> 12288 lost+found
<DIR> 1024 boot
NSA320>
')

printenv in case this helps

$this->bbcode_second_pass_code('', 'NSA320> printenv
arcNumber=3956
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm$load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3
bootdelay=10
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa320.dtb
ethact=egiga0
ethaddr=00:19:CB:00:51:81
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
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)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; 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 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
usb_ready_retry=15

Environment size: 3008/131068 bytes
')

The problem i am now trying to understand is during the boot the "uImage" file seems to load ok, but not "uInitrd". It then tries to load "DTB /boot/dts/kirkwood-nsa320.dtb". i am fairly sure they were not in the boot folder when i copied it from the extract file i extracted into the rootfs partition.

$this->bbcode_second_pass_code('', 'Found bootable drive on ide 0
loading uImage ...
4600064 bytes read in 771 ms (5.7 MiB/s)
loading uInitrd ...
** File not found /boot/uInitrd **
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
** File not found /boot/dts/kirkwood-nsa320.dtb **
Unknown command 'bootm0x800000' - try 'help'')

so i am a little unsure where to get the files its now looking for during the boot.

Any ideas?

EDIT:
So i update load_initrd parameter in env to:
$this->bbcode_second_pass_code('', 'echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/initramfs-linux.img')

this results in it loading but now i get a new error:
$this->bbcode_second_pass_code('', 'starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: ide_preinit failed

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

Part Start Sector Num Sectors UUID Type
1 2048 62527488 63b800ce-01 83

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **

no IDE devices available
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 354 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
4600064 bytes read in 568 ms (7.7 MiB/s)
loading uInitrd ...
5553261 bytes read in 637 ms (8.3 MiB/s)
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
** File not found /boot/dts/kirkwood-nsa320.dtb **
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-4.4.97-1-ARCH
Created: 2017-11-11 4:51:55 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4600000 Bytes = 4.4 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
resetting ...


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC: Kirkwood 88F6281_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')

any ideas what i have done wrong?
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby summers » Sat May 12, 2018 12:36 pm

Your problem is $this->bbcode_second_pass_code('', '
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm$load_uimage_addr; fi; fi') it is meant to read $this->bbcode_second_pass_code('', 'bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi') so near tthe end is a missing space beetween "bootm" and "$load_uimage_addr;" so do $this->bbcode_second_pass_code('', 'setenv bootcmd_exec 'run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi'
saveenv
reset')
And you should be good ...

Also your ramdisk seems to have a problem. Don't know if pre device tree if you can boot without a ramdisk, but I'd give that a go ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA320 Arch Linux Install Failure

Postby artical » Sat May 12, 2018 1:52 pm

Hi Summers,

Having a fast learning curve with Linux, have learnt so much over this last week :D, thanks so much for the advise i really appreciate it.

i have adjust the bootcmd_exec parameter as you suggested, but basically get the same error

$this->bbcode_second_pass_code('', 'U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC: Kirkwood 88F6281_A1
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: 128 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
MV88E1318 PHY initialized on egiga0
starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

Partition Map for IDE device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000800 0x15d509fff ""
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
type: linux
guid: 3b0f2d3a-2662-4d42-9b45-2c61d95c6b0a
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
device ide 0:1
1 bytes read in 47 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
4078783 bytes read in 650 ms (6 MiB/s)
loading uInitrd ...
5553261 bytes read in 872 ms (6.1 MiB/s)
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
13175 bytes read in 18 ms (713.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-4.16.1-kirkwood-tld-1
Created: 2018-05-12 13:12:21 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4078719 Bytes = 3.9 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
resetting ...
')

copy of new printenv settings:
$this->bbcode_second_pass_code('', 'arcNumber=3956
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3
bootdelay=10
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa320.dtb
ethact=egiga0
ethaddr=00:19:CB:00:51:81
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/initramfs-linux.img
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
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)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=PARTUUID=aa349922-0577-4d06-b2ea-25fd6c564183 rw rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; 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 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
usb_ready_retry=15')

When you say "Also your ramdisk seems to have a problem. Don't know if pre device tree if you can boot without a ramdisk, but I'd give that a go ..." probably a noob question, but how would i accomplish this? :oops:
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby summers » Sat May 12, 2018 5:46 pm

You uboot says it has a problem with the ramdisk, now i was wrong about your kernel - it is a device tree kernel, usually in uboot with device tree it boots a zImage, but you are booting a uImage which is the old format.

Anyway device tree kernels, especially ones on arch, have most of the important bits in the main kernel. So you should be able to boot with the main kernel with the device tree.

Now if the old uboot method (bootm) works like the new boot method (bootz) then rather than the command:
$this->bbcode_second_pass_code('', 'bootm ${loadaddr} ${rdaddr}:${filesize};') you can hopefully do $this->bbcode_second_pass_code('', 'bootm ${loadaddr} - ${fdtaddr};')
Now probably easiest if you by hand load the kernel and device tree into memory using the usual method. Then booting as above will hopefully get you into a working linux.

Then I'd say reinstall the kernel (or update) and that should hopefully give you a good ram disk, so you can boot the usual way in future.

Actually reading your uboot variables more cllosely, its very different from mine. Yours say you can do:
$this->bbcode_second_pass_code('', 'bootm $load_uimage_addr - $load_dtb_addr')
That should boot without the ramdisk, but with the device tree ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA320 Arch Linux Install Failure

Postby artical » Mon May 14, 2018 8:05 pm

Thanks summers, I am on the road with work this week so will try when I get home.
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby artical » Fri May 18, 2018 9:23 am

Hi Summers,

so have spent some time this morning working through this as you advised and have moved forward a little.

boot sequence now boots, but system now hangs at "loading Kernel"

$this->bbcode_second_pass_code('', 'starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

Partition Map for IDE device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000800 0x003e87ff "boot"
attrs: 0x0000000000000000
type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
type: system
guid: 1b7a8422-68ee-4442-abb7-b929228ea916
2 0x003e8800 0x15d509fff "rootfs"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
type: linux
guid: 0ea686f1-1c93-4279-9001-874ba5994b21
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: WDC WD30EZRX-00DC0B0 Firm: 80.00A80 Ser#: WD-WCC1T1717336
Type: Hard Disk
Supports 48-bit addressing
Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
device ide 0:1
1 bytes read in 30 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
4600064 bytes read in 784 ms (5.6 MiB/s)
## Error: "load_initrd" not defined
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
13175 bytes read in 16 ms (803.7 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-4.4.97-1-ARCH
Created: 2017-11-11 4:51:55 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4600000 Bytes = 4.4 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
Booting using the fdt blob at 0x1c00000
Loading Kernel Image ... OK
Loading Device Tree to 0fff9000, end 0ffff376 ... OK

Starting kernel ...
')

Printenv settings:
$this->bbcode_second_pass_code('', 'bootdelay=5
load_zimage=echo loading zImage ...; load $bootdev $device $load_uimage_addr /boot/zImage
arcNumber=3956
baudrate=115200
bootargs=setenv bootargs console=ttyS0,115200 root=0b5f2054-5dcc-4689-8efb-4d71559c3b5a rootdelay=10 $mtdparts $custom_params
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3
bootdelay=5
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa320.dtb
ethact=egiga0
ethaddr=00:19:CB:00:51:81
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
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)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
setenv=bootcmd_exec run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; 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 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
usb_ready_retry=15
')

i also re-partitioned the disk, so i now have 2 partitions on there 'boot' and 'rootfs' as follows:
$this->bbcode_second_pass_code('', 'Partition Map for IDE device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000800 0x003e87ff "boot"
attrs: 0x0000000000000000
type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
type: system
guid: 1b7a8422-68ee-4442-abb7-b929228ea916
2 0x003e8800 0x15d509fff "rootfs"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
type: linux
guid: 0ea686f1-1c93-4279-9001-874ba5994b21
')

unfortunately in doing so i have replaced the kernel version (Linux-4.16.1-kirkwood-tld-1), as this has changed on boot log and for the life of me i cannot figure out how to get that booting again, so its now booting this kernel (Linux-4.4.97-1-ARCH) which is the latest from here. At this point i am not even how sure how critical that is? but thought i would mention.

reading on the forums around the boot hanging at this point seems to point to an issue with my bootarg settings.

any ideas?

thx
Artical
artical
 
Posts: 10
Joined: Sat Apr 14, 2018 3:13 pm

Re: NSA320 Arch Linux Install Failure

Postby summers » Fri May 18, 2018 11:52 am

Am at work now, so can't do much of a reply.

What we would hope for is to get the console working, so we can see output from the kernel booting. Then we can see what is going wrong.

Now the console is set up via bootargs, you have:

$this->bbcode_second_pass_quote('', 'b')ootargs=setenv bootargs console=ttyS0,115200 root=0b5f2054-5dcc-4689-8efb-4d71559c3b5a rootdelay=10 $mtdparts $custom_params


Which seems a bit odd, without checking I'd have expected

$this->bbcode_second_pass_quote('', 'b')ootargs=console=ttyS0,115200 root=0b5f2054-5dcc-4689-8efb-4d71559c3b5a rootdelay=10 $mtdparts $custom_params


Now that may be enough to get output, but I also have this nagging worry in the back of my mind. You are on the original marvell uboot, which looks fairly old. The older uboot had more limited booting methods (e.g. using uImage); also didn't do device trees. This is part of my worry, you are adding a device tree - is this set up correctly. E.g. does it pass the bootargs in the right way.

On my nsa325 at home, I have a copy of the old uboot set up - that will be later than the nsa320, but still fairly old. I'll check how it booted - as I suspect you have to do the same, at least until uboot is updated ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Next

Return to ARMv5

Who is online

Users browsing this forum: No registered users and 6 guests