Default credentials:
alarm
/alarm
root
/root
The following setup requires qemu-arm-static
and arch-chroot
to be
installed on the system where the SD card is prepared. So, start with
installing these tools:
yay -S qemu-user-static-bin arch-install-scripts
All the following commands require root permissions, so it might be a good idea
to start with sudo -s
.
-
Find your sdcard with
lsblk
and start fdisk to partition the SD card:fdisk /dev/sdX
-
At the fdisk prompt, delete old partitions and create a new one:
- Type o. This will clear out any partitions on the drive.
- Type p to list partitions. There should be no partitions left.
- Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +100M for the last sector.
- Type t, then c to set the first partition to type W95 FAT32 (LBA).
- Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
- Write the partition table and exit by typing w.
-
Create and mount the boot partition:
mkfs.vfat /dev/sdX1 mkdir boot mount /dev/sdX1 boot
-
Create and mount the root partition:
mkfs.btrfs /dev/sdX2 mkdir root mount /dev/sdX2 root btrfs subvolume create root/root
-
Download and extract the root filesystem:
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz bsdtar -xpf ArchLinuxARM-rpi-3-latest.tar.gz -C root/root sync
(ignore the "Failed to set file flags" messages)
-
Move boot files to the first partition:
mv root/root/boot/* boot/ sync umount boot root
-
chroot to the SD card and update the system:
mount -o subvol=root,autodefrag,ssd /dev/sdX2 root mount /dev/sdX1 root/boot cp /usr/bin/qemu-arm-static root/usr/bin arch-chroot root /bin/bash
Continue with the steps below and exit chroot afterwards using:
exit umount root/boot root
-
Initialize and update the system:
pacman-key --init pacman-key --populate archlinuxarm pacman -Syu
-
Install btrfs driver and register the btrfs partition as root:
pacman -S btrfs-progs uboot-tools
Add the following options to the
bootargs
line in/boot/boot.txt
:rootflags=subvol=root,autodefrag,ssd
Recompile the boot configuration:
cd /boot ./mkscr
-
I usually use ansible to install all the rest. This requires python 2:
pacman -S python2
echo "gpu_mem=16" >> /boot/config.txt
echo "hdmi_safe=1" >> /boot/config.txt
echo "dtoverlay=pi3-disable-wifi" >> /boot/config.txt
Write the following lines to /etc/systemd/network/20-wired.network
[Match]
Name=enp1s0
[Network]
Address=10.1.10.9/24
Gateway=10.1.10.1
DNS=10.1.10.1
#DNS=8.8.8.8