Skip to content

Commit 452b8f4

Browse files
committed
Add script to easily start ArchARM on qemu
1 parent aa97d3d commit 452b8f4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/start_qemu.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
IMG=archarm-rpi-aarch64.img
4+
LOOP=$(sudo losetup --find --show --partscan "$IMG")
5+
ROOT_UUID=$(sudo blkid -s PARTUUID -o value "${LOOP}p2")
6+
BOOT_UUID=$(sudo blkid -s PARTUUID -o value "${LOOP}p1")
7+
KERNEL=/mnt/arch-boot/Image
8+
sudo mount "${LOOP}p1" /mnt/arch-boot
9+
sudo mount "${LOOP}p2" /mnt/arch-root
10+
11+
qemu-system-aarch64 \
12+
-M virt -cpu max -m 8192 -display none \
13+
-kernel "$KERNEL" \
14+
-drive file="$IMG" \
15+
-serial stdio -monitor none \
16+
-nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22 \
17+
-append "earlycon=pl011,0xfe201000 console=ttyAMA0,115200 root=PARTUUID=${ROOT_UUID} rootfstype=ext4 rw rootwait fsck.repair=yes"
18+
19+
sudo umount /mnt/arch-boot
20+
sudo umount /mnt/arch-root
21+
sudo losetup -D

0 commit comments

Comments
 (0)