-
Notifications
You must be signed in to change notification settings - Fork 0
Arch Linux Installation ARM
This example is using sd card, feel free to change mmcblk to whatever partition you are using
- wget "http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
- fdisk /dev/mmcblk1
-
With GPT label
-
Creates one partition 512MB (W95 FAST32) -> (Do not confuse with the Hidden one, that will not work personal experience...)
-
Creates another with ext4 (Linux Partition)
- mkfs.vfat /dev/mmcblk1p1
- mkfs.ext4 /dev/mmcblk1p2
- mkdir /mnt
- mount /dev/mmcblk1p2 /mnt
- mkdir /mnt/boot
- mount /dev/mmcblk1p1 /mnt/boot
- bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C /mnt
- sync (truly necessary, if your pen-drive or sd card is slow, my brother this will take some time)
- genfstab -U /mnt >> /mnt/etc/fstab
-
Check if there is extra partition created by default:
cat /mnt/etc/fstab -
If you want to add some packages or change configurations before booting you can use
arch-chroot /mnt Pacman Init
# Execute this inside the sd card (chroot)
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Sy- umount /mnt/boot
- umount /mnt
- Now add the sd card into device and start it
- Change hostname:
hostnamectl set-hostname my-device-beautiful-name - Use rapsberry-pi commands:
sudo pacman -S raspberrypi-utils
- pacman -S iwd
- systemctl enable --now iwd
- iwctl
- station wlan0 scan
- station wlan0 get-networks
- station wlan0 coinnect "Wifi Name"
- exit
- vim /etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true
- systemctl restart iwd
- vim /etc/pam.d/su
Uncomment
#auth sufficient pam_wheel.so trust use_uid- vim /usr/local/bin/update_and_reboot.sh
- Put everthing from update_and_reboot.sh inside it
- vim /etc/systemd/system/update_and_reboot.service
[Unit]
Description=Update Arch Linux and Reboot
[Service]
Type=oneshot
ExecStart=/usr/local/bin/update_and_reboot.sh- vim /etc/systemd/system/update_and_reboot.timer
[Unit]
Description=Timer for weekly Arch Linux update and reboot
[Timer]
OnCalendar=Tue 20:00:00
Persistent=true
[Install]
WantedBy=timers.target- sudo systemctl enable --now update_and_reboot.timer
- Now you device will update on Tuesday 8 pm
If you have a bad micro sd card, some files can be corrupted sometimes, especially if you turned off the device while a file still writing or due to power outages.
- use a recovery boot pen-drive (or just insert the sd card in your home device)
do not mount it- execute this command to check remove and clean corrupted files:
fsck.ext4 -f /dev/sde2 -
Accept everything, and pray for important files to not be deleted (probably was just tmp files or logs)
- now you can insert it again on your raspberry pi and test if everthing is working again
- pacman -Qq > /tmp/pkglist.txt
- pacman -S --needed --overwrite '*' $(cat /tmp/pkglist.txt)
- sync
- reboot
Generally you want to make a backup of your system to prevent corruptions
- tar -cvpzf /path/to/backup/home-backup-$(date +%F).tar.gz /home
If you are trying to make a backup from a different drive, take a look at External Backup From a USB Drive
- mariadb-dump -u root -p --all-databases --single-transaction --routines --triggers --events > "/path/to/backup/mariadb-backup-$(date +%F).sql"