diff --git a/README.md b/README.md index ab92d94..0c4976d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ $ ./$ARCH/run.sh urmom.qcow2 10022 $ ssh user@localhost -p10022 ``` +## AARCH64 Guide +```console +$ ./aarch64/prolog.sh +$ ./aarch64/install.sh alpine-aarch64.iso urmom.qcow2 +$ ./aarch64/run.sh urmom.qcow2 10022 +$ ssh user@localhost -p10022 +``` + So far `$ARCH`-s we support are: - [x86_64](./x86_64/) - [aarch64](./aarch64/) diff --git a/aarch64/install.sh b/aarch64/install.sh index 7e5770a..fe78e32 100755 --- a/aarch64/install.sh +++ b/aarch64/install.sh @@ -6,13 +6,12 @@ ISO_PATH="$1" QCOW2_IMAGE="$2" # TODO: check if the user didn't provide enough arguments - qemu-img create -f qcow2 "$QCOW2_IMAGE" 20G qemu-system-aarch64 \ -cpu cortex-a53 -smp cores=4 \ -nographic \ -M virt -m 4096 \ - -bios /usr/share/qemu/edk2-aarch64-code.fd \ + -bios ./rom/edk2-aarch64-code.fd \ -drive format=qcow2,file="$QCOW2_IMAGE" \ -device ramfb \ -cdrom "$ISO_PATH" \ diff --git a/aarch64/prolog.sh b/aarch64/prolog.sh new file mode 100755 index 0000000..2774102 --- /dev/null +++ b/aarch64/prolog.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -xe + +if ! command -v bunzip2 >/dev/null 2>&1; then + echo "ERROR: bunzip2 not found" + exit 1 +fi + +mkdir -p rom +FILE="edk2-aarch64-code.fd" +CURRENT_PATH=$(pwd) +git clone -j$(nproc) --depth=1 https://github.com/qemu/qemu.git +cd "$CURRENT_PATH/qemu" +bunzip2 -k pc-bios/"$FILE".bz2 +cp -pv pc-bios/"$FILE" ../rom +cd .. +rm -rf qemu diff --git a/aarch64/run.sh b/aarch64/run.sh index 0825070..36f85d0 100755 --- a/aarch64/run.sh +++ b/aarch64/run.sh @@ -11,7 +11,7 @@ qemu-system-aarch64 \ -cpu cortex-a53 -smp cores=4 \ -nographic \ -M virt -m 4096 \ - -bios /usr/share/qemu/edk2-aarch64-code.fd \ + -bios ./rom/edk2-aarch64-code.fd \ -drive format=qcow2,file="$QCOW2_IMAGE" \ -device ramfb \ -device e1000,netdev=net0 \