Welcome! Log In Create A New Profile

Advanced

Debian on WD MyCloud EX2 Ultra

Posted by vzhilov 
Re: Debian on WD MyCloud EX2 Ultra
March 06, 2021 04:02PM
Thank you Bodhi but i dont think its a jdownloader problem, if i have the problem with wget already, i just added that in the last post!

Edit;

I have now ordered a new nas Have no more desire on it.



Edited 3 time(s). Last edit at 03/07/2021 02:28PM by Yodaxy.
Re: Debian on WD MyCloud EX2 Ultra
March 09, 2021 10:43AM
bodhi Wrote:
-------------------------------------------------------
> @dtd,
>
> Here is the revised version of the DTS and its
> DTB. I've changed the file name to be consistent
> with what we have currently. I also change the
> machine name in the DTS (do a diff with your
> version to see the changes).
>
> @all,
>
> Please try this armada-385-wd-ex2-ultra.dtb. I've
> added a fix to keep the persistent MAC address
> (local MAC address will not be generated by the
> kernel).

Thank you, bodhi!

I have compiled Kernel 5.11.5 for this box using your new .dtd and .dts files. I had to take off IPv6 support out of kernel in order for the final file fit into 5Mb. But I seem to mess up my u-boot and bootargs. My old instruction on how to flash u-boot doesn’t work.

And even if I do:

usb start
fatload usb 0:1 0xa00000 uImage
fatload usb 0:1 0xf00000 uInitrd
bootm 0xa00000 0xf00000

it just hangs, so there is no boot log.

Here is my printenv:

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$bootargs_end $mvNetConfig video=d ovefb:lcd0:$1cd0_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_panel=$1cd_panel
ovefb:lcd0:$1cd0_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_panel=$1cd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:ethO:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand.e 0x02000020 0x0500000 0x0500000; nand read.e 0x2900000 0x0a00000 0x0500000; bootm 0x02000020 0x2900000 
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$s erverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$1cdO_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_pane 1=$1cd_panel; bootz 0x2000000 — $fdtaddr;
erverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$1cdO_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_pane 1=$1cd_panel; bootz 0x2000000 — $fdtaddr;
1=$1cd_panel; bootz 0x2000000 — $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip= $ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$1cd0_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_panel=$1cd_panel; bootz 0 x2000000 — $fdtaddr;
$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$1cd0_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_panel=$1cd_panel; bootz 0 x2000000 — $fdtaddr;
x2000000 — $fdtaddr;
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;
bootdelay=1 
cacheShare=no
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no 
eeeEnable=no 
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no 
enaWrAllo=no 
eth1addr=00:50:43:1a:2c:36
ethlmtu=1500 
eth2addr=00:50:43:1a:33:36
eth2mtu=1500 
eth3addr=00:50:43:2c:33:la
eth3mtu=1500 
ethact=egiga2 
ethaddr=00:50:43:33:2c:36
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 
lcdO_params=640x480-16@60
lcd_pane1=0 
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@2Ond0,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.scrive=1
usbType=3
vxworks_en=no 
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 3216/524284 bytes 
Marvell»



Edited 2 time(s). Last edit at 03/09/2021 10:57AM by vzhilov.
Re: Debian on WD MyCloud EX2 Ultra
March 09, 2021 05:16PM
vzhilov,

> I have compiled
> Kernel
> 5.11.5
for this box using your new .dtd and
> .dts files.

That's probably not enough. You need to use my kernel config and patches to make sure that it will work.

And also use earlyprintk to see more info during boot.

Current:
bootargs=root=/dev/ram console=ttyS0,115200

Should be
setenv bootargs 'root=/dev/ram console=ttyS0,115200 earlyprintk=serial'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 10, 2021 05:10AM
Quote


bodhi Wrote:
-------------------------------------------------------
> That's probably not enough. You need to use my
> kernel config and patches to make sure that it
> will work.

Oh, yes, you are right. Is that something new?

Quote

> And also use earlyprintk to see more info during
> boot.
>
> Current:
>
> bootargs=root=/dev/ram console=ttyS0,115200
>
>
> Should be
>
> setenv bootargs 'root=/dev/ram
> console=ttyS0,115200 earlyprintk=serial'
> 

Thank you, I did that. But still no luck, it just fails to recover partition:


Device UUID: 34375840-037F—B8C1-2285-24A3009F87FF
Service UUID: FFEO
RX UUID: FFE1 
 TX UUID: FFE1

Connecting 
Successfully connected to BLE device.

Enable HD1 
Enable HD2 
 et:
I  port I Interface      PHY address

1 egiga0 I    RGMII        In—Band
1 egigal      RGMII        In—Band
1 egiga2 I SGMII Ox00 
egiga0, egigal, egiga2 [PRIME] 
Hit any key to stop autoboot: 0 
nand — NAND sub—system

Usage:
nand info — show available NAND devices
nand device [dev] — show or set current device 
nand read — addr off partition size
nand write — addr off partition size
    read/write 'size' bytes starting at offset 'off' 
    to/from memory address 'addr', skipping bad blocks.
nand read. raw — addr offlpartition [count] 
nand write. raw — addr offlpartition [count]
    Use read.raw/write.raw to avoid ECC and access the flash as—is.
nand write.trimffs — addr off partition size
    write 'size' bytes starting at offset 'off' from memory address
    'addr', skipping bad blocks and dropping any pages at the end
    of eraseblocks that contain only OxFF
nand erase[.spread] [clean] off size — erase 'size' bytes from offset 'off' 
    With '.spread', erase enough for given file size, otherwise,
    'size' includes skipped bad blocks.
nand erase.part [clean] partition — erase entire mtd partition'
nand erase.chip [clean] — erase entire chip' 
nand bad — show bad blocks
nand dump[.00b] off — dump page
nand scrub [—y] off size 1 scrub.part partition 1 scrub.chip
    really clean NAND erasing bad blocks (UNSAFE)
nand markbad off [...] — mark bad block(s) at offset (UNSAFE)
nand biterr off — make a bit error at offset (UNSAFE)

 AND read: device 0 offset 0xa00000, size 0x500000 
 5242880 bytes read: OK
•# Booting image at 02000020 ...

 AND read: device 0 offset 0xc800800, size 0xf00000 
 15728640 bytes read: OK
•# Booting image at 00a00000
•# Booting kernel from Legacy Image at 00a00000 
   Image Name:    Linux-382
   Created:       2015-08-02    3:54:03 UTC
   Image Type:    ARM Linux Kernel Image (uncompressed)
   Data Size:     4093292 Bytes = 3.9 MiB
   Load Address: 00008000 
   Entry Point: 00008000 
   Verifying Checksum OK
•# Loading init Ramdisk from Legacy Image at 00e00000
   Image Name:    Ramdisk
   Created:       2015-10-05    5:02:44 UTC
   Image Type:    ARM Linux RAMDisk Image (gzip compressed)
   Data Size:     7010744 Bytes = 6.7 MiB
   Load Address: 00e00000 
   Entry Point: 00e00000 
   Verifying Checksum       OK 
   Loading Kernel Image ... OK
OK

Starting kernel ...

I have flashed new OS 5 from WD before doing all that, could that mess all up?
Re: Debian on WD MyCloud EX2 Ultra
March 10, 2021 05:27AM
vzhilov,

> I have flashed new OS 5 from WD before doing all
> that, could that mess all up?

