User:Erkexzcx/RaspberryPI

From Alpine Linux

Understanding the Procedure

Alpine Linux installation on Raspberry Pi differs from Arch Linux ARM. For Alpine Linux, you create a single boot partition on the SD card using your computer, copy files from the *.tar.gz package, and then boot the system. Once booted, Alpine Linux will load entirely into RAM, allowing you to perform the regular setup, including repartitioning the SD card. After completion, you can boot into a fully installed Alpine Linux environment.

Installation for "Live Boot"

Partitioning the SD Card

Connect the SD card to your computer. Replace 'sdX' in the following instructions with the device name for the SD card as it appears on your computer.

Start fdisk to partition the SD card:

fdisk /dev/sdX

At the fdisk prompt, delete old partitions and create a new one:

  1. Type o to clear out any existing partitions.
  2. Type p to list partitions. There should be none left.
  3. Type n, then 'p' for primary, 1 for the first partition, press ENTER for the default first sector, and type +256M for the last sector.
  4. Type t, then c to set the first partition to type W95 FAT32 (LBA).
  5. Write the partition table and exit by typing w.

Formatting & Mounting the SD Card

Create and mount the FAT filesystem:

mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot

Download and Copy Files

Download and extract the root filesystem (as root, not via sudo):

wget https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/aarch64/alpine-rpi-3.17.1-aarch64.tar.gz
bsdtar -xpf alpine-rpi-3.17.1-aarch64.tar.gz -C boot
sync

Setting Up Headless Access

By default, Alpine Linux does not include an SSH server, WiFi, or any other headless access options. To address this, use the alpine-linux-headless-bootstrap project. This project enables internet access (on the Ethernet port) and sets up SSH access for "live boot" (see the README.md for more information):

wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/main/headless.apkovl.tar.gz -P boot

(Optional) Setting Up WiFi

If you prefer not to use Ethernet, you can configure WiFi access. To set up WiFi on boot, add a single configuration file using the wpa_passphrase command below:

wpa_passphrase 'ExampleWifiSSID' 'ExampleWifiPassword' > boot/wpa_supplicant.conf

Unmounting the SD Card

You can now unmount the SD card:

umount boot