ODROID-XU: Compiling a kernel

This documents how I compiled a more recent kernel for the ODROID-XU. The good news is the hardware is pretty fast, and it doesn’t take long to compile a kernel. The bad news is it doesn’t boot with the new kernel, and because of the complete lack of debuggability, it’s impossible to find out why.

I first checked out the hardkernel git repository’s 3.11-rc7 branch. Some explanation: The upstream Linux kernel doesn’t have support for the Exynos 5410 SoC, nor for many of the peripherals on this system, and so hardkernel (the makers of ODROID) maintain a set of patches on top of the upstream kernel which they rebase periodically. In this case there are approximately 60 extra patches on top of the upstream 3.11-rc7 kernel, starting with this patch to add basic support for the 5410 and continuing by adding more and more peripheral support.

(Note that this 3.11-rc7 branch is still missing support for important features like USB 3.0 and the GPU. Also this kernel is still using the ARM big.LITTLE switcher hack so still no KVM for you. YMMV)

After checking this out (on the ODROID) I did:

make odroidxu_defconfig
make menuconfig

You can then build the kernel in the usual way:

make -j5

Then install the modules (in this case to /lib/modules/3.11.0-rc7-66032-g4521a9d/):

sudo make modules_install
sync

And make an initramfs:

mkinitrd ./initrd-3.11.0-rc7 3.11.0-rc7-66032-g4521a9d
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d initrd-3.11.0-rc7 uInitrd

Finally we can install the kernel and initrd into /boot/uboot (the u-boot directory). But save a backup of the old kernel and initrd first. The following commands are run as root:

mv /boot/uboot/zImage /boot/uboot/zImage-official3.4.5
mv /boot/uboot/uInitrd /boot/uboot/uInitrd-official3.4.5
cp arch/arm/boot/zImage /boot/uboot/
cp uInitrd /boot/uboot/
sync

This is what the /boot/uboot directory ends up looking like for me:

-rwxr-xr-x 1 root root    5510 Sep 27 03:14 boot.ini
-rwxr-xr-x 1 root root  293168 Sep 27 03:14 u-boot.bin
-rwxr-xr-x 1 root root 8104359 Nov  8 07:29 uInitrd
-rwxr-xr-x 1 root root 6518598 Sep 27 03:14 uInitrd-official3.4.5
-rwxr-xr-x 1 root root 2113424 Nov  8 07:29 zImage
-rwxr-xr-x 1 root root 5127832 Sep 27 03:13 zImage-official3.4.5

Note that the u-boot configuration shouldn’t need to be modified, and in any case the configuration is signed by hardkernel so it cannot be modified (GRRRRRR, another reason to hate this hardware).

And now reboot and hope for the best. If it doesn’t come up, then you have to pull the SD card, plug it into a real computer, and switch back to the *-official* files that you backed up above. As discussed before there is no serial port or monitor, so these failures are not debuggable.

9 Comments

Filed under Uncategorized

9 responses to “ODROID-XU: Compiling a kernel

  1. Does the onboard debug serial console not work? Or do you just not have the right adapter for it?

    • rich

      It requires a special cable, and it is rumoured that if it is plugged in when the ODROID is off, then it’ll burn out the CPU. These machines need either a proper serial port or a monitor that works at boot. The Trim Slice has a proper serial port. All PCs have a monitor that works at boot.

      • Any serial adapter that handles 1.8v will work fine (for example, FTDI’s TTL-232RG-VREG1V8-WE is convenient with wire ends, and FTDI sells it directly from their UK website; there are also much cheaper modules that would require soldering). I find the CPU burning rumor unlikely, but if you hook up only the GND and RX leads, which will allow you to see debug output but not send anything, then there is no chance of destroying the ODROID, as RX is high impedance.

      • rich

        Thanks, I just ordered one of those from Farnell, total cost was £25 (includes tax and delivery).

        I should say that none of this is obvious. I’ve probably spent 2 years looking at ARM hardware and this is the first I’ve heard of this piece of equipment.

      • Just one more clarification — the photo on the farnell site is a little misleading; I think that particular cable has just bare wide ends, so it will still require soldering to the ODROID serial header, or to have a header pin crimped on, or to be connected with a small alligator clip, etc.

  2. Abner

    If you lack knowledge to build your own kernel or read the documentation, I would suggest you to use pre-built images. For example.. you want to use mainline but according to your instructions you didn’t even parsed the device tree file.
    Your second complain of requiring a magical UART adapter or that the board will burn with it is so stupid that made me kill two puppies in anger.
    And sir, you are a complete ignorant just ranting around.

    PS: I’ve read hardkernel sources for 3.11-rc7 and again, your ignorance surprises me.. There’s no big.LITTLE support there. Provided dts file (that you don’t know what the fuck it is) only configures 4 A15’s cores.

  3. Pingback: Compiling ODROID-XU 3.11-rc7 kernel, attempt 2 | Richard WM Jones

  4. Pingback: Compiling ODROID 3.12.3 kernel, attempt 3 | Richard WM Jones

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s