Heisath / wdmc2-kernel

Tools to create a mainline linux kernel and debian rootfs for WD MyCloud Gen2
GNU General Public License v2.0
33 stars 11 forks source link

Support for WD MyCloud Mirror Gen.2 #14

Closed nmaas87 closed 2 years ago

nmaas87 commented 2 years ago

Hey there, awesome repo! I have an WD MyCloud Mirror Gen.2 and wanted to ask if it would be possible to add support for that ARMADA-385 device? I got the needed dts from here: https://wd.hides.su/wdnas.el8.website/Other/Official_linux_kernel/uImage-armada-385-wdmc-mirror-gen2 And copied an older v5.10.109 kernel config from here: https://github.com/gisab/WDMC-Ex2/blob/main/3.Kernel/kernel.config

I overwrote the normal wdmc2-kernel dts file with the WDMCM2 one and the linux-5.15.y.config with the older kernel config. Obviously I kept the file names the same as the original git files here :)

I created an USB 2 stick with FAT32 and EXT4 partition. I copied the content of the in output created boot-5.15.45.tar.gz to the boot/first partition (which now has a boot folder in it and then the files) and the output of the output/rootfs/ to the root/second partition.

As the WD does not boot from the stick (it got 2 USB 3.0 ports), I put the stick in the first / correct on and attach via UART, stop autoboot, load usb via usb reset, list the first partition fatls usb 0:1 and set the uimage for boot with fatload usb 0:1 0x500000 /boot/uimage then start with bootm 0x500000

Enable HD1
Enable HD2
Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |   In-Band    |
| egiga1 |   RGMII   |   In-Band    |
| egiga2 |   SGMII   |     0x00     |
egiga0, egiga1, egiga2 [PRIME]
Hit any key to stop autoboot:  0
Marvell>> usb reset
(Re)start USB...
USB0:   Port (usbActive) : 0    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>> fatls usb 0:1
            boot/
            system volume information/

0 file(s), 2 dir(s)

Marvell>> fatls usb 0:1 boot
            ./
            ../
   131668   linux-5.15.45.config
  1622632   uramdisk
  4299203   uimage
  4299203   uimage-5.15.45

4 file(s), 2 dir(s)

Marvell>> fatload usb 0:1 0x500000 /boot/uimage
reading /boot/uimage
4299203 bytes read in 165 ms (24.8 MiB/s)
Marvell>>
Marvell>> bootm 0x500000

sadly this happens:

Marvell>>
Marvell>> bootm 0x500000
## Booting image at 00500000 ...
## Booting kernel from Legacy Image at 00500000 ...
   Image Name:   WDMC-Gen2
   Created:      2022-06-06  15:46:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4299139 Bytes = 4.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

DTB:0x0041D2E0 (0x000046A3)
C:0x000080E0-0x004219C0->0x00D7B700-0x01194FE0
DTB:0x01190900 (0x000046DC)
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 5.15.45 (root@yocto) (arm-none-eabi-gcc (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907], GNU ld (2.31.1-12+11) 2.31.1) #2 SMP Mon Jun 6 17:46:27 CEST 2022
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: WD MyCloud Mirror gen2: Marvell Armada 385
Memory policy: Data cache writealloc
Zone ranges:
  Normal   [mem 0x0000000000000000-0x000000001fffffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000001fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
percpu: Embedded 11 pages/cpu s14028 r8192 d22836 u45056
Built 1 zonelists, mobility grouping on.  Total pages: 129920
Kernel command line: root=/dev/ram console=ttyS0,115200
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 505968K/524288K available (8758K kernel code, 490K rwdata, 2064K rodata, 1024K init, 340K bss, 18320K reserved, 0K cma-reserved, 0K highmem)
rcu: Hierarchical RCU implementation.
rcu:    RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 D prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
sched_clock: 64 bits at 666MHz, resolution 1ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x999999d70a, max_idle_ns: 440795225152 ns
Switching to timer-based delay loop, resolution 1ns
Ignoring duplicate/late registration of read_current_timer delay
clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 1332.00 BogoMIPS (lpj=6660000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
mvebu-pmsu: Initializing Power Management Service Unit
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Booting CPU 1
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (2664.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 256 KiB pool for atomic coherent allocations
thermal_sys: Registered thermal governor 'step_wise'
cpuidle: using governor ladder
mvebu-pmsu: CPU hotplug support is currently broken on Armada 38x: disabling
mvebu-pmsu: CPU idle is currently broken on Armada 38x: disabling
cryptd: max_cpu_qlen set to 1000
raid6: neonx8   gen()  1366 MB/s
raid6: neonx8   xor()   924 MB/s
raid6: neonx4   gen()  1652 MB/s
raid6: neonx4   xor()  1165 MB/s
raid6: neonx2   gen()  2035 MB/s
raid6: neonx2   xor()  1372 MB/s
raid6: neonx1   gen()  1597 MB/s
raid6: neonx1   xor()  1121 MB/s
raid6: int32x8  gen()   438 MB/s
raid6: int32x8  xor()   266 MB/s
raid6: int32x4  gen()   506 MB/s
raid6: int32x4  xor()   300 MB/s
raid6: int32x2  gen()   625 MB/s
raid6: int32x2  xor()   298 MB/s
raid6: int32x1  gen()   563 MB/s
raid6: int32x1  xor()   262 MB/s
raid6: using algorithm neonx2 gen() 2035 MB/s
raid6: .... xor() 1372 MB/s, rmw enabled
raid6: using neon recovery algorithm
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource arm_global_timer
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
FS-Cache: Loaded
CacheFiles: Loaded
NET: Registered PF_INET protocol family
IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
Initialise system trusted keyrings
workingset: timestamp_bits=14 max_order=17 bucket_order=3
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
FS-Cache: Netfs 'cifs' registered for caching
Key type cifs.idmap registered
xor: measuring software checksum speed
   arm4regs        :  2172 MB/sec
   8regs           :  1668 MB/sec
   32regs          :  1733 MB/sec
   neon            :  1576 MB/sec
xor: using function: arm4regs (2172 MB/sec)
async_tx: api initialized (async)
Key type asymmetric registered
Asymmetric key parser 'x509' registered
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
io scheduler kyber registered
armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
mv_xor f1060800.xor: Marvell shared XOR driver
mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
mv_xor f1060900.xor: Marvell shared XOR driver
mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
printk: console [ttyS0] disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 31, base_baud = 12500000) is a 16550A
printk: console [ttyS0] enabled
f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 32, base_baud = 12500000) is a 16550A
brd: module loaded
loop: module loaded
ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
ahci-mvebu f10a8000.sata: supply target not found, using dummy regulator
ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
scsi host0: ahci-mvebu
scsi host1: ahci-mvebu
ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 52
ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 52
hwmon hwmon0: temp1_input not attached to any thermal zone
mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
mvneta f1034000.ethernet eth0: Using random mac address d2:b9:63:b4:81:c4
usbcore: registered new interface driver lan78xx
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-orion: EHCI orion driver
orion-ehci f1058000.usb: EHCI Host Controller
orion-ehci f1058000.usb: new USB bus registered, assigned bus number 1
orion-ehci f1058000.usb: irq 48, io mem 0xf1058000
orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 5.15.45 ehci_hcd
usb usb1: SerialNumber: f1058000.usb
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
ohci-platform: OHCI generic platform driver
uhci_hcd: USB Universal Host Controller Interface driver
xhci-hcd f10f0000.usb3: xHCI Host Controller
xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000010010
xhci-hcd f10f0000.usb3: irq 53, io mem 0xf10f0000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: xHCI Host Controller
usb usb2: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb2: SerialNumber: f10f0000.usb3
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
xhci-hcd f10f0000.usb3: xHCI Host Controller
xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb3: Product: xHCI Host Controller
usb usb3: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb3: SerialNumber: f10f0000.usb3
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 1 port detected
xhci-hcd f10f8000.usb3: xHCI Host Controller
xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000010010
xhci-hcd f10f8000.usb3: irq 54, io mem 0xf10f8000
usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb4: Product: xHCI Host Controller
usb usb4: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb4: SerialNumber: f10f8000.usb3
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 1 port detected
xhci-hcd f10f8000.usb3: xHCI Host Controller
xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 5
xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb5: Product: xHCI Host Controller
usb usb5: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb5: SerialNumber: f10f8000.usb3
hub 5-0:1.0: USB hub found
ata2: SATA link down (SStatus 0 SControl 300)
hub 5-0:1.0: 1 port detected
ata1: SATA link down (SStatus 0 SControl 300)
fotg210_hcd: FOTG210 Host Controller (EHCI) Driver
Warning! fotg210_hcd should always be loaded before uhci_hcd and ohci_hcd, not after
SPI driver max3421-hcd has no spi_device_id for maxim,max3421
usbcore: registered new interface driver usb-storage
i2c_dev: i2c /dev entries driver
mv64xxx_i2c f1011000.i2c: can't get pinctrl, bus recovery not supported
mv64xxx_i2c f1011100.i2c: can't get pinctrl, bus recovery not supported
device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.com
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
marvell-cesa f1090000.crypto: CESA device successfully registered
hid: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered PF_INET6 protocol family
Segment Routing with IPv6
In-situ OAM (IOAM) with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered PF_PACKET protocol family
Bridge firewalling registered
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
Registering SWP/SWPB emulation handler
Loading compiled-in X.509 certificates
input: gpio-keys as /devices/platform/gpio-keys/input/input0
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
usb 2-1: new high-speed USB device number 2 using xhci-hcd
List of all partitions:
0100            4096 ram0
 (driver?)
0101            4096 ram1
 (driver?)
0102            4096 ram2
 (driver?)
0103            4096 ram3
 (driver?)
0104            4096 ram4
 (driver?)
0105            4096 ram5
 (driver?)
0106            4096 ram6
 (driver?)
0107            4096 ram7
 (driver?)
No filesystem could mount root, tried:
 ext3
 ext2
 ext4
 vfat
 msdos
 iso9660

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.45 #2
Hardware name: Marvell Armada 380/385 (Device Tree)
[<c0110090>] (unwind_backtrace) from [<c010af50>] (show_stack+0x10/0x14)
[<c010af50>] (show_stack) from [<c0980c30>] (dump_stack_lvl+0x40/0x4c)
[<c0980c30>] (dump_stack_lvl) from [<c010d478>] (do_handle_IPI+0x110/0x12c)
[<c010d478>] (do_handle_IPI) from [<c010d4ac>] (ipi_handler+0x18/0x20)
[<c010d4ac>] (ipi_handler) from [<c017d774>] (handle_percpu_devid_irq+0x78/0x12c)
[<c017d774>] (handle_percpu_devid_irq) from [<c0177b28>] (handle_domain_irq+0x5c/0x78)
[<c0177b28>] (handle_domain_irq) from [<c0500790>] (gic_handle_irq+0x7c/0x90)
[<c0500790>] (gic_handle_irq) from [<c01012fc>] (__irq_svc+0x5c/0x78)
Exception stack(0xc147bf60 to 0xc147bfa8)
bf60: 00000f28 00000000 00000001 c0115ee0 c0d05fcc ffffe000 c0d06010 00000002
bf80: c0c5ec70 c0d7a5b8 00000000 00000000 00000001 c147bfb0 c01081c8 c01081cc
bfa0: 60000013 ffffffff
[<c01012fc>] (__irq_svc) from [<c01081cc>] (arch_cpu_idle+0x38/0x3c)
[<c01081cc>] (arch_cpu_idle) from [<c098d328>] (default_idle_call+0x24/0x34)
[<c098d328>] (default_idle_call) from [<c01551e0>] (do_idle+0x1b4/0x1dc)
[<c01551e0>] (do_idle) from [<c0155514>] (cpu_startup_entry+0x18/0x1c)
[<c0155514>] (cpu_startup_entry) from [<00101cd0>] (0x101cd0)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) ]---

Any idea on how to get this fixed?

Heisath commented 2 years ago

That does not look too bad. Kernel boots, but can't find rootfs. You might want to load the uRamdisk from this repo, or create your own one. Try using fatload to load the uRamdisk and then bootm <kernel> <ramdisk> to boot. Even if the ramdisk fails to mount a root system it would then give you an emergency prompt. Check this file for reference https://github.com/Heisath/wdmc2-kernel/blob/master/build_initramfs.sh

nmaas87 commented 2 years ago

Thank you :). I tried it in both ways, loading the kernel and ramdisk somwhere in memory and starting it, but it always started the nand memory with the original software. What am I doing wrong? :)

usb reset
fatload usb 0:1 0x500000 /boot/uramdisk
fatload usb 0:1 0x550000 /boot/uimage

Marvell>> bootm 0x550000 0x500000
## Booting image at 00550000 ...
## Booting kernel from Legacy Image at 00550000 ...
   Image Name:   WDMC-Gen2
   Created:      2022-06-06  15:46:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4299139 Bytes = 4.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00500000 ...
   Image Name:   Custom initramfs
   Created:      2021-07-28   7:11:31 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    1622568 Bytes = 1.5 MiB
   Load Address: 00e00000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC
### Ramdisk error, Loading Rescure Firmware from NAND Flash ###

Marvell>> bootm 0x500000  0x550000
## Booting image at 00500000 ...
## Booting kernel from Legacy Image at 00500000 ...
   Image Name:   Custom initramfs
   Created:      2022-06-06  15:50:56 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    1620683 Bytes = 1.5 MiB
   Load Address: 00e00000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC

NAND 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-06-17   9:20:50 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4087060 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-07-01   3:00:52 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6945245 Bytes = 6.6 MiB
   Load Address: 00e00000
   Entry Point:  00e00000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
Heisath commented 2 years ago
## Booting kernel from Legacy Image at 00550000 ...
   Image Name:   WDMC-Gen2
   Created:      2022-06-06  15:46:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4299139 Bytes = 4.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00500000 ...
   Image Name:   Custom initramfs
   Created:      2021-07-28   7:11:31 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    1622568 Bytes = 1.5 MiB
   Load Address: 00e00000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC

The "bad data crc" is the hint. I assume you are using two memory locations to close together. They are overwriting each other. Also remember that it needs to be high enough not to interfere when the kernel/ramdisk is unpacked.

The original rescue firmware gives you good spots to load: 0x00a00000 for kernel and 0x00e00000 for ramdisk.

nmaas87 commented 2 years ago

Perfect, it started up - a0 and e0 where still too close, but a0 and f0 worked. It still does crash however

egiga0, egiga1, egiga2 [PRIME]
Hit any key to stop autoboot:  0
Marvell>> usb start
(Re)start USB...
USB0:   Port (usbActive) : 0    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>> usb start
(Re)start USB...
USB0:   Port (usbActive) : 0    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 0x00a00000 /boot/uimage
reading /boot/uimage
4299203 bytes read in 165 ms (24.8 MiB/s)
Marvell>> fatload usb 0:1 0x00f00000 /boot/uramdisk
reading /boot/uramdisk
1868366 bytes read in 82 ms (21.7 MiB/s)
Marvell>> bootm 0x00a00000 0x00f00000
## Booting image at 00a00000 ...
## Booting kernel from Legacy Image at 00a00000 ...
   Image Name:   WDMC-Gen2
   Created:      2022-06-06  15:46:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4299139 Bytes = 4.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00f00000 ...
   Image Name:   Custom initramfs
   Created:      2022-06-06  19:31:49 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    1868302 Bytes = 1.8 MiB
   Load Address: 00e00000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

DTB:0x0041D2E0 (0x000046A3)
C:0x000080E0-0x00421A00->0x00D7B700-0x01195020
DTB:0x01190900 (0x00004720)
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 5.15.45 (root@yocto) (arm-none-eabi-gcc (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907], GNU ld (2.31.1-12+11) 2.31.1) #2 SMP Mon Jun 6 17:46:27 CEST 2022
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: WD MyCloud Mirror gen2: Marvell Armada 385
Memory policy: Data cache writealloc
Zone ranges:
  Normal   [mem 0x0000000000000000-0x000000001fffffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000001fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
percpu: Embedded 11 pages/cpu s14028 r8192 d22836 u45056
Built 1 zonelists, mobility grouping on.  Total pages: 129920
Kernel command line: root=/dev/ram console=ttyS0,115200
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 504136K/524288K available (8758K kernel code, 490K rwdata, 2064K rodata, 1024K init, 340K bss, 20152K reserved, 0K cma-reserved, 0K highmem)
rcu: Hierarchical RCU implementation.
rcu:    RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 D prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
sched_clock: 64 bits at 666MHz, resolution 1ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x999999d70a, max_idle_ns: 440795225152 ns
Switching to timer-based delay loop, resolution 1ns
Ignoring duplicate/late registration of read_current_timer delay
clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 1332.00 BogoMIPS (lpj=6660000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
mvebu-pmsu: Initializing Power Management Service Unit
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Booting CPU 1
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (2664.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 256 KiB pool for atomic coherent allocations
thermal_sys: Registered thermal governor 'step_wise'
cpuidle: using governor ladder
mvebu-pmsu: CPU hotplug support is currently broken on Armada 38x: disabling
mvebu-pmsu: CPU idle is currently broken on Armada 38x: disabling
cryptd: max_cpu_qlen set to 1000
raid6: neonx8   gen()  1366 MB/s
raid6: neonx8   xor()   924 MB/s
raid6: neonx4   gen()  1653 MB/s
raid6: neonx4   xor()  1166 MB/s
raid6: neonx2   gen()  2036 MB/s
raid6: neonx2   xor()  1373 MB/s
raid6: neonx1   gen()  1599 MB/s
raid6: neonx1   xor()  1121 MB/s
raid6: int32x8  gen()   438 MB/s
raid6: int32x8  xor()   266 MB/s
raid6: int32x4  gen()   506 MB/s
raid6: int32x4  xor()   300 MB/s
raid6: int32x2  gen()   625 MB/s
raid6: int32x2  xor()   298 MB/s
raid6: int32x1  gen()   563 MB/s
raid6: int32x1  xor()   262 MB/s
raid6: using algorithm neonx2 gen() 2036 MB/s
raid6: .... xor() 1373 MB/s, rmw enabled
raid6: using neon recovery algorithm
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource arm_global_timer
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
FS-Cache: Loaded
CacheFiles: Loaded
NET: Registered PF_INET protocol family
IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (invalid magic at start of compressed archive); looks like an initrd
Freeing initrd memory: 1828K
Initialise system trusted keyrings
workingset: timestamp_bits=14 max_order=17 bucket_order=3
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
FS-Cache: Netfs 'cifs' registered for caching
Key type cifs.idmap registered
xor: measuring software checksum speed
   arm4regs        :  2166 MB/sec
   8regs           :  1661 MB/sec
   32regs          :  1726 MB/sec
   neon            :  1571 MB/sec
xor: using function: arm4regs (2166 MB/sec)
async_tx: api initialized (async)
Key type asymmetric registered
Asymmetric key parser 'x509' registered
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
io scheduler kyber registered
armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
mv_xor f1060800.xor: Marvell shared XOR driver
mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
mv_xor f1060900.xor: Marvell shared XOR driver
mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
printk: console [ttyS0] disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 31, base_baud = 12500000) is a 16550A
printk: console [ttyS0] enabled
f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 32, base_baud = 12500000) is a 16550A
brd: module loaded
loop: module loaded
ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
ahci-mvebu f10a8000.sata: supply target not found, using dummy regulator
ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
scsi host0: ahci-mvebu
scsi host1: ahci-mvebu
ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 52
ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 52
hwmon hwmon0: temp1_input not attached to any thermal zone
mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
mvneta f1034000.ethernet eth0: Using random mac address 5a:9e:0f:c8:21:a7
usbcore: registered new interface driver lan78xx
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-orion: EHCI orion driver
orion-ehci f1058000.usb: EHCI Host Controller
orion-ehci f1058000.usb: new USB bus registered, assigned bus number 1
orion-ehci f1058000.usb: irq 48, io mem 0xf1058000
orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 5.15.45 ehci_hcd
usb usb1: SerialNumber: f1058000.usb
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
ohci-platform: OHCI generic platform driver
uhci_hcd: USB Universal Host Controller Interface driver
xhci-hcd f10f0000.usb3: xHCI Host Controller
xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000010010
xhci-hcd f10f0000.usb3: irq 53, io mem 0xf10f0000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: xHCI Host Controller
usb usb2: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb2: SerialNumber: f10f0000.usb3
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
xhci-hcd f10f0000.usb3: xHCI Host Controller
xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb3: Product: xHCI Host Controller
usb usb3: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb3: SerialNumber: f10f0000.usb3
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 1 port detected
xhci-hcd f10f8000.usb3: xHCI Host Controller
xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000010010
xhci-hcd f10f8000.usb3: irq 54, io mem 0xf10f8000
usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb4: Product: xHCI Host Controller
usb usb4: Manufacturer: Linux 5.15.45 xhci-hcd
usb usb4: SerialNumber: f10f8000.usb3
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 1 port detected
xhci-hcd f10f8000.usb3: xHCI Host Controller
xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 5
xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb5: Product: xHCI Host Controller
usb usb5: Manufacturer: Linux 5.15.45 xhci-hcd
ata2: SATA link down (SStatus 0 SControl 300)
usb usb5: SerialNumber: f10f8000.usb3
hub 5-0:1.0: USB hub found
ata1: SATA link down (SStatus 0 SControl 300)
hub 5-0:1.0: 1 port detected
fotg210_hcd: FOTG210 Host Controller (EHCI) Driver
Warning! fotg210_hcd should always be loaded before uhci_hcd and ohci_hcd, not after
SPI driver max3421-hcd has no spi_device_id for maxim,max3421
usbcore: registered new interface driver usb-storage
i2c_dev: i2c /dev entries driver
mv64xxx_i2c f1011000.i2c: can't get pinctrl, bus recovery not supported
mv64xxx_i2c f1011100.i2c: can't get pinctrl, bus recovery not supported
device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.com
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
marvell-cesa f1090000.crypto: CESA device successfully registered
hid: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered PF_INET6 protocol family
Segment Routing with IPv6
In-situ OAM (IOAM) with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered PF_PACKET protocol family
Bridge firewalling registered
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
Registering SWP/SWPB emulation handler
Loading compiled-in X.509 certificates
input: gpio-keys as /devices/platform/gpio-keys/input/input0
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
RAMDISK: Couldn't find valid RAM disk image starting at 0.
usb 2-1: new high-speed USB device number 2 using xhci-hcd
List of all partitions:
0100            4096 ram0
 (driver?)
0101            4096 ram1
 (driver?)
0102            4096 ram2
 (driver?)
0103            4096 ram3
 (driver?)
0104            4096 ram4
 (driver?)
0105            4096 ram5
 (driver?)
0106            4096 ram6
 (driver?)
0107            4096 ram7
 (driver?)
No filesystem could mount root, tried:
 ext3
 ext2
 ext4
 vfat
 msdos
 iso9660

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.45 #2
Hardware name: Marvell Armada 380/385 (Device Tree)
[<c0110090>] (unwind_backtrace) from [<c010af50>] (show_stack+0x10/0x14)
[<c010af50>] (show_stack) from [<c0980c30>] (dump_stack_lvl+0x40/0x4c)
[<c0980c30>] (dump_stack_lvl) from [<c010d478>] (do_handle_IPI+0x110/0x12c)
[<c010d478>] (do_handle_IPI) from [<c010d4ac>] (ipi_handler+0x18/0x20)
[<c010d4ac>] (ipi_handler) from [<c017d774>] (handle_percpu_devid_irq+0x78/0x12c)
[<c017d774>] (handle_percpu_devid_irq) from [<c0177b28>] (handle_domain_irq+0x5c/0x78)
[<c0177b28>] (handle_domain_irq) from [<c0500790>] (gic_handle_irq+0x7c/0x90)
[<c0500790>] (gic_handle_irq) from [<c01012fc>] (__irq_svc+0x5c/0x78)
Exception stack(0xc147bf60 to 0xc147bfa8)
bf60: 00000a92 00000000 00000001 c0115ee0 c0d05fcc ffffe000 c0d06010 00000002
bf80: c0c5ec70 c0d7a5b8 00000000 00000000 00000001 c147bfb0 c01081c8 c01081cc
bfa0: 60000013 ffffffff
[<c01012fc>] (__irq_svc) from [<c01081cc>] (arch_cpu_idle+0x38/0x3c)
[<c01081cc>] (arch_cpu_idle) from [<c098d328>] (default_idle_call+0x24/0x34)
[<c098d328>] (default_idle_call) from [<c01551e0>] (do_idle+0x1b4/0x1dc)
[<c01551e0>] (do_idle) from [<c0155514>] (cpu_startup_entry+0x18/0x1c)
[<c0155514>] (cpu_startup_entry) from [<00101cd0>] (0x101cd0)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) ]---

no emergency console available at that point, sadly. Looks like it does not get the USB stick?

Heisath commented 2 years ago

Nah the usb stick is not the problem at this point. After you load the images in uboot it does not matter. There is still something wrong with detecting the ramdisk:

Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (invalid magic at start of compressed archive); looks like an initrd

and RAMDISK: Couldn't find valid RAM disk image starting at 0.

I can just suggest to fiddle further with the values, or try the various ramdisks available where you got the dts. Or you could try to boot your kernel with the vendor rescue ramdisk.

nmaas87 commented 2 years ago

I played around with it and could find an old ram disk ( https://wd.hides.su/fox_exe/WDMyCloud-Mirror-Gen2/Debian/Dev/uRamdisk ) - with this one I can load some kernels. But it looks like I encounter the same error as #8 - I can boot to a Ramdisk with 5.10 kernel, but newer ones give the same error as above. Looks like there is some issue with uBoot?

Heisath commented 2 years ago

Yeah I just realized your kernel is at 4.1MiB already... Try to disable some functionality, move stuff to modules or select "Optimize for size" instead of performance...

nmaas87 commented 2 years ago

Hey there, I got it working! The real problem was the defunct uBoot on the WDMyCloudMirror Gen2, which needed to be patched. Thanks for all your help, I wrote everything together in this blog post: https://www.nico-maas.de/?p=2469 - and secured the most important files here: https://github.com/nmaas87/WDMCMG2 Also, you might like to try compiling the kernel with these changes:

remove:
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y

add:
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_TRIM_UNUSED_KSYMS=y
CONFIG_UNUSED_KSYMS_WHITELIST=""

the last two commands should remove a lot of debug symbols and further slim down the kernel :)

Heisath commented 2 years ago

Cool. Maybe I will integrate this at some point. Might need a MyCloud Mirror to test first though.