Compare commits

..

No commits in common. "a3e2f8b5edefefa9ca4439111836a2496a88404f" and "081c18be4d5c1b15a3fa75d63a800a962101c9a1" have entirely different histories.

10 changed files with 53 additions and 51 deletions

15
android-x86/create.sh Normal file
View File

@ -0,0 +1,15 @@
#!/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 10G
qemu "$@" \
-drive file=android.iso,media=cdrom,readonly=on
#-device usb-host,vendorid=0xffff,productid=0xffff

5
android-x86/download_isos.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
android='https://sourceforge.net/projects/android-x86/files/latest/download'
curl -LC- -o android.iso "$android"

View File

@ -2,14 +2,10 @@
cd "$(dirname "$0")"
. ../lib.sh
ISO=(
[android]='https://sourceforge.net/projects/android-x86/files/latest/download'
)
if ! [ -f hda.qcow2 ]; then
ask_yn 'hda not found, create?' || exit 1
qemu-img create -f qcow2 hda.qcow2 10G
download_isos
ask_yn "hda.qcow2 not found, create?" \
&& bash ./create.sh \
|| exit 1
fi
qemu "$@" \

View File

@ -10,7 +10,7 @@ if ! [ -f hda.qcow2 ]; then
|| exit 1
fi
echo "User: ${BOLD}${RED}arch:arch${NORMAL}"
echo -e 'User: \e[1m\e[31march:arch\e[0m'
read -rp 'Continue? '
qemu "$@" \

View File

@ -10,7 +10,7 @@ if ! [ -f hda.qcow2 ]; then
|| exit 1
fi
echo "User: ${BOLD}${RED}root:${NORMAL}"
echo -e 'User: \e[1m\e[31mroot:\e[0m'
read -rp 'Continue? '
qemu "$@" \

View File

@ -1,16 +0,0 @@
#!/bin/bash -e
cd "$(dirname "$0")"
. ../lib.sh
ISO=(
[fedora39.iso]='https://download.fedoraproject.org/pub/fedora/linux/releases/39/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-39-1.5.iso'
)
if ! [ -f hda.qcow2 ]; then
ask_yn 'hda not found, create?' || exit 1
qemu-img create -f qcow2 hda.qcow2 20G
download_isos
fi
qemu "$@" \
#-device usb-host,vendorid=0xffff,productid=0xffff

18
lib.sh
View File

@ -3,10 +3,6 @@ DIR="$(dirname "${BASH_SOURCE[0]}")"
BRIDGE=virbr0
NORMAL=$'\e[0m'
BOLD=$'\e[1m'
RED=$'\e[31m'
function ask_yn() {
local ans
@ -18,19 +14,6 @@ function ask_yn() {
esac
}
declare -A ISO
declare -a OPTS
function download_isos() {
for iso in "${!ISO[@]}"; do
if ! [ -f "$iso" ] && ask_yn "download $iso?"; then
curl -LC- -o "$iso" "${ISO[$iso]}"
fi
if [ -f "$iso" ]; then
OPTS+=(-drive "file=$iso,media=cdrom,readonly=on")
fi
done
}
function _getmaxram() {
local ram; ram="$(free -g | awk '/^Mem:/{print $2 - 2}')"
@ -69,7 +52,6 @@ function qemu() {
-device qemu-xhci \
-object memory-backend-ram,id=mem,size=2G,share=on \
-numa node,memdev=mem \
"${OPTS[@]}" \
"$@"
)
}

16
win2k22/create.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash -e
cd "$(dirname "$0")"
. ../lib.sh
if ! [ -f win2k22.iso ] || ! [ -f virtio.iso ]; then
ask_yn "win2k22.iso and/or virtio.iso not found, download?" \
&& bash ./download_isos.sh \
|| exit 1
fi
qemu-img create -f qcow2 hda.qcow2 40G
qemu "$@" \
-drive file=win2k22.iso,media=cdrom,readonly=on \
-drive file=virtio.iso,media=cdrom,readonly=on \
#-device usb-host,vendorid=0xffff,productid=0xffff

8
win2k22/download_isos.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash -e
win2k22='https://go.microsoft.com/fwlink/p/?LinkID=2195280'
virtio='https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso'
curl -LC- \
-o win2k22.iso "$win2k22" \
-o virtio.iso "$virtio"

View File

@ -2,16 +2,12 @@
cd "$(dirname "$0")"
. ../lib.sh
ISO=(
[win2k22]='https://go.microsoft.com/fwlink/p/?LinkID=2195280'
[virtio]='https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso'
)
if ! [ -f hda.qcow2 ]; then
ask_yn 'hda not found, create?' || exit 1
qemu-img create -f qcow2 hda.qcow2 40G
download_isos
ask_yn "hda.qcow2 not found, create?" \
&& bash ./create.sh \
|| exit 1
fi
qemu "$@" \
-drive file=virtio.iso,media=cdrom,readonly=on \
#-device usb-host,vendorid=0xffff,productid=0xffff