Welcome! Log In Create A New Profile

Advanced

WD MyCloud Gen2 (Glacier, Armada 375)

Posted by Miraculix666 
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 30, 2021 04:13PM
Hello

Figured I'd post here rather than revive my dead thread (https://forum.doozan.com/read.php?2,36023,36023)
I followed the instructions (kind of, my device never came with a disk so I used another Linux box) and prepped an hdd with the rootfs, latest kernel, and correct dtb baked into the uImage.
Unfortunately, it's failing in a similar way to how it did in my previous thread ("Unable to handle kernel paging request at virtual address")

I'm using the following to boot it:
setenv bootargs 'root=LABEL=rootfs console=ttyS0,115200'
ide reset; ext4load ide 0:1 0xa00000 /uImage; ext4load ide 0:1 0xf000000 /uInitrd; bootm 0xa00000 0xf000000

For some reason, ext4load won't enter a directory so I copied the files onto the root.
Those addresses came from the existing bootcmd which loads uRamdisk (recovery fw). Any ideas? I've attached the boot log from the point where I enter the commands in the prompt.
Attachments:
open | download - mycloud_boot.log (20 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 30, 2021 07:32PM
Quote

For some reason, ext4load won't enter a directory so I copied the files onto the root.

Sounds like the Ext4 file system on the disk has not been finalized. If you did not specify the "no lazy init" option when you format, it is formatting Ext4 file system in the background. If you recall formatting this HDD took only a few seconds or a minute then it was definitely still formating in the background. Therefore it cannot be used as a boot disk.

U-boot does not recognize this Ext4 behavior.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 01, 2021 04:03AM
Hi bodhi

Unfortunately that doesn't seem to be the issue, the uImage/uInitrd load successfully and it hasn't gotten to the switch-root point by the time it panics.
In any case, I re-formatted the drive with
mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/sda1 -L rootfs
Once it was done, I ran sync and unmounted cleanly. I copied the images to the root again just in case (it's a bit of a process for me to move the drive back and forth)

If I use ext4ls to list the contents, it shows the root contents fine. If I try and list the contents of /boot, it shows an empty dir (lines 132 - 163 of the attached log). Either way, I put the files on the root again so it loads them fine and panics again.

Some things I've noticed:
- The panic is the same as last time I tried this, before we had the dtb (Unable to handle kernel paging request at virtual address xxx)
- Extracting the usb_recovery archive from http://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/ to a USB stick boots fine without any intervention
- There's a "bad CRC" warning on boot. This is concerning since this device was never even switched on with its original drive inside (it was bought for the raw disk and I claimed the enclosure). This means changes to my environment don't persist a reboot. I will need to solve this at some stage

I've tacked on my environment to the end of the file. Looking at it, I don't understand how anything other than USB would boot unless there are some baked-in routines for booting from HDD
Attachments:
open | download - boot.log (33.8 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 01, 2021 05:38AM
Okay, I went over this thread properly and see that I should be able to change bootargs once I'm booted into Debian and can use fw_setenv tool with osa's params. That will write the variable and fix the checksum. So it will only be a tethered boot the first time.

Also, the difference between this time and last time is that last time I also had "junk in compressed archive" in the initrd. Could be a false alarm, the "junk" won't always cause unpacking to fail if the archive data is intact, if I understand it correctly.

So the only problem is this kernel paging request error, and to figure out why I'm getting it and nobody else when I haven't changed anything on the device...
Maybe I will try later to boot from USB instead. First partition FAT32 with uInitrd and uInitrd (uRamdisk) and second partition ext4 with the rootfs
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 01, 2021 06:22AM
megal0maniac,

> Also, the difference between this time and last
> time is that last time I also had "junk in
> compressed archive" in the initrd. Could be a
> false alarm, the "junk" won't always cause
> unpacking to fail if the archive data is intact,
> if I understand it correctly.

It will not fail to continue booting, but eventually will hang. "junk in compressed archive" means the uInitrd was corrupted (i.e cut short because the load address is not far enough in memory and got overwritten). So the text is a bit misleading (the file on disk is OK, but its copy in memory was corrupted).

> So the only problem is this kernel paging request
> error, and to figure out why I'm getting it and
> nobody else when I haven't changed anything on the
> device...

That puzzles me too. But verify that you use the same load addresses for uImage and uInitrd as osa did.

Yes, try to boot with USB only to see if the error occurs the same way.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 01, 2021 07:22AM
Very strange... it fails in exactly the same way. I didn't provide a rootfs because it doesn't get far enough to switch, but I replaced the files on the USB stick and I get the same kernel paging request panic.
I used the exact commands that osa used to generate uImage and uInitrd, with the latest dtb. I'm using the stock load addresses as well and the kernel is <5MB (it says uncompressed but I guess u-boot just doesn't recognise the xz compression?)
Attachments:
open | download - usbboot.log (21.4 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 01, 2021 10:44PM
megal0maniac,

> kernel is <5MB (it says uncompressed but I guess
> u-boot just doesn't recognise the xz compression?)

While u-boot does not understand xz, it does not really do any thing in this case other than loading the image to a memory location. The kernel will uncompress the image on its own.

[    4.940162][    C1] [<c010ccd0>] (arch_cpu_idle) from [<c0afc610>] (default_idle_call+0x30/0x50)
[    4.949004][    C1] [<c0afc610>] (default_idle_call) from [<c0158074>] (do_idle+0x130/0x2ac)
[    4.957501][    C1] [<c0158074>] (do_idle) from [<c01584ec>] (cpu_startup_entry+0x18/0x1c)
[    4.965821][    C1] [<c01584ec>] (cpu_startup_entry) from [<00101e50>] (0x101e50)
[    4.973363][    T1] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Your log looks somewhat like the broken cpu idle. What we did in Armada 370 boxes was explicitly stated that the cpu-idle is broken in the DTS. The Armada 38x series are automatically regcognized as broken cpu-idle in the kernel.

Since the Armada XP cpu idle is working, its cousins (370, 375) originally have cpu idle acitvated. It works for other people with this box, though. But I'm guessing it really does not work in some edge cases.

Perhaps I should make a test DTB for this box with the cpu-idle broken like I did for the Mirabox.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 02, 2021 04:10PM
megal0maniac,

Try booting with the attached DTB.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - armada-375-wd-mycloud-gen2.dtb (13 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2021 07:37AM
Sorry I took so long to get to this, haven't had a chance to look until now.
Unfortunately it does exactly the same thing as before (log attached) so I don't think this is the issue.
I confirmed that the only difference between that dtb and the one packaged with the kernel is the "broken-idle" line under coherency-fabric@21010

I'm not convinced about those addresses, often it seems that the kernel will load and then instead of loading uinitrd, it tries to kick off rescue boot:
Marvell>> ide reset; ext4load ide 0:1 0xa00000 /uImage; ext4load ide 0:1 0xf000000 /uInitrd; bootm 0xa00000 0xf000000

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
  Device 0 @ 0 0:
Model: ST3500418AS                              Firm: CC38     Ser#:             6VMDEBGW
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)

5185308 bytes read in 117 ms (42.3 MiB/s)
9682541 bytes read in 195 ms (47.4 MiB/s)
### Start network installation ###
RX_ICMP
rx_icmp(): Listening to incoming WD ICMP beacons for 3 second!
Error...
rxIcmp - rxIcmp

Usage:
rxIcmp Start Listening to incoming WD ICMP beacons
## Booting image at 00a00000 ...
## Booting kernel from Legacy Image at 00a00000 ...
   Image Name:   Linux-5.12.6-mvebu-tld-1
   Created:      2021-07-05  11:19:12 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5185244 Bytes = 4.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
### Loading Rescure Firmware uRamdisk from USB 2.0 Disk ###
(Re)start USB...

It throws you back to a prompt when everything fails, then you reset, try again and it works

5185308 bytes read in 118 ms (41.9 MiB/s)
9682541 bytes read in 195 ms (47.4 MiB/s)
## Booting image at 00a00000 ...
## Booting kernel from Legacy Image at 00a00000 ...
   Image Name:   Linux-5.12.6-mvebu-tld-1
   Created:      2021-07-05  11:19:12 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5185244 Bytes = 4.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 0f000000 ...
   Image Name:   initramfs-5.12.6-mvebu-tld-1
   Created:      2021-07-05  11:19:34 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9682477 Bytes = 9.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

It's very confusing, the boot behaviour seems random. I've run out of ideas :/
Attachments:
open | download - boot_20210705.log (19.8 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2021 03:32PM
megal0maniac,

> ### Loading Rescure Firmware uRamdisk from USB 2.0
> Disk ###
> (Re)start USB...

When you see this, and stock u-boot envs do not show any thing related, then the rescue check is implemented internally. If there is a USB drive plugged in and you are booting with HDD, it will try to read the rescue FW from that potential rescue thumb drive..

> It's very confusing, the boot behaviour seems
> random. I've run out of ideas :/

So use either USB or HDD, but not both. See if the random behavior will be gone that way.

Regarding the kernel panic, try booting only with serial console (unplug the ethernet cable) and see far you will get it booting.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2021 03:43PM
bodhi Wrote:
-------------------------------------------------------
> So use either USB or HDD, but not both. See if the
> random behavior will be gone that way.

I’m only using the hdd. No usb plugged in

> Regarding the kernel panic, try booting only with
> serial console (unplug the ethernet cable) and see
> far you will get it booting.

This is just serial. Not bothering to connect Ethernet until it actually boots. Nothing connected except HDD, serial and power
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2021 03:45PM
> This is just serial. Not bothering to connect
> Ethernet until it actually boots. Nothing
> connected except HDD, serial and power

In that case, try connect Ethernet cable before booting!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 05, 2021 03:48PM
bodhi Wrote:
-------------------------------------------------------
> In that case, try connect Ethernet cable before
> booting!

Now there’s a novel idea! :)
If it doesn’t panic then I will be truly confused, but I’m willing to try anything at this point. Will try and report back in the morning
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 06, 2021 03:55AM
Nope, same thing. Eth link up and DHCP server handing out leases

Process:
- Boot without intervention ("press any key to stop autoboot" doesn't work anyway), wait for prompt
- Set bootargs and attempt to boot (line 107)
- Files are loaded and kernel is booted but not uinitrd (119 - 138)
- Returned to prompt. Attempt to boot again (179)
- Same failure, returned to prompt
- "reset" command, wait for reset and prompt (248)
- Set bootargs and attempt to boot again (365)
- Both files load now, kernel panics. Traces look different, no mention of cpu_idle. Actual panic message and address same as before
Attachments:
open | download - boot_20210706.log (34.5 KB)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 06, 2021 03:49PM
megal0maniac,

> Nope, same thing. Eth link up and DHCP server
> handing out leases

Yes. The idea is to see if the error change when you plug in Ethernet cable (the last place on the stack was the Armada 370 network driver). But it did not change, so most likely it is not the NIC hardware.

Can you boot OK with USB rootfs (formatted as Ext3), like osa did in his instruction?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 11, 2021 08:41AM
Sorry for the delay. I tried this right away but didn’t get around to pressing results.
I formatted a USB drive as ext3 and copied the whole rootfs with the broken idle dtb embedded in uImage. Tried both ext2load and ext4load, they both read the files fine and both resulted in the same crash with the same address.
What’s bugging me is that usually it will only boot the uImage and then try and load rescue firmware. I need to issue a reset after first boot in order for the uInitrd to boot as well. But the addresses I’m using are the stock ones, so the same as osa.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
July 11, 2021 03:33PM
megal0maniac,

> What’s bugging me is that usually it will only
> boot the uImage and then try and load rescue
> firmware. I need to issue a reset after first boot
> in order for the uInitrd to boot as well. But the
> addresses I’m using are the stock ones, so the
> same as osa.

If you follow extactly the same procedure as osa posted at his blog:

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

And still see the error, then it is indeed strange!

One observation:

In this troubleshooting session, you would want to avoid loading initrd, and see how far you can get with uImage only.

bootm 0x00a00000

-bodhi
===========================
Forum Wiki
bodhi's corner
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: