Follow these tutorial:
https://tomcore.io/docs/howto/raspberrypi/install-alpine-linux-on-raspberrypi/
https://github.com/macmpi/alpine-linux-headless-bootstrap/tree/main
https://wiki.alpinelinux.org/wiki/Setting_up_a_SSH_server?ref=angelsanchez.me
Microsoft DiskPart version 10.0.19041.964
Copyright (C) Microsoft Corporation.
On computer: WORKHAUS
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 931 GB 1024 KB *
Disk 1 Online 14 GB 0 B *
Change to MBR
instead of GPT
because the pamarams id=
later won't work
DISKPART> list disk
DISKPART> select disk 1
DISKPART> clean
DISKPART> convert mbr
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 931 GB 1024 KB *
Disk 1 Online 14 GB 0 B
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 9 GB 1024 KB
Partition 2 Primary 5192 MB 9 GB
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> list partition
There are no partitions on this disk to show.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> list partition
There are no partitions on this disk to show.
DISKPART> create partition primary size=256 id=0c
DiskPart succeeded in creating the specified partition.
DISKPART> create partition primary size=10240 id=83
DiskPart succeeded in creating the specified partition.
DISKPART> create partition primary id=82
DiskPart succeeded in creating the specified partition.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
* Partition 1 Primary 256 MB 1024 KB
Partition 2 Primary 10 GB 257 MB
Partition 3 Primary 4696 MB 10 GB
DISKPART> format fs=FAT32 LABEL="bootpart" QUICK
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> exit
Download the latest Raspberry PI aarch64 Alpine version from the Alpine website. Next, unpack the gzip archive you have downloaded on your SD Card
Also copy these file from alpine-linux-headless-bootstrap
repository on /boot
folder of your SD Card:
headless.apkovl.tar.gz
wpa_supplicant.conf
authorized_keys
Change the value of wpa_supplicant.conf
for the SSID and Password for your WIFI connections
The authorized_keys
file should has your id_rsa.pub if you want to access by ssh without password
Create an emtpy file called ssh
on the /boot folder of your SD Card to enable ssh server
ssh root@192.168.x.x
Setup the Ethernet and/or the Wi-Fi interface by executing setup-interfaces:
~ # setup-interfaces
Available interfaces are: eth0 wlan0.
Enter '?' for help on bridges, bonding and vlans.
Which one do you want to initialize? (or '?' or 'done') [eth0]
Also enable the wlan0
with dhcp
Run setup-timezone and setup-ntp to set up your time zone and start an ntp client (chronyd does the job)
~ # setup-timezone
~ # setup-ntp
~ # date
~ # setup-apkrepos
The script will ask you to choose your preferred mirror of the Alpine repository. If you are unsure choose the option “Detect and add fastest mirror from above list `
~ # apk add e2fsprogs
~ # mkfs.ext4 /dev/mmcblk0p2
~ # mount /dev/mmcblk0p2 /mnt
~ # mkswap /dev/mmcblk0p3
~ # swapon /dev/mmcblk0p3
~ # rc-update add swap boot
~ # rc-update add network boot
~ # apk add openssh
~ # rc-update add sshd boot
~ # mkdir -p /mnt/root/.ssh
~ # cp /dev/mmcblk0p1/authorized_keys /mnt/root/.ssh
~ # chmod 600 /mnt/root/.ssh
~ # chmod 400 /mnt/root/.ssh/authorized_keys
~ # export FORCE_BOOTFS=1
~ # export SWAP_DEVICES=/dev/mmcblk0p3
~ # setup-disk /mnt
~ # mount -o remount,rw /dev/mmcblk0p1
~ # rm /media/mmcblk0p1/\* -r
~ # cp -r /mnt/boot/\* /media/mmcblk0p1/
~ # reboot
Now you can enable the community repository
https://wiki.alpinelinux.org/wiki/Repositories
neofetch
.hddddddddddddddddddddddh. root@alpi
:dddddddddddddddddddddddddd: ---------
/dddddddddddddddddddddddddddd/ OS: Alpine Linux v3.19 aarch64
+dddddddddddddddddddddddddddddd+ Host: Raspberry Pi 4 Model B Rev 1.4
`sdddddddddddddddddddddddddddddddds` Kernel: 6.6.14-0-rpi
`ydddddddddddd++hdddddddddddddddddddy` Uptime: 2 hours, 58 mins
.hddddddddddd+` `+ddddh:-sdddddddddddh. Packages: 105 (apk)
hdddddddddd+` `+y: .sddddddddddh Shell: zsh 5.9
ddddddddh+` `//` `.` -sddddddddd Terminal: /dev/pts/1
ddddddh+` `/hddh/` `:s- -sddddddd CPU: (4) @ 1.500GHz
ddddh+` `/+/dddddh/` `+s- -sddddd Memory: 63MiB / 7810MiB
ddd+` `/o` :dddddddh/` `oy- .yddd
hdddyo+ohddyosdddddddddho+oydddy++ohdddh
.hddddddddddddddddddddddddddddddddddddh.
`yddddddddddddddddddddddddddddddddddy`
`sdddddddddddddddddddddddddddddddds`
+dddddddddddddddddddddddddddddd+
/dddddddddddddddddddddddddddd/
:dddddddddddddddddddddddddd:
.hddddddddddddddddddddddh.