I have been investigating this and playing a little…
The downloadable “firmware” for the WD My Cloud is just the raw boot image.
During an “upgrade” operation it splits the md based mirror and just does a dd of the raw image to lay it down.
It then copies all the customized configuration files over to the newly built image and boots from it.
I have already used this to “de-soft-brick” after I upgraded PHP to load OwnCloud… that broke the UI… doh.
I was able to run the script “updateFirmwareFromFile.sh” in /usr/local/sbin to perform the de-brick.
I downloaded the firmware zip and extracted the .deb file and planted it on the MyCloud in /CacheVolume
Then did… /usr/local/sbin/updateFIrmwareFromFile.sh /CacheVolume/sq-030104-139-20131028.deb
Worked like a charm to undo my “soft brick”. I say soft brick since the UI was non-functional but ssh was fine.
The “masterInstall.sh” script in /usr/local/sbin looks quite interesting also, I have not finished reading that over yet.
It appears to format the drive and start from scratch… Anyone else reverse engineer this script yet?
All these scripts are part of the wd-nas pkg:
WDMyCloud:/usr/local/sbin# dpkg -L wd-nas | grep -i install
Some snippets from the update.log:
Preparing to replace sq 03.01.04-139 (using …/sq-030104-139-20131028.deb) …
Master package name: sq
disable lazy init
stopping duplicate md device /dev/md0
Restore raid device: /dev/sda1
Restore raid device: /dev/sda2
Prepare for upgrade pkg install…
mdadm: set /dev/sda1 faulty in /dev/md1
mdadm: hot removed /dev/sda1 from /dev/md1
Preparing FW upgrade image on: “/dev/md0”
Unpacking replacement sq …
Setting up sq (03.01.04-139) …
root: ## postinst ##
/var/lib/dpkg/info/sq.postinst: line 6: /CacheVolume/upgrade/disk-param.conf: No such file or directory
root: ## postinst_body ##
root: ## postinst_header ##
postinst: Master package name: sq
postinst: sq-postinst: action=configure
root: ## postinst_image ##
Copy image to upgrade device /dev/md0:
mounting new root file system
root: sourcing new config files