Using a custom kernel and loader.o

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 18:54, 15 July 2006 by RussK (Talk) (Loading Your New Kernel)

Jump to: navigation, search

These instructions will allow you to run a custom kernel, without the danger of having to reprogram your Flash ROM. Plenty of other people have already written HOWTO's. If you want to use a custom Linux 2.6 kernel, you must have udev installed. This article is based on a custom Linux 2.6.15 kernel.

For more information, check out The complete Gentoo Linux 2.6 migration guide. Other useful pages are Applying a Kernel Patch and General Kernel Build

Preparing for Install

Download the vanilla kernel source, untar it, and move into the source directory.

# cd /usr/src
# wget
# tar xvjf linux-2.6.15.tar.bz2
# cd linux-2.6.15

Download the latest kernel patch and apply it. You may need to adjust the name of the patch. The patch should support both the standard Kurobox and HG model. Please report any changes needed to the config files, or any bugs you find, on the forums. Remember to include the type of box you are running, along with any supporting information-- the more information the better.

# wget
# tar xvjf kurobox-patch-2-6-15.tar.bz2
# patch -p1 < kurobox-patch-2-6-15.patch

Configure the Kernel

Next we need to configure the kernel. There is a basic configuration with each patch.

For the standard Kurobox do this:

# cp config_kurobox .config

For the Kurobox HG do this:

# cp config_kuroboxhg .config

If you want to use the standard kernel type this:

# make oldconfig

If you want to customize your kernel type this:

# make menuconfig

Compile and Prepare the Kernel

Make the kernel and make and install the modules. This took just under 2.5 hours on my Kurobox with the standard configuration.

# make vmlinux modules modules_install

loader.o will need a binary of the new kernel, so we'll convert our new kernel and put it in /boot

# objcopy -O binary vmlinux /boot/vmlinux-2.6.15-kurobox

Loading Your New Kernel

Change to /boot and download a copy from the Kurobox download area if you don't have it yet. loader.o will work with the standard kurobox and the HG.

# cd /boot
# wget

Sync the drive, load the kernel into memory, and jump to the new kernel.

For the standard Kurobox do this:

# sync;insmod loader.o kernel=vmlinux-2.6.15-kurobox

For the Kurobox HG do this:

# sync;insmod -f loader.o kernel=vmlinux-2.6.15-kurobox

If your new kernel works, you can set up the Kurobox bootloader (more on this later).