Yes, the kernel files are ones from stock FW. So you need to reflash the new build uImage and uInitrd to NAND ( if that's what you want to boot from).

OTOH, if you only want to boot kernel from from USB/HDD rootfs then the u-boot envs were no longer good after that OS5 flash (bootcmd was reset).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 10, 2021 05:46AM
After I flashed OS5, I flashed my old u-boot, my initrd and tried old or new kernel. But I can only boot from recovery partition of 2015. The custom images do not boot.
Re: Debian on WD MyCloud EX2 Ultra
March 10, 2021 07:33AM

Device UUID: 34375840-037F—B8C1-2285-24A3009F87FF
Service UUID: FFEO
RX UUID: FFE1 
 TX UUID: FFE1

Connecting 
Successfully connected to BLE device.

Enable HD2
 et:
1 port I Interface       PHY address
1 
1 egiga0 I    RGMII        In—Band
1 egigal      RGMII        In—Band
1 egiga2 I SGMII I 0x00 
egiga0, egigal, egiga2 [PRIME] 
Hit any key to stop autoboot: 0 
 Marvell» usb start
(Re)start USB...
USBO:   Port (usbActive) : 1       Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found 
       scanning usb for ethernet devices... 0 Ethernet Device(s) found 
 Marvell» fatload usb 0:1 0x02000020 uImage
reading uImage
5159667 bytes read in 287 ms (17.1 MiB/s)
 Marvell» fatload usb 0:1 0x2900000 uInitrd
reading uInitrd
4830114 bytes read in 265 ms (17.4 MiB/s)
 Marvell» bootm 0x02000020 0x2900000
•# Booting image at 02000020 ...
•# Booting kernel from Legacy Image at 02000020 ...
   Image Name:    Kernel—v5.11.5
   Created:       2021-03-09 13:50:46 UTC
   Image Type:    ARM Linux Kernel Image (uncompressed)
   Data Size:     5159603 Bytes = 4.9 MiB
   Load Address: 00008000 
   Entry Point: 00008000 
   Verifying Checksum OK
•# Loading init Ramdisk from Legacy Image at 02900000 ...
   Image Name:    BusyBox v1.31
   Created:       2020-04-21 13:35:00 UTC
   Image Type:    ARM Linux RAMDisk Image (lzma compressed)
   Data Size:     4830050 Bytes = 4.6 MiB
   Load Address: 00000000 
   Entry Point: 00000000 
   Verifying Checksum OK

Nothing else happens, even with your kernel



Edited 2 time(s). Last edit at 03/10/2021 07:37AM by vzhilov.
Re: Debian on WD MyCloud EX2 Ultra
March 10, 2021 04:25PM
vzhilov,

If you can no longer boot into your RAID rootfs (I recall you are using RAID), or HDD rootfs.

Try booting the rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 on USB. See if you can get back to a working system first. And use

- the zImage-5.10.7-mvebu-tld-1 (from linux-5.10.7-mvebu-tld-1-bodhi.tar.bz2)
- the latest DTB (from linux-5.10.7-mvebu-tld-1-bodhi.tar.bz2)

- The uInitrd can be from Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2

This will give you an idea what's working.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 11, 2021 08:31AM
If I would get a single message for a clue I will be happy


Device UUID: 34375840-037F—B8C1-2285-24A3009F87FF
Service UUID: FFEO
RX UUID: FFE1 
 TX UUID: FFE1

Connecting 
Successfully connected to BLE device.

 et:
1 port      Interface 1 PHY address
1                      1 
1 egiga0      RGMII    1   In—Band
1 egigal      RGMII    1   In—Band
1 egiga2 SGMII 1 0x00 
egiga0, egigal, egiga2 [PRIME] 
Hit any key to stop autoboot: 0 
 Marvell» usb start
(Re)start USB...
USBO:   Port (usbActive) : 1       Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found 
       scanning usb for ethernet devices... 0 Ethernet Device(s) found 
 Marvell» fatload usb 0:1 0x02000020 uImage.bodhi
reading uImage.bodhi
5143307 bytes read in 289 ms (17 MiB/s) 
 Marvell» bootm 0x02000020
•# Booting image at 02000020 ...
•# Booting kernel from Legacy Image at 02000020 ...
   Image Name:    Linux-5.10.7—mvebu—tld-1
   Created:       2021-03-11    9:23:54 UTC
   Image Type:    ARM Linux Kernel Image (uncompressed)
   Data Size:     5143243 Bytes = 4.9 MiB
   Load Address: 00008000 
   Entry Point: 00008000 
   Verifying Checksum OK

And then total silence



Edited 1 time(s). Last edit at 03/11/2021 08:32AM by vzhilov.
Re: Debian on WD MyCloud EX2 Ultra
March 11, 2021 10:12PM
At this point:

> Hit any key to stop autoboot: 0

printenv

and do the rest like you did to boot the box from USB.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 12, 2021 02:22AM

Connecting 
Successfully connected to BLE device.

Enable HD2
Net:
1 port    I Interface I PHY address

1 egiga0      RGMII        In—Band
1 egigal      RGMII        In—Band
1 egiga2 I    SGMII    I     0x00
egiga0, egigal, 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 earlyprintk=serial
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=d 
ovefb:lcd0:$lcd0_params cicd.lcd0_enable=$lcd0_enable cicd.lcd_panel=$1cd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:ethO:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand.e 0x02000020 0x0500000 0x0500000; nand read.e 0x2900000 0x0a00000 0x0500000; bootm 0x02000020 0x2900000 
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$s 
erverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$1cd0_params cicd.lcd0_enable=$lcd0_enable cicd.lcd_pane 
l=$lcd_panel; bootz 0x2000000 — $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip= 
$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params cicd.lcd0_enable=$1cd0_enable cicd.lcd_panel=$lcd_panel; bootz 0 
x2000000 — $fdtaddr;
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;
bootdelay=1 
cacheShare=no
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no 
eeeEnable=no 
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no 
enaWrAllo=no 
eth1addr=00:50:43:1a:2c:36
ethlmtu=1500 
eth2addr=00:50:43:1a:33:36
eth2mtu=1500 
eth3addr=00:50:43:2c:33:la
eth3mtu=1500 
ethact=egiga2 
ethaddr=00:50:43:33:2c:36
ethmtu=1500 
ethprime=egiga2
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x—modular.dtb
filesize=12 
ide_path=i
image_name=uImage
initrd_name=uInitrd
ipaddr=192.168.11.110
kernel_addr_r=2080000
lcd0_enable=0 
lcd0_params=640x480-16@60
lcd_pane1=0 
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@15tret0
sbOMode=host 
usbActive=1 
usbType=3
vxworks_en=no 
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 3235/524284 bytes 
Marvell» usb start
(Re)start USB...
USBO: Port (usbActive) : 1 Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
      scanning usb for storage devices... 1 Storage Device(s) found
      scanning usb for ethernet devices... 0 Ethernet Device(s) found 
Marvell» fattoad usb 0:1 0x02000020 uImage.bodhi
reading uImage.bodhi
5143307 bytes read in 283 ms (17.3 MiB/s) 
Marvell» bootm 0x02000020
•# Booting image at 02000020 ...
•# Booting kernel from Legacy Image at 02000020 ... 
  Image Name: Linux-5.10.7—mvebu—tld-1
  Created:    2021-03-11 9:23:54 UTC
  Image Type: ARM Linux Kernel Image (uncompressed)
  Data Size:  5143243 Bytes = 4.9 MiB
  Load Address: 00008000 
  Entry Point: 00008000 
  Verifying Checksum OK



Edited 1 time(s). Last edit at 03/12/2021 02:23AM by vzhilov.
Re: Debian on WD MyCloud EX2 Ultra
March 12, 2021 04:55PM
vzhilov.

Set this env before booting:

setenv fdt_skip_update yes

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 13, 2021 01:40AM
Device UUID: 34375840-037F—B8C1-2285-24A3009F87FF
Service UUID: FFEO
RX UUID: FFE1 
TX UUID: FFE1

Connecting 
Successfully connected to BLE device.

Enable HD2
Net:
   port I Interface 1 PHY address

I egiga0 I    RGMII    1   In—Band
I egigal      RGMII    1   In—Band
I egiga2 I    SGMII    1     0x00 
egiga0, egigal, egiga2 [PRIME] 
Hit any key to stop autoboot: 0
Marvell» printenv fdt_skip_update 
fdt_skip_update=no
Marvell» setenv fdt_skip_update yes 
Marvell» printenv fdt_skip_update 
fdt_skip_update=yes
Marvell» usb start
(Re)start USB...
USBO:    Port (usbActive) : 1      Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
        scanning usb for storage devices... 1 Storage Device(s) found 
        scanning usb for ethernet devices... 0 Ethernet Device(s) found 
Marvell» fatload usb 0:1 0x02000020 uImage.bodhi
reading uImage.bodhi
5143307 bytes read in 284 ms (17.3 MiB/s) 
Marvell» bootm 0x02000020
## Booting image at 02000020 ...
## Booting kernel from Legacy Image at 02000020 ...
   Image Name:    Linux-5.10.7—mvebu—tld-1
   Created:       2021-03-11     9:23:54 UTC
   Image Type:    ARM Linux Kernel Image (uncompressed)
   Data Size:     5143243 Bytes = 4.9 MiB
   Load Address: 00008000 
   Entry Point: 00008000 
   Verifying Checksum OK

Same thing, unfortunately. Nothing after I try to boot the kernel.
Re: Debian on WD MyCloud EX2 Ultra
March 13, 2021 04:09PM
vzhilov,

Indeed it is qutite a strange behavior. Your envs don't have any thing that stands out that could be wrong other than fdt_skip_update. This is a quite important setting, which must be set to yes when running with modern kernel DTB.
fdt_skip_update=no

I'd suggest:

- Go back a few kernel versions. Keep using an older and older uImage until it can boot.

- Boot with a normal bootargs (no RAID). Alternately with earlyprintk and without. Load to 0x02000000 (instead of 0x02000020 as stock does):

So for each uImage try 2 boots
fatload usb 0:1 0x02000000 uImage
stenv fdt_skip_update yes
setenv bootargs 'root=/dev/sda1 console=ttyS0,115200'
bootm 0x02000000
and
fatload usb 0:1 0x02000000 uImage
stenv fdt_skip_update yes
setenv bootargs 'root=/dev/sda1 console=ttyS0,115200 earlyprintk=serial'
bootm 0x02000000

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 19, 2021 02:59PM
I have tried some so far, but don’t get any results. I’m thinking to try with the rescue kernel that always boots in case of failover. Which one is that? How do I get that, like below?

dd if=/dev/mtd /mnt/USB/uImage ?
Re: Debian on WD MyCloud EX2 Ultra
March 19, 2021 03:52PM
vzhilov,

> I have tried some so far, but don’t get any
> results. I’m thinking to try with the rescue
> kernel that always boots in case of failover.
> Which one is that? How do I get that, like below?

I'm not familiar with that rescue kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
March 24, 2021 04:06AM
I mean, since my /dev/mtdblock1 partition is of a problem I still can boot if I dont stop boot process. As I understand it boots from some other default partition:


Enable HD1 
Enable HD2 
 et:
I  port I Interface I PHY address

1 egiga0 I    RGMII        In—Band
1 egigal      RGMII        In—Band
1 egiga2 I SGMII 0x00 
egiga0, egigal, egiga2 [PRIME] 
Hit any key to stop autoboot: 0 
nand — NAND sub—system

Usage:
nand info — show available NAND devices
nand device [dev] — show or set current device 
nand read — addr off partition size
nand write — addr offipartition size
    read/write 'size' bytes starting at offset 'off' 
    to/from memory address 'addr', skipping bad blocks.
nand read. raw — addr offlpartition [count] 
nand write. raw — addr off partition [count]
    Use read.raw/write.raw to avoid ECC and access the flash as—is.
nand write.trimffs — addr offipartition size
    write 'size' bytes starting at offset 'off' from memory address
    'addr', skipping bad blocks and dropping any pages at the end
    of eraseblocks that contain only OxFF
nand erase[.spread] [clean] off size — erase 'size' bytes from offset 'off'
    With '.spread', erase enough for given file size, otherwise,
    'size' includes skipped bad blocks.
nand erase.part [clean] partition — erase entire mtd partition'
nand erase.chip [clean] — erase entire chip' 
nand bad — show bad blocks
nand dump[.00b] off — dump page
nand scrub [—y] off size 1 scrub.part partition 1 scrub.chip
    really clean NAND erasing bad blocks (UNSAFE)
nand markbad off [...] — mark bad block(s) at offset (UNSAFE)
nand biterr off — make a bit error at offset (UNSAFE)

 AND read: device 0 offset 0xa00000, size 0x500000 
 5242880 bytes read: OK
•# Booting image at 02000020 ...

 AND read: device 0 offset 0xc800800, size 0xf00000 
 15728640 bytes read: OK
•# Booting image at 00a00000
•# Booting kernel from Legacy Image at 00a00000 
   Image Name:    Linux-382
   Created:       2015-08-02    3:54:03 UTC
   Image Type:    ARM Linux Kernel Image (uncompressed)
   Data Size:     4093292 Bytes = 3.9 MiB
   Load Address: 00008000 
   Entry Point: 00008000 
   Verifying Checksum OK
•# Loading init Ramdisk from Legacy Image at 00e00000
   Image Name:    Ramdisk
   Created:       2015-10-05    5:02:44 UTC
   Image Type:    ARM Linux RAMDisk Image (gzip compressed)
   Data Size:     7010744 Bytes = 6.7 MiB
   Load Address: 00e00000 
   Entry Point: 00e00000 
   Verifying Checksum       OK 
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU Ox0
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.10.39 (kman@kmachine) (gcc version 4.6.4 (Linaro GCC branch-4.6.4. Marvell GCC Dev 201310-2126.3d181f66 64K MAXPAGESIZE ALI 
GN) ) #1 SMP Sun Aug 2 11:53:57 CST 2015 2014T30p5 Build—git3e9fe59
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
 Machine: Marvell Armada 380/381/382/385/388 (Device Tree), model: Marvell Armada 385 Development Board
bootconsole [earlycon0] enabled
 Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 1 pages/cpu @c09d0000 s8320 r8192 d16256 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32737 
Kernel command line: root=/dev/ram console=ttyS0,115200 earlyprintk=serial 
PID hash table entries: 4096 (order: —1, 16384 bytes)

So I’m trying to understand which one is that boots fine. So I can copy it to flash drive (with dd) and try to boot with that old kernel from flash drive. As we see above this kernel 100% boots fine. If that will not do so from USB then the problem is something else. Then I will stop trying different kernels and will try to look somewhere else.
Re: Debian on WD MyCloud EX2 Ultra
April 08, 2021 04:15AM
Just a remark, I don’t have any HDD attached to the device, only the flash drive which I use to boot the kernel. Can that be a problem?
Re: Debian on WD MyCloud EX2 Ultra
April 08, 2021 04:27PM
vzhilov,

> Just a remark, I don’t have any HDD attached to
> the device, only the flash drive which I use to
> boot the kernel. Can that be a problem?

Of course. There must be a rootfs somewhere on your system to boot into Debian.

The kernel has started to boot:
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU Ox0
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.10.39 (kman@kmachine) (gcc version 4.6.4 (Linaro GCC branch-4.6.4. Marvell GCC Dev 201310-2126.3d181f66 64K MAXPAGESIZE ALI 
GN) ) #1 SMP Sun Aug 2 11:53:57 CST 2015 2014T30p5 Build—git3e9fe59
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
 Machine: Marvell Armada 380/381/382/385/388 (Device Tree), model: Marvell Armada 385 Development Board
bootconsole [earlycon0] enabled
 Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 1 pages/cpu @c09d0000 s8320 r8192 d16256 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32737 
Kernel command line: root=/dev/ram console=ttyS0,115200 earlyprintk=serial 
PID hash table entries: 4096 (order: —1, 16384 bytes)

However, is this the only output you see on serial console and it stopped?

And your bootargs told the kernel to look for the rootfs on RAID, not on USB.

Kernel command line: root=/dev/ram console=ttyS0,115200 earlyprintk=serial

If the only drive plugged in is the USB with rootfs on it, then the root device should be:

root=/dev/sda1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
November 24, 2022 01:53PM
I think it is my exactly same situation.. totally silence.

Marvell>> fatload usb 0:1 0x02000000 boot_mio/uImage                                                                                        
reading boot_mio/uImage                                                                                                                     
3886355 bytes read in 153 ms (24.2 MiB/s)                                                                                                                                                                                                         
Marvell>> setenv fdt_skip_update yes                                                                                                        
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                            
Marvell>> bootm 0x02000000                                                                                                                  
## Booting image at 02000000 ...                                                                                                            
## Booting kernel from Legacy Image at 02000000 ...                                                                                         
   Image Name:   WDMC-Gen2                                                                                                                  
   Created:      2022-11-23  15:00:20 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    3886291 Bytes = 3.7 MiB                                                                                                    
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK



Edited 1 time(s). Last edit at 11/24/2022 01:58PM by i5Js.
Re: Debian on WD MyCloud EX2 Ultra
November 24, 2022 02:39PM
Testing with one of your kernels

Marvell>> usb start                                                                                                                         
(Re)start USB...                                                                                                                            
USB0:   Port (usbActive) : 1    Interface (usbType = 3) : USB XHCI 1.00                                                                     
scanning bus 0 for devices... 2 USB Device(s) found                                                                                         
       scanning usb for storage devices... 1 Storage Device(s) found                                                                        
       scanning usb for ethernet devices... 0 Ethernet Device(s) found                                                                      
Marvell>> fatload usb 0:1 0x02000000 boot/uimage                                                                                            
reading boot/uimage                                                                                                                         
5076006 bytes read in 195 ms (24.8 MiB/s)                                                                                                   
Marvell>> setenv fdt_skip_update yes                                                                                                                                                                                                            
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                            
Marvell>> bootm 0x02000000                                                                                                                  
## Booting image at 02000000 ...                                                                                                            
## Booting kernel from Legacy Image at 02000000 ...                                                                                         
   Image Name:   Linux-5.2.9-mvebu-tld-1                                                                                                    
   Created:      2022-11-24  20:26:21 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    5075942 Bytes = 4.8 MiB                                                                                                    
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK             
Re: Debian on WD MyCloud EX2 Ultra
January 18, 2023 04:08AM
Hi guys, i had modded my ex2 ultra with the following guide:

https://wd.hides.su/wdnas.el8.website/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/_info_EN.txt

My rootfs is currently on my Radi 1 hdd's:

mount /dev/md1 /mnt/root

I am on the kernel used by that guide (4.15 RC6) and i want to update it to at least 5.1.x without loosing my data / configuration.

Can you guys please help me with that?

Thank you so much in advance



Edited 1 time(s). Last edit at 01/18/2023 10:10AM by marcexeu.
Re: Debian on WD MyCloud EX2 Ultra
January 18, 2023 02:35PM
marcexeu,

> I am on the kernel used by that guide (4.15 RC6)
> and i want to update it to at least 5.1.x without
> loosing my data / configuration
.

Whatever you will decide, you should backup the rootfs before doing anything.

The kernel is recent enough
wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/debian-stretch-rootfs.tar.xz

that you could potentially upgrade the kernel and also the stretch rootfs to some later Debian version. But the rootfs upgrade will be a massive change.

Debian stretch is too old. Have you upgrade Debian, and to what version?

You will need serial console. The kernel files can be temporarily on USB or tftp, so you can boot it into your RAID rootfs, so you can see that it work. Booting might have problem depending on what Debian version is on your rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on WD MyCloud EX2 Ultra
January 19, 2023 10:36AM
I am currently on debian 11 with kernel Linux-4.15.0-rc6 but i do not have a serial cable.
Looks like i need to update uImage and URamdisk in case i want to upgrade kernel to 5.x or superior.

Update it loosing data on roots is ok if necessary (i can reinstall samba, trasmission and openvpn server), i think what i need is uImage and Ramdisk compactible with a newer kernel + to untar the new kernel to my rootfs right?
Re: Debian on WD MyCloud EX2 Ultra
January 19, 2023 04:26PM
> I am currently on debian 11 with kernel
> Linux-4.15.0-rc6

Great! then you could install new kernel linux-5.15.5-mvebu-tld-1-bodhi.tar.bz2 or the latest linux-6.0.7-mvebu-tld-1-bodhi.tar.bz2 But try it out with tftp or USB first.

> but i do not have a serial cable.

That will make quite risky.

>
> Looks like i need to update uImage and URamdisk in
> case i want to upgrade kernel to 5.x or superior.
>
>
> Update it loosing data on roots is ok if necessary
> (i can reinstall samba, trasmission and openvpn
> server), i think what i need is uImage and Ramdisk
> compactible with a newer kernel + to untar the new
> kernel to my rootfs right?

No. You are booting with the kernel stored on flash, and rootfs on RAID. Eventhough the kernel is installed on the rootfs, kernel files need to be copied to NAND like you did before in that installation.

Quote
https://wd.hides.su/wdnas.el8.website/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/_info_EN.txt

dd if=/dev/zero of=/dev/mtdblock1
dd if=uImage of=/dev/mtdblock1
dd if=/dev/zero of=/dev/mtdblock2
dd if=uRamdisk of=/dev/mtdblock2

The flashing above is the risky part. If it does not work, then you have to connect serial console to recover (it is painful to do so). So serial console will allow you to boot the new kernel using tftp or USB storage first.

Or one of the users in this working thread can volunteer to flash the new kernel and boot that way so you can be sure it will work.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/19/2023 04:26PM by bodhi.
Re: Debian on WD MyCloud EX2 Ultra
January 20, 2023 02:26AM
Thank you, there is a recovery mode from usb on this device for re-flashing the uImage and uRamdisk, so no issues with:

dd if=/dev/zero of=/dev/mtdblock1
dd if=uImage of=/dev/mtdblock1
dd if=/dev/zero of=/dev/mtdblock2
dd if=uRamdisk of=/dev/mtdblock2

If possible i would like to update it to kernel 6.0.7, if i undestood it correclty the process is:

1) Unpack kernel on Rootfs
2) Flash uImage
3) Flash uRamdisk
4) reboot

