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

Click on the view hidden in the first post.

I copied 4,12 uImage and Fox_exe’s uramdisk to /boot on a usb pendrive. After reboot mycloud starts, with blinking blue-stable yellow and stable green (just like debian) lights, but I am not able to connect with ssh or telnet. It says no route to the host. Though on router page it shows up.

I have the same deal. It boots to a login. I can login on the UART. But can not ssh into the device. But sshd is in the uRamdisk.

I just looked at the init file. It looks like it starts a telnet session. So try to telnet into the device.

Telnet doesn’t work. I am glad that I am trying this with USB and haven’t copied this to mycloud hard-disk.

The “Fox_exe” uRamdisk blinks, when it enters the rescue mode.
You can lookup the ip in the router an telnet to the ip (Wd My Cloud).

You have changed the partitions on the harddrive?
Important is to have the 5th removed, otherwise you always end in the rescue mode.

Johns

1 Like

When you have problems and the UART connected, you can post the log to a pastepin or as PM.

With linux use screen as terminal program:

screen /dev/ttyUSB0 115200
<ctrl> a H

And it logs to screenlog.0

Johns

1 Like

What is pastepin? I use putty which has built in logging.

I just tested a USB boot using the 4.12 uImage and URamdisk. I was able to then telnet into the My Cloud.

What is pastepin? I use putty which has built in logging.

Pastebin is a 3rd party website that allows users to post large logfiles, etc and not weigh down a support forum with 1GB files that are only useful for 1 person, in 1 situation.

Here’s an example

Sorry my failure, i meaned “pastebin” with “B”.
Its to post logs, without having big posts in the forum.

Do you use the original firmware? Than this is normal.

Johns

I built the kernel with block trace enabled. I then tested the image using the USB boot. It booted up to the point where it panic’d becasue of the root problem. So I copied the uImage to the third partition and rebooted using only the disk. It also panic’d at the same point. I would have thought that building the image from the released GPL source should have worked.
Not sure what the differences are between your build and the WD build from the GPL? I need to see if I can determine what is different about there uImage and the one that I built. When it comes to the wrong root.

I tested fox’s unbrick method for the gen2. I couldn’t get telnet working. But booting your 4.12 image. It boots up and I can telnet into the My Cloud. Using telnet I can mount the different partitions and look at the data on them. Your image might be useful for people to look into why the My Cloud does not work.
Since they don’t have to open up the device.

I am interested in the newer kernel because many modules that can be built for it are more mature/stable. Zram being one of them.

With a custom kernel, we can pass a different root location (/dev/sda2 for instance…), and then have a fully persistent environment on the Gen2, like we have on the Gen1, allowing all kinds of fun things. (Like permanently getting iSCSI working without having to resort to ugly hacks). Having more mature versions of Video4Linux modules would be useful too, for people that want to use the NAS as a back-end for security camera storage. (The cameras can be cheap wired ones, sitting directly on the MyCloud via USB, and the MyCloud has the necessary modules to work with the cameras)

I am very interested in the full build instructions, as I would LOVE to fully customize this device.

1 Like

[quote=“rac8006, post:32, topic:211143, full:true”]
I built the kernel with block trace enabled. I then tested the image using the USB boot. It booted up to the point where it panic’d becasue of the root problem. [/quote]

The next test is to copy your own build kernel to USB stick and boot.
When it didn’t boot your build system isn’t working. If it works, something
is missing.

I have unpacked the uRamdisk-recovery, it seem that it needs squashfs.

CONFIG_MISC_FILESYSTEMS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_ZLIB=y

Add these 3 lines to your config, make oldconfig, just press return for
the questions. (Default is good). Or make menuconfig → Filesystems
→ Misc Filesystems → Squash 4.0

Johns

Debian on USB stick for WD My Cloud Gen2

I’m thinking about the howto. But everybody, who can use it, needs only this simple:

  • download uRamdisk from GitHub - Johns-Q/wdmc-gen2: WD My Cloud Gen2 (Kernel / Distribution / Information) drop
  • download uImage from same link
  • download jessie-rootfs.tar.gz from http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen2/Debian/
  • get an empty USB 2.0 stick (USB 3.0 sticks have boot problems)
  • make a DOS partition table on the usb stick
  • make a FAT32 (LBA) partition ~1GB on the usb stick
  • make a linux partition remaining space on the usb stick
  • make a FAT32 filesystem on the FAT32 partition
  • make a EXT4 filesstem on the linux partition
  • make a directory /boot on the FAT32 partition
  • copy uRamdisk and uImage into /boot on the FAT32 partition
  • extract jessie-rootfs.tar.gz in the root / of the EXT4 partition
  • remove etc/udev/rules.d/70-persistent-net.rules from the EXT4 partition
  • insert usb stick into the WD My Cloud Gen2 and reboot
  • have dhcp server on your network running
  • login using ssh get ip from your router log (root/mycloud)
  • change root password

Much fun playing arround.

Johns

3 Likes

I was using USB3.0 pendrive. When I inserted pendrive with bluelight blinking at the poweron I was able to login using ssh.
This time I was testing with alpine linux. When I tried to search for packages I get

Ignoring /media/usb/apks/armhf/APKINDEX.tar.gz: No such file or directory

I guess I will have dig into alpine wiki. EDIT: found solution in alpine FAQs.

What I like with alpine is that poweroff is working, mycloud was actually powered-off with leds off. I will test with alpine and may migrate to that leaving debian-jessie, (which containes so many outdated packages).

When I look into my alpine tar archive, there is ./apks/armhf/APKINDEX.tar.gz
Should be on the usb-stick too.

I planned to make an easy to use debian image with the jessie-rootfs.tar.gz,
but I see no problems to use a newer debian.

You should be able to upgrade debian, if it needs a newer kernel, this is now possible.

Johns

Issue was /etc/apk/repositories which contained only “/media/usb/apks”. So I had to add repos and run ‘apk update’ to solve the issue. Actually I am liking alpine. Both debian and alpine are new for me as I am archlinux user, so it doesn’t matter much. I have to learn either.
Can I use “edge” repos (rolling release) or will it mess with the kernel? Currently I have added only v3.6/main and community repos.

I’m new to alpinelinux too. I needed a distribution with armhf for the WD My Cloud. I normaly use gentoo, compiling packages is a little too slow on it.

My image is a pure installation image, you should start here: Installation - Alpine Linux
I have only preinstalled sshd and enabled network.
Just keep my uImage and uRamdisk.

Important is: are the packages available you need? look here: Alpine Linux packages
Using “edge” is no problen.

I missed “mmv”, “convmv” already.

We can try archlinux too. When you have the UART connected, every armhf
distribution should work.

I’m currently playing with debian-stretch.

Johns

The easiest way to install debian stretch seems to use the alpine image.
Make DOS and EXT4 partition on USB stick.

Install alpine on DOS partition and boot

mount /dev/sdb2 /mnt
setup-apkrepos 
apk add debootstrap perl
debootstrap --variant=minbase --no-check-certificate --arch armhf stable /mnt

chroot into the new debian, setup password, network and ssh and boot and pray.

Johns