Clean OS (Debian), OpenMediaVault and other "firmwares"

Hi and thanks for answering. Could you tell me how i can realize that and what i have to do? This moment i have installed the Clean Debian Wheezy Test Build with 64k and WD Patch, which you can download from this thread. And what next now?

1 Like

Hi @Fox_exe and anyone else that could help me.

I installed DSM5 on my Gen1 WD MyCloud last year and it went smoothly. However, recently, it doesn’t seem to get an IP Address when booting. I have to physically unplug the lan cable and replug it for it to register, get an ip address (which is already a static ip address) and access the device. Is there a fix for this? Can anyone help me?

Any help is greatly appreciated.

Hey @Fox_exe I’ve made a lot of progress rebuilding a debian file system and walking through the entire process. I had a couple of things come up. One little thing is I noticed in your LED driver script some of the comparison operators only work with bash and not sh/dash (== etc). I made a few changes there. I was a little confused on this part of your init script:

if [ -b $SWAP_DEV ] && [ -b $ROOT_DEV ] && [ -b $DATA_DEV ] && [ ! -b $CONF_DEV ]; then
  mount $ROOT_DEV $ROOTFS || run_shell

  if [ -h $ROOTFS/linuxrc ]; then
      umount /sys 2> /dev/null
      umount /proc 2> /dev/null
      umount /dev/pts 2> /dev/null
      umount /dev 2> /dev/null
      exec switch_root -c /dev/console $ROOTFS /linuxrc || run_shell
  fi
fi

I’m having a hard time understand what this does? I also had one other question. In the clean debian image, is the standard debian init system ever run (/sbin/init)? Maybe I’m looking at the wrong image, but I don’t see it yet. Do I need to pivot root from ram fs? Thanks again for all of your work and help. I’m going to write up a tutorial etc when I’ve finished and hope to contribute. [EDIT] I may have answered my own question. I guess this part is the root pivot? And we only pivot to the disk root (not ram) if linuxrc doesn’t exist? Thanks again!

Hi, browsing in the files I found my cloud mirror and etc… But I dont wanna risk, becauuse my model is My Clod Personal Network Amazon.com and the models are not very clear in the official page, so then its to know which firmware to download

Its just “WD MyCloud” (Personal Network Storage = NAS = Network attached storage - Just a device “type”, not model name).
But i dont shure what generation is it. Meybe 1, maybe 2… Need check Firmware version (v04.xx or v03.xx - Gen1, v2.xx - Gen2) or serial number (If ends with 00 - Its Gen1, 10 - Gen2)

Yep. but pivot_root not work for me, so i use switch_root. Its same.
Also ui use /linuxrc as main init script (For use ramdisk for any linux distro, where init may be not /usr/init, but something else)

About script: Introduction to if
First string - Check if all partitions exist and its a “block device” (Also check partition for config. Its exist only in original firmware). I use it for check if original firmware installed.
Next - Mount root file system
… check if /linuxrc in rootfs exist and its a “symbolic link”.
… Unmount all unused file systems (Because initscript mount it again while boot and you get startup errors)
… switch_root - use /dev/console (Current console) as main console. Mount $ROOTFS as root “/”. And run /linuxrc as main program (init). /linuxrc - just a link to default /usr/sbin/init (systemd in Jessie, initd in Wheezy)

@Fox_exe Thanks for the help. So far I’ve built a successful initrd, recovery initrd, and a clean debian system using deboostrap. They all work great using your kernel uImage. My next goal is to rebuild the marvel linux kernel from their github source. I’m trying to build using the toolchain provided in the WD source download and your helpmebuild script. I know that you have added a number of patches and additional enhancements, but should I expect a vanilla marvel linux kernel to function? I’m not able to find a armada-375-wdmc-gen2.dtb file int the download. What is the difference between your build and the WD uImage? Thanks again for your help!

WD uses Marvell kernel (But old version) + Patches for non-standart memory page size (SW and HW/MMU support). And few additions in iScsi module.

If use correct dtb file - you can use stock Marvell kernel or lates linux kernel (4.x.x). Its work. But dont have some functions (Internal flash support, wrong thermal data, no gpio-led/buttons etc.)

@Fox_exe Thx. I was able to build the marvel kernel but like you mentioned it looks like the kernel fails to detect USB drive and led etc don’t work. I think I may have accidentally overwritten your config file when i ran make menuconfig? I also had to patch a file for it to build, but i suspect that was due to my bad configuration. In your files you mentioned making the kernel modules as optional. These modules are build into the Kernel right? Is it important that I build these? Or is this only if you want to add a module with depmod/modprobe later? I’m relatively new to Kernel building. If you would like to check out the repositories, I have tried to credit you. My goal is to build from the ground off following your work and to keep it as simple as I can for my own understanding. I forked the Marvell Kernel for the kernel source, and used deboostrap for the initrd and rootfs. It would be great to get your feedback. I’ve got a lot more to add but not a lot of time:

You can find kernel config in my archives. Just kopy it to kernel sources (rename to .config).
After that - you can run menuconfig for change this config (add/remove modules and other options).
In WDMC Gen2 USB not work. I dont find why (Seems like need driver for external USB chip. He connected to PCIe #1. Or some patches from WD kernel)
In WDMC Mirror Gen1 - Need enable USB power by GPIO pin №13 (Fixed in DTB file).
In WDMC Mirror Gen2 - USB work perfect “out-of-the-box”.

Okay. Thanks for your help. I’ll work on the USB and share what I find. Your recover image kernel seems to have USB working. Is it using the WD kernel? I see there is an eth0 Mac address script. Why is this important?

Because MAC stored in internal flash. Kernel dont known it. So, need some “workaround” for assign real MAC (Instead of preconfigured in DTB).
Another way: u-boot “atags” (Kernel can load u-boot variables during boot). But its not work.

About “recovery” - I make this image from “Buildroot” tool (And slightly cleanup). Also its good tool for make some software with “native” hardware support and CrossCompiler for our CPU (Newest version).

Hey @Fox_exe, I’m working on getting USB to work. It looks like its an on chip feature. The reason I was curious about the usb recovery Kernel is it seems like USB works when I use it. Is that kernel build from marvell-linux sources? I would like to integrate your patches also for LED etc, but I’m not sure which ones I need. [EDIT] It looks like your USB recovery Kernel is the only one I can get too boot debian. Everything else fail to find all devices, like there is a udev problem. Is your source for this kernel available?

Yes, recovery uses WD kernel. So alost all functions work.
All sources, what i have available on gdrive or ftp.anionix.ru

Okay. Great. Thank you!

Hey Fox_exe. I’m sorry for a ton of questions. This is my last one =) I’m trying to find the original uImage used in your My Cloud 2 Gen recovery archive. I went through all of the WD downloads and was unable to build that same Kernel and have it work.

Which download from the WD site can I use to download that kernel you are using? Is it from the most recent 2.X firmware?

THANKS again so much!!

It turned out none of my builds of the WD Kernel would boot with debian’s systemd because systemd requires kernel config CONFIG_FHANDLE to be set.

see requirements section here:
https://cgit.freedesktop.org/systemd/systemd/tree/README

Hello everybody,

i was happy to find this topic here, for installing a new OS on the WD box.
unforturnately i made something wrong, and dont know how to fix my issue.
i would like to ask u how i can get out of this and get my box running again.

WD My Cloud 2 TB, 1 bay, Gen 1

I installed the Debian clean system, everything was working fine, but couldnt install the OMV.
So i installed the image with the OMV preinstalled, and there the problem came.

That was the last output i got from it:

root@MyCloud:/home# ./install.sh

Ok, lets go…
Stop all processes…
forked-daapd: no process found
[ ok ] Stopping cron (via systemctl): cron.service.
./install.sh: line 44: wdAutoMountAdm.pm: command not found
Recreate mdraid partitions:
Restoring raid…

Current device: /dev/md1
Upgrade device: /dev/md0
Upgrade part: /dev/sda1
Current raid status:

Personalities : [linear] [raid0] [raid1] [raid10]
md1 : active raid1 sda1[1] sda2[0]
1999808 blocks [2/2] [UU]

unused devices:

Creating new mdraid volume…
mdadm: set /dev/sda1 faulty in /dev/md1
mdadm: hot removed /dev/sda1 from /dev/md1
Installing new data…
Done! Cleanup…
Reboot to take effect…
root@MyCloud:/home# Not writing utmp record, assuming that systemd-update-utmp is used.
Rebooting.
packet_write_wait: Connection to 192.168.1.10 port 22: Broken pipe

UPDATE: and i get now a solid white LED as status

I hope somebody knows how to help me.
thank your very much.

  • laonex

If you can ssh in still, i would ssh in and take a look at / share the debian boot log. If you can’t ssh in I would try booting from Fox’s usb boot drive and telnet in to recover and try again.

Hello acole, thanks for your reply. I can´t SSH it anymore. Fox´s USB Boot drive also doesn´t work.
I as well tryed the Recovery.zip with the DHCP method, also doesn´t work.