Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tiberiucorbu/f8cb7a14661fe2febcc4 to your computer and use it in GitHub Desktop.
Save tiberiucorbu/f8cb7a14661fe2febcc4 to your computer and use it in GitHub Desktop.

Arch Linux ARM - Cubieboard A10 - Write boot and system files

ETA : 5 to 10 min

After the card was partitioned you can proceed with system installation, in this document explains how to write the bootloader and the filesystem of ArchLinux Arm on the card for Cubieboard A10.

Briefly there are two tar balls to download: the bootloader and the filesystem, the bootloader contains the boot script and the files needed for the boot, while the filesystem archive the files needed for the system. These files should be copied from the bootloader archive to the first partion of your card and for the filesytem to the second partition of your card, preaty simple huh?. Also in the bootloader archive you will find the files necessary to make your card bootable, these must be writen at the very begining of the card (Remember that 1M before the first partition)

You would need:

  • Card reader
  • Properly partitioned card
  • Root access.
  • Cubieboard A10.

Optional but very useful:

  • TTL cable - the one provided by Cubieboard

I strongly suggest checking again which is your working drive, the following commands can as well compromise a whole partition, and please note : I will not offer you support for your careless actions.

The procedure

First umount the partitions, if they ware mount automaticaly :

umount /dev/sdb1
umount /dev/sdb2

Create a working directory :

mkdir alarm_cubieA10 && cd alarm_cubieA10

Download the bootloader :

wget http://archlinuxarm.org/os/sunxi/cubieboard-bootloader.tar.gz

Download the filesistem :

wget http://archlinuxarm.org/os/ArchLinuxARM-sun4i-latest.tar.gz

Unpack bootloader archive :

tar -xvf cubieboard-bootloader.tar.gz

Now you may switch to root access from this point on, use sudo before each command or run su:

sudo su

Write boot script to the card, replace sdb with your drive and run these commands from you working directory:

dd if=cubieboard/sunxi-spl.bin of=/dev/sdb bs=1024 seek=8
dd if=cubieboard/u-boot.bin of=/dev/sdb bs=1024 seek=32

Create /mnt/boot directory and mount first partition of the card there:

mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot

Copy the compiled FEX cubiebord*.bin and uEnv.txt to /mnt/boot:

cp cubieboard/cubieboard*.bin /mnt/boot 
cp cubieboard/uEnv.txt /mnt/boot

Mount second partition:

mkdir /tmp/arch
mount /dev/sdb2 /tmp/arch

Unpack the system files to the second partition :

tar -zxf ArchLinuxARM-sun4i-latest.tar.gz -C /tmp/arch

Copy uImage from the filesystem to the boot partition

cp /mnt/arch/boot/uImage /mnt/boot/uImage

Nearly done ... Unmount partitions and sync.

umount /mnt/boot
umount /mnt/arch
sync

Now remove the card from you PC place it in your Cubieboard slot. If you want to see boot console dumps, attach your TTL cable as described here: http://linux-sunxi.org/Cubieboard/TTL and power up your Cubie.

A cool thing about the connecting the TTL cable is that you can actually login as you would do via a ssh, you wont need to find it's IP nor a network, to connect to your board.

If you don't have a TTL cable than connect to your board trough DHCP enabled LAN network via Eth otherwise attach a keyboard and a display and log in locally.

Use user : root and password: root for login but remember to change the password as soon as you login into your arch linux arm box:

  passwd

After you change the password is strongly recommended to update your system (to have the latest security and bug fixes patches).

pacman -Syu

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment