Welcome! Log In Create A New Profile

Advanced

WD MyCloud Gen2 (Glacier, Armada 375)

Posted by Miraculix666 
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 09:11AM
doppelgospelhm Wrote:
-------------------------------------------------------
> Could you provide installation steps please? For
> me this didn't work:

1. You're only building the uImage, not the uInitrd
2. You need to ensure that your USB disk is FAT formatted
3. You need to copy uImage and uInitrd to a /boot/ folder on the USB, and rename uInitrd to uRamdisk
4. You may also need to modify your bootargs on the device, this needs to be done on the device itself otherwise it won't find your root partition and you'll get flashing red light (see the last steps under step 4 in osa's tutorial

The additional instructions look like this:
# Before chroot
mkdir /mnt/usb/boot
# Inside chroot
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
# Exit chroot
cp /mnt/sdb3/boot/uImage /mnt/usb/boot/uImage
cp /mnt/sdb3/boot/uInitrd /mnt/usb/boot/uRamdisk

Then the command to set the boot args is
fw_setenv bootargs 'root=/dev/sda3 console=ttyS0,115200'
but it has to be done on the device as it alters the contents of the flash.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:02AM
So decompiling u-boot wasn't a complete waste :)
Setting the bootcmd variable doesn't work, but the built-in process is as follows:
### Loading Firmware from USB 2.0 Disk ###
usb reset; fatload usb 0:1 0xa00000 /boot/uImage; fatload usb 0:1 0xf00000 /boot/uRamdisk
### Loading Firmware from Disk ###
ide reset; ext2load ide 0:3 0xa00000 /boot/uImage; ext2load ide 0:3 0xf00000 /boot/uRamdisk
### Loading Rescure Firmware from Disk ###
ext2load ide 0:5 0xa00000 /boot/uImage; ext2load ide 0:5 0xf00000 /boot/uRamdisk
### Start network installation ###
dhcp; tftp 0xa00000 uImage

Knowing this, instead of bootstrapping with a USB, I just created a third partition on the disk, formatted ext2, created /boot folder and put uImage/uRamdisk in there. Could even script it in post-update.d. It's an extra step when upgrading kernel but better than needing a USB to boot from HDD.
I can updated bootargs, but even if I couldn't, I can embed them in the .dts so that would solve that too. Finally a useable board!
Thanks @bodhi for all your work!
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:19AM
megal0maniac Wrote:
-------------------------------------------------------

> Then the command to set the boot args is
>
> fw_setenv bootargs 'root=/dev/sda3
> console=ttyS0,115200'
>
> but it has to be done on the device as it alters
> the contents of the flash.

Thank you! Is set the boot args mandatorily? Because I relied on Franceso's post and there is no bootargs set. Also is it safe to set boot args, like can I bricking my device with this settings? Or I can just format sda3 if something goes wrong and start it again?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:31AM
megal0maniac Wrote:
-------------------------------------------------------

>
> The additional instructions look like this:
>
> cp /mnt/sdb3/boot/uImage /mnt/usb/boot/uImage
> cp /mnt/sdb3/boot/uInitrd /mnt/usb/boot/uRamdisk
>

why we need to copy uImage and uRamdisk on USB? As I know device boot from sda3, so rootfs, uImage and uRamdisk are supposed to be there.

in my case i use FAT32 USB with boot folder with these files in it https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/usbrecovery.tar.gz, so device booted from USB correctly with Fox's mini OS, then i connect to device with telnet and do all stuff.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 07:48AM
doppelgospelhm Wrote:
-------------------------------------------------------
> why we need to copy uImage and uRamdisk on USB? As
> I know device boot from sda3, so rootfs, uImage
> and uRamdisk are supposed to be there.

Sorry, I think that you and I are trying to do things quite differently so I'm still getting up to speed with the other process. In my case, I don't have the original drive (or firmware), just the bare board with serial port access so I'm fairly free to do whatever - I'm not trying to preserve anything.

Once you have Fox's mini OS installed on a USB, there's no reason to do anything with a USB so the instructions you posted confused me. Are you trying to preserve the original firmware?

The bootargs, as far as I understand, are necessary. At a minimum they tell the kernel where to find the root filesystem. There is a way to embed the bootargs in the dtb file, but that isn't done here so I don't see how the system would boot based on those instructions. Default bootargs points to /dev/ram for rootfs. I'm waiting for @bodhi to jump in and make all of this clear :P
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 03:42PM
> based on those instructions. Default bootargs
> points to /dev/ram for rootfs. I'm waiting for
> @bodhi to jump in and make all of this clear :P

Actually I don't know how to help. Since we don't have a complete installation instruction here for this box, I need to see all the steps that you guys use for installation.

- Can this u-boot read from USB and/or HDD using ext2load?
- Can you save the envs at u-boot prompt? especially the bootcmd.
- If you can save envs, does the bootcmd got reset by this u-boot each time it powers up?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 11:18PM
bodhi Wrote:
-------------------------------------------------------
> - Can this u-boot read from USB and/or HDD using
> ext2load?
It can. It has ext4load and fatload as well.

> - Can you save the envs at u-boot prompt?
> especially the bootcmd.
Nope. I have not found a way to persist any env vars from within u-boot. Once booted, fw_saveenv works if you provide initial variables in a file, then it can write the whole environment. BUT, this overwrites the MAC address and serial at the tail end of the flash (could be corrected by making the environment smaller)

> - If you can save envs, does the bootcmd got reset
> by this u-boot each time it powers up?
Yip. All changes and new variables set by fw_setenv reflect in u-boot EXCEPT for bootcmd which gets defaulted by some boot routine. Even then, it seems to be ignored anyway, so you need to configure storage to satisfy one of the three built in commands.

I also made a backup of mtd0 which I’m happy to share. Flash is only 1MiB.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 08, 2024 12:41AM
@megal0maniac,

> Nope. I have not found a way to persist any env
> vars from within u-boot.

> Yip. All changes and new variables set by
> fw_setenv reflect in u-boot EXCEPT for bootcmd
> which gets defaulted by some boot routine. Even
> then, it seems to be ignored anyway, so you need
> to configure storage to satisfy one of the three
> built in commands.
>

OK. Thanks for the refresher. I dealt with too many boards so really hard to keep track things, unless I own the HW or there is an installation guide written here.

Let me build an armada-375 reference board u-boot, hoppefully if it is bootable with kwboot then that's what we will see if it will solve the problem. It might not have everything, but if it is able to set envs and save envs and boot into Debian would make life easier.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 08, 2024 02:31PM
Please try kwboot the attached u-boot image.

uboot.2024.07-rc2-tld-1.db-88f6720.kwb
md5:
806ec0f497725b46b9e0d322719b4d5e
sha256:
c595b3a5794ddb9f7a60e27917b8c2e87db9819039e30b4a64fbcb2407f91955

An example of running kwboot (if you have not run it before): https://forum.doozan.com/read.php?3,51739,51919#msg-51919

If it loads and runs OK, interrupt the count down and see if you can bring up the USB and ping the router:
usb start
setenv ipaddr <some valid IP address in the subnet that this box is connected to>
ping <router IP address>

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2024.07-rc2-tld-1.db-88f6720.kwb (498.8 KB)
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: