ArchlinuxARM

From WikiPixie
Jump to: navigation, search

ArchLinux ARM

Introduction to Archlinux ARM

ArchlinuxARM is a Linux distribution derived from Archlinux specifically for ARM devices. ArchlinuxARM has gained popularity among the single-board computer hobbyists for its simplicity, minimalism, community and extensive documentation.

Why Archlinux?

  • Simplicity. You get exactly what you need, nothing more.
  • Modernity. With Arch, you are always running the latest software packages . You don't have to wait for the distro to make those packages available for you; Arch Linux users will get them as soon as they're out.
  • Minimalism. Arch gives you the ability to build your system from scratch, including only the software you actually need. This minimizes the amount of SD card memory it takes to hold the operating system for PixiePro, leaving more space for everything else you'll be doing.
  • Community. Extensive Wiki and the biggest user repository

Installing Archlinux ARM PixiePro

We provide Archlinux ARM PixiePro built-in images specifically designed for PixiePro. In order to load the Archlinux Image to a micro SD card refer to this link

Installing Packages in Archlinux

Pixie has its own pacman repository with a variety of custom and optimized packages. To see a list of available Pixie custom packages, visit the following page:

http://treats4geeks.org/pixie/repo/

Official Archlinux precompiled packages can be installed from Archlinux ARM repository

http://archlinuxarm.org/packages

In order to install any of the packages from this repositories, issue the following command:

  • $sudo pacman -S <name_of_the_package>

If the package you're looking for is not in the previous repositories, you can search it on the unofficial Archlinux repository (AUR):

https://aur.archlinux.org/packages/

To install packages from the AUR:

  • $yaourt -S <name_of_the_package>

Removing Packages in Archlinux

  • To remove a single package, leaving all of its dependencies installed:
    $ sudo pacman -R <name_of_the_package>
  • To remove a package and its dependencies which are not required by any other installed package::
    $ sudo pacman -Rs <name_of_the_package>

Updating/Upgrading Archlinux

ArchLinux is a rolling release distribution, that means that there are no periodic releases like in Debian or Ubuntu. In ArchLinux the packages are constantly being updated, so to have the latest software packages, just enter the following commands:

  • To perform a full package database synchronization:
    $ sudo pacman -Syy
  • To perform a full system update:
    $ sudo pacman -Syu

And that is all, you should run these commands, lets say once a week, and you will stay up to date.

Querying package databases

  • To search for already installed packages:
    $ pacman -Qs <name_of_the_package>
  • To list all packages explicitly installed and not required as dependencies:
    $ pacman -Qet
  • To list a dependency tree of a package:
    $ pactree <name_of_the_package>
  • To list all packages no longer required as dependencies (orphans):
    $ pacman -Qdt

Packaging software for Archlinux (Advanced)

This tutorial will guide you through the necessary steps to create your own packages using the Arch Linux build system (ABS).

Packages in Arch Linux are built using the makepkg utility and the information stored in a PKGBUILD file.When makepkg is run, it searches for a PKGBUILD in the current directory and follows the instructions there in order to retrieve and compile the required files to be packaged within a package file (pkgname.pkg.tar.xz). The resulting package contains binary files and installation instructions; readily installed with pacman.

  • First, create a PKGBUILD file for the package you want to build. For more information about the PKGBUILD file structure and functions see here.
  • Run makepkg utility:
    $ makepkg
  • If the compile process was successfull, you should see a package file (pkgname.pkg.tar.xz) within the same directory.
  • Now you can manually install the package using pacman:
    $ sudo pacman -U pkgname.pkg.tar.xz

Submitting packages to the AUR

Please read the Archlinux User Repository (AUR) guidelines for a detailed description of the submission process.

Distributed Compiling using DistCC (Advanced)

If you plan on building a lot of packages and want to speed up the process, the following guide will turn an x86 Linux computer into an ARM cross-compiler.

Distcc is a program to distribute builds across several machines on a network. distcc is usually much faster than a local compile and its compatible with Archlinux makepkg utility.

master
The master (PixiePro) is the computer which initiates and distributes the compilation to the configured slaves.

slaves
The slaves are one or multiple machines running the distcc daemon which accepts incoming compilation requests send by the master.

We provide an out of the box Virtualbox Archlinux x86 Machine with everything configured in order to setup your computer as a distcc slave.

Configuring the Slave device

  • Virtualbox is a free and cross-platform application. Download and install the latest VirtualBox version according to your platform from the following link:

https://www.virtualbox.org/wiki/Downloads

  • Open the VirtualBox application and create a new virtual machine:

NewVM.png

  • Create a new virtual machine, and select the option "Use an existing virtual hard disk file". Choose the memory size according to your needs (recommended size: 1024 MB):

ExportVM.png

  • Once the virtual machine is created, go to to the virtual machine settings, and in the network tab select "Bridged Adapter":

Network-settings.png

  • Login to Archlinux with the following username and password:

username: archuser
password: arch-user-cool

ArchDistccLogin.png

  • Once login, check the machine's ip address:

VMIP.png

Configuring the Master device

  • Installing distcc on PixiePro:
    $sudo pacman -S distcc
  • Start the distcc daemon
    $sudo systemctl start distccd
  • If you want the distcc service to start at boot:
    $sudo systemctl enable distccd

The minimal configuration for distcc on the master includes the setting of one or multiple slaves in the configuration file /etc/distcc/hosts.

  • Check the ip address of the ArchDistcc VirtualBox machine created in the previous section and add the following line in the /etc/distcc/hosts file (For example, if the IP Address is 10.0.2.125) :
    10.0.2.125,cpp
  • In order to add distcc support to makepkg, edit the configuration file /etc/makepkg.conf in the following sections:
  1. BUILDENV has distcc unbanged i.e. without exclamation point.
  2. Uncomment the DISTCC_HOSTS line and add the IP addresses of the slaves then a slash and the number of threads they are to use.
  3. Adjust the MAKEFLAGS variable to correspond to the number of sum of the number of individual values specified for the max threads per server. In this case we are only configuring one slave with a maximum of 8 threads, so MAKEFLAGS variable should be equal to 8 threads.

Example:

BUILDENV=(distcc fakeroot color !ccache !check)
MAKEFLAGS="-j8"
DISTCC_HOSTS="10.0.2.125/8"
  • Now everytime you compile a package using makepkg, you will be using distributed compiling with distcc. In order to check the received files in the slave device(s), open a terminal and type in the following command:
    $tail -f /var/log/distcc/distccd.log