[GUIDE] How to write a custom firmware to your MBL

This Guide is now used in conjunction with the Guide I created to make a custom firmware file

 

This guide will restore your drive to the exact state it was in when you use the following guide to make a custom firmware image

 

http://community.wd.com/t5/My-Book-Live/GUIDE-Build-a-Custom-Firmware/m-p/533729#M18066

There are now 3 versions of the guide to choose from and it is now hopefully more Mac friendly as well.

(GUIDE 1) Replaces the resetButtonAction.sh script by simply uploading a .deb file from the MyBookLive Dashboard so that it writes your custom firmware when you press the reset button.

updateFile.deb UPDATED TO WORK WITH CURRENT AND FUTURE FIRMWARE

(GUIDE 2) Manually replace the resetButtonAction.sh script so that it writes your custom firmware when you press the reset button.

(GUIDE 3) Allows you to run the script manually from either PuTTY (Windows) or Terminal (Mac) so that it writes your custom firmware to the drive

No data will be lost on the data partition.

Take note of all the share names you created in the dashboard of your MyBookLive under Shares prior to holding down the reset button.

_____________________________________________________________________________________________________

(GUIDE 1) The easiest of the guides to follow

  1. Copy “rootfs.img” to the root of your Public share on your MyBookLive

  2. Download my updateFile.deb from http://www.mediafire.com/?6yyo0vacy2ijquv

  3. Open the dashboard and go to Settings/ Updates /Update From File and point it to updateFile.deb that you downloaded in step 2 and click OK

  4. My updateFile.deb will simply copy my modified resetButtonAction.sh file to your MyBookLive

  5. Your drive will reboot…Wait until the drive fully boots (Green LED)

  6. To execute the script press and hold the reset button on the MyBookLive for 5-6 seconds or until the LED starts blinking red

  7. The LED will blink red while the script is restoring your custom firmware

  8. After several minutes, the drive should reboot and when you get to a solid green LED, access the dashboard and you should be back to the exact state you were in when you created your custom firmware

  9. If your shares disappeared on the MyBookLive, fear not, the data is still there and you just need to recreate the shares under the dashboard again and all your data will be there

  10. Please note, you will need to upload my updateFile.deb from the dashboard any time you restore or downgrade the firmware on the drive as it will overwrite the modified script file

If your shares are still listed in the MyBookLive dashboard but are not accessible, rename the shares and then rename them back to get them linked properly again.
Example: Movies> Movies1>Movies

If your shares are missing in the MyBookLive dashboard, recreate them in the dashboard and you will be able to access your data again

A reboot is required to get the share and drive usage totals to reflect the actual data usage after these changes
_____________________________________________________________________________________________________

(GUIDE 2) For those wanting to manually replace the resetButtonAction.sh script so the script will run by simply pressing the reset button

  1. Download resetButtonAction.zip from http://www.mediafire.com/?42pv7zrx1kx3xkk

  2. Copy rootfs.img to the root of your Public folder on the MyBookLive

  3. Unzip resetButtonAction.sh from the zip file downloaded in step 1

  4. Windows users download  WinSCP from http://winscp.net/download/winscp510setup.exe
     4a) Mac users download CyberDuck from http://cyberduck.ch/Cyberduck-4.2.1.zip

  5. Enable SSH access on your MyBookLive by going to http://mybooklive/UI/ssh

  6. Windows users start WinSCP and enter the login info…Host: mybooklive  Username: root  Password: welc0me
     6a) Mac users start CyberDuck to login to the MyBookLive using SFTP  Host: mybooklive  Username: root  Password: welc0me  Port: 22

  7. Browse to /usr/local/sbin and copy resetButtonAction.sh from the MyBookLive to your computer so you have a backup

  8. Copy resetButtonAction.sh that you unzipped in step 3 to /usr/local/sbin and when asked, overwrite the existing file

  9. To execute the script press and hold the reset button on the MyBookLive for 5-6 seconds or until the LED starts blinking red

  10. The LED will blink red while the script is restoring your custom firmware

  11. After several minutes, the drive should reboot and when you get to a solid green LED, access the dashboard and you should be back to the exact state you were in when you created your custom firmware

  12. If your shares disappeared on the MyBookLive, fear not, the data is still there and you just need to recreate the shares under the dashboard again and all your data will be there

  13. Please note, you will need to overwrite resetButtonAction.sh at /usr/local/sbin any time you restore or downgrade the firmware on the drive as it will overwrite the modified script file

If your shares are still listed in the MyBookLive dashboard but are not accessible, rename the shares and then rename them back to get them linked properly again.
EX. Movies > Movies1 > Movies

If your shares are missing in the MyBookLive dashboard, recreate them in the dashboard and you will be able to access your data again

