Breathing new life into MBL (new disk/sleep monitoring/miniDLNA/openvpn)

COMPILE KERNEL for MY BOOK LIVE

TUN device is required for OPENVPN. I tried to use the previously compile TUN module provide in forums and failed. Perhaps those TUN modules are outdated. I tried to compile and install the TUN module but it also failed. There are successful implementations on OPENVPN easily meant that previous WD version might even have the TUN device build-in.

Anyway, I can only make this work only with the compilation of the whole kernel under the current version of WD firmware.

The basic steps are very similar to this link: Compiling a My Book Live Kernel - Hacking WD MyBook World Ed.

I added my comments on kernel configuration which was a bit blurred in the link.

Environment: My Book Live firmware with version 02.43.10-048 (released in June 2015)

Copy the warning statement from the link: THIS PROCEDURE HAVE A VERY HIGH POTENTIAL TO BRICK YOUR WD DEVICE! ONLY BUILD A NEW KERNEL IF YOU REALLY KNOW WHAT YOU ARE DOING.

Steps 1 to 6 are very similar to the above link:

1. Install the required tools:

aptitude install gcc-4.3 libncurses5-dev make patch uboot-mkimage

Notice: If you run into trying to overwrite ‘/etc/ld.so.conf.d/powerpc-linux-gnu.conf’, which is also in package wd-lib issue, refer to Broken dependencies on WD mybook life running lenny/squeeze - Debian User Forums

2. Set gcc alternatives:

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 --slave /usr/bin/cpp cpp /usr/bin/cpp-4.3

3. Create the build directory:

mkdir /Datavolume/build
cd /Datavolume/build

4. Download the relevant GNU package that matches with the actual system level

wget http://download.wdc.com/gpl/gpl-source-mybookliveduo-02.43.10-048.zip

5. Unzip the GNU package

apt-get install unzip
unzip gpl-source-mybookliveduo-02.43.10-048.zip
cd /DataVolume/build/packages/kernel_2.6.32-11

6. Download and install a kernel patch which addresses a build failure:

wget http://mybookworld.wikidot.com/local--files/compiling-mybook-live-modules/kernel_2.6.32-11-crtsavres-v2.patch
patch -p0 < kernel_2.6.32-11-crtsavres-v2.patch

7. Configure the kernel, in which I tried to enrich more details.

7.1 Prepare a sample config file and start menuconfig:

make 44x/apollo_3G_nas_defconfig
make menuconfig

7.2 Configure the kernel

Add TUN module: Device Drivers-> Network Device Support-> put a M next to Universal TUN/TAP device driver support

And as suggested by the link, disabled XFS, USB, NTFS, FAT (as MBL does not have USB):

XFS: File system → XFS filesystem support
USB: Device Drivers → USB support
NTFS/FAT: File system → DOS/FAT/NT Filesystems (and disable everything under the submenu)

8. The step was marked as important in the guide:

cp .config ~

Just if there are any directory/file with the same name (which I encountered this problem), rename the existing file/directory and try again.

9. Download a new build.sh:

rm build.sh
wget http://mybookworld.wikidot.com/local--files/compiling-mybook-live-kernel/build.sh

10. Build kernel:

./build.sh

Please make sure the swap memory is on (via the top command) or the compilation would fail due to out-of-memory.

It take 90 minutes to compile. After compilation, if file/directory is renamed in step 8, please remove the .config file in root directory and restore the old file/directory.

11. Ensure if everything was built correctly, and the resulting artifacts are written at /newkernel.

12. POINT OF NO RETURN: If things are OK and got the balls needed to overwrite the kernel, install it.

Backup the (i) /boot/uImage and (ii) all files under /lib/modules
Use Filezilla to delete everything under /lib/modules

Then:

cd /boot
mv /newkernel/lib/modules/2.6.32.11 /lib/modules
cp /newkernel/boot/uImage /boot

*** Please ensure the modules are really copied across to /lib/modules. ***

13. Restart the system

14. If everything went nicely, the system will boot up in the new kernel.

15. Try the commands after reboot to ensure the TUN module works:

 modprobe tun
 lsmod

16. We now have a working TUN module and a customized kernel.

The author of the original link is trying to install iptables. Kernel configuration for iptables can be found in the link: http://www.gentoo-wiki.info/HOWTO_Iptables_for_newbies. After compiling the kernal and install iptables, we can define firewall rules in MBL.

1 Like

Final thoughts

It started when I bought a Smart TV trying to eliminate my MiBox media player, have a cleaner desk and less wirings. MiniDLNA is used to replace the sluggish WD DLNA and it was so successful.

Then I try to get rid of the DD-WRT router, which sole purpose is a 24 * 7 openvpn server consuming 8W of electricity.

With the successfull installation of OPENVPN server in MBL, then MBL did not sleep. So I delved into links related to this area, finally realized that the setup recommended in the link was writing log to disk (instead of ramdisk) every 15 minutes. No wonder the device was waking up after sleeping for just 5 minutes.

Every move has a purpose, though whether it is worthwhile to invest so much energy and time in a legacy (but still effective) product is debatable.

In some part of the globe, 90% of forum messages can be filtered off as they are meaningless replies such as start from scratch, format hard disk, reinstall windows. There are links threw out which are inconclusive or even contentious. There are no comments from the persons posting the links to indicate whether they really understood or tried the ideas in the link. This forum is so different: resourceful, helpful and peaceful.

For ordinary users, a fully functional up-to-date NAS available in the consumer market, and/or a mid-end home router with openvpn preinstalled is always the preferred choice.

Playing around with MBL is really ‘breathing new life’ back into a discountinued product. I would still prefer to have miniDLNA over a US$20 Twonky version 8 simply because the free miniDLNA software supports .rm and .rmvb videos vs Twonky’s simpler one time setup/configuration but no realmedia video support. Donating 10 pounds to join MBL optware club for an automated openvpn installation scripts is quizzical. The firmware versions supported for the script were not stated, or, some answers under the last Q&A in 2013 was a bit deviated from usual experience in DDwrt/Openwrt VPN setups. The adminstrators of the optware club might need to update the website in order to attract continuous donations from more MBL users. Well, the question should be if there are still any market at all.

Thanks for reading.

1 Like

Very nice guide. Thank you for the time you spend to write it. I have a My Book Live DUO, so I am a little bit nervous if the kernel patch works for me. Thank you again.

Thanks very much for your excellent guide.
As I’m very late to this party, I encountered various problems (like minidlna new version).
But the most annoying thing is that the linux compiling files are not anymore available in the archive shared by you (https://dl.dropbox.com/u/19024553/libc_for_02.11.09-053.tar).

As my Linux skills are just a liitle above zero, could you - or other kind soul here - to repost a new available link for these files, or alternatively to show as - step by step - how to compile minidlna on My Book Live?

Thanks in advance!