ARM Installation Guide - ParabolaWiki

# ARM Installation Guide

Warning: SBCs normally run the GNU/Linux system, but that doesn't mean that all is well for software freedom on these boards. Therefore, we don't support hardware that doesn't work without running a nonfree program as Raspberry Pi 2, ODROID (models that uses the Samsung Exynos SoC), Arndale and Intel Edison boards, see the FSF article for more info.
Warning: Our kernel images use custom names (eg. vmlinuz-linux-libre-grsec) to allow for 2 or more kernels in the same system once we add GRUB and Extlinux compatibility.
Warning: We don't have uImage packages available in Parabola since we are adapting our kernels for GRUB and Extlinux compatibility. However, if you won't use GRUB, we suggest use our script to create a new one based on the kernel that you want. If you find any trouble applying it please report on our Bug Tracker
Note: uboot4grub packages are under development yet for U-Boot with GRUB support, therefore SBCs doesn't work with GRUB support for now
Note: uboot4extlinux packages are under development yet for U-Boot with Extlinux support, except uboot4extlinux-am335x_bone that is available from [libre] since it works well and stable from coadde's Beaglebone Black. For another uboot4extlinux packages, we need ARMv7 boards for porting and testing before move them to [libre].
Note: By default grub is built for systems which have RAM at address 0x08000000. However SBC boards which we are targeting have RAM starting from different values (eg. BeagleBone and BeagleBone Black are 0x82000000) so we need adjust GRUB_KERNEL_ARM_UBOOT_LINK_ADDR to make sure it matches U-Boot load_addr. Therefore, we are creating grub packages with specific suffix for it (eg. grub-am335x_bone for BeagleBone and BeagleBone Black)

# Create Parabola installation image

This step is necessary until the Parabola developers release an official tarball. You will need an existing Parabola installation to do this.

## Configuration files

If you want an armv7h root filesystem in your existing Parabola system you only need take a copy from pacman.conf and edit it, eg:

    $ mkdir -p parabola-arm-workdir/mnt && cd parabola-arm-workdir
    $ cp /etc/pacman.conf .   # It's advised to use the default pacman.conf if you do a release

You must set the architecture to armv7h (the default is auto) in the "general options" section in /etc/pacman.conf. Then, you should remove the [multilib] repository.

    pacman.conf

    [options]
    Architecture = armv7h

## Root filesystem

Make sure the pacman keyring has been initialized

    # pacman-key --init

Import, trust and install the archlinuxarm keyring. When possible, Parabola leverages free packages that originally came from Arch ARM.

    # pacman -U https://www.parabola.nu/packages/core/any/archlinuxarm-keyring/download/
    # pacman-key --lsign-key builder@archlinuxarm.org
    # pacman -U https://www.parabola.nu/packages/core/any/archlinuxarm-keyring/download/

Note: If this doesn't work, use any other available package mirror with each package. Update with the most recent package version, for example:

    # pacman -U https://repo.parabola.nu/core/os/armv7h/archlinuxarm-keyring-20140119-1-any.pkg.tar.xz
    # pacman-key --lsign-key builder@archlinuxarm.org
    # pacman -U https://repo.parabola.nu/core/os/armv7h/archlinuxarm-keyring-20140119-1-any.pkg.tar.xz

Install pacstrap if you haven't already and install the base group packages with it

    # pacman -S arch-install-scripts
    # pacstrap -c -d -C ./pacman.conf ./mnt/ base

Note: Errors about exec() calls might be benign. You may proceed to test and further configure this chroot using QEMU

Optionally pack everything into a tarball:

    # cd mnt && tar xJf ../parabola_arm_rootfs.tar.xz ./

Congratulations, you now have a Parabola ARMv7 rootfs inside parabola-arm-workdir/mnt/, copy it to the storage media you plan to boot Parabola from. Since ARM computers are too diverse in their boot firmware, boot process and expected partitioning schemes we can only provide installation instructions for a limited number of free software-friendly devices.

# Test and customize installation image

Note: This section is optional. Depending on your device characteristics it could also help you install an appropriate uboot firmware/bootloader package to the storage device you plan to boot from, all from within your new Parabola image and without recurring to an existing OS on the ARM device

It is possible to use PRoot, a user-space chroot implementation, and the QEMU hypervisor to emulate an ARM machine with its filesystem placed inside the x86 host.

## Requirements

### PRoot Installation

PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc. This means that users don't need any privileges or setup to do things like using an arbitrary directory as the new root filesystem, making files accessible somewhere else in the filesystem hierarchy, or executing programs built for another CPU architecture transparently through QEMU user-mode. Also, developers can use PRoot as a generic GNU/Linux process instrumentation engine thanks to its extension mechanism, see CARE for an example. Technically PRoot relies on ptrace, an unprivileged system-call available in every Linux kernel.

To install, you run:

    # pacman -S proot

### QEMU

QEMU (short for Quick Emulator) is a free software hosted hypervisor that performs hardware virtualization (not to be confused with hardware-assisted virtualization)

We need it (qemu-arm) emulate an ARMv7 machine from a x86 machine, so you run:

    # pacman -S qemu-arch-extra

### Prepare chroot and enter from PRoot

     # mount -o rbind /dev parabola-arm-workdir/mnt/dev

     # mount -o bind /sys parabola-arm-workdir/mnt/sys

     # mount -o bind /tmp parabola-arm-workdir/mnt/tmp

     # mount -t proc none parabola-arm-workdir/mnt/proc

     # rm parabola-arm-workdir/mnt/etc/resolv.conf

     # cp -a /etc/resolv.conf parabola-arm-workdir/mnt/etc

     # proot -0 -q /usr/bin/qemu-arm -r parabola-arm-workdir/mnt

## Configuring chroot

### Package signature verification

Make sure signature verification is enabled in /etc/pacman.conf:

    pacman.conf

    SigLevel    = Required DatabaseOptional

To be able to install signed packages, you have to initialise the pacman keyring:

    # pacman-key --init
    # pacman-key --populate archlinux
    # pacman-key --populate archlinuxarm
    # pacman-key --populate parabola

Note: This step can take quite a while, be patient. (see Pacman-Key)

### Generating locales

Before a locale can be enabled on the system, it has to be generated. The current generated/available locales can be viewed with:

    $ locale -a

The locales that can be generated are listed in the /etc/locale.gen file: their names are defined using the format [language][_TERRITORY][.CODESET][@modifier]. To generate a locale, first uncomment the corresponding line in the file (or comment to remove); when doing this, also consider localizations needed by other users on the system and specific variables. For example, for American-English uncomment en_US.UTF-8 UTF-8. When done, save the file and generate the uncommented locale(s) by executing:

    # locale-gen

Note: locale-gen also runs with every update of glibc.

### More Configuration

Visit Installation_guide#Installation.

# How to install Parabola ARM

We assume the user is on any 100% free software GNU/Linux distribution, Trisquel for instance.

## GTA04 A3

The GTA04 typically has its bootloader in NAND. So here we will put everything on one partition for simplicity. We format a microSD card (all its content will be lost)

    # fdisk /dev/mmcblk0 # Create a partition on your microSD card.
    # mkfs.ext4 /dev/mmcblk0p1 # Format it as ext4
    # mount /dev/mmcblk0p1 /mnt

Then we extract the rootfs to it, --numeric-owner is needed for compatibility with other host distributions like Trisquel

    # tar xf /path/to/parabola_arm_rootfs.tar.xz -C /mnt --numeric-owner

We then have the rootfs in place, but uboot expects an uImage in /boot/uImage, so we create that:

    # cat /mnt/boot/vmlinuz-linux-libre /mnt/boot/dtbs/linux-libre/omap3-gta04a3.dtb > /tmp/zImage.dtb
    # mkimage -A arm -O linux -T kernel -C none -a 0x82000000 -e 0x82000000 -d /tmp/zImage.dtb /mnt/boot/uImage

You might need to adjust the boot parameters/cmdline given to the kernel and the uboot environment to fit your partioning scheme.

Parabola then boots and you are supposed to see the boot log on the serial console. At the time of writing the kernel lacks the GTA04 display driver, this is bug #587

## Bootloader configuration

#### U-Boot

Note: You don't need do a manual intervention to install the U-Boot bootloader package for your hardware (except BeagleBoard and BeagleBoard-xM) since it does automatically for you, however it just works for linux-libre. If you would use another kernel or multiples kernels in the same hardware, see U-Boot4GRUB and U-Boot4Extlinux for more info

##### BeagleBoard and BeagleBoard-xM

Manual intervention is needed to use uboot-omap3_beagle

Note: Replace sdX1 in the following instructions with the FAT filesystem partition (which contains the boot files) for the SD card as it appears on your computer

Mount the FAT filesystem

     # mkdir boot
     # mount /dev/sdX1 boot

Copy boot files to the first partition

     # cp -a /boot/* boot

Unmount the partition

     # umount boot

#### GRUB

grub has support for ARMv7 machines with EFI support. See our GRUB article for more info.

Note: By default grub is built for systems which have RAM at address 0x08000000. However SBC boards which we are targeting have RAM starting from different values (eg. BeagleBone and BeagleBone Black are 0x82000000) so we need adjust GRUB_KERNEL_ARM_UBOOT_LINK_ADDR to make sure it matches U-Boot load_addr. Therefore, we are creating grub packages with specific suffix for it (eg. grub-am335x_bone for BeagleBone and BeagleBone Black)

#### U-Boot4GRUB

uboot4grub packages are under development yet for U-Boot with GRUB support. At the moment, we have some packages for testing and debugging from [libre-testing].

Note: If you want add this repo, you need add the following lines in /etc/pacman.conf.

    [libre-testing]
    Include = /etc/pacman.d/mirrorlist

#### U-Boot4Extlinux

Extlinux is one of the many spinoffs of Syslinux -- the bootloader used for live CDs and many other applications. It's not as commonly used as a bootloader for desktops and laptops, but it's perfectly capable of that and U-Boot supports it. uboot4extlinux packages are under development yet for U-Boot with Extlinux support. At the moment, we have some packages for testing and debugging from [libre-testing].

Note: If you want add this repo, you need add the following lines in /etc/pacman.conf.

    [libre-testing]
    Include = /etc/pacman.d/mirrorlist

Note: uboot4extlinux-am335x_bone is available from [libre] since it works well and stable from coadde's Beaglebone Black. For another uboot4extlinux packages, we need more ARMv7 boards for porting and testing before move them to [libre].

## See also

- x86 Installation Guide
- MIPS Installation Guide

Categories:

- Request:Expansion
- Getting and installing
- ARM