Welcome! Log In Create A New Profile

Advanced

Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra

Posted by Storm 
Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 27, 2022 03:21AM
Hi all,

I am trying to install Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on my WD My Cloud Ex2 Ultra, but failed to do so yet. Short summary of what I did:
  • Soldered wires to the onboard UART so I have terminal access via a USB to UART converter and minicom.
  • Upgraded stock WD OS3 to OS5 (Maybe nog a very good idea in hindsight..)
  • Upgraded uboot using instructions and image from CyberPK https://forum.doozan.com/read.php?2,28939,98649#msg-98649.
  • After the uboot upgrade I set and saved the instructions to boot from USB (mentioned in the same post as above).
  • Then I made the uImage, uInitrd and rootfs according to the instructions from Bodhi from 28 sept 2021 https://forum.doozan.com/read.php?2,32146
  • I copied those on a USB drive (ext3 formatted), plugged it in the WD EX2 Ultra and booted. The boot process finds the USB storage device and then hangs after the message 'Loading image...'.
  • I retried the process with a FAT32 formatted USB drive for the uImage and uInitrd. That enables both of them to load (after changing the FW params to use fatload instead of ext2load), but the boot process then hangs. Similar behaviour is described by vzhilov in this post. That thread does not end with a solution for this problem unfortunately.
  • Something else which is odd is that at the u-boot prompt the ext2*-commands to interact with a ext2/3 USB drive also result in a hanging device. I mean ext2load and ext2ls. fatload and fatls do work with the same USB drive (but then reformatted as FAT32 off-course).

Vzhilov suggests this hanging behaviour might have something to do with the upgrade of stock WD OS3 to OS5.

I am thinking to use the most recent GPL sources from WD to build a new uboot.bin and see if that helps, at least for reading ext2 USB drives. After that I will try to patch those uboot sources to enable booting Debian. Any ideas to help are welcome.
Re: Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 27, 2022 03:51AM
Storm,

The WD Ex2 Ultra has been successfully booted. See the posts starting from here:

https://forum.doozan.com/read.php?2,99079,99354#msg-99354

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 27, 2022 04:17AM
Hi Bodhi,

thanks for the quick reply. I know it has been booted successfully by others, I read most of the topics concerning the WD EX2 Ultra on this forum :-)

It seems that the procedures used in that topic from 2020 by CyberPK and vzhilov do not work anymore on these devices that had a WD OS5 upgrade. Or at least, that is what vzhilov suggests in a post from 2021 https://forum.doozan.com/read.php?2,99079,117744#msg-117744. The behaviour that he describes is very similar to what I see on my box.



Edited 1 time(s). Last edit at 06/27/2022 09:33AM by Storm.
Re: Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 27, 2022 03:22PM
Storm,

> It seems that the procedures used in that topic
> from 2020 by CyberPK and vzhilov do not work
> anymore on these devices that had a WD OS5
> upgrade.

Ah, I see. So perhaps that WD OS5 upgrade might have changed some u-boot envs. If you or anybody who has done that upgrade with serial console connected and keep the log, I might be able to tell what can be done to fix the problem.

For now, you can post the u-boot envs while in serial console. May be I can tell the difference between this set of envs and the one used in successful boot by CyberPK and vzhilov.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 28, 2022 03:48AM
Thanks Bodhi. Bootlog and printenv output is below.

This output is from a u-boot compiled from the WD sources u-boot-2013.01-2014_T3.0p2 and GrandTeton-20170708.patch, as explained here https://github.com/vzhilov/WDMC-Ex2-Ultra/tree/master/1.UBoot. After flashing NAND with the built u-boot I updated the bootcmd as mentioned on vzhilov's Github page. There are some environment variables to boot from USB from CyperPK's post here but they are not used during autoboot. Stock WD OS5 can boot with this setup on my device.

BootROM - 1.73
Booting from NAND flash

General initialization - Version: 1.0.0
Detected Device ID 6820
High speed PHY - Version: 2.0

Load WD GrandTeton Serdes Config:
board SerDes lanes topology details:
 | Lane #  | Speed |  Type       |
 --------------------------------
 |   0    |  06   |  SATA0      |
 |   1    |  05   |  PCIe0      |
 |   2    |  06   |  SATA1      |
 |   3    |  05   |  USB3 HOST1 |
 |   4    |  05   |  USB3 HOST0 |
 |   5    |  00   |  SGMII2     |
 --------------------------------
PCIe, Idx 0: detected no link
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.26.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window 
DDR3 Training Sequence - Ended Successfully
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2013.01_v1.04 (Jun 27 2022 - 15:51:17) Marvell version: 2014_T3.0p6

mvBoardIdIndexGet(boardId) = 1
Board: GrandTeton DB6820
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1332 [MHz]
       L2     @ 666 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 666 [MHz]
       DDR 32 Bit Width, FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  1 GiB

