Build a new kernel (and kernel modules) for the LinkStation

'' This article Based on work by frontalot, and timtimred. Originally by timtimred. at Linkstationwiki.org ''

Abstract
This article is for people that want to build a new kernel for the LinkStation. We will use the powerpc-hdhglan LinkStation for our example.

Prerequisites
This article assumes that you have installed Projects/OpenLink or Projects/FreeLink and the appropriate development tools. You also will need the kernel source code, a working kernel .config, and any applicable patches. You may download them from [here].

Cross-Toolchain | You can build the kernel and kernel modules much, much faster by using a cross-toolchain.:)

Method
tar -xvzf linux-sources-2.4.20-lsw-ppc-hg1.tgz mkdir /usr/src ln -s /path/to/kernel/directory /usr/src/linux cd /usr/src/linux
 * Extract the kernel source code somewhere sensible. Mine lives in /mnt/ somewhere with an alias to it from /usr/src/linux to keep it off the tiny system partition:

make menuconfig
 * Copy the kernel .config to the kernel source directory then run:


 * You can add/remove features to/from the kernel. Note that the supplied kernel .config will build properly so any errors when compiling are most likely due to your modifications.

make oldconfig make dep make objcopy -O binary vmlinux
 * Compile the kernel. Make sure you have something else to amuse you because this takes a while:

make modules make modules_install
 * Compile the kernel modules. This step may take some time depending on the modules you selected:

cp -r release_modules/lib/modules/2.4.20_mvl31-linkstationwiki-hg1/ /lib/modules/
 * Now copy the kernel modules to the correct place:

depmod -a
 * Load your new kernel using the kernel loader how-to. Then build the kernel module dependencies:


 * You should now have a working kernel replacement and be able to load some shiny new kernel modules!