megarpi
archlinuxarm
bobo_logo_orange

Install Instructions for a single RPi

To bootstrap the OS we have to "burn" from a *nix like system the contents of a decompressed *.tar.gz file to an SD card. For the Raspberry Pi there exists two releases both for the older B/B+ model and the newer 2nd edition B model. You need also either a built-in (/dev/mmcblk_) or USB card reader (/dev/sd_) for writing to the SD card. Replace the underscore (_) with the number/letter that has been assigned to your card reader, ie. check for example the output of dmesg.

  1. Put the SD card into the card reader and open up a shell. Check if your system is automounting existing SD card partitions and unmount them via sudo umount /media/$USER/* or sudo umount /mnt/*.
  2. Elevate your shell with admin rights, ie. type sudo bash.
  3. Create a basic partition file via touch disk.layout and insert the content from below.
  4. Start sfdisk to partition the SD card: sfdisk --force /dev/mmcblk_ < disk.layout or sfdisk --force /dev/sd_ < disk.layout.
  5. Create the FAT filesystem for the boot partition: mkfs.vfat /dev/mmcblk_p1 or mkfs.vfat /dev/sd_1.
  6. Create the ext4 filesystem for the root partition: mkfs.ext4 /dev/mmcblk_p2 or mkfs.ext4 /dev/sd_2.
  7. Create directories for the mounting points: mkdir boot root.
  8. Mount the boot partition: mount /dev/mmcblk_p1 boot or mount /dev/sd_1 boot.
  9. Mount the root partition: mount /dev/mmcblk_p2 root or mount /dev/sd_2 root.
  10. Download the root filesystem: wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz or wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz.
  11. Extract the root filesystem to SD card and go for a coffee (Debian may require to install bsdtar: apt-get install bsdtar): bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root or bsdtar -xpf ArchLinuxARM-rpi-2-latest.tar.gz -C root.
  12. Sync disk: sync.
  13. Move boot files to the boot partition: mv root/boot/* boot.
  14. Unmount the two partitions: umount boot root.
  15. Remove the directories used for the mount points: rmdir boot root.

After that you can remove the SD card and put it in the Raspberry Pi. To SSH to the Raspberry Pi use the default hostname alarmpi and the user root with password root.

Content of disk.layout file

# Partition table generated from /dev/mmcblk0
unit: sectors

: start=     8192, size=   196608, Id= c
: start=   204800, size=         , Id=83

Post Installation Setup

After a successful boot of the Raspberry Pi you can either attach a keyboard and a display or ssh to it (ssh root@alarmpi).

  1. Update the system: pacman -Syu --noconfirm.
  2. Install sudo: pacman -S sudo --noconfirm.
  3. Set the timezone to CET: timedatectl set-timezone Europe/Rome.
  4. Add new user (replace USERNAME with your preference): useradd -m -G wheel -s /bin/bash USERNAME.
  5. Change password for root and user (replace PASSWORD with your preference): echo "root:PASSWORD" | chpasswd and echo "USERNAME:PASSWORD" | chpasswd.
  6. Edit the sudoers file via nano /etc/sudoers and remove the comment tag # on the line before the %wheel ALL=(ALL) NOPASSWD: ALL string. Save and exit by pressing CTRL+O, CTRL+X.
  7. Change the hostname of the Raspberry (replace HOSTNAME with your preference): hostnamectl set-hostname HOSTNAME.
  8. Finally reboot the Raspberry Pi via the reboot command.

After that the Raspberry Pi is reachable via SSH under ssh root@HOSTNAME and ssh USERNAME@HOSTNAME with the modified passwords.


Free University of Bolzano - Faculty of Computer Science - 2013-2016

unibz_cs_logo