Skip to content

Commit c1bdfc2

Browse files
committed
Add scripts to run freebsd on qemu
1 parent aab16c1 commit c1bdfc2

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

qemu/freebsd/run.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
dir="$HOME/.local/opt/qemu"
6+
efi="/opt/homebrew/share/qemu/edk2-aarch64-code.fd"
7+
vda="$dir/freebsd.qcow2"
8+
9+
# -monitor stdio
10+
# -nographic
11+
# -hda
12+
# -drive file=$vda,if=virtio
13+
14+
qemu-system-aarch64 \
15+
-machine virt \
16+
-cpu max \
17+
-smp 4 \
18+
-m 8G \
19+
-bios $efi \
20+
-drive file=$vda,if=virtio \
21+
-nic user,hostfwd=tcp::2222-:22 \
22+
-nographic

qemu/freebsd/setup.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
version="14.1-RELEASE"
6+
7+
name="FreeBSD-$version-arm64-aarch64-zfs"
8+
file="$name.qcow2"
9+
file_xz="$file.xz"
10+
url="https://download.freebsd.org/releases/VM-IMAGES/$version/aarch64/Latest/$file_xz"
11+
12+
cwd=$(pwd)
13+
14+
mkdir -p ~/.local/cache/freebsd
15+
cd ~/.local/cache/freebsd
16+
trap "cd $cwd" EXIT
17+
18+
wget $url
19+
unxz -k $file_xz
20+
21+
mkdir -p ~/.local/opt/qemu
22+
cd ~/.local/opt/qemu
23+
24+
mv ~/.local/cache/freebsd/$file freebsd.qcow2

0 commit comments

Comments
 (0)