Arch Linux on Rasberry Pi
This repository contains instruction and scripts to configure your Raspberry Pi to work with Arch Linux ARM installation and expose network on the USB Type-C port
This allows you work with you to power and connect over network from your iPad Pro/Air simultaneously
- Raspberry PI with aarch64 support. That means ARMv8 instruction set. Supported ISA could be checked in specification of model
- SD card. Recommended minimum size 16Gb
- Another Linux host (virtual machine, e.g VirtualBox, could work too with USB passthrough configured properly) for creating initial bootable card. Of course hub or builtin port for SD required too
- Availability to connect Raspberry Pi to Ethernet Network or dedicated workspace (monitor and keyboard) for it
Image could be created according instruction or with script
IMPORTANT: this script requires sudo
and works in not interactive manner.
Be careful specifying device for formating, you could lose all your data or harm your system
Result: bootable SD card with vanilla Arch Linux ARM. DHCP for Ethernet should be enabled and default user alarm
should exist. sshd
should be enabled as well.
Why upstream kernel should be replaced?
The short answer is bugs. There are some bugs in upstream kernel (especially for RPi4 8Gb) related to peripherals and interfaces (e.g. USB), and the simplest way to get rid of them is to switch to supported and tested version of kernel provided by RPi developers. If initial distribution of Arch Linux ARM will switch to the supported aarch64 kernel this step will not be needed in future.
Script
could be used for non-interactive configuration. Requires sudo
and reboot host at the end.
If you want to do steps by hand, always rember to modify fstab file accordingly, otherwise machine will not boot.
Result: Pi now runs new Linux kernel
Because solution to share iPad connection to the Internet over Ethernet was not found the main solution of connecting Pi to network while using with tablet will be wireless network
Script could be used as interactive tool for configuring.
It adds only one network to the wpa_supplicant
configuration. Additional networks could be added with wpa_cli
.
Result: Pi could connect to specified WiFi network automatically
Script could be used for non-interactive configuration.
Result: special daemon configures usb0
device each boot allowing to use it as network
interface, mDNS provides name resolution of RPi host for iPad
After previous steps it is finally possible to access Raspberry Pi from iPad
using <raspberry_pi_hostname>.local
name. If all configured properly iPad should show Ethernet connection in its settings with ipv4 : 169.254.*.*
- In most cases
base-devel
package is required by Arch Linux users - Create new user
- Configuring
sudo
- Installing AUR helper (e.g. yay)
After creation of configured environment for specific device it's good idea to save it as image for easy redeploying in future.
- Creation of new image file from device
# probably requires sudo on your platform dd bs=1M if=/dev/<sd_device> of=<image_name>.img
- Shrinking it to actual size - PiShrink is a good solution for this task
After redeploying of image the process of expanding volume required.
fdisk /dev/<sd_device> <<EOF
p
d
<root_volume_number>
n
p
<root_volume_number>
p
w
EOF
resize2fs /dev/<root_volume>
- Share pre-built images