Skip to content

Add aarch64 prolog #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
3 changes: 1 addition & 2 deletions aarch64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
17 changes: 17 additions & 0 deletions aarch64/prolog.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion aarch64/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down