From 629c6134f35d165dbe480ee45b1cf0b8327d9fc0 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 24 Oct 2023 20:03:50 +0200 Subject: [PATCH] README: Raspberry Pi --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c693f3e..c2147d6 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ - [NixOS installation](#nixos-installation) - [Graphical installation](#graphical-installation) - [Remote installation: disko and nixos-anywhere](#remote-installation-disko-and-nixos-anywhere) - - [ARM device: Raspberry Pi 3B+](#arm-device-raspberry-pi-3b) + - [ARM device: SD image for the Raspberry Pi 3B+](#arm-device-sd-image-for-the-raspberry-pi-3b) - [ISO](#iso) - [Default configuration](#default-configuration) - [Apply modified configuration](#apply-modified-configuration) + - [ARM device: Vanilla UEFI boot loader for the Raspberry Pi 3B+](#arm-device-vanilla-uefi-boot-loader-for-the-raspberry-pi-3b) - [Update, build and switch](#update-build-and-switch) - [Update](#update) - [Build and switch: Using Colmena](#build-and-switch-using-colmena) @@ -68,7 +69,7 @@ Install NixOS via SSH everywhere. There is a separate repository for these steps. Its README can be found here: https://codeberg.org/privacy1st/nixos-anywhere-example/src/template/README.md -## ARM device: Raspberry Pi 3B+ +## ARM device: SD image for the Raspberry Pi 3B+ ### ISO @@ -110,6 +111,55 @@ nixos-rebuild boot reboot ``` +## ARM device: Vanilla UEFI boot loader for the Raspberry Pi 3B+ + +**TODO**: The EFI menu was working. But I got many squashfs errors when booting an USB stick with the NixOS installer. + +* https://www.eisfunke.com/posts/2023/uefi-boot-on-raspberry-pi-3.html + +Preparing a micro SD card with an UEFI boot loader: + +```shell +nix-shell -p parted gptfdisk +``` +```shell +sudo parted --script /dev/SDX -- \ + mklabel gpt \ + mkpart ESP fat32 2Mib 512MiB \ + set 1 esp on \ + mkpart primary 512MiB 100% \ + print + +sudo wipefs --all /dev/SDX1 +sudo wipefs --all /dev/SDX2 + +sudo mkfs.fat -F32 /dev/SDX1 + +sudo gdisk /dev/SDX +# r +# p +# h +# 1 +# N +# 0c +# N +# N +# o +# w +# Y +``` + +In addition to the SD card, attach an USB stick with NixOS ARM (https://nixos.org/download.html#nixos-iso, https://hydra.nixos.org/job/nixos/release-23.05/nixos.iso_minimal.aarch64-linux, https://hydra.nixos.org/job/nixos/release-23.05/nixos.iso_minimal_new_kernel_no_zfs.aarch64-linux or https://hydra.nixos.org/job/nixos/trunk-combined/nixos.iso_minimal.aarch64-linux) to the Raspberry Pi. + +```shell +sudo umount /dev/SDX +sudo dd if=nixos-minimal-XXX-aarch64-linux.iso of=/dev/SDX bs=4M conv=fsync +``` + +Then install NixOS the way you prefer, but don't touch/modify the partition table! + +See https://nixos.wiki/wiki/NixOS_on_ARM/UEFI#Installing + ## Update, build and switch Local (yodaTux):