RPi4B - Arch Linux
Raspberry Pi 4BにArch Linux (64it)をインストールしてみました。
https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4
環境
- Raspberry Pi 4B
- 32GB SDカード
- Arch Linux
構築
作業PC
gpartedでSDカードのパーティションを削除しておく
rootで作業する
su
Start fdisk to partition the SD card:
fdisk /dev/sdX
私の環境では/dev/sdaでした
At the fdisk prompt, delete old partitions and create a new one:
入力 内容 o This will clear out any partitions on the drive p list partitions. There should be no partitions left n
p
1
ENTER
+400Mthe first partition on the drive t
cset the first partition to type W95 FAT32 (LBA). n
p
2
ENTER
ENTERthe second partition on the drive w Write the partition table and exit Create and mount the FAT filesystem:
mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 bootCreate and mount the ext4 filesystem:
mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 rootDownload 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
syncMove boot files to the first partition:
mv root/boot/* boot
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 0Unmount the two partitions:
umount boot root
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で作業する
su
- 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 - パッケージの更新
pacman -Syu
- base-develのインストール
pacman -S base-devel
reboot
Raspberry Pi (2)
- gnomeのインストール
pacman -S 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" - 再起動
reboot
利用
- ChromiumはFlatpak版が動作する
- alarmのユーザ名を変更(ユーザIDはそのまま)
GDMの画面で、
Ctrl+Alt+F4
rootでログインCtrl+Alt+F1usermod -l arch alarm
groupmod -n arch alarm
usermod -d /home/arch -m arch
exit - visudo
- openssh
sudo pacman -S openssh
- ホスト名の変更
hostnamectl set-hostname rpi4b
- Bluetoothの有効化
sudo pacman -S bluez bluez-utils gnome-bluetooth-3.0
sudo systemctl enable bluetooth
sudo systemctl start bluetooth - その他設定
https://ktkr3d.github.io/archlinux/
https://ktkr3d.github.io/GNOME/
TODO
- Wifi
- pritunl/wireguard
- rdp接続しても画面が真っ黒・・・
sudo pacman -S gnome-remote-desktop freerdp inetutils
RDP_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.key
sudo grdctl --system rdp set-tls-cert ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt
sudo grdctl --system rdp set-credentials "${RDP_USER}" "${RDP_PASS}"
sudo grdctl --system rdp enable - networkmanager
sudo pacman -S networkmanager