Mainline kernel (>=4.11.x) for WD My Cloud Gen2

Hi,

i have debian 9 on my wd mycloud gen2.
(thx Fox_exe)

i use Debian-kernel-bin_3.10.70_002.tar.gz
USB hdd not working. reboot not working.

also tested Debian-kernel-bin_4.15.0-rc6.tar.gz
usb hd working. reboot working.
timemachine backup not working (netatalk) and printing (cups)

can i “maybe” solve the problems with kernel 4.11 ?

bg
Michael

Tell me more - Erros? Need kernel modules? Or what?

Note: You can compile your own kernel: https://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/

Is there a kernel somewhere that can boot the original firmware from the HDD (just the 4.x kernel on USB and then use that new kernel to boot the original firmware)?

The kernel and ramdisk from post #1 will boot from USB but not start the WD firmware. It just blinks yellow-red and starts a telnet server. It also behaves like this when copied to boot on sda3 (although it says otherwise on the github it does not seem to be able to boot the existing firmware)

I would need something that can start the existing firmware with a newer kernel to confirm whether my USB problem is related to the old kernel drivers from WD and fixed in a newer kernel. I would like to do this with the original firmware and and not configure samba and mountpoints and everything from scratch.

Doesn’t work. Will just blink red-yellow and not start the original firmware. Fortunately it also opens a telnet server so it can be replaced with original kernel and ramdisk to unbrick it again.

doesn’t work. LED red/yellow blinking and only telnet server, no sshd. second partition on USB is not mounted.

Edit: It works now. File system must be extracted while being root AND do NOT use the “safely eject drive” button in KDE, this will interrupt(!) the sync process and forcefully umount after some timeout, do sync first and wait until it returns before ejecting the USB. I didn’t know this. I always thought it would sync and wait and then umount when using this “eject” button. I was wrong. This also explains some strange data loss on my SD card I experienced a while ago.

My USB HDD problem still persists, even with the 4.12.0 kernel. So it must be the hardware that is broken in my MyCloud.

i Have tried a few kernels.
3.10.70.002 - no usb
4.11 / 4.12 / 4.15rc6 / 4.15+ problems with cups / netatalk / timemachine

I got no error log, do not know where to generate, maybe someone can tell how i can log my errors. maybe netatalk …

I have tried netatalk v2 and v3.
both result in the same problem.
after mycloud boots, i can print via cups v2.2.1 and connect my mac to wdmc for backups.
after a short time, my printers are gone and i can not connect by apples timemachine.

now i am useing 3.10.70.002 again.
cups & timemachine works. usb not :frowning:

i have seen, i can try to build a kernel for wdmc, but i am not real familiar with compiling.
i think you are much more experienced then me.
i dont know if there are modules missing for the kernel or how to solve this.

@m_f_g, check logs folder (/var/log, use tail, less or grep for search/view).

I compiled 4.15 kernel on my Mycloud, using your kenel_config and dts files. After that I replaced uImage (4.12) in my alpine /boot with newly compiled uImage but device did not boot, I am getting continually blinking led only. Same issue with uImage extracted from your debian_kenel-bin_4.15 file.

My device is working fine with 4.12 kernel but I wish to get better performance for MiniDLNA performance.

Hi, Fox! I have two questions about the kernel you provided at https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/

  1. Can I use your kernel with the original WD system?
  2. I want to have ipv6 for WD Mycloud Gen2. It seems the original kernel doesn’t have ipv6 mods.
/boot # lsmod
Module                  Size  Used by
netatop                34087  0 
tun                    16377  0 
ufsd                  566385  0 
jnl                    26976  1 ufsd

I find your kernel seems to have ipv6 mod at /lib/modules/XX/net/ipv6. Can I get ipv6 function if I use your kernel?
Thank you!

Nope. Need rename ethernet system name (eth0 → egiga1), slighty different (and wrong-configured) DTS and some strange modifications in kernel.

But you can download official sources and compile ipv6 modules for original kernel.

A few days ago I found this thread. This kernel is almost the same as in Debian Stretch, so I decided to use it for a clean install on an empty harddisk. This means only access to a regular computer (x86_64 processor). Here are all the commands I used:

root@obelix:~# fdisk /dev/sdd
Command (m for help): g
Command (m for help): n, 1, 2097151
Command (m for help): n, 3, 8388607
Command (m for help): n, <enter>, <enter>
root@obelix:~# mkswap -L swap /dev/sdd1
root@obelix:~# mkfs.ext4 -L root /dev/sdd3
root@obelix:~# mkfs.ext4 -m 0 -L home /dev/sdd2
root@obelix:~# debootstrap --foreign --arch armhf stretch /root/bootstrap http://ftp.nl.debian.org/debian/
root@obelix:~# cp /usr/bin/qemu-arm-static bootstrap/usr/bin/
root@obelix:~# LANG=C chroot bootstrap/ /debootstrap/debootstrap --second-stage
root@obelix:~# mount /dev/sdd2  bootstrap/home/
root@obelix:~# LANG=C chroot bootstrap/ /bin/bash
root@obelix:/# vi /etc/hostname 
root@obelix:/# vi /etc/resolv.conf 
root@obelix:/# vi /etc/network/interfaces
root@obelix:/# vi /etc/fstab 
root@obelix:/# vi /etc/apt/sources.list
root@obelix:/# cd dev
root@obelix:/dev# mknod console c 5 1
root@obelix:/dev# chmod 600 console
root@obelix:/dev# cd
root@obelix:~# passwd
root@obelix:~# adduser hvdkamer
root@obelix:~# apt-get update
root@obelix:~# apt-get upgrade
root@obelix:~# apt-get --no-install-recommends install aptitude
root@obelix:~# apt-get --no-install-recommends install openssh-server
root@obelix:~# exit
root@obelix:~# cd bootstrap/boot/
root@obelix:~/bootstrap/boot# cp -a /media/hvdkamer/WDMC4BOOT/boot/* .
root@obelix:~/bootstrap/boot# chown root.root *
root@obelix:~# umount /dev/sdd2
root@obelix:~# umount /dev/sdd3

De four fdisk-command prompts are abbreviated. So n,1,2097151 means press the n, then enter, on the next question press 1 and then again enter and in the next question type the number. The debootstarp must be done in two fases. The first installs a base system and is processor independent. The second stage must me done on the CPU of the WD My Cloud, but that can be emulated thanks to qemu. So the second stage can also be done :). The installer doesn’t create the important console character device, so this must be done manually. The WDMC4BOOT is a USB flash drive with uImage and uRamdisk found in the first post. I tested this with a Debian Jessie installation from @Fox_exe

That’s it. Afterwards plug the harddisk to the WD My Cloud motherboard and in my case it worked without any further tweaking. I know the above is very condensed, but should be enough for someone accustomed to the commandline and some basic knowledge on how embedded computers work. Of course you can ask questions, but I don’t read the forum here regularly. Don’t know if a PM is send to my mailaddress. However you can find it also on my labjournal website (in Dutch, use Google translate).

I just place it here:

Hi genius2k,
Did you success in build and load the ipv6 kernel module ? I build the module but can’t load it .

[143687.675113] ipv6: Unknown symbol inet6_register_icmp_sender (err 0)
[143687.680181] ipv6: Unknown symbol inet6_lookup (err 0)
[143687.683994] ipv6: Unknown symbol inet6_del_protocol (err 0)
[143687.688364] ipv6: Unknown symbol secure_tcpv6_sequence_number (err 0)
[143687.693653] ipv6: Unknown symbol inet6_hash_connect (err 0)
[143687.697972] ipv6: Unknown symbol inet6_unregister_icmp_sender (err 0)
[143687.703221] ipv6: Unknown symbol inet6_protos (err 0)
[143687.707060] ipv6: Unknown symbol __inet6_lookup_established (err 0)
[143687.712141] ipv6: Unknown symbol __inet6_hash (err 0)
[143687.716085] ipv6: Unknown symbol inet6_lookup_listener (err 0)
[143687.720654] ipv6: Unknown symbol inet6_add_protocol (err 0)
[143687.725033] ipv6: Unknown symbol icmpv6_send (err 0)

Hi Fox,

After I enable the kernel build with CONFIG_IPV6=m, the net/ipv6 module can be built, but I can’t use modprobe load ipv6 to load the module with stock firmware, is there any other way to enable ipv6 with stock firmware ? I also tried to build the kernel with buildin ipv6 module, the box can’t start, I had to boot with your userecovery to restore the kernel.

Regards,

You need to build it into the kernel but not as modules because for the stock system, you can only change uImage (the kernel) but not content in /lib directory.

You can take a look at my old files used to build the kernel. Some suggestions:

  1. use the toolchain in the official firmware, try to build a kernel without modifying anything in the kernel configuration file and install it into your system
  2. modify the kernel configurations for ipv6
CONFIG_IPV6=y
# CONFIG_IPV6_PRIVACY is not set
# CONFIG_IPV6_ROUTER_PREF is not set
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
CONFIG_INET6_TUNNEL=y
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
CONFIG_INET6_XFRM_MODE_BEET=y
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
CONFIG_IPV6_SIT=y
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=y
# CONFIG_IPV6_GRE is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_IPV6_MROUTE is not set
# CONFIG_NETWORK_SECMARK is not set

I have switched to fox’s debian system. So I couldn’t provide more helpful information

Thanks Genius2k, it works like a charm!