Welcome! Log In Create A New Profile

Advanced

WD MyCloud Gen2 (Glacier, Armada 375)

Posted by Miraculix666 
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
September 15, 2021 05:42PM
Hi

It looks that your 5.12 and 5.13 configs have CONFIG_MVPP2_PTP enabled.

Kernel 5.13.17 boots fine when CONFIG_MVPP2_PTP is disabled.

Need to investigate later if latest changes to drivers/net/ethernet/marvell/mvpp2 will allow to boot with CONFIG_MVPP2_PTP enabled.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
September 15, 2021 07:33PM
osa,

> It looks that your 5.12 and 5.13 configs have
> CONFIG_MVPP2_PTP enabled.
>
> Kernel 5.13.17 boots fine when CONFIG_MVPP2_PTP is
> disabled.
>
> Need to investigate later if latest changes to
> drivers/net/ethernet/marvell/mvpp2 will allow to
> boot with CONFIG_MVPP2_PTP enabled.

Right on! that's what I saw yesterday. A problem with Kconfig, probably.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
September 16, 2021 08:43AM
Hi,

Kernel 5.13.17 segfaults with CONFIG_MVPP2_PTP enabled, so for now disabling it would be necessary.
I'm not sure if next kernel will fit into 5MB size limit, so this might be the last working kernel for this box
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 05, 2021 04:11PM
osa,

> I'm not sure if next kernel will fit into 5MB size
> limit, so this might be the last working kernel
> for this box

I'm reconfiguring this kernel and moving some drivers out to initrd. Looks like we'll keep it smaller than 5MB easily.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 07, 2021 07:15AM
> like we'll keep it smaller than 5MB easily.

Sounds great.
Please, make sure all marvel sata + ext3/4 drivers are built into kernel.
I found, that initrd is loaded into memory, but is not used - looks like kernel is overwriting some memory regions (on decompression?) and uses drivers from root partition. For that reason default debian 11 kernel/initrd cannot be used to boot on wd



Edited 2 time(s). Last edit at 10/07/2021 07:27AM by osa.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 07, 2021 03:57PM
osa,

> Please, make sure all marvel sata + ext3/4 drivers
> are built into kernel.

These are important drivers so I always make sure they are built into the kernel.

> I found, that initrd is loaded into memory, but is
> not used - looks like kernel is overwriting some
> memory regions (on decompression?)

I don't think it is a kernel decompression problem. Sounds like u-boot problem that we have not solved. Using stock u-boot and cannot change the load adresses will cause the initrd to be corrupted if it is too big. And the standard Debian 10/11 always produce a large initrd, my kernel build also result in a large initrd.

Perhaps we shoud look at the GPL source for this u-boot and try to pach it to solve this once and for all.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 09, 2021 08:50AM
Bodhi,
it looks this problem was for a longer time, but i didn't paid attention.
I'll dig deeper to find out if first supported kernels (5.2/5.3?) had this issue or it is related with changing compression to xz.

There's no u-boot source code in wd's gpl sources.


BootROM - 1.51
Booting from SPI flash


General initialization - Version: 1.0.0
High speed PHY - Version: 0.1.1 (COM-PHY-V20) 
USB2 UTMI PHY initialized succesfully
USB2 UTMI PHY initialized succesfully
High speed PHY - Ended Successfully

DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run with PBS.
DDR3 Training Sequence - Ended Successfully 
BootROM: Image checksum verification PASSED

 ** LOADER **


U-Boot 2013.01_v1.03 (Nov 20 2014 - 16:39:45) Marvell version: 2014_T2.0p3

Board: WD_Glacier_DB-88F6720-V2
SoC:   MV88F6720 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 800 [MHz]
       L2     @ 400 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 534 [MHz]
       DDR 16Bit Width, FastPath Memory Access, DLB Enabled
DRAM:  512 MiB

Map:   Code:		0x1fed6000:0x1ff92c90
       BSS:		0x1ffefa20
       Stack:		0x1f9c5f20
       Heap:		0x1f9c6000:0x1fed6000

SF: Detected MX25L8006E with page size 64 KiB, total 1 MiB
PCI-e 0: Detected No Link.
PCI-e 1: Detected No Link.
SF: Detected MX25L8006E with page size 64 KiB, total 1 MiB
MAC addr: 00:90:A9:ED:7B:9A
### Loading Firmware from USB 3.0 Disk ###
USB2.0 0: Host Mode
USB2.0 1: Device Mode
USB3.0 0: Host Mode
Board configuration detected:
	GE-PHY-0 on MAC0
SERDES configuration:
	Lane #0: PCIe0
	Lane #1: PCIe1
	Lane #2: SATA0
	Lane #3: USB3
Net:   egiga0 [PRIME]
*** ERROR: ping address not given
Hit any key to stop autoboot:  0 
(Re)start USB...
USB0:   Port (usbActive) : 0	Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
## Booting image at 00a00000 ...
### Loading Firmware from USB 2.0 Disk ###
(Re)start USB...
USB0:   Port (usbActive) : 1	Interface (usbType = 2) : USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
## Booting image at 00a00000 ...
### Loading Firmware from Disk ###

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
  Device 0 @ 0 0:
Model: WDC WD800JD-75MSA3                       Firm: 10.01E04 Ser#:      WD-WMAM9CT05924
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76293.9 MB = 74.5 GB (156250000 x 512)

5181396 bytes read in 169 ms (29.2 MiB/s)
9659113 bytes read in 276 ms (33.4 MiB/s)
## Booting image at 00a00000 ...
## Booting kernel from Legacy Image at 00a00000 ...
   Image Name:   Linux-5.10.3-mvebu-tld-1
   Created:      2020-12-28  22:09:37 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5181332 Bytes = 4.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00f00000 ...
   Image Name:   initramfs-5.10.3-mvebu-tld-1
   Created:      2020-12-28  22:10:01 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9659049 Bytes = 9.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

DTB:0x004F5BB8 (0x000033DC)
C:0x000080C0-0x004F9020->0x01171700-0x01662660
DTB:0x0165F1F8 (0x00003459)
Uncompressing Linux... done, booting the kernel.
[    0.000000][    T0] Booting Linux on physical CPU 0x0
[    0.000000][    T0] Linux version 5.10.3-mvebu-tld-1 (root@debian) (gcc (Debian 8.3.0-6) 8.3.0, GNU ld (GNU Binutils for Debian) 2.31.1) 
#1 SMP PREEMPT Mon Dec 28 04:19:55 PST 2020
[    0.000000][    T0] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000][    T0] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000][    T0] OF: fdt: Machine model: WD MyCloud Gen2
[    0.000000][    T0] Memory policy: Data cache writealloc
[    0.000000][    T0] INITRD: 0x00f00000+0x00937000 overlaps in-use memory region - disabling initrd
[    0.000000][    T0] Zone ranges:
[    0.000000][    T0]   Normal   [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0]   HighMem  empty
[    0.000000][    T0] Movable zone start for each node
[    0.000000][    T0] Early memory node ranges
[    0.000000][    T0]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] percpu: Embedded 20 pages/cpu s52812 r8192 d20916 u81920
[    0.000000][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 130048
[    0.000000][    T0] Kernel command line: root=/dev/sda2 console=ttyS0,115200
[    0.000000][    T0] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000][    T0] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000][    T0] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000][    T0] Memory: 502352K/524288K available (10240K kernel code, 1474K rwdata, 3080K rodata, 1024K init, 357K bss, 21936K reser
ved, 0K cma-reserved, 0K highmem)
[    0.000000][    T0] random: get_random_u32 called from ____cache_alloc+0x404/0x78c with crng_init=0
[    0.000000][    T0] rcu: Preemptible hierarchical RCU implementation.

Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 09, 2021 03:46PM
osa,

Quote

> it looks this problem was for a longer time, but i
> didn't paid attention.
> I'll dig deeper to find out if first supported
> kernels (5.2/5.3?) had this issue or it is related
> with changing compression to xz.

I think it has been there for quite a long time, probably from day one that you and others tried to boot the new Debian kernel. I recalled seeing it, but since you and other can boot and not raising the question so I forgot to revisit this issue.

Quote

> [ 0.000000][ T0] INITRD: 0x00f00000+0x00937000 overlaps in-use memory region - disabling initrd

This means the load address for initrd is not good, its size is too big. Note that stock kernel has a much smaller initrd.

Since there is no u-boot GPL source, you would have find a workaround to load uInitrd at higher memory address.

Let's think about this a bit. If I remembered this issue incorrectly ( then there was a kernel version that work in the past).

Here are my oldest installed kernel initrd. if the uInitrd.4.19.1-mvebu-tld-1 works then it is easy to fix this problem. If not then we can try to figure out a way.

-rw-r--r-- 1 root root 8.3M Nov  9  2018 uInitrd.4.19.1-mvebu-tld-1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 09, 2021 04:05PM
osa,

Try this to see if it works

In serial console, before booting:
setenv initrd_high 0xffffffff
and then
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
October 14, 2021 11:00PM
megal0maniac,

I thought about your kernel panic problem some more. It might be the rootfs.

https://forum.doozan.com/read.php?2,94839,122549#msg-122549

I'd like to see what your rootfs looks like.

Mount it on another Linux box and assuming it is mounted at /media/sdb1.

cd /media/sdb1
ls -latr
ls -latr /media/sdb1/boot/
mount
cat /media/sdb1/etc/fstab

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



Edited 3 time(s). Last edit at 10/15/2021 02:23AM by bodhi.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
December 27, 2021 01:33AM
Good afternoon, I bought a glacier gen2 375 without a disk, purple lights up when turned on is this normal? there is no USB flash drive loading or the local network is not loaded whether the loader is damaged, it can flash it, I tried all the instructions, I mark up the disk in linux ubuntu 20.4 installed on wmware, I fill 5 images into their places, I connect the disk and there is no download
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
January 06, 2022 04:34PM
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 04, 2023 02:38PM
Hi

I'm probably the only user of bodhi's kernel on this box, but i just want to let you know

I just tested linux-6.3.8 kernel and it fits into 5MB limit and boots just fine.
I looked at sizes of all 6.x kernels and they should fit too



Edited 1 time(s). Last edit at 07/04/2023 02:39PM by osa.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2023 04:09PM
thanks for the feedback @osa

you will find there are more people using and referencing the work on this peaceful corner of the intertubes than post... its always good to hear when people feedback on good work done by the maestro

============================
Breaking stuff since 1994 :-)
============================
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 06, 2023 11:08AM
Indeed much appreciated, thanks osa!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 08, 2023 06:45AM
EDIT:

eroneous post - deleted

============================
Breaking stuff since 1994 :-)
============================



Edited 1 time(s). Last edit at 07/08/2023 02:52PM by Gravelrash.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 09:16AM
osa Wrote:
-------------------------------------------------------
> It's still work in progress
>
> https://translate.google.com/translate?sl=pl&tl=en&u=http://osowiecki.net/debian-na-wd-my-cloud-2-gen/
>
> I believe all that stuff can be run as a single
> script so probably easiest way to install.
> Now it's time to write recovery manuals ;-)
>
> Comments and suggestions are appreciated


Have tried this manual from boot with Fox's unbricking usb but his distro have not dpkg package, also have not apt and apt-get, so I stuck here. From what distro I can boot to finish this Osa'a manual?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 01:22PM
@doppelgospelhm,

> Have tried this manual from boot with
> Fox's
> unbricking usb
but his distro have not
> dpkg package, also have not apt and
> apt-get, so I stuck here. From what distro
> I can boot to finish this Osa'a manual?

Use my latest release rootfs Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 (16 Dec 2023)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 01:52PM
That's exactly the distro I wanted to install. But I have a new hard drive with no any OS on it and need to boot from a USB. What do I need to do to do that? Copy uImage and uRamdisk from Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 (16 Dec 2023) to USB and boot from it?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 02:30PM
> need to boot from a USB. What do I need to do to
> do that? Copy uImage and uRamdisk from
> Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 (16
> Dec 2023) to USB and boot from it?

No. You need to follow the release instruction to create the full USB rootfs. Scroll down to the section 16 Dec 2023.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 03:53PM
So I need a PC or laptop with some Linux to prepare USB (like in the section 16 Dec 2023), then boot WD MyCloud with this USB and then I can do this manual https://translate.google.com/translate?sl=pl&tl=en&u=http://osowiecki.net/debian-na-wd-my-cloud-2-gen/ , right? Is there any way to install just this Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 (16 Dec 2023) to WD MyCloud (without a newest kernel update) in an easier way?

For example, connect hard drive from WD MyCloud to some Linux PC and follow instructions in the section 16 Dec 2023 to mnt/sda3? This way I don't need a USB and can install Debian directly on the hard drive. Or it is not possible?



Edited 1 time(s). Last edit at 05/04/2024 03:59PM by doppelgospelhm.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 04:30PM
> For example, connect hard drive from WD MyCloud to
> some Linux PC and follow instructions in the
> section 16 Dec 2023 to mnt/sda3? This way I don't
> need a USB and can install Debian directly on the
> hard drive. Or it is not possible?

Yes, that' the idea. You can run the rootfs on either USB or HDD. The rootfs installation is the same.

However, I have not looked at osa's instruction on that site so don't know. But if the kernel uImage and uInitrd are stored on flash, then USB and HDD rootfs booting are identical.

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



Edited 1 time(s). Last edit at 05/04/2024 04:32PM by bodhi.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 04, 2024 05:32PM
Good, thank you!

bodhi Wrote:
-------------------------------------------------------
> But if the kernel uImage
> and uInitrd are stored on flash

Sorry, didn't understand, what flash do you mean?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 05, 2024 01:32PM
@doppelgospelhm,

> bodhi Wrote:
> -------------------------------------------------------
> > But if the kernel uImage
> > and uInitrd are stored on flash
>
> Sorry, didn't understand, what flash do you mean?

Don't worry about it. We should run the kernel from USB or HDD if possible.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 05, 2024 09:34PM
According to instructions in the section 16 Dec 2023 we make uImage but not uInitrd, do I need also do something like this:
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.6.2-mvebu-tld-1 -d initrd.img-6.6.2-mvebu-tld-1 uInitrd
or I should leave uInitrd by default from tarball?
(on WD MyCloud Gen2 it is called uRamdisk, so I just renamed it)

By now WD MyCloud Gen2 shines blue all the time.
Where I can get boot log?



Edited 4 time(s). Last edit at 05/05/2024 10:41PM by doppelgospelhm.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 05, 2024 11:03PM
Unfortunatly links are dead on linux-5.11.7-mvebu-tld-1-bodhi.tar.bz2 and linux-5.10.7-mvebu-tld-1-bodhi.tar.bz2, any chance to reupolad them?



Edited 1 time(s). Last edit at 05/05/2024 11:04PM by doppelgospelhm.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 12:29AM
@doppelgospelhm,

> Unfortunatly links are dead on
> linux-5.11.7-mvebu-tld-1-bodhi.tar.bz2 and
> linux-5.10.7-mvebu-tld-1-bodhi.tar.bz2, any chance
> to reupolad them?

Use the latest kernel: linux-6.8.7-mvebu-tld-1-bodhi.tar.bz2 (19 Apr 2024). It shoud work the same.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 07:27AM
Hello :)
After a 3 year break, I pulled this board out of the cupboard and gave it another try. It "just works" with the 6.6.2-mvebu-tld-1 rootfs.
However, some observations:

  • The stock u-boot does not have a saveenv command, so no way to change anything from there
  • fw_printenv doesn't work off the bat, even with the right addresses. But running printenv in u-boot and copying those values to /etc/u-boot-initial-env allows you to start tweaking variables, and they reflect in u-boot \:D/
  • Unfortunately, even though other parameters persist, stock u-boot appears to overwrite bootcmd :(

I've been trying to decompile u-boot without much success, to figure out where/how it overwrites bootcmd, or some other variable I could hijack. So I have no persistent way of booting currently.

WD download links also seem to have dried up, although I don't know whether the sources for u-boot were ever made available for this device.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 07:33AM
What I tried at this moment:
Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 - no success
Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar - no success
Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar - no success (no dts for WD MyCloud Gen2)

osa Wrote:
-------------------------------------------------------
> Hi
>
> It looks that your 5.12 and 5.13 configs have
> CONFIG_MVPP2_PTP enabled.
>
> Kernel 5.13.17 boots fine when CONFIG_MVPP2_PTP is
> disabled.
>
> Need to investigate later if latest changes to
> drivers/net/ethernet/marvell/mvpp2 will allow to
> boot with CONFIG_MVPP2_PTP enabled.


Is it fixed in Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar or how can I fix this CONFIG_MVPP2_PTP?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 07:43AM
megal0maniac Wrote:
-------------------------------------------------------
> Hello :)
> After a 3 year break, I pulled this board out of
> the cupboard and gave it another try. It "just
> works" with the 6.6.2-mvebu-tld-1 rootfs.


Could you provide installation steps please? For me this didn't work:
parted /dev/sda
mkpart primary 0G 1G
mkpart primary 4G 100%
mkpart primary 1G 4G
q
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
mkswap /dev/sda1

# Mounting USB and HD
mkdir /mnt/sda3
mount /dev/sda3 /mnt/sda3
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb

# Extract and patch rootfs for WDMyCloudGen2
tar -xjvf /mnt/usb/boot/Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 -C /mnt/sda3
chroot /mnt/sda3

sed -i '/rootfs/c\/dev/sda3 / ext4 noatime,errors=remount-ro 0 1' /etc/fstab
sed -i '/mtd1/c\/dev/mtd0 0xf0000 0x10000 0x10000 1' /etc/fw_env.config

# Generating Kernel
cd /boot
cp -a uImage uImage.orig
cp -a zImage-6.6.2-mvebu-tld-1 zImage.fdt 
cat dts/armada-375-wd-mycloud-gen2.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-6.6.2-mvebu-tld-1 -d zImage.fdt uImage

cp -a uInitrd uRamdisk

# Let's Start! REMOVE USB drive
exit
sync
umount /media/sdb3
umount /media/usb
reboot -f



Edited 1 time(s). Last edit at 05/06/2024 07:44AM by doppelgospelhm.
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: