ODROID/Hardkernel Linux kernel
Hardkernel has made their own fork of the Linux kernel for all of the ODROID devices, which we will use to build a working Linux kernel image. It may be possible that you have to check out a specific branch for your device, for instance, to check out the odroid-3.8.y branch, you can do the following:
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroid-3.8.y odroid
After the kernel has been cloned, you can set the current directory to where it has been cloned:
Now it is time to configure the kernel. The available configurations within a branch can be found in arch/arm/configs. For instance, if you want to build the Linux kernel for the ODROID-U2 using the odroid-3.8.y branch, you can run the following:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make odroidu2_defconfig
If you want to modify the configuration, it can be found in .config, or you can run the following to interactively alter certain options:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make menuconfig
Upon configuring the kernel, it is now possible to build the kernel image and the modules:
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make -j3 zImage modules
The -j option allows you to specify how many threads should be used. The recommendation is to specify the number of processor cores and/or hardware threads, plus one (e.g. on a dual-core processor with hyper-threading, the suggested number is 5).
After the build process has finished, the kernel image and the modules can be installed to the boot and the root partition, respectively (in the example below, they are assumed to be /dev/mmcblk0p1 and /dev/mmcblk0p3, respectively):
mount /dev/mmcblk0p1 /boot mount /dev/mmcblk0p3 /mnt/extern cp arch/arm/boot/zImage /boot CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm INSTALL_MOD_PATH=/mnt/extern make modules_install
The Linux kernel should now be successfully set up for your ODROID device.