Skip to content

Instantly share code, notes, and snippets.

@trixpan
Last active July 21, 2021 17:10
Show Gist options
  • Save trixpan/6ff425f65d736b07aecf to your computer and use it in GitHub Desktop.
Save trixpan/6ff425f65d736b07aecf to your computer and use it in GitHub Desktop.
How to really Arch Linux on Cubieboard 1.... (for the Wiki entry is sort of short of some things)

Intro Notes

I wrote this guide because after getting my CubieBoard 1 I followed the Arch Linux ARM instructions and was suprised to be left with a system that albeit working, had missing RAM and no fbconsole at all.

This guide gets Arch Linux ARM into your 1GB Cubieboard 1 with the minimum functionality one would expect. It is not intended to be an all encompassing document, focusing instead on saving your time having to read through the forum to get functionality that otherwise every other Linux distribution brings out of box.

You will have to adjust these instructions if you have a 512M Cubieboard.

Step 1 - Format disk your SD Card

At a minimum, you need to create the first partition on an SD card to store the bootloader files and kernel uImage. For the root filesystem you can choose to use either a second partition on the SD card, USB or SATA. This guide however only covers SD. Replace instances of /dev/mmcblkX with the appropriate device name registered on your system.

Use fdisk to partition, then format the SD card. The first partition as 32MB FAT, the second as ext4. It is suggested that the first partition start after block 2048.

REMEMBER TO MKFS BOTH partitions accordingly

Step 2 - Installing the cubieboard bootloader

Download the cubieboard bootloader tarball, and write the bootloader to disk

Note: The Arch original bootloader package does not initialise the full 1GB of RAM. In order to get that you need to get the latest Bootloader files from Sunxi.

mkdir arch_arm_temp
cd arch_arm_temp
mkdir sunxi
wget http://dl.linux-sunxi.org/users/amery/testing-3.4/latest/cubieboard_hwpack.tar.xz
tar tf cubieboard_hwpack.tar.xz -C sunxi
dd if=sunxi/bootloader/sunxi-spl.bin of=/dev/mmcblkX bs=1024 seek=8
dd if=sunxi/bootloader/u-boot.bin of=/dev/mmcblkX bs=1024 seek=32

Get the standard Arch instalation files.

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

Step 3 - Copying files to the SD Card

Download the root filesystem tarball and extract it (as root, or sudo su) to the ext4 partition on the SD card. It is important to do this as root, as special files need to be created as part of the filesystem that can only be created by root. Then, copy the kernel uImage to the boot partition

mkdir boot
mkdir arch
mount /dev/mmcblkXp1 boot
mount /dev/mmcblkXp2 arch
wget http://archlinuxarm.org/os/ArchLinuxARM-sun4i-latest.tar.gz
tar -zxf ArchLinuxARM-sun4i-latest.tar.gz -C ./arch
cp ./arch/boot/uImage ./boot/uImage

Copy the compiled FEX and uEnv.txt to /boot

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

Step 4 - Enabling DVI on BOOT

NOTE THE FOLLOWING CHANGES ARE RELATED TO GETTING AN DVI MONITOR CONNECTED TO THE CUBIEBOARD HDMI PORT Since I don't have an HDMI capable monitor I have no clue what happens to the box when you plug it to a HDMI connector...

Also note these steps will disable HDMI audio but at least your monitor should be working

Configure Arch to load the required modules on boot.

vi arch/etc/modules-load.d/cubie.conf

Add the following contents.

# Enable video on boot
fbcon
lcd
hdmi
disp
disp_ump
ump
# If you want to enable the board Status leds uncomment the line bellow. The box will light up a green led upon boot...
leds_sunxi

Modify bootloader configuration to enable HDMI-> DVI on boot.

vi boot/uEnv.txt

Ensure it has the following contents

boot_mmc=fatload mmc 0 0x43000000 ${fexfile}; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000
console=tty0
extraargs=console=tty0 disp.screen0_output_mode=EDID:1280x720p60 hdmi.audio=0 rootwait mac_addr=00:CE:39:B7:74:4E 
fexfile=cubieboard.bin

Please note the original Arch entry uses ethaddr instead of mac_addr. For some reason the original syntax did not work for me

Step 5 - Unmount the drive

sync
umount /dev/mmcblkX*

Step 6 - Finishing it up

Insert into the CubieBoard, and power it on.

You should be able to login to the box using ssh as root/root or the console. Remember to:

  • passwd
  • pacman -Syu
  • vi /etc/hostname
  • etc etc etc
@thrix
Copy link

thrix commented Feb 25, 2016

in step 2, you are only testing the tar, instead of extracting it ....

@kanehekili
Copy link

Does not seem to be up to date:
wget http://archlinuxarm.org/os/ArchLinuxARM-sun4i-latest.tar.gz
ERROR 404: Not Found.
You might find it here:
http://dl.cubieboard.org/software/a10-cubieboard/archlinux/
Regards
kanehekili

@trixpan
Copy link
Author

trixpan commented Dec 25, 2016

@kanehekili - sure not. very old instructions

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