ODROID U2

From Funtoo Linux
Revision as of 04:43, 18 January 2013 by Jeanfrancis (Talk | contribs)

Jump to: navigation, search

The [ODROID U2 ] is an ARM development board, featuring a 1.7 GHz quad-core CPU (ARMv7a). This document contains notes about installing Funtoo Linux on this device.

Contents

Preliminary discussion

The ODROID-U2 needs u-boot as a bootloader, and at the time of writing this document, the required sources are not available. Some forum posts seem to indicate that they were once available, but other posts say that it never worked.

Some distributions (Ubuntu for example) already have SD-card images for the U2. This means that somebody has (or had) found the necessary information. To keep tracks, the last section will show how a working Ubuntu SD-card image has been used to bootstrap this Funtoo installation. The other sections will be edited after a better solution is found.

The following sections contain a quite unusual way of getting Funtoo installed, but will be updated when missing software is available.


Micro-SD Card Preparation

As there is missing software from upstream, we need to start with a SD-card image containing the bootloader (u-boot), and a boot partition containing the files that are required at boot-time. To do this, we started with an Ubuntu SD-card for the ODROID-U2 (see the last section for details).

First, download the u-boot and boot partition image.

Then, extract it and copy it over your SD-card (we will use /dev/sdb for the rest of this document, adjust as needed).

# gunzip odroid_u2_uboot_and_boot_partition-2013-01-17.img.gz
# dd if=odroid_u2_uboot_and_boot_partition-2013-01-17.img of=/dev/sdb

You should now have the following partition schema:

#  cfdisk -P s /dev/sdb                                                                                                                                                                                                                             
Partition Table for /dev/sdb
               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
   Pri/Log           0        3071*     0#       3072*Free Space           None
 1 Primary        3072*      68607*     0       65536*Linux (83)           None
 2 Primary       68608*   11472895*     0    11404288*Linux (83)           None
   Pri/Log    11472896*   15661055*     0     4188160*Free Space           None
------------------------------------------------------------

The bootloader requires some of the space that is available at the beginning of the device. Don't override this free space, as it is not "free".


The boot partition /dev/sdb1 is formatted as FAT32 and contains some files. The other partition appears as the partition table has been copied, but it is not formatted.

Remove this partition (/dev/sdb2) and add other partitions to fit your needs. In the following example, there is a 1GB swap partition and the remaining space is used as an ext4 root partition.

Partition Table for /dev/sdb
               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
   Pri/Log           0        3071*     0#       3072*Free Space           None
 1 Primary        3072*      68607*     0       65536*Linux (83)           None
 2 Primary       68608*    2074741*     0     2006134 Linux swap / So (82) None
 3 Primary     2074742*   15661055*     0    13586314*Linux (83)           None
------------------------------------------------------------
# mkswap /dev/sdb2
# mkfs.ext4 /dev/sdb3

Boot partition setup

To be continued...

Funtoo Linux Installation

Follow the guide from [Funtoo_Linux_Installation_on_ARM] for


Personalized Kernel Compilation

Cross-compiler installation

In order to compile the Linux kernel for the ODROID U2, an ARMv7a hardfloat toolchain is needed. Install it using crossdev:

#  emerge crossdev
#  crossdev -v -t armv7a-hardfloat-linux-gnueabi (also add -S if you want a stable toolchain)


Kernel Compilation an Installation

The kernel for the ODROID U2 can be directly compiled from the sources, given by hardkernel. Note that there are several branches (odroid-3.0.y, odroidx-3.6.y and odroid-next when this page was written), but we will stick with the default branch as it provides a defconfig for a simple start.

#  cd ../odroid_u2
#  git clone https://github.com/hardkernel/linux.git
#  cd linux
#  ARCH=arm make odroidu2_ubuntu_defconfig
#  ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make -j8 (adapt depending on the number of cores available on the build machine)
#  ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make modules_install INSTALL_MOD_PATH=/mnt/SD_root


Miscellaneous

Bootstrapping a Funtoo installation using an Ubuntu SD-card Image

[Ubuntu for ODROID-U2] is a port of Ubuntu working on the ODROID-U2. They provide a working SD-card image that already contains the necessary first bits of information (u-boot image) on the beginning of the SD-card, a fat32 boot partition with boot files, and an ext4 partition for Ubuntu root filesystem.

The following steps are inspired by [work of kripton that provides a Gentoo SD-card image].

We will use it to bootstrap a Funtoo installation, and try to find a better solution in the future.

1. Download a SD-card image from [[1]]. 2. Extract it if it's compressed. 3. Run dd if=name_of_image of=/dev/your_sd_card_device

After a while, this should give you the following partition table:

Partition Table for /dev/sdc
               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
   Pri/Log           0        3071*     0#       3072*Free Space           None
 1 Primary        3072*      68607*     0       65536*Linux (83)           None
 2 Primary       68608*   11472895*     0    11404288*Linux (83)           None
   Pri/Log    11472896*   15661055*     0     4188160*Free Space           None
------------------------------------------------------------

To provide a starting point for a Funtoo installation, we will reuse the first 68607 sectors if this installation to extract the boot loader and the boot partition.

# dd if=/dev/sdc of=uboot_and_boot_partition.img bs=512 count=68607

This is it! This file will be used to install Funtoo and have already u-boot and boot partition available.

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff