Sam Stelfox

Thoughts from a software engineer, systems hacker and Linux gubernāre.

Raspberry Pi

Downloaded the ArchLinux version from here

used the following command to get the image on:

dd if=archlinux-hf-2013-07-22.img | pv | sudo dd of=/dev/mmcblk0 bs=4M

used the following to update the partitions on the device, and mount the rootfs:

partprobe /dev/mmcblk0
mount /dev/mmcbl0p5 /mnt

I edited /etc/iptables/simple_firewall.rules and added the following after the ctstate line:

-A INPUT -m tcp -p tcp --dport 22 -j ACCEPT

(Turns out the above wasnt needed as it defaults to wide-open).

Grabbed a password hash out of my shadow file and replaced the one that was in it (didnt bother too look up what the defaults were).

Ran sync on the card, removed it installed it in the RPi, connected its ethernet jack and power. Scanned for port 22 and found it.

ssh root@<rpi>

pacman -Syu
hostnamectl set-hostname

Created network config file [email protected] with the following contents:


And a systemd file at /etc/systemd/system/network@.service with the following config:

Description=Network connectivity (%i)


ExecStart=/usr/bin/ip link set dev %i up
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i
ExecStart=/usr/bin/ip route add default via ${gateway}

ExecStop=/usr/bin/ip addr flush dev %i
ExecStop=/usr/bin/ip link set dev %i down

systemctl enable [email protected]
systemctl start [email protected]
systemctl disable [email protected]

At this point I switched to the arch linux notes.