ARM Installation Guide

From ParabolaWiki
Jump to: navigation, search
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 Preparation

Take a fresh copy of pacman.conf for armv7h:

$ mkdir -p parabola-arm-workdir/mnt/
$ cp /usr/share/pacman/defaults/pacman.conf.armv7h parabola-arm-workdir/pacman.conf

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


1.2 Root filesystem

Get pacstrap if you haven't done already and use it to install the base group into 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 cJf ../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.2.3 Banana Pi

These are the instructions for installing Parabola in the Banana Pi, this could (theorically) be adapted for the Banana Pro and Orange Pi too by just changing the packages. This was done in a Banana Pi M1, but later versions should work too. First install Arch ARM in a SD-Card and migrate to Parabola. Inside the Banana Pi, install uboot-bananapi and when it asks you to flash uboot, accept it. Later, run the /boot/mkscr script, but before make sure to have the uboot-tools package installed

# pacman -S uboot-banapi
# cd /boot && ./mkscr

Optionally, you can install uboot4extlinux-bananapi which has been proved to work.

# pacman -S uboot4extlinux-bananapi
Note: If you will install uboot-bananapi you will not be able to choose multiple kernels to boot, and you will need initramfs or uImage and script.bin. It is suggested to generate initramfs for this case, but make sure the kernel you install has the /etc/mkinitcpio.d/linux-libre-xxx.preset file, otherwise you will not be able to generate it.

3.3 Troubleshooting

3.3.1 Mkinitcpio

3.3.1.1 WARNING: No modules were added to the image. This is probably not what you want.

If when creating the initramfs image with mkinitcpio, you get the message

==> WARNING: No modules were added to the image. This is probably not what you want.

Just ignore, you should be able to boot anyways.

3.3.1.2 ERROR: kernel version extraction from image not supported for `armv7' architecture

If when running mkinitcpio you get the message

ERROR: kernel version extraction from image not supported for `armv7' architecture

Or similar (like armv7h, armv7l, etc) edit /bin/mkinitcpio and where it says $arch leave it as

if [[ $arch != @(i?86|x86_64|armv7?) ]]; then
    error "kernel version extraction from image not supported for \`%s' architecture" "$arch"

3.3.1.3 ERROR: invalid kernel specified: '/boot/vmlinuz-linux-libre'

In this case edit /etc/mkinitcpio.d/linux-libre-xxx.preset and where it says ALL_kver="/boot/vmlinuz-linux-libre-xxx" change /boot/vmlinuz-linux-libre-xxx with the kernel release, which should be the output of uname -r, if you are using that kernel. You can see them with

$ ls /lib/modules
Note: The xxx stands for the kernel special name.

3.3.2 Iceweasel

3.3.2.1 Error code: NS_ERROR_NET_INADEQUATE_SECURITY

If some websites give you this error on Iceweasel (an probably on Icecat) with a message like:

Your connection is not secure

The website tried to negotiate an inadequate level of security.

www.example.com uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe.   The website administrator will need to fix the server first before you can visit the site.

Error code: NS_ERROR_NET_INADEQUATE_SECURITY

Then open a new tab and write about:config, then search spd and disable network.http.spdy.enabled

3.4 See also