required
arch-chroot
tool setup (see arch wiki)build image
# retrieve radxa debian and archlinuxarm images
wget <https://github.com/radxa/debos-radxa/releases/download/20221031-1045/rock-5b-debian-bullseye-xfce4-arm64-20221031-1558-gpt.img.xz>
wget <http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz>
# extract debian image
xz -d rock-5b-debian-bullseye-xfce4-arm64-20221031-1558-gpt.img.xz
# create new empty image (at least 20GB needed to build kernel)
truncate -s 20G arch-rock5b.img
# mount original and new image to loop0 and loop1
sudo losetup -P /dev/loop0 rock-5b-debian-bullseye-xfce4-arm64-20221031-1558-gpt.img && sudo losetup -P /dev/loop1 arch-rock5b-image.img
# copy partition table from original to new image
sudo sgdisk -R=/dev/loop1 rock-5b-debian-bullseye-xfce4-arm64-20221031-1558-gpt.img
# refresh
sudo sgdisk -G /dev/loop1
# lsblk should be
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 3.7G 0 loop
|-loop0p1 259:5 0 512M 0 part
`-loop0p2 259:6 0 3.2G 0 part
loop1 7:1 0 5G 0 loop
|-loop1p1 259:3 0 512M 0 part
`-loop1p2 259:4 0 3.2G 0 part
# create FS on new partitions
sudo mkfs.vfat /dev/loop1p1 && sudo mkfs.ext4 /dev/loop1p2
# resize rootfs partition using GParted
sudo parted /dev/loop1
(parted) print
# Model: Loopback device (loopback)
# Disk /dev/loop1: 5369MB
# Sector size (logical/physical): 512B/512B
# Partition Table: gpt
# Disk Flags:
#
# Number Start End Size File system Name Flags
# 1 16.8MB 554MB 537MB boot boot, esp
# 2 554MB 4000MB 3446MB rootfs
#
(parted) resizepart 2 100%
(parted) quit
# resize FS to take full space
sudo resize2fs /dev/loop1p2
sudo mount -o rw /dev/loop1p2 /mnt
sudo tar -xzvf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt > /dev/null
sudo mount /dev/loop1p1 /mnt/boot
# chroot into image
sudo arch-chroot /mnt
# first time pacman init
pacman-key --init
pacman-key --populate
# install required packages
pacman -Sy base-devel vim git
# edit /etc/sudoers to allow users from wheel group to sudo
visudo
# change to default user
su alarm
# build midstream kernel (until available in AUR directly)
git clone <https://github.com/hbiyik/hw_necromancer.git>
cd hw_necromancer/rock5b/linux-rk3588-midstream/
makepkg -si
# ctrl-d until exited from chroot
sudo umount /mnt
sudo losetup -d /dev/loop0 && sudo losetup -d /dev/loop1
after flashing and booting arch-rock5b.img
, resize rootfs to wanted size
archlinux setup
# rename default user (replace myusername to yours)
usermod -l myusername alarm
# update user home
usermod -d /home/myusername -m myusername
# use zsh as default shell
sudo pacman -Sy zsh grml-zsh-config
chsh -s /usr/bin/zsh
checking TEMPS
# list thermal zones TYPES
cat /sys/class/thermal/thermal_zone*/type
soc-thermal
bigcore0-thermal
bigcore1-thermal
littlecore-thermal
center-thermal
gpu-thermal
npu-thermal
# list thermal zones TEMPS (65614 = 65,614°C)
cat /sys/class/thermal/thermal_zone*/temp
65615
68384
68384
66538
61923
61000
62846