Map:   Code:                    0x3fece000:0x3ff96000
       BSS:                     0x3ffef654
       Stack:                   0x3f9cdf20
       Heap:                    0x3f9ce000:0x3fece000
raise: Signal # 8 caught
raise: Signal # 8 caught
       U-Boot Environment:      0x00000000:0x00080000 (NAND)

NAND:  ID: daad ,256 MiB
MMC:   mv_sdh: 0
PCI-e 0: Detected No Link.
USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode
Board configuration detected:
Creating 1 MTD partitions on "nand0":
0x00000f500000-0x00000ff00000 : "mtd=7"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=7"
UBI: MTD device size:            10 MiB
UBI: number of good PEBs:        80
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             32
UBI: total number of reserved PEBs: 48
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1
UBIFS: mounted UBI device 0, volume 0, name "reserve2"
UBIFS: mounted read-only
UBIFS: file system size:   4063232 bytes (3968 KiB, 3 MiB, 32 LEBs)
UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  200807 bytes (196 KiB)
Loading file '/mac_addr' to addr 0x02000000 with size 18 (0x00000012)...
Done
Set lan 2 WakeOnLan ok
Enable HD1
Enable HD2
Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |   In-Band    |
| egiga1 |   RGMII   |   In-Band    |
| egiga2 |   SGMII   |     0x00     |
egiga0, egiga1, egiga2 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> printenv
CASset=max
MALLOC_len=5
MPmode=SMP
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=root=/dev/ram console=ttyS0,115200
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bol
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read.e 0x02000020 0x0500000 0x0500000; nand read.e 0x2900000 0x0a00000 0x0500000; bootm 0x020000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtd;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root ;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000; 
bootcmd_stock=echo Booting from stock ... ; run set_bootargs_stock; printenv bootargs; nand read.e 0xa00000 0
bootcmd_usb=echo Booting from USB ...; usb start; run usb_set_bootargs; if run load_image; then if run load_p
bootdelay=1
bootdev=usb
cacheShare=no
console=console=ttyS0,115200
device=0:1
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:dd:2b:4e
eth1mtu=1500
eth2addr=00:50:43:dd:7a:4e
eth2mtu=1500
eth3addr=00:50:43:2b:7a:dd
eth3mtu=1500
ethact=egiga2
ethaddr=00:50:43:7a:2b:4e
ethmtu=1500
ethprime=egiga2
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
filesize=12
ide_path=/
image_name=uImage
initrd_name=uInitrd
ipaddr=192.168.11.110
kernel_addr_r=2080000
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
load_image=echo loading Image ...; ext2load $bootdev $device $load_image_addr /boot/uImage
load_image_addr=0x02000020
load_initrd=echo loading uInitrd ...; ext2load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x2900000
loadaddr=0x02000000
loads_echo=0
mtddevname=u-boot
mtddevnum=0
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:5m(u-boot)ro,5m@5m(kernel),5m@10m(uRamdisk),185m@15m(image.cfs),15m@200m(rescu)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:4e:7a:dd
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
partition=nand0,0
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serverip=192.168.11.114
set_bootargs_stock=setenv bootargs root=/dev/ram console=ttyS0,115200
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw i;
stderr=serial
stdin=serial
stdout=serial
usb0Mode=host
usbActive=1
usbType=3
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk="
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 4107/524284 bytes
Marvell>> 
Re: Installation of Rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi on WD EX2 Ultra
June 28, 2022 02:48PM
Good news, the box can boot from SSD! To achieve this I did the following:
  • Changed the partition table on the SSD from GPT to MBR. Somehow u-boot cannot handle GPT partition tables, see also this post.
  • I referred back to booting from SSD instead of USB, as described by Gisab on his Github page.
  • I replaced the 'ide reset' commands in his instruction with 'scsi reset'. Afterwards it can find the SSD. Surprisingly the commands ext2ls and ext2load do work on the SSD. (They result in a hanging u-boot when using them on the USB drive.)
  • I changed the firmware environment variables to boot from the SSD as shown below.

Marvell>> setenv bootcmd_sata 'scsi reset;ext2load scsi 0:1 0x500000 /boot/uImage;ext2load scsi 0:1 0xa00000 /boot/uInitrd;bootm 0x500000 0xa00000' 
Marvell>> setenv set_bootargs_sata 'setenv bootargs "root=/dev/sda1 console=ttyS0,115200 rootdelay=10 usbcore.autosuspend=-1 $mtdparts earlyprintk=serial raid=noautodetect"'
Marvell>> setenv bootcmd 'run set_bootargs_sata;run bootcmd_sata'                                                                                                                
Marvell>> printenv bootcmd 
Marvell>> run bootcmd

After triple-checking that it worked, I saved the variables. The box now boots automatically the rootfs on the SSD. Thanks for the support!
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: