ARM Installation Guide

From ParabolaWiki
Jump to: navigation, search
Gnu06-mascot-logo+parabola-logo 050ppi.png
Warning: SBCs normally run the GNU/Linux system, but that doesn't mean that all is well for software freedom on these boards. Therefore, there's no support for hardware that doesn't work without running a nonfree program, such as Raspberry Pi, ODROID (models using the Samsung Exynos SoC), Arndale, Intel Edison boards and probably others. See the FSF article for more info.

1 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.

1.1 Configuration files

Start by taking a copy of pacman.conf and editing it:

$ mkdir -p parabola-arm-workdir/mnt/
$ cp /etc/pacman.conf parabola-arm-workdir/   # 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. Disable or remove all respositories other than [libre], [core], [extra] and [community] (those which aren't available for armv7h).

pacman.conf
[options]
Architecture = armv7h

1.2 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: In case those URLs are unavailable, use any other up-to-date mirror. Use the most recent package versions, 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

Get pacstrap if you haven't done it already and use it to install the base group packages to the empty folder:

# pacman -S arch-install-scripts
# pacstrap -c -d -C parabola-arm-workdir/pacman.conf parabola-arm-workdir/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 parabola-arm-workdir/mnt/ && tar xJf ../parabola_arm_rootfs.tar.xz ./ && cd ../../

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.

2 Test and customize installation image

Note: This section is optional. Depending on your device it could also help you install one of our bootloaders right now on the storage device you plan to boot from. That assumes parabola-arm-workdir/mnt/ is a mountpoint for /dev/mmcblk0 (the SD card) or something.

Follow one of the methods described in Building_armv7h_packages_on_a_x86_system#QEMU_and/or_Proot up until section #Build_package. That will allow you to access and configure your new armv7h image using QEMU, previous to putting it on a real device.

Note: Visit Beginners'_Guide#Chroot_and_configure_the_base_system to learn about further configuration options.

3 How to install Parabola ARM

3.1 Install a bootloader

Warning: Our kernel images use custom names (eg. vmlinuz-linux-libre-grsec) to allow for 2 or more kernels in the same system using GRUB or Extlinux.
Note: 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 them, we suggest you 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

3.1.1 U-Boot

Warning: Standalone uboot packages only work for a single kernel: linux-libre. If you use other or multiples kernels you should look for one of #U-Boot4Extlinux or #U-Boot4GRUB instead.

Installing the appropriate U-Boot package will copy the bootloader to your storage device's boot sector. Manual intervention shouldn't be necessary, unless you are installing for a BeagleBoard or BeagleBoard-xM.

3.1.1.1 BeagleBoard and BeagleBoard-xM

Manual intervention is needed to use uboot-omap3_beagle. Replace sdX1 in the following instructions with the FAT filesystem partition (the one with the boot files) for the SD card as it appears in 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
3.1.1.2 BeagleBone Black

To download the BeagleBone Black U-Boot in parabola-arm-workdir/mnt/, run

# pacstrap -c -d -C parabola-arm-workdir/pacman.conf parabola-arm-workdir/mnt/ uboot-am335x_bone

To make the SD card bootable in a BeagleBone Black (assuming the target SD card is /dev/sdb) it is necessary to run

# dd if=parabola-arm-workdir/mnt/boot/MLO of=/dev/sdb count=1 seek=1 conv=notrunc bs=128k
# dd if=parabola-arm-workdir/mnt/boot/u-boot.img of=/dev/sdb count=2 seek=1 conv=notrunc bs=384k

3.1.2 U-Boot4Extlinux

Note: uboot4extlinux-am335x_bone is available from [libre] since it's reported to work reliably on coadde's Beaglebone Black. For other uboot4extlinux packages we need more ARMv7 boards for porting and testing before moving them to [libre].

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. This allows for interactive multi-boot and multiple kernels. 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 wish to use this repo add the following lines to /etc/pacman.conf:
[libre-testing]
Include = /etc/pacman.d/mirrorlist

3.1.3 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 wish to use this repo add the following lines to /etc/pacman.conf:
[libre-testing]
Include = /etc/pacman.d/mirrorlist

3.1.4 GRUB

grub claims some support for ARMv7 machines with EFI support (GRUB#UEFI_systems). Parabola hackers are investigating using this.

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 to 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)

3.2 Device-specific instructions

This article or section needs expansion.
Please help expand this article so the intended scope is covered in sufficient detail. (Discuss)

3.2.1 GTA04 A3

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

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

3.2.2 BeagleBone Black

The following requires at minimum a functional 1 GiB SD card. Important: The SD card's contents will be lost, so make sure you have a backup of it before starting.

Insert the SD card into your computer and open a terminal.

Gain root privileges. Otherwise, make sure you have the required permissions to perform the following steps.

Find the /dev entry the SD card was detected under by running dmesg. For example, it could be /dev/sdb or /dev/sdc etc.

From now on, let /dev/CARD be the path to the device node respective to the SD card, where CARD is sdb or sdc, etc. (as detected above).

Next, run (press return after typing each line. Also, make sure you don't type <press return>, but actually press return):

# fdisk /dev/CARD
o
n
p
1
2048
<press return>
w
# mkfs.ext4 -F -O ^metadata_csum,^64bit /dev/CARD1

Next, follow the steps in #Create_Parabola_installation_image, except between

$ mkdir -p parabola-arm-workdir/mnt/

and the next command, run

# mount /dev/CARD1 parabola-arm-workdir/mnt/

Then, install U-Boot for your BeagleBone Black as described above.

3.3 See also