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.