diff --git a/android-x86/create.sh b/android-x86/create.sh new file mode 100644 index 0000000..3859128 --- /dev/null +++ b/android-x86/create.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e +cd "$(dirname "$0")" +. ../lib.sh + +if ! [ -f android.iso ]; then + ask_yn "android.iso not found, download?" \ + && bash ./download_isos.sh \ + || exit 1 +fi + +qemu-img create -f qcow2 hda.qcow2 40G + +CMD=( + "${CMD[@]}" + -drive file=android.iso,media=cdrom,readonly=on +) + +"${CMD[@]}" diff --git a/android-x86/download_isos.sh b/android-x86/download_isos.sh new file mode 100755 index 0000000..6e7d30f --- /dev/null +++ b/android-x86/download_isos.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +android='https://sourceforge.net/projects/android-x86/files/latest/download' + +curl -LC- -o android.iso "$android" diff --git a/android-x86/run.sh b/android-x86/run.sh new file mode 100755 index 0000000..2fc768b --- /dev/null +++ b/android-x86/run.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e +cd "$(dirname "$0")" +. ../lib.sh + +if ! [ -f hda.qcow2 ]; then + ask_yn "hda.qcow2 not found, create?" \ + && bash ./create.sh \ + || exit 1 +fi + +CMD=( + "${CMD[@]}" + -nic user,model=virtio-net-pci + -vga std + # USB passthrough, might need root privileges + #-device usb-host,vendorid=0xffff,productid=0xffff +) + +"${CMD[@]}"