A reboot is required to get the share and drive usage totals to reflect the actual data usage after these changes

_____________________________________________________________________________________________________

(GUIDE 3) For those wanting to manually run the script without replacing the resetButtonAction.sh script you can follow this guide which will let you run the script from PuTTY (Windows) or Terminal (Mac)

  1. Download resetButtonAction.zip from http://www.mediafire.com/?42pv7zrx1kx3xkk

 1a) Or try the new resetButtonAction_v2.zip http://www.mediafire.com/?lk5pcd3rg50ddo2

  1. Copy rootfs.img to the root of your Public folder on the MyBookLive

  2. Unzip resetButtonAction.sh from the zip file downloaded in step 1 and rename it to downgrade.sh

  3. Windows users download WinSCP from http://winscp.net/download/winscp510setup.exe
     4a) Mac users download CyberDuck from http://cyberduck.ch/Cyberduck-4.2.1.zip

  4. Enable SSH access on your MyBookLive by going to http://mybooklive/UI/ssh

  5. Windows users start WinSCP and enter the login info…Host: mybooklive  Username: root  Password: welc0me
     6a) Mac users start CyberDuck to login to the MyBookLive using SFTP  Host: mybooklive  Username: root  Password: welc0me  Port: 22

  6. Copy downgrade.sh from step 3 to /usr/local/sbin

  7. Download PuTTY from http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

  8. Windows users open PuTTY and enter the MyBookLive hostname or IP and click the OPEN button
     9a) Mac users start Terminal and enter the MyBookLive hostname or IP
     9b) Username: root  Password: welcome (Password will not be shown in the window as you type it)

  9. Make the script executable in either PuTTY (Windows) or Terminal (Mac) by typing
    cd /usr/local/sbin
    chmod 755 downgrade.sh

  10. Run the script in PuTTY (Windows) or Terminal (Mac) by typing
    /usr/local/sbin/downgrade.sh

  11. The LED will blink red while the script is restoring your custom firmware

  12. After several minutes, the drive should reboot and when you get to a solid green LED, access the dashboard and you should be back to the exact state you were in when you created your custom firmware

  13. If your shares disappeared on the MyBookLive, fear not, the data is still there and you just need to recreate the shares under the dashboard again and all your data will be there

If your shares are still listed in the MyBookLive dashboard but are not accessible, rename the shares and then rename them back to get them linked properly again.
Example: Movies>Movies1>Movies

If your shares are missing in the MyBookLive dashboard, recreate them in the dashboard and you will be able to access your data again

A reboot is required to get the share and drive usage totals to reflect the actual data usage after these changes

login as: root
root@192.168.1.6's password:
Linux MyBookLive 2.6.32.11-svn52288 #1 Wed Oct 26 18:57:59 PDT 2011 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Disclaimer: SSH provides access to the network device and all its
content, only users with advanced computer networking and Linux experience
should enable it. Failure to understand the Linux command line interface
can result in rendering your network device inoperable, as well as allowing
unauthorized users access to your network. If you enable SSH, do not share
the root password with anyone you do not want to have direct access to all
the content on your network device.


MyBookLive:~# cd /usr/local/sbin
MyBookLive:/usr/local/sbin# chmod 755 downgrade.sh
MyBookLive:/usr/local/sbin# /usr/local/sbin/downgrade.sh


currentRootDevice = /dev/md1
upgradeRootDevice = /dev/md0

Ensure both partitions are members of the original MD device
mdadm: hot remove failed for /dev/sda1: Device or resource busy
mdadm: Cannot open /dev/sda1: Device or resource busy
mdadm: hot remove failed for /dev/sda2: Device or resource busy
mdadm: Cannot open /dev/sda2: Device or resource busy

Setting up the upgraded raid unit
mdadm: /dev/sda1 appears to contain an ext2fs file system
    size=1999808K mtime=Wed Dec 31 16:00:01 1969
mdadm: size set to 1999808K
mdadm: creation continuing despite oddities due to --run
mdadm: array /dev/md0 started.
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
125184 inodes, 499952 blocks
24997 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
7824 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Checking for bad blocks (read-only test): done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Copy image to upgrade device /dev/md0
3999616+0 records in
3999616+0 records out
2047803392 bytes (2.0 GB) copied, 121.793 s, 16.8 MB/s


all done, now rebooting

Broadcast message from root@MyBookLive (pts/0) (Thu Oct 18 06:04:42 2012):
The system is going down for reboot NOW!
MyBookLive:/usr/local/sbin#

All credit for the script goes to Dan Kvelstad (With a small modification made by me) You can see his thread at http://mybookworld.wikidot.com/forum/t-368098/debricking-script-that-can-keep-datahttp://

Hello,

Thanks for this amazing guide.