RPi4B - Arch Linux Created 2025-03-27 | Updated 2025-03-29
Raspberry Pi 4BにArch Linux (64it)をインストールしてみました。
https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4
環境
Raspberry Pi 4B
32GB SDカード
構築 作業PC
gpartedでSDカードのパーティションを削除しておく
rootで作業する
Start fdisk to partition the SD card:
At the fdisk prompt, delete old partitions and create a new one:
o |This will clear out any partitions on the drivep |list partitions. There should be no partitions leftn p 1 ENTER +400M|the first partition on the drivet c |set the first partition to type W95 FAT32 (LBA).n p 2 ENTER ENTER |the second partition on the drivew |Write the partition table and exit
Create and mount the FAT filesystem:
mkfs.vfat /dev/sdX1 mkdir bootmount /dev/sdX1 boot
Create and mount the ext4 filesystem:
mkfs.ext4 /dev/sdX2 mkdir rootmount /dev/sdX2 root
Download and extract the root filesystem (as root, not via sudo):
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root sync
Move boot files to the first partition:
Edit fstab
root/etc/fstab # Static information about the filesystems. # See fstab(5) for details. # <file system> <dir> <type> <options> <dump> <pass> #/dev/mmcblk0p1 /boot vfat defaults 0 0 /dev/mmcblk1p1 /boot vfat defaults 0 0 /dev/mmcblk1p2 / ext4 defaults 0 0
Unmount the two partitions:
Raspberry Pi (1)
Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5V power.
Use the serial console or SSH to the IP address given to the board by your router.
Login as the default user alarm with the password alarm.
The default root password is root.
rootで作業する
Initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
pacman-key --init pacman-key --populate archlinuxarm
ミラーの設定
/etc/pacman.d/mirrorlist ### Japan ## Tokyo # Server = http://jp.mirror.archlinuxarm.org/$arch/$repo Server = http://jp.mirror.archlinuxarm.org/$arch/$repo
パッケージの更新
base-develのインストール
pacman -S base -devel reboot
Raspberry Pi (2)
gnomeのインストール
GDMのインストールと有効化
pacman -S gdm systemctl enable gdm
タイムゾーンの設定
curl https://ipapi.co/timezone timedatectl set-timezone "Asia/Tokyo"
ロケールの設定
locale-gen localectl set-locale LANG="en_US.UTF-8"
再起動
利用
ChromiumはFlatpak版が動作する
alarmのユーザ名を変更(ユーザIDはそのまま) GDMの画面で、Ctrl +Alt +F4 rootでログインusermod -l arch alarm groupmod -n arch alarm usermod -d /home/arch -m arch exit
Ctrl +Alt +F1
visudo
openssh
ホスト名の変更hostnamectl set-hostname rpi4b
Bluetoothの有効化sudo pacman -S bluez bluez-utils gnome-bluetooth-3.0sudo systemctl enable bluetoothsudo systemctl start bluetooth
その他設定https://ktkr3d.github.io/archlinux/ https://ktkr3d.github.io/GNOME/
TODO
Wifi
pritunl/wireguard
rdpsudo pacman -S gnome-remote-desktop freerdp inetutilsRDP_USER="${USER} " RDP_PASS="12345678" sudo -u gnome-remote-desktop sh -c 'mkdir -p ~/.local/share/gnome-remote-desktop/' sudo -u gnome-remote-desktop sh -c "openssl req -new -newkey rsa:4096 -days 720 -nodes -x509 -subj /C=SE/ST=NONE/L=NONE/O=GNOME/CN=$(hostname) -out ~/.local/share/gnome-remote-desktop/tls.crt -keyout ~/.local/share/gnome-remote-desktop/tls.key" sudo grdctl --system rdp set-tls-key ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.keysudo grdctl --system rdp set-tls-cert ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crtsudo grdctl --system rdp set-credentials "${RDP_USER} " "${RDP_PASS} " sudo grdctl --system rdp enable
接続しても画面が真っ黒・・・
networkmanagersudo pacman -S networkmanager