Welcome! Log In Create A New Profile

Advanced

Debian installation instructions for WD EX2100

Posted by hmartin 
Re: Debian installation instructions for WD EX2100
August 31, 2021 12:07PM
Hello,

first of all:
Thanks for this instructions and the content/threads of the forum!

I think the instructions are a little bit obsolete/legacy. I have a WD My Cloud EX2100 with the lastest firmware/update before WD My Cloud OS 5.

The differences:
1. uart output
The uart output started only with:
Enable HD2
Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x00     |
| egiga1 |   RGMII   |   In-Band    |
| egiga2 |   SGMII   |     0x01     |
egiga0 [PRIME], egiga1, egiga2
Hit any key to stop autoboot:  0 
Marvell>>

2. kwboot
I also was unable to use kwboot. It just was stucked/loading loop at:
Sending boot message. Please reboot the target.../

Maybe the differences were because the NAS doesn't wanted to boot/start/power up while the uart adapter is connected to a pc. After I plug the USB uart adapter off the pc the NAS starting/booting normally. Seems like that WD changed/modified the BootROM?

So I skipped kwboot the EX2100 and was able to boot debian from a USB stick. So I missed the command 'saveenv' of Installing the modified u-boot (skipped that step) and just followed the guide, maked backups and flashed 'u-boot-a38x-Yosemite_2014T3_PQ-nand.bin'. After that I was able to use the command 'saveenv' and followed the steps again without making backups.

Currently not working:
- autoboot starts WD firmware (debian manually startable over uart with the command 'run bootcmd_usb')
- mcm-daemon not working - having errors like esion (with EX4100)

autoboot
See attached file 'printenv.txt'. Are there any wrong environment variables setted for autoboot from USB?

mcm-daemon
It seems like it's or was a known problem...

hmartin wrote:
Quote

fdtfile=armada-38x-modular.dtb

This is leftover from the stock uboot environment. It's not used to boot Debian. So your DTB is appended to the end of the kernel, which is why the second serial port is not being created (because the DTB you downloaded is not being used).

You need to append the updated DTB to the bare kernel, as described in the second link.

My outputs...
1. WD firmware
# dmesg | grep tty
[    0.000000] Kernel command line: root=/dev/ram console=ttyS0,115200
[    1.320838] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 44) is a 16550A
[    1.909263] console [ttyS0] enabled
[    1.931876] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 45) is a 16550A

2. Debian buster
# dmesg | grep tty
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sdc1 rootdelay=10 mtdparts=armada-nand:5m(u-boot)ro,5m@5m(kernel),5m@10m(uRamdisk),441m@15m(image.cfs),15m@456m(rescue_fw),20m@471m(config),10m@491m(reserve1),10m@501m(reserve2) earlyprintk=serial
[    3.097643] printk: console [ttyS0] disabled
[    3.122759] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 31, base_baud = 12500000) is a 16550A
[    3.132432] printk: console [ttyS0] enabled
[    3.174741] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 32, base_baud = 12500000) is a 16550A
...
# fw_printenv | grep dtb
fdtfile=armada-38x-modular.dtb
...
# mcm-daemon -df
mcm-daemon[3285]: Bind name to ls. 
mcm-daemon[3285]: Listen on ls for connections. 
mcm-daemon[3285]: Server startup success on port 57367
mcm-daemon[3285]: Got no stop magic, but read 1 bytes!
mcm-daemon[3285]: Buf 0: 0
mcm-daemon[3285]: Try number: 1
mcm-daemon[3285]: Got no stop magic, but read 1 bytes!
mcm-daemon[3285]: Buf 0: 0
mcm-daemon[3285]: Try number: 2
mcm-daemon[3285]: Got no stop magic, but read 1 bytes!
mcm-daemon[3285]: Buf 0: 0
mcm-daemon[3285]: Try number: 3
mcm-daemon[3285]: Got no stop magic, but read 1 bytes!
mcm-daemon[3285]: Buf 0: 0
mcm-daemon[3285]: Try number: 4
mcm-daemon[3285]: Error sending DeviceReady command, exit!

I used following commands to append the updated DTB and using currently the lastest kernel (linux-5.13.8-mvebu-tld-1-bodhi.tar.bz2):
cd /boot
tar -xjf linux-5.13.8-mvebu-tld-1-bodhi.tar.bz2
tar -xf linux-dtb-5.13.8-mvebu-tld-1.tar

apt-get remove flash-kernel 
dpkg -i linux-image-5.13.8-mvebu-tld-1_1.0_armhf.deb

cp -a zImage-5.13.8-mvebu-tld-1 zImage.fdt 
cat dts/armada-385-wd-ex2100.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.13.8-mvebu-tld-1 -d zImage.fdt uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.13.8-mvebu-tld-1 -d initrd.img-5.13.8-mvebu-tld-1 uInitrd

sync 
sync
sync
shutdown -r now
Am I doing something wrong?

Thanks for any advice!
Attachments:
open | download - printenv.txt (3.7 KB)
open | download - bootcmd_usb.txt (33.3 KB)
Re: Debian installation instructions for WD EX2100
August 31, 2021 05:09PM
kaihen,

The bootcmd_custom is missing

bootcmd=run bootcmd_custom; setenv bootargs root=/dev/ram console=ttyS0,115200; nand read.e 0xa00000 0x500000 0x500000;nand read.e 0xf00000 0xa00000 0x500000;bootm 0xa00000 0xf00000

Now I reread the instruction and looks like hmartin also missed that!

In serial console

setenv bootcmd_custom 'run bootcmd_usb'

and test booting
boot

If it works OK, then you can reboot back to serial consle again and set it permanently with saveenv

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian installation instructions for WD EX2100
September 01, 2021 06:40AM
@bodhi:
Thanks for that fast response/advice!

I also saw the error in the uart output while booting (like sorgonas have):
...
## Error: "bootcmd_custom" not defined
...
But didn't know what to set.

The autoboot now working like described and expected.

Now I only need to find out how to get the mcm-daemon running / how to fix the dtb problem. The full blown fan makes me crazy... :(
Re: Debian installation instructions for WD EX2100
September 01, 2021 11:27AM
Hello sorgonas,

would you like to test something?

This could maybe fix your booting problem. Your 'usb_set_bootargs' says that you want to boot from a hdd from the nas and not from the prepared USB stick. So just try to change the location of 'root' to your USB stick:
setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=/dev/sdc1 rootdelay=10 earlyprintk=serial $mtdparts"'
or
setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial $mtdparts"'
Or remove your hdd's while booting from the USB stick.

Your output shows that you have set 'sda1' in 'usb_set_bootargs' for 'root' but your devices (sda/sdb = hdd and sdc = USB stick) are:
...
[    1.626150] scsi 0:0:0:0: Direct-Access     ATA      WDC WD20EFRX-68E 0A82 PQ: 0 ANSI: 5
[    1.626641] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    1.626645] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    1.626669] sd 0:0:0:0: [sda] Write Protect is off
[    1.626713] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.627063] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.627644] ata2.00: configured for UDMA/133
[    1.627787] scsi 1:0:0:0: Direct-Access     ATA      WDC WD20EFRX-68E 0A82 PQ: 0 ANSI: 5
[    1.628333] sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    1.628337] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    1.628360] sd 1:0:0:0: [sdb] Write Protect is off
[    1.628403] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.628643] sd 1:0:0:0: Attached scsi generic sg1 type 0
[    1.658096]  sdb: sdb1 sdb2 sdb3 sdb4
[    1.658861] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    1.659730]  sda: sda1 sda2 sda3 sda4
[    1.660454] sd 0:0:0:0: [sda] Attached SCSI removable disk
...
[    3.047743] scsi 2:0:0:0: Direct-Access     USB 2.0  Flash Disk       4.00 PQ: 0 ANSI: 2
[    3.056299] sd 2:0:0:0: Attached scsi generic sg2 type 0
[    3.061783] sd 2:0:0:0: [sdc] 1013887 2048-byte logical blocks: (2.08 GB/1.93 GiB)
[    3.069531] sd 2:0:0:0: [sdc] Write Protect is off
[    3.074468] sd 2:0:0:0: [sdc] Asking for cache data failed
[    3.080008] sd 2:0:0:0: [sdc] Assuming drive cache: write through
[    3.091790]  sdc: sdc1
[    3.094983] sd 2:0:0:0: [sdc] Attached SCSI removable disk
...



Edited 2 time(s). Last edit at 09/01/2021 02:15PM by kaihen.
Re: Debian installation instructions for WD EX2100
September 01, 2021 02:51PM
kaihen,

There is a mcm-daemon solution somewhere in this thread:

https://forum.doozan.com/read.php?2,28939

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian installation instructions for WD EX2100
September 01, 2021 03:11PM
bodhi,

thanks for that advice.

I solved my - self-made - problem by choosing the correct git branch before executing the 'make' command. *facepalm*
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: