Skip to content

Instantly share code, notes, and snippets.

@abtrout
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abtrout/10473705 to your computer and use it in GitHub Desktop.
Save abtrout/10473705 to your computer and use it in GitHub Desktop.
ArchlinuxARM on Raspberry PI: initial setup notes

These are some notes from installing Archlinux ARM on my raspberry pi.

Expand the root partition.

The default root partition is much smaller than my 32gb SD card. We can resize it with fdisk as suggested in these useful forum posts on the subject.

# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.24.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x417ee54b

Device         Boot     Start       End  Blocks  Id System
/dev/mmcblk0p1           2048    186367   92160   c W95 FAT32 (LBA)
/dev/mmcblk0p2         186368   3667967 1740800   5 Extended
/dev/mmcblk0p5         188416   3667967 1739776  83 Linux

Command (m for help): d
Partition number (1,2,5, default 5): 2

Partition 2 has been deleted.

Command (m for help): n

Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): e
Partition number (2-4, default 2): 
First sector (186368-62333951, default 186368): 
Last sector, +sectors or +size{K,M,G,T,P} (186368-62333951, default 62333951): 

Created a new partition 2 of type 'Extended' and of size 29.6 GiB.

Command (m for help): n

Partition type:
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): l

Adding logical partition 5
First sector (188416-62333951, default 188416): 
Last sector, +sectors or +size{K,M,G,T,P} (188416-62333951, default 62333951): 

Created a new partition 5 of type 'Linux' and of size 29.6 GiB.

Command (m for help): p
Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x417ee54b

Device         Boot     Start       End   Blocks  Id System
/dev/mmcblk0p1           2048    186367    92160   c W95 FAT32 (LBA)
/dev/mmcblk0p2         186368  62333951 31073792   5 Extended
/dev/mmcblk0p5         188416  62333951 31072768  83 Linux

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

# reboot

All that's left do is resize the new volume after reboot.

# resize2fs /dev/mmcblk0p5
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mmcblk0p5 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p5 is now 7768192 blocks long.

# df /
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/root       30575292 427948  28874492   2% /

Taking advantage of systemd for initial set up.

Say what you want -- I like systemd.

# hostnamectl set-hostname tofu
# echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
# locale-gen
# localectl set-locale LANG="en_US.UTF-8"
# timedatectl set-timezone America/Chicago
# timedatectl set-ntp 1

Set up wireless networking with netctl.

# cp /etc/netctl/examples/wireless-wpa /etc/netctl
# wpa_passphrase $SSID $WIFI_PASS >> /etc/netctl/wireless-wpa

Edit so that Key=\"<HEX KEY FROM WPA_PASSPHRASE> and enable it.

You can unset HISTFILE so that your wifi pass doesn't get written to your .bash_history.

# netctl enable wireless-wpa
# netctl start wireless-wpa

Make some changes in /boot/config.txt.

A detailed list of possibile configuration options can be found here. A list of changes I made is below:

# 1920x1080 from HDMI
hdmi_group=2                                                                                                      
hdmi_mode=82
# some overclocking
arm_freq=950
core_freq=450
sdram_freq=450
over_voltage=6
# less gpu memory = more memory
gpu_mem_512=64
gpu_mem_256=64

These will take change on next reboot.

Using pacman to update our system.

# pacman -Syu
# pacman -S vim sudo git tmux xf86-video-fbturbo-git fbterm

Time for some twerking tweaking.

Like everything else, the ArchWiki has a great wiki for the raspberry pi.

I'll come back to this.

Other stuff to do

  • Make your raspberry pi an Airplay receiver with sharepoint (available from the AUR).
    1. alsaequal (AUR) is a system-wide equalizer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment