Install a customised kernel to the WDH1NC10000 (MBWE)

I'll describe here how you can install your own modified kernel to your MBWE (WhiteLight)

WARNING: This is for Linux experts only!
NEVER try this without backing up your data!
NEVER try this without knowing absolutely sure how to unbrick your MBWE!
NEVER install a new kernel as default boot kernel without having tested it!
You use these instructions ON YOUR OWN RISK!

Prerequisites

Make backups

First, I recommend that you make a backup of all important bootloader stuff. Using my kernel-installer, this can be easily done like this:

root@mybook:~# mbwe-kernel-installer --backup

The backup files will be dumped to the directory '/var/mbwe-kernel-installer'. If you are not going to use a LOCALVERSION (see below), it also would be very wise to make backups of all original kernel modules.
Last, but most important, you should backup all your data.

Test a custom kernel that is KNOWN to work

Before you start with you own kernel (and maybe choose a configuration that does not work) please start by installing a custom kernel that is tested and is known to work.
Please have a look at my kernel installer page on howto do this and a small selection of tested kernels.
Since I think this is very important, you also find the same uImage-test in the download section at the bottom of this page.

Cross compiling the kernel

As described in my cross compiling howto, start by using the default config from WD.
Modify it according to your needs, and then compile the kernel:

cd $MBWE_SDK/kernel/kernel-source/kernel-0.4.6 export CROSS_COMPILE=arm-linux-gnueabi- export PATH="$PATH:$MBWE_SDK/toolchain/bin" make zImage

Create the uImage

cp $MBWE_SKD/kernel/kernel-source/vendor/u-boot/tools/mkimage $MBWE_SDK/toolchain/bin/ cd $MBWE_SDK/kernel/kernel-source/kernel-0.4.6 export CROSS_COMPILE=arm-linux-gnueabi- export PATH="$PATH:$MBWE_SDK/toolchain/bin" make uImage

If for some reason this does not give you an uImage with the correct load address and entry point, you can also create the uImage "by hand" to fine-tune these parameters like this:

mkimage -A arm -C none -a <load address> -e <entry point> -d zImage uImage

What are the correct loadaddress and entrypoint? Well, you can dump the original kernel and look which parameters it uses like so (you already MADE a backup of it, didn't you ?!):

mkimage -l uimage-boot

Hint: you can also try to use my kernel-installer for this using the --debug command (which also dumps some other info)

Install kernel modules

Now we are about to install the kernel modules. But wait.... !

What if one of our newly created kernel modules does not work and prevent booting?
Then we also could not boot using the backup kernel - the box would be bricked !

We need a way to ensure that the (original) backup kernel loads the original, unmodified modules.... here is how I solved this problem (if you have other/easier/better ways, feel free to tell me)

This way, your modules will be in a separate path and the original modules remain untouched.

Installing the uImage

Since using wrong sector offsets or making typos would BRICK YOUR BOX, I recommend using my kernel-installer. Though it is not completely fail-safe, it will protect you from the most silly things:

To install the kernel as alternate boot image for testing (STRONGLY RECOMMENDED), type

mbwe-kernel-installer --install-test uImage

Now you can test if this kernel works by interrupting the boot process by hitting a key on the serial console, and then entering the command 'run select0 load2 boot'.
Please note: If you play around with the bootloader and stumble over the command it executes on boot, you could get the impression that u-boot automatically loads the backup-kernel if the default-kernel fails. THIS IS WRONG. If you look close, you'll see that this is only the case when LOADING the default kernel fails, but NOT when the default kernel does not boot.

To install the kernel as default boot image (once you MADE SURE THAT THE KERNEL BOOTS), type

mbwe-kernel-installer --install-boot uImage
WARNING: If the default kernel does not boot, YOUR BOX WILL BE BRICKED !!!!

Further info

If you do not want to use my installer but rather use 'dd', you'll need to know the sector offsets. You will find them on my disk offset table, but please make sure they are the same on your MBWE before using them!

Downloads

Thanks

Thanks to Dmitry Samersoff who helped me a lot to figure out how to get a self-compiled kernel to boot on the MyBook World.