[NSA-325] arch installer on usb not loaded by uboot 201707

Discussion about U-Boot and the kernel.

[NSA-325] arch installer on usb not loaded by uboot 201707

Postby dtralara » Sun Aug 09, 2020 6:46 pm

On my NSA-325 v2, I updated uboot to the following version (following instructions in https://forum.doozan.com/read.php?3,12381)
$this->bbcode_second_pass_code('', '
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
ZyXEL NSA325 2-Bay Power Media Server
')

Then I created an installation FAT32 usb key following these instructions https://archlinuxarm.org/platforms/armv5/zyxel-nsa325.
But it fails to load the content of the usb key and format the hard drive and returns "invalid partition"

$this->bbcode_second_pass_code('', '
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...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: ST3250824AS Firm: 3.AAH Ser#: 4ND3VHP8
Type: Hard Disk
Supports 48-bit addressing
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

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

Part Start Sector Num Sectors UUID Type

## 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 ...
** Invalid partition 1 **

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

Part Start Sector Num Sectors UUID Type
1 63 488392002 00000000-01 83 Boot
running scan_disk ...
Scan device usb
device usb 0:1
** Invalid partition 1 **
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: ST3250824AS Firm: 3.AAH Ser#: 4ND3VHP8
Type: Hard Disk
Supports 48-bit addressing
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)
device ide 0:1
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
loading uImage ...
** Invalid partitio
')

Is there a problem with my uboot installation?
Here the environment variables.
$this->bbcode_second_pass_code('', '
NSA325> printenv
arcNumber=4495
baudrate=115200
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
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
bootdelay=10
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa325.dtb
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
fileaddr=800000
filesize=ca0
if_netconsole=ping $serverip
init_ide=ide reset
init_mmc=mmc rescan
init_usb=usb start
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=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
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
scan_ide=ide reset
scan_mmc=mmc rescan
scan_usb=usb start
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_loaded=0
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: 3190/131068 bytes
')



PS: The harddrive with archlinux installed on it that use to use with the stock NAS doesn't boot either.
dtralara
 
Posts: 18
Joined: Wed Apr 15, 2020 2:27 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby summers » Mon Aug 10, 2020 9:23 am

That uboot looks like its looking for a single root partition.

So you'll need to extract the .tar.gz file to a single partition.

Probably also work checking you can access the partition, as from the log looks like that made be a problem. So you need to use something like $this->bbcode_second_pass_code('', 'usb start') and $this->bbcode_second_pass_code('', 'ext4ls').
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby dtralara » Mon Aug 10, 2020 10:31 am

Thank you.

I can indeed access the partition (which is a single root fat formatted partition, isn't it?)
$this->bbcode_second_pass_code('', '
NSA325> fatls usb 0:1
1258 nsa325-alarm.tar.gz
64 nsa310_check_file_c0
36 salted_md5sum_3x0
23 usb_key_func.sh
2358 usb_key_func.sh.2
0 rootfs.tgz

6 file(s), 0 dir(s)
')
(even without having to start usb).

I'll try to prepare a rootfs usb key then...

I've seen tutorials on how to make a debian based rootfs. But I'm still confused on how I could make an arm arch based one...
Is the rootfs.tgz file here the correct file to do it?
dtralara
 
Posts: 18
Joined: Wed Apr 15, 2020 2:27 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby summers » Mon Aug 10, 2020 11:09 am

Yes use the rootfs.tgz file and extract all of it into the first partition, probably ext4 formatted.

The other files in there, are the default ones for NSA-325 that change the OS installed when the machine is delivered. Most of this is rewriting the uboot variables, and extracting the root filesystem. You have already rewritten the uboot rules - by installing a more up to date uboot, so all you have to do is extract the root file system to a partition.

Actually, if those are the file sizes in the fatls, then they look wrong. So just download the tar gz file from http://os.archlinuxarm.org/os/ArchLinuxARM-kirkwood-latest.tar.gz
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby dtralara » Mon Aug 10, 2020 1:01 pm

Thanks.

I prepared a single partition, ext4, rootfs usb key and it successfully starts the boot process.

But the boot process gets interrupted, and I'm not sure how to fix that.

$this->bbcode_second_pass_code('', '
[ 9.289118] Waiting 10 sec before mounting root device...
[ 9.914916] scsi 2:0:0:0: Direct-Access SanDisk Cruzer Blade 1.00 PQ: 0 ANSI: 6
[ 9.924118] sd 2:0:0:0: Attached scsi generic sg0 type 0
[ 9.929514] sd 2:0:0:0: [sda] 30605312 512-byte logical blocks: (15.7 GB/14.6 GiB)
[ 9.938740] sd 2:0:0:0: [sda] Write Protect is off
[ 9.944237] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 9.958408] sda: sda1
[ 9.963486] sd 2:0:0:0: [sda] Attached SCSI removable disk
[ 19.304114] VFS: Cannot open root device "LABEL=rootfs" or unknown-block(0,0): error -6
[ 19.312147] Please append a correct "root=" boot option; here are the available partitions:
')

Do I need to first modify /etc/fstab to be able to use the usb as the rootfs or is it set up automatically during the boot process?


The penultimate line makes a reference to "LABEL=rootfs". The uboot environment variable is
$this->bbcode_second_pass_code('', '
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
')
Is there something incorrect here? (I used e2label to label the ext4 partion rootfs)
Edit: I get the same error after passing the following env variable to uboot
$this->bbcode_second_pass_code('', '
bootargs=console=ttyS0,115200 root=/dev/sda1 rootfstype=ext4 rootwait
')



The full log is here

$this->bbcode_second_pass_code('', '
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...
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 30603264 ce291bb3-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 292 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
4623320 bytes read in 433 ms (10.2 MiB/s)
loading uInitrd ...
** File not found /boot/uInitrd **
loading DTB /boot/dts/kirkwood-nsa325.dtb ...
** File not found /boot/dts/kirkwood-nsa325.dtb **
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-4.4.219-1-ARCH
Created: 2020-04-17 6:27:50 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4623256 Bytes = 4.4 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.219-1-ARCH (builduser@leming) (gcc version 9.2.0 (GCC) ) #1 PREEMPT Fri Apr 17 06:42:50 UTC 2020
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: ZyXEL NSA325 2-Bay Power Media Server
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129920
[ 0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 509128K/524288K available (6618K kernel code, 548K rwdata, 1892K rodata, 296K init, 720K bss, 15160K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0857b74 (8511 kB)
[ 0.000000] .init : 0xc0858000 - 0xc08a2000 ( 296 kB)
[ 0.000000] .data : 0xc08a2000 - 0xc092b2dc ( 549 kB)
[ 0.000000] .bss : 0xc092b2dc - 0xc09df468 ( 721 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:114
[ 0.000010] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[ 6.820897] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[ 6.821061] Console: colour dummy device 80x30
[ 6.821084] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[ 6.910949] pid_max: default: 32768 minimum: 301
[ 6.911024] Security Framework initialized
[ 6.911096] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 6.911111] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 6.911702] Initializing cgroup subsys io
[ 6.911730] Initializing cgroup subsys memory
[ 6.911773] Initializing cgroup subsys devices
[ 6.911795] Initializing cgroup subsys freezer
[ 6.911814] Initializing cgroup subsys net_cls
[ 6.911832] Initializing cgroup subsys perf_event
[ 6.911850] Initializing cgroup subsys net_prio
[ 6.911917] CPU: Testing write buffer coherency: ok
[ 6.912305] Setting up static identity map for 0x81e0 - 0x8238
[ 6.913948] devtmpfs: initialized
[ 6.915874] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 6.915906] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 6.916317] pinctrl core: initialized pinctrl subsystem
[ 6.916951] NET: Registered protocol family 16
[ 6.917315] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 6.940971] cpuidle: using governor ladder
[ 6.970970] cpuidle: using governor menu
[ 6.971096] Kirkwood: MV88F6282-Rev-A1, TCLK=200000000.
[ 6.971117] Feroceon L2: Enabling L2
[ 6.971147] Feroceon L2: Cache support initialised.
[ 6.972876] Kirkwood PCIe port 0: link up
[ 6.972884] PCI: bus0 uses PCIe port 0
[ 6.973058] PCI host bridge to bus 0000:00
[ 6.973073] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xe7ffffff]
[ 6.973081] pci_bus 0000:00: root bus resource [io 0x1000-0xffff]
[ 6.973089] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 6.973725] PCI: bus0: Fast back to back transfers disabled
[ 6.973763] pci 0000:00:01.0: BAR 0: assigned [mem 0xe0000000-0xe0001fff 64bit]
[ 7.002172] vgaarb: loaded
[ 7.002427] SCSI subsystem initialized
[ 7.002824] usbcore: registered new interface driver usbfs
[ 7.002887] usbcore: registered new interface driver hub
[ 7.002932] usbcore: registered new device driver usb
[ 7.003057] pps_core: LinuxPPS API ver. 1 registered
[ 7.003064] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 7.003088] PTP clock support registered
[ 7.003903] clocksource: Switched to clocksource orion_clocksource
[ 7.035083] FS-Cache: Loaded
[ 7.044886] NET: Registered protocol family 2
[ 7.045523] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 7.045578] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 7.045629] TCP: Hash tables configured (established 4096 bind 4096)
[ 7.045682] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 7.045702] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 7.045865] NET: Registered protocol family 1
[ 7.046133] RPC: Registered named UNIX socket transport module.
[ 7.046142] RPC: Registered udp transport module.
[ 7.046147] RPC: Registered tcp transport module.
[ 7.046152] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 7.046197] pci 0000:00:01.0: enabling device (0140 -> 0142)
[ 7.057426] VFS: Disk quotas dquot_6.6.0
[ 7.057638] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 7.059191] FS-Cache: Netfs 'nfs' registered for caching
[ 7.060063] NFS: Registering the id_resolver key type
[ 7.060107] Key type id_resolver registered
[ 7.060113] Key type id_legacy registered
[ 7.060182] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 7.061167] fuse init (API version 7.23)
[ 7.062774] aufs 4.4-20170911
[ 7.066946] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 7.066962] io scheduler noop registered
[ 7.066972] io scheduler deadline registered
[ 7.067181] io scheduler cfq registered
[ 7.067373] io scheduler bfq registered (default)
[ 7.067379] BFQ I/O-scheduler: v7r11
[ 7.067556] mv_xor mv_xor.0: Marvell shared XOR driver
[ 7.104786] mv_xor mv_xor.0: Marvell XOR (Registers Mode): ( xor cpy )
[ 7.104972] mv_xor mv_xor.1: Marvell shared XOR driver
[ 7.144771] mv_xor mv_xor.1: Marvell XOR (Registers Mode): ( xor cpy )
[ 7.149056] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 7.149848] console [ttyS0] disabled
[ 7.169918] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33, base_baud = 12500000) is a 16550A
[ 7.778412] console [ttyS0] enabled
[ 7.793574] brd: module loaded
[ 7.802445] loop: module loaded
[ 7.805971] sata_mv sata_mv.0: cannot get optional clkdev
[ 7.811485] sata_mv sata_mv.0: slots 32 ports 2
[ 7.818479] scsi host0: sata_mv
[ 7.822046] scsi host1: sata_mv
[ 7.825487] ata1: SATA max UDMA/133 irq 21
[ 7.829600] ata2: SATA max UDMA/133 irq 21
[ 7.834356] nand: device found, Manufacturer ID: 0x92, Chip ID: 0xf1
[ 7.840734] nand: Eon NAND 128MiB 3,3V 8-bit
[ 7.845221] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 7.852830] Scanning device for bad blocks
[ 7.910724] 4 cmdlinepart partitions found on MTD device orion_nand
[ 7.917029] Creating 4 MTD partitions on "orion_nand":
[ 7.922193] 0x000000000000-0x000000100000 : "u-boot"
[ 7.927589] 0x000000100000-0x000000500000 : "uImage"
[ 7.932924] 0x000000500000-0x000002500000 : "rootfs"
[ 7.938297] 0x000002500000-0x000008000000 : "data"
[ 7.950392] libphy: orion_mdio_bus: probed
[ 7.954624] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[ 7.964025] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 52:3b:20:9c:11:51
[ 7.972885] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 7.979497] ehci-pci: EHCI PCI platform driver
[ 7.984052] ehci-orion: EHCI orion driver
[ 7.988140] orion-ehci orion-ehci.0: EHCI Host Controller
[ 7.993581] orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
[ 8.001332] orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
[ 8.023923] orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
[ 8.030601] hub 1-0:1.0: USB hub found
[ 8.034427] hub 1-0:1.0: 1 port detected
[ 8.038856] xhci_hcd 0000:00:01.0: xHCI Host Controller
[ 8.044161] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 2
[ 8.051878] xhci_hcd 0000:00:01.0: hcc params 0x014042cb hci version 0x96 quirks 0x00000004
[ 8.061013] hub 2-0:1.0: USB hub found
[ 8.064842] hub 2-0:1.0: 2 ports detected
[ 8.069341] xhci_hcd 0000:00:01.0: xHCI Host Controller
[ 8.074645] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 3
[ 8.082138] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[ 8.090937] hub 3-0:1.0: USB hub found
[ 8.094773] hub 3-0:1.0: 2 ports detected
[ 8.099403] usbcore: registered new interface driver uas
[ 8.104912] usbcore: registered new interface driver usb-storage
[ 8.110985] usbcore: registered new interface driver ums-alauda
[ 8.117008] usbcore: registered new interface driver ums-cypress
[ 8.123077] usbcore: registered new interface driver ums-datafab
[ 8.129163] usbcore: registered new interface driver ums_eneub6250
[ 8.135496] usbcore: registered new interface driver ums-freecom
[ 8.141573] usbcore: registered new interface driver ums-isd200
[ 8.147573] usbcore: registered new interface driver ums-jumpshot
[ 8.153727] usbcore: registered new interface driver ums-karma
[ 8.159652] usbcore: registered new interface driver ums-onetouch
[ 8.165954] usbcore: registered new interface driver ums-realtek
[ 8.172031] usbcore: registered new interface driver ums-sddr09
[ 8.178046] usbcore: registered new interface driver ums-sddr55
[ 8.184049] usbcore: registered new interface driver ums-usbat
[ 8.190243] mousedev: PS/2 mouse device common for all mice
[ 8.195886] ata1: SATA link down (SStatus 0 SControl F300)
[ 8.353925] usb 1-1: new high-speed USB device number 2 using orion-ehci
[ 8.506276] hub 1-1:1.0: USB hub found
[ 8.510339] hub 1-1:1.0: 4 ports detected
[ 8.563925] ata2: SATA link down (SStatus 0 SControl F300)
[ 8.793919] usb 1-1.2: new high-speed USB device number 3 using orion-ehci
[ 8.905931] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 8.912494] scsi host2: usb-storage 1-1.2:1.0
[ 9.203919] rtc-mv rtc-mv: internal RTC not ticking
[ 9.208929] i2c /dev entries driver
[ 9.213338] sdhci: Secure Digital Host Controller Interface driver
[ 9.219566] sdhci: Copyright(c) Pierre Ossman
[ 9.223994] sdhci-pltfm: SDHCI platform and OF driver helper
[ 9.230752] ledtrig-cpu: registered to indicate activity on CPUs
[ 9.236925] usbcore: registered new interface driver r8712u
[ 9.242720] gre: GRE over IPv4 demultiplexor driver
[ 9.247677] NET: Registered protocol family 17
[ 9.252235] Key type dns_resolver registered
[ 9.257321] registered taskstats version 1
[ 9.262881] Key type encrypted registered
[ 9.267464] console [netcon0] enabled
[ 9.271136] netconsole: network logging started
[ 9.276067] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[ 9.283032] hctosys: unable to open rtc device (rtc0)
[ 9.289118] Waiting 10 sec before mounting root device...
[ 9.914916] scsi 2:0:0:0: Direct-Access SanDisk Cruzer Blade 1.00 PQ: 0 ANSI: 6
[ 9.924118] sd 2:0:0:0: Attached scsi generic sg0 type 0
[ 9.929514] sd 2:0:0:0: [sda] 30605312 512-byte logical blocks: (15.7 GB/14.6 GiB)
[ 9.938740] sd 2:0:0:0: [sda] Write Protect is off
[ 9.944237] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 9.958408] sda: sda1
[ 9.963486] sd 2:0:0:0: [sda] Attached SCSI removable disk
[ 19.304114] VFS: Cannot open root device "LABEL=rootfs" or unknown-block(0,0): error -6
[ 19.312147] Please append a correct "root=" boot option; here are the available partitions:
[ 19.320598] 0100 8192 ram0 (driver?)
[ 19.325268] 0101 8192 ram1 (driver?)
[ 19.329913] 0102 8192 ram2 (driver?)
[ 19.334581] 0103 8192 ram3 (driver?)
[ 19.339235] 0104 8192 ram4 (driver?)
[ 19.343882] 0105 8192 ram5 (driver?)
[ 19.348549] 0106 8192 ram6 (driver?)
[ 19.353195] 0107 8192 ram7 (driver?)
[ 19.357844] 0108 8192 ram8 (driver?)
[ 19.362490] 0109 8192 ram9 (driver?)
[ 19.367140] 010a 8192 ram10 (driver?)
[ 19.371873] 010b 8192 ram11 (driver?)
[ 19.376609] 010c 8192 ram12 (driver?)
[ 19.381343] 010d 8192 ram13 (driver?)
[ 19.386080] 010e 8192 ram14 (driver?)
[ 19.390813] 010f 8192 ram15 (driver?)
[ 19.395552] 0800 15302656 sda driver: sd
[ 19.400196] 0801 15301632 sda1 ce291bb3-01
[ 19.405105] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 19.413408] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.219-1-ARCH #1
[ 19.419873] Hardware name: ZyXEL NSA325 2-Bay Power Media Server
[ 19.425922] [<c000fd58>] (unwind_backtrace) from [<c000d3dc>] (show_stack+0x10/0x14)
[ 19.433702] [<c000d3dc>] (show_stack) from [<c00cc95c>] (panic+0x9c/0x21c)
[ 19.440610] [<c00cc95c>] (panic) from [<c08592c0>] (mount_block_root+0x1a0/0x24c)
[ 19.448124] [<c08592c0>] (mount_block_root) from [<c085953c>] (mount_root+0xd8/0x100)
[ 19.455988] [<c085953c>] (mount_root) from [<c08596c0>] (prepare_namespace+0x15c/0x1bc)
[ 19.464029] [<c08596c0>] (prepare_namespace) from [<c0858e84>] (kernel_init_freeable+0x200/0x254)
[ 19.472942] [<c0858e84>] (kernel_init_freeable) from [<c064bd38>] (kernel_init+0x8/0xe0)
[ 19.481068] [<c064bd38>] (kernel_init) from [<c000a4e8>] (ret_from_fork+0x14/0x2c)
[ 19.488673] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 80.563916] random: nonblocking pool is initialized

')
Last edited by dtralara on Mon Aug 10, 2020 1:53 pm, edited 1 time in total.
dtralara
 
Posts: 18
Joined: Wed Apr 15, 2020 2:27 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby summers » Mon Aug 10, 2020 1:35 pm

As I recall it, the kirkwood kernel, only has limited methods of recognizing partitions. I don't recall if the label is allowed. IIRC the preferred method these days is PARTUUID. Think you get that using $this->bbcode_second_pass_code('', 'blkid'). Am at work right now - I'll check when I get home what I have.

It look like the one for the HDD is $this->bbcode_second_pass_quote('', 'c')e291bb3-01


Hmm, and quick read of your env variables, looks like it doesn't read info like this from a file on the hdd. So when I get home I'll give you my end variables, so you can see that it loads an file.

Anyway for you think you have to update things in uboot.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby dtralara » Mon Aug 10, 2020 3:17 pm

Thanks.

After modifying the following uboot variable, it works, it boots with the rootfs on the usbkey
$this->bbcode_second_pass_code('', '
# after hitting a key to stop autoboot in uboot
> setenv set_bootargs setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts $custom_params

> $set_bootargs

> boot

')

It's still a work around and I will use blockname instead of /dev/sda (that can change if other hdd are connected), but it works for now and now I can install arch on the hdd.

Thanks again for your help.
dtralara
 
Posts: 18
Joined: Wed Apr 15, 2020 2:27 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby summers » Mon Aug 10, 2020 7:53 pm

OK on my NSA-325 I have:
$this->bbcode_second_pass_code('', 'bootcmd=run startboot;run bootubi
bootdir=/boot
bootfilem=uImage
bootfilez=zImage
bootpart=1:1
bootubi=echo Trying to boot from NAND ...;if run mountubi; then ubifsload ${loadaddr} /boot/zImage;ubifsload ${fdtaddr} /boot/dtbs/${fdtfile};ubifsumount; setenv bootargs console=${console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs rootwait ${mtdparts};bootz ${loadaddr} - ${fdtaddr};fi
console=ttyS0,115200
devnum=2
ethact=egiga0
ethaddr=AA:BB:CC:DD:EE:FF
fdtaddr=0x800000
fdtdir=/boot/dtbs
fdtfile=kirkwood-nsa325.dtb
ipaddr=10.10.10.3
loadaddr=0x810000
loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile} ; fdt addr ${fdtaddr} ; fdt set /mbus@f1000000/nand@12f chip-delay <40>
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilez} || load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilem}
loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
mainargs=setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}
mountubi=ubi part rootfs; ubifsmount ubi0:rootfs
mtddevname=uboot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0xC0000(uboot),0x40000(uboot_env),0x80000(old_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
ncip=10.10.10.5
ncipk=10.10.10.4
netconsole=on
partition=nand0,0
preboot=if env exists netconsole && test ${netconsole} = on; then if ping ${ncip}; then setenv stdin nc; setenv stdout nc; setenv stderr nc; version; if env exists ncargsusr; then echo ncargs has been defined by user; setenv ncargs ${ncargsusr}; else setenv ncargs ignore_loglevel netconsole=6665@${ipaddr}/eth0,6666@${ncipk}/; fi; fi; else echo Netconsole has been turned off.; echo To turn it on, set netconsole variable to on.; setenv stdin; setenv stdout; setenv stderr; setenv ncargs; fi
rdaddr=0x1100000
rdfile=initramfs-linux.img
startboot=usb start; ide reset; for devtype in usb ide; do setenv devnum 0; while ${devtype} dev ${devnum}; do echo ${devtype} found on device ${devnum}; setenv bootpart ${devnum}:1; echo Checking for: ${bootdir}/uEnv.txt ...; if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then echo Running uenvcmd ...; run uenvcmd; fi; fi; if run loadimage; then if env exists root; then echo root has been defined by user; else part uuid ${devtype} ${bootpart} uuid; setenv root PARTUUID=${uuid}; fi; run mainargs; if run loadfdt; then if run loadrd; then bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}; else bootz ${loadaddr} - ${fdtaddr}; fi; else if run loadrd; then echo Booting uImage with initrd; bootm ${loadaddr} ${rdaddr}:${filesize}; else bootm ${loadaddr}; fi; fi; else echo No kernel found; fi; setexpr devnum ${devnum} + 1; done; done;
')
so it load /boot/uEnv.txt which contains:
$this->bbcode_second_pass_code('', 'root=PARTUUID=94a2dc27-01
mtdparts=mtdparts=orion_nand:0xC0000(uboot),0x40000(uboot_env),0x80000(old_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}; fdt addr ${fdtaddr}; fdt set /mbus@f1000000/nand@12f chip-delay <45>')
I'll try and find out what my other machines have - as they make it easier.

Edit: oh yes - you probably don't need the fdt chip delay bit of code - thats for when you can't write to the eeprom due to speed issues - it was two ways of down clocking via the device tree. Both worked, but will only be needed if you have problems.
Last edited by summers on Tue Aug 11, 2020 8:11 am, edited 1 time in total.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby summers » Mon Aug 10, 2020 8:01 pm

And my PocketBeagle, with a more modern uboot, I don't think has *anything* set in the env, that I can find. So it uses the default set up which load /boot/boot.scr and I have the file /boot./boot.txt
$this->bbcode_second_pass_code('', '# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=tty0 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
gpio set 54
echo fdt: ${fdtfile}
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
gpio set 55
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
gpio set 56
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
gpio set 56
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
')
Which you can see is far easier. So if your uboot, can work with /boot/boot.scr then its far easier ...

You can see what bohdi has compiled into the executable here: https://github.com/mibodhi/u-boot-kirkwood/blob/2017.07-kirkwood-tld-1/include/configs/nsa325.h
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: [NSA-325] arch installer on usb not loaded by uboot 2017

Postby dtralara » Tue Aug 11, 2020 10:25 am

Thank you.

The second approach (with boot.scr) seems cleaner, I might check that option.

After installing arch on the harddrive (the one installed on the left slot) I ended up saving the env changes that I mentioned above
$this->bbcode_second_pass_code('', '
> setenv set_bootargs setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts $custom_params
> $set_bootargs
> saveenv
')
For now, it doesn't seem to encounter any problem and boots properly. I'll switch to a more robust boot.scr approach if there's a problem.

Thanks again for your help and for sharing your settings.
dtralara
 
Posts: 18
Joined: Wed Apr 15, 2020 2:27 pm

Next

Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 4 guests

cron