Difference between revisions of "ODROID U2"

From Funtoo Linux
Jump to: navigation, search
(Bootstrapping a Funtoo installation using Ubuntu)
(15 intermediate revisions by one user not shown)
Line 1: Line 1:
The [[http://www.hardkernel.com/renewal_2011/products/prdt_info.php| 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.
+
The [http://www.hardkernel.com/renewal_2011/products/prdt_info.php| 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.
  
 
== Preliminary discussion ==
 
== Preliminary discussion ==
Line 5: Line 5:
 
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.
 
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 working Ubuntu was used to bootstrap this Funtoo installation. The other sections will be edited after a better solution is found.
+
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.
  
{{fancywarning|The following sections are a work-in-progress and following them will fail to work. Please see the last section.}}
+
{{fancywarning|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 ==
 
== Micro-SD Card Preparation ==
First, create the partition structure to suit your needs. In this example, there is a 100 MB boot partition, a 1 GB swap partition, and the remaining partition is for the root filesystem.
+
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).
  
{{fancywarning|The bootloader requires some of the space that is available at the beginning of the device. Keep at least 10 MB free on the beginning of the device.}}
+
First, download the [http://ftp.osuosl.org/pub/funtoo/distfiles/odroid_u2_uboot_and_boot_partition-2013-01-17.img.gz 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''').
 +
 +
<console>
 +
# ##i##gunzip odroid_u2_uboot_and_boot_partition-2013-01-17.img.gz
 +
# ##i##dd if=odroid_u2_uboot_and_boot_partition-2013-01-17.img of=/dev/sdb
 +
</console>
 +
 +
You should now have the following partition schema:
 +
 +
<console>
 +
# ##i## cfdisk -P s /dev/sdb
 +
</console>
 +
 
<pre>
 
<pre>
Partition Table for /dev/sdc
+
Partition Table for /dev/sdb
               First      Last # Type
+
               First      Last
              Sector      Sector  Offset    Length  Filesystem Type (ID) Flag
+
# Type       Sector      Sector  Offset    Length  Filesystem Type (ID) Flag
 
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 
-- ------- ----------- ----------- ------ ----------- -------------------- ----
   Pri/Log          0       40959*    0#     40960*Free Space          None
+
   Pri/Log          0       3071*    0#       3072*Free Space          None
  1 Primary       40960*     245759*    0     204800*W95 FAT32 (LBA) (0C) Boot
+
  1 Primary       3072*     68607*    0       65536*Linux (83)           None
  2 Primary     245760*    2342911*    0    2097152*Linux swap / So (82) None
+
  Pri/Log      68608*      69631*    0        1024*Free Space          None
3 Primary     2342912*  15661055*    0    13318144*Linux (83)           None
+
  2 Primary       69632*    4263935*    0    4194304*Linux (83)           None
 +
  Pri/Log     4263936*  15661055*    0    11397120*Free Space           None
 
------------------------------------------------------------
 
------------------------------------------------------------
 
</pre>
 
</pre>
  
 +
{{fancywarning|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 really "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.
  
sdc1 is formatted as FAT32, sdc2 as swap and sdc3 as ext4.
+
Remove this partition (/dev/sdb2) and add other partitions to fit your needs. Create a root partition as the second partition, starting at sector 69632. In the following example, there is also a 1GB swap partition at the end.
  
Note that the boot partition must be the first one, and that its filesystem should be FAT32 or ext2 (not tested).
+
<pre>
 +
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
 +
  Pri/Log      68608*      69631*    0        1024*Free Space          None
 +
2 Primary      69632*  13654922*    0    13585291*Linux (83)          None
 +
3 Primary    13654923*  15661055*    0    2006133*Linux swap / So (82) None
 +
 
 +
------------------------------------------------------------
 +
</pre>
 +
 
 +
<console>
 +
# ##i##mkfs.ext4 /dev/sdb2
 +
# ##i##mkswap /dev/sdb3
 +
</console>
  
 
== Funtoo Linux Installation ==
 
== Funtoo Linux Installation ==
Follow the guide from [Funtoo_Linux_Installation_on_ARM] for
+
Follow the guide from [[Funtoo Linux Installation on ARM]] to begin the installation of Funtoo on the root filesystem. Note that once you are finished, you will not be able to boot the ODROID U2 until you complete the next sections.
 +
 
 +
=== Modules ===
 +
 
 +
To be continued...
 +
 
 +
== Boot partition setup ==
 +
Mount the boot partition (/dev/sdb1) in /mnt/SD_root/boot (created in the last section). It should contain the following files:
 +
 
 +
<pre>
 +
boot
 +
├── board.dtb
 +
├── boot
 +
├── boot-hdmi1080.scr
 +
├── boot-hdmi1080.txt
 +
├── boot-hdmi720.scr
 +
├── boot-hdmi720.txt
 +
├── boot.ini
 +
├── boot.scr
 +
├── boot.scr.orig
 +
├── boot.txt
 +
├── boot.txt.orig
 +
├── config.3.0.51
 +
├── uInitrd.orig
 +
├── zImage
 +
└── zImage.3.0.51.orig
 +
</pre>
  
 +
More information to come about how to personalize the boot process.
  
== Kernel and Bootloader ==
+
== Personalized Kernel Compilation ==
  
 
=== Cross-compiler installation ===
 
=== Cross-compiler installation ===
Line 45: Line 105:
 
# ##i## crossdev -v -t armv7a-hardfloat-linux-gnueabi (also add -S if you want a stable toolchain)
 
# ##i## crossdev -v -t armv7a-hardfloat-linux-gnueabi (also add -S if you want a stable toolchain)
 
</console>
 
</console>
 
 
=== Bootloader ===
 
The bootloader to use with the ODROID U2 is u-boot. Sources are not available yet. Source code present on hardkernel's github repository is not functional at the time of writing this page.
 
 
To be continued... All repositories containing u-boot do not work. A binary version has been found, but not tested yet.
 
 
  
  
Line 64: Line 117:
 
# ##i## ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make -j8 (adapt depending on the number of cores available on the build machine)
 
# ##i## ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make -j8 (adapt depending on the number of cores available on the build machine)
 
# ##i## ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make modules_install INSTALL_MOD_PATH=/mnt/SD_root
 
# ##i## ARCH=arm CROSS_COMPILE=/usr/bin/armv7a-hardfloat-linux-gnueabi- make modules_install INSTALL_MOD_PATH=/mnt/SD_root
 +
# ##i## cp arch/arm/boot/zImage /mnt/SD_root/boot
 
</console>
 
</console>
  
  
== Bootstrapping a Funtoo installation using Ubuntu ==
+
== Miscellaneous ==
[[http://odroid.foros-phpbb.com/t2005-linaro-ubuntu-1211-for-odroid-u2|Linaro 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 [[http://odroid.foros-phpbb.com/t2242-gentoo-hardfp-image-for-the-u2|the work of kripton that provides a Gentoo SD-card image]].
+
=== Bootstrapping a Funtoo installation using an Gentoo SD-card Image ===
 +
[http://odroid.foros-phpbb.com/t2005-linaro-ubuntu-1211-for-odroid-u2|Linaro 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.
 +
 
 +
Using this image, kripton created [http://odroid.foros-phpbb.com/t2242-gentoo-hardfp-image-for-the-u2|Gentoo SD-card image]. We will use this image to provide a start point for Funtoo users.
  
 
We will use it to bootstrap a Funtoo installation, and try to find a better solution in the future.
 
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 [[http://odroid.foros-phpbb.com/t2005-linaro-ubuntu-1211-for-odroid-u2]].
+
1. Download a SD-card image from [http://odroid.foros-phpbb.com/t2242-gentoo-hardfp-image-for-the-u2].
 
2. Extract it if it's compressed.
 
2. Extract it if it's compressed.
 
3. Run dd if=name_of_image of=/dev/your_sd_card_device
 
3. Run dd if=name_of_image of=/dev/your_sd_card_device
Line 80: Line 136:
 
After a while, this should give you the following partition table:
 
After a while, this should give you the following partition table:
 
<pre>
 
<pre>
Partition Table for /dev/sdc
+
Partition Table for /dev/sdb
 
               First      Last
 
               First      Last
 
  # Type      Sector      Sector  Offset    Length  Filesystem Type (ID) Flag
 
  # Type      Sector      Sector  Offset    Length  Filesystem Type (ID) Flag
Line 86: Line 142:
 
   Pri/Log          0        3071*    0#      3072*Free Space          None
 
   Pri/Log          0        3071*    0#      3072*Free Space          None
 
  1 Primary        3072*      68607*    0      65536*Linux (83)          None
 
  1 Primary        3072*      68607*    0      65536*Linux (83)          None
  2 Primary      68608*   11472895*    0   11404288*Linux (83)          None
+
  Pri/Log      68608*      69631*    0        1024*Free Space          None
   Pri/Log   11472896*  15661055*    0     4188160*Free Space          None
+
  2 Primary      69632*   4263935*    0     4194304*Linux (83)          None
 +
   Pri/Log     4263936*  15661055*    0   11397120*Free Space          None
 
------------------------------------------------------------
 
------------------------------------------------------------
 
</pre>
 
</pre>
  
To be continued...
+
 
 +
To provide a starting point for a Funtoo installation, we will reuse the first 68631 sectors if this installation to extract the boot loader and the boot partition.
 +
 
 +
<console>
 +
# ##i##dd if=/dev/sdb of=uboot_and_boot_partition.img bs=512 count=68631
 +
</console>
 +
 
 +
This is it! This file will be used to install Funtoo and have already u-boot and boot partition available.

Revision as of 04:08, 4 February 2013

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
   Pri/Log       68608*      69631*     0        1024*Free Space           None
 2 Primary       69632*    4263935*     0     4194304*Linux (83)           None
   Pri/Log     4263936*   15661055*     0    11397120*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 really "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. Create a root partition as the second partition, starting at sector 69632. In the following example, there is also a 1GB swap partition at the end.

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
   Pri/Log       68608*      69631*     0        1024*Free Space           None
 2 Primary       69632*   13654922*     0    13585291*Linux (83)           None
 3 Primary    13654923*   15661055*     0     2006133*Linux swap / So (82) None

------------------------------------------------------------
# mkfs.ext4 /dev/sdb2
# mkswap /dev/sdb3

Funtoo Linux Installation

Follow the guide from Funtoo Linux Installation on ARM to begin the installation of Funtoo on the root filesystem. Note that once you are finished, you will not be able to boot the ODROID U2 until you complete the next sections.

Modules

To be continued...

Boot partition setup

Mount the boot partition (/dev/sdb1) in /mnt/SD_root/boot (created in the last section). It should contain the following files:

boot
├── board.dtb
├── boot
├── boot-hdmi1080.scr
├── boot-hdmi1080.txt
├── boot-hdmi720.scr
├── boot-hdmi720.txt
├── boot.ini
├── boot.scr
├── boot.scr.orig
├── boot.txt
├── boot.txt.orig
├── config.3.0.51
├── uInitrd.orig
├── zImage
└── zImage.3.0.51.orig

More information to come about how to personalize the boot process.

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
#  cp arch/arm/boot/zImage /mnt/SD_root/boot


Miscellaneous

Bootstrapping a Funtoo installation using an Gentoo 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.

Using this image, kripton created SD-card image. We will use this image to provide a start point for Funtoo users.

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/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
   Pri/Log       68608*      69631*     0        1024*Free Space           None
 2 Primary       69632*    4263935*     0     4194304*Linux (83)           None
   Pri/Log     4263936*   15661055*     0    11397120*Free Space           None
------------------------------------------------------------


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

# dd if=/dev/sdb of=uboot_and_boot_partition.img bs=512 count=68631

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