User:Erkexzcx/RaspberryPI: Difference between revisions

From Alpine Linux
No edit summary
(Style, typing mistakes)
 
Line 1: Line 1:
= Understanding procedure =
= Understanding the Procedure =


Alpine Linux installs differently in comparison to Arch Linux ARM. With Alpine Linux, you will have to create a single boot partition on SD card using your computer, copy/paste files from *.tar.gz package and...boot it. Once booted, Alpine Linux will be fully loaded into the RAM and from there you will perform a regular setup, including repartitioning SD card. Once done, you will be able to boot into a fully installed Alpine Linux installation.
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" =
= Installation for "Live Boot" =


== Partitioning SD card ==
== Partitioning the SD Card ==


Connect 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.
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:
Start fdisk to partition the SD card:
Line 13: Line 13:


At the fdisk prompt, delete old partitions and create a new one:
At the fdisk prompt, delete old partitions and create a new one:
# Type '''o'''. This will clear out any partitions on the drive.
# Type '''o''' to clear out any existing partitions.
# Type '''p''' to list partitions. There should be no partitions left.
# Type '''p''' to list partitions. There should be none 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 '''+256M''' for the last sector.
# 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.
# Type '''t''', then '''c''' to set the first partition to type {{ic|W95 FAT32 (LBA)}}.
# Type '''t''', then '''c''' to set the first partition to type {{ic|W95 FAT32 (LBA)}}.
# Write the partition table and exit by typing '''w'''.
# Write the partition table and exit by typing '''w'''.


== Formatting & mounting SD card ==
== Formatting & Mounting the SD Card ==


Create and mount the FAT filesystem:
Create and mount the FAT filesystem:
Line 26: Line 26:
  mount /dev/sdX1 boot
  mount /dev/sdX1 boot


== Download and copy files ==
== Download and Copy Files ==


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


== Setup headless access ==
== Setting Up Headless Access ==


By default, such Alpine Linux will not have SSH server, wifi or any other headless access. In order to solve it, the project [https://github.com/macmpi/alpine-linux-headless-bootstrap alpine-linux-headless-bootstrap] has been born. This project automatically starts internet (on Ethernet port) as well as setups SSH access for "live boot" (see its README.md for more information):
By default, Alpine Linux does not include an SSH server, WiFi, or any other headless access options. To address this, use the [https://github.com/macmpi/alpine-linux-headless-bootstrap 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
  wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/main/headless.apkovl.tar.gz -P boot


=== (Optional) Setup WiFi ===
=== (Optional) Setting Up WiFi ===


If you won't be using Ethernet, you can use WiFi. Configuring WiFi on boot is as simple as adding a single configuration file using below {{ic|wpa_passphrase}} command:
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 {{ic|wpa_passphrase}} command below:
  wpa_passphrase 'ExampleWifiSSID' 'ExampleWifiPassword' > boot/wpa_supplicant.conf
  wpa_passphrase 'ExampleWifiSSID' 'ExampleWifiPassword' > boot/wpa_supplicant.conf


== Unmount SD card ==
== Unmounting the SD Card ==


You can now unmount your SD card:
You can now unmount the SD card:
  umount boot
  umount boot

Latest revision as of 20:39, 21 March 2023

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