right?

So now what i need is only the uImage and uRamdisk that workds with 6.0.7, but i do not have a dtd file, and even if i found one, i dont know how to configure it to boot from my sata hdd. Can you please help me on that?

Thank you in advance!
Re: Debian on WD MyCloud EX2 Ultra
January 20, 2023 03:19PM
marcexeu,

> 1) Unpack kernel on Rootfs
> 2) Flash uImage
> 3) Flash uRamdisk
> 4) reboot
>
> right?

Incorrect. What the above does is an intermediate step that hopefully will boot the system, but not a full installation.

Here is the full kernel installation in my release thread.

Quote

Updated 09 Nov 2022:

Kernel 6.0.7-mvebu-tld-1 package has been uploaded.

New/Updated in this release:

- General kernel upgrade.

Latest Linux kernel 6.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-6.0.7-mvebu-tld-1-bodhi.tar.bz2

md5:
bfb1d7cf103f501b991e21b9886db4f6
sha256:
dcf50e17352f7d84ab606abdef374ec0d3db1c39b242c6ae7924b7283edc3ead

As always, please check the hash of your download!

There are 6 files in this tarball:

Quote

linux-image-6.0.7-mvebu-tld-1_1.0_armhf.deb
linux-headers-6.0.7-mvebu-tld-1_1.0_armhf.deb
zImage-6.0.7-mvebu-tld-1
config-6.0.7-mvebu-tld-1
linux-dtb-6.0.7-mvebu-tld-1.tar
linux-6.0.7-mvebu-tld-1.patch

Installation

NOTE: the following steps are for a general kernel upgrade. For initial installation, please see "Installation Instruction for specific boxes" in the thread description at the top of this release thread.

1. Backup your current zImage, uImage, and uInitrd. In the /boot directory, these are files for your current kernel (xx.xx.xx is the version number):
uInitrd
uImage
zImage-xx.xx.xx-mvebu-xxx
initrd.img-xx.xx.xx-mvebu-xxx
System.map-xx.xx.xx-mvebu-xxx
vmlinuz-xx.xx.xx-mvebu-xxx
config-xx.xx.xx-mvebu-xxx
dts/

2. Extract the kernel and the DTB files in the archive:

cd /boot
tar -xjf linux-6.0.7-mvebu-tld-1-bodhi.tar.bz2
tar -xf linux-dtb-6.0.7-mvebu-tld-1.tar

3. And install it with dpkg. Remove flash-kernel first to avoid potential problem (if flash-kernel was not installed then you'll see some error output):

cd /boot
apt-get remove flash-kernel
dpkg -i linux-image-6.0.7-mvebu-tld-1_1.0_armhf.deb

4. Create uImage and uInitrd (kernel file initrd.img-6.0.7-mvebu-tld-1 was generated by dpkg in step 3). I am using the Zyxel NAS326 as an example here. Please replace armada-380-zyxel-nas326.dtb below with the appropriate DTB name for your box.

cd /boot
cp -a zImage-6.0.7-mvebu-tld-1 zImage.fdt
cat dts/armada-380-zyxel-nas326.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-6.0.7-mvebu-tld-1 -d zImage.fdt uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.0.7-mvebu-tld-1 -d initrd.img-6.0.7-mvebu-tld-1 uInitrd

5. The new uImage and uInitrd files should be created in /boot directory now. You're ready to reboot the system:
sync
sync
sync
shutdown -r now

Just run uImage and uInitrd (i.e. uRamdisk) will boot the system into your rootfs (a different rootfs than the kernel is intended for). Most likely it will boot your current rootfs, but it will encounter problem later.

Step 3 above will install the kernel, and populate other parts of the rootfs.

>
> So now what i need is only the uImage and uRamdisk
> that workds with 6.0.7, but i do not have a dtd
> file, and even if i found one,

Step 4 above will append the DTB to uImage for kernel 6.0.7.

> i dont know how to
> configure it to boot from my sata hdd. Can you
> please help me on that?

Once you can boot the kernel, it will find your rootfs on RAID. When you get to that point, I can help. Also you can read this thread to see what other people have done.

========

Note:

The new kernel uImage and uInitrd size are substantially larger than the old kernel. So the flashing must take into account about the difference. And the boot command in u-boot might have to be adjusted to boot the new kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/20/2023 03:42PM by bodhi.
Author:

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: