Alternative Firmware (Debian Jessie, Synology DSM6)

@bumbolicious, upgrade kernel before OS upgrade
https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen1/Developing/

@Fox_exe
I need your help again. I’ve compiled many kernels for my wdmc Ex2-Ultra, but every time I add CONFIG_POSIX_MQUEUE = y, the device won’t boot, the blue light is flashing all the time. I do not have a serial connection, so I do not know what the problem is. Maybe someone can confirm this problem or you could show me my mistake?

Does someone knows if there is a way to install these firmwares on a WD PR2100/PR4100?
on the 4GB emmc should be enough space for a clean debian install

@Fox_exe

I’m having some problems with your latest Debian Stretch build for the EX2 Ultra. It boots fine and all, but I can’t seem to be able to install docker-ce, it dies with the following error:

dockerd[4392]: Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables --wait -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
dockerd[4392]: Perhaps iptables or your kernel needs to be upgraded.
dockerd[4392]:  (exit status 3) 

The main issue is that the iptable set do not have the iptables_nat module - it is not compiled by the kernel. Since you did not publish the kernel sources (which is BTW still required because of the GPLv2 license), I can’t compile said module either.

Could you please update the 4.15.0-rc6 kernel libs with it, and also, upload the sources to GitHub?

EDIT: The following config changes are required by docker:

CONFIG_CGROUP_FREEZER
CONFIG_IP_NF_TARGET_MASQUERADE
CONFIG_NETFILTER_XT_MATCH_IPVS
CONFIG_IP_NF_NAT
CONFIG_POSIX_MQUEUE
CONFIG_VXLAN
CONFIG_IPVLAN

Optional:
CONFIG_USER_NS
CONFIG_SECCOMP
CONFIG_CGROUP_PIDS
CONFIG_CGROUP_PIDS

The following flags would also be helpful for diagnostics:
CONFIG_TASKSTATS
CONFIG_TASK_DELAY_ACCT
CONFIG_TASK_IO_ACCOUNTING

Wrong: All sources is here: https://www.kernel.org/
Kernel config and DTS file is here: Fox_exe file archive | Contents of /WDMyCloud/WDMyCloud-Mirror-Gen2/Dev/Kernel-4.14.4/

@Fox_exe you do realize that linking randomly to the main kernel repo is not enough, right?

GPLv2, apart from other things, requires the developer releasing the binaries to make the exact source code and build instructions available. Also there’s no tagged release for your 4.15.0-rc6 kernel images, so it is kinda hard to build modules for that - I’d rather not risk building full kernel images since I do not have serial access to the NAS, and screwing up an EX2 Ultra means no way of recovering.

@fonix232, Download any of kernel v4.1x (From 4.0 up to 4.18) and use my kernel build config + DTS file for your device.
More info: https://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/

I don’t provide source codes of a kernel as I didn’t make any changes to them.
I just added one file - DTS (Device Tree Source) - its a hardware description. Something like Configuration file.
So GPL rules are followed.

Found 4.15.0-rc6. Compiled using the same config as yours (pulled directly from /proc/config.gz), using the following script (which presumes the folder I’m in is the 4.15.0-rc6 kernel source root):

#!/bin/bash

# Set up variables
export DIR_RESULT=../output
export DTS_FILE=armada-385-wdmc-Ex2-Ultra
export KERNEL_VERSION=$(make kernelversion)
rm -rf $DIR_RESULT
mkdir -p $DIR_RESULT

# Download DTS
wget http://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/$DTS_FILE.dts -o linux-stable/arch/arm/boot/dts/$DTS_FILE.dts

# Make kernel and modules
make oldconfig
make zImage
make $DTS_FILE.dtb
make modules
make INSTALL_MOD_PATH=$DIR_RESULT modules_install

# Package uImage
cat arch/arm/boot/zImage arch/arm/boot/dts/$DTS_FILE.dtb > zImage_with_dtb
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n $DTS_FILE -d zImage_with_dtb $DIR_RESULT/uImage
rm zImage_with_dtb

# Package modules
cd $DIR_RESULT
tar zcfv lib_$KERNEL_VERSION.tar.gz lib

# Flash kernel, update modules
dd if=/dev/zero of=/dev/mtdblock1
dd if=uImage of=/dev/mtdblock1
tar zxf lib_$KERNEL_VERSION.tar.gz -C /

This script worked fine once, but when I ran it again, after boot the power LED keeps blinking, and there’s no network connection… Without any changes.

You have to recover and try to kompile as needed without CONFIG_POSIX_MQUEUE. If this works it’s the same problem that i had.

Can’t recover it, got no way to get into it. What’s wrong with POSIX_MQUEUE? It’s needed for docker, and it has been running on the official firmware so I guess it was working at some time…

Just look up “how to recover”.

For me it worked after a few attempts with an FAT32 USB stick,
http://anionix.ddns.net/WDMyCloud/WDMyCloud-Mirror-Gen2/Original/
and while you plug in the power cord, hold down the restore button for a long long time.

You should get into the recovery mode then you can upload
http://anionix.ddns.net/WDMyCloud/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/Firmware-debian-linux-4.14.4.bin

I dont know, I’m no kernel programmer. My understanding is it shouldn’t be a problem but my observing is different. It could be a driver/hardware problem or some codes snippetes wich spamme the message queues. But i dont know for sure, because i also don’t have a serial (uart) connection.

I’ve bricked my NAS before, and unfortunately, the EX2 Ultra has a bootloader that has no recovery option - the web interface won’t work, and it won’t flash from the USB drive either. The only option I have is an FTDI flash, but I do not have a dongle or a soldering iron at my disposal right now.

@Fox_exe any idea why CONFIG_POSIX_MQUEUE causes a boot failure? I’ll try to get some logs once I get an FTDI dongle and can solder the pins to my NAS.

This is new to me, that you need to recover with FTDI/Serial(Uart) an EX2 Ultra. But don’t get me wrong, won’t stop you, if you know what you do.

I also have an EX2 Ultra and for me it works with a FAT32 USB stick (boot flag) with uImage and uRamdisk downloaded from the “WDMyCloud mirror gen2 / original” folder to the root directory or boot directory. Since I am not sure if the folder with the name “boot” is needed. Simply hold down the reset button while plugging in the power cord, and continue to hold it until all flashing lights go out.

It should boot into the recovery mode after serveral attempts. You should see the IP if it gets the IP from the DHCP services.

Hmm, I’ll look into this. But at the end I might just end up replacing the bootloader with a custom one (plus a Debian/Alpine Linux base FS on the NAND).

@Fox_exe have you ever tried/succeeded in compiling U-Boot from source?

@Fox_exe
Hey i wanted to ask you, wich of your ports works the best or if the original Firmware is enough for me.

Primarly i only need 2 things

  1. Web Access over Internet
  2. NFS

These Things are good to have but not so important
1.1. Couch Potato
2. Transmission…

I have the 1bay My Private Cloud

So now my Questions:

  1. Is NFS really working on the 1bay My Cloud ( I heard that the method of activating it over SSH don’t run propertly).
  2. What Port is working good?
  • In DSM there is no working Web Access so far.
  • OMV only installs im RAM.

Am I right so far?

Sorry for my bad English
I’m Russian

@C0nvert

I do not have 1bay My Private Cloud, but I wonder if OMV is only loaded into Ram. That does not make any sense to me, as the Linux system can also easily access and use its own partition, just like all the firewares of Fox_exe do it at the moment.

Also NFS shouldn’t be a problem with the orginal firmware. For example I found one hack here:

But nevertheless you have to try on our own!

Okay, got what you’re saying. However for me even in recovery mode, it won’t help (I finally got to recovery - you don’t need the USB drive for that, just boot the device as usual, then when booted press and hold the reset button until it reboots to flashing red lights) - the upload form won’t accept the payload, it returns a 404 for some reason.

EDIT: Brought it back successfully. The secret is to boot the Debian base uImage/uRamdisk, which boots into an actually reachable shell. Flash the same images onto the device and bam, it’s working. Got to investigate why CONFIG_POSIX_MQUEUE is killing it tho.

Great to hear, but how did you “boot the Debian base uImage/uRamdisk” if you didn’t use a USB Stick?

For that I did use the USB drive - but no matter if otherwise I had a USB drive or not, it just booted into rescue mode.

Nevertheless finally I can do some testing without screwing with my actual system, which is nice. Hopefully I can figure out what’s wrong - or at least cobble together a ramdisk that saves kernel and bootloader logs to the hard drive.

EDIT:

I’d also love to try a new build of U-Boot - it would allow for some further finetuning and possibly even booting e.g. Alpine Linux (which is pretty small, and could use the internal NAND for squashFS installing base packages).

For now I’ll just try to make a restore image that actually enables SSH, not just the ■■■■■■ web UI or telnet.

I would be happy with only OVM and Docker! :grinning: