Compare commits
2 Commits
081c18be4d
...
a3e2f8b5ed
Author | SHA1 | Date | |
---|---|---|---|
a3e2f8b5ed | |||
b0ffbb9c0c |
@ -1,15 +0,0 @@
|
|||||||
#!/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
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
android='https://sourceforge.net/projects/android-x86/files/latest/download'
|
|
||||||
|
|
||||||
curl -LC- -o android.iso "$android"
|
|
@ -2,10 +2,14 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
. ../lib.sh
|
. ../lib.sh
|
||||||
|
|
||||||
|
ISO=(
|
||||||
|
[android]='https://sourceforge.net/projects/android-x86/files/latest/download'
|
||||||
|
)
|
||||||
|
|
||||||
if ! [ -f hda.qcow2 ]; then
|
if ! [ -f hda.qcow2 ]; then
|
||||||
ask_yn "hda.qcow2 not found, create?" \
|
ask_yn 'hda not found, create?' || exit 1
|
||||||
&& bash ./create.sh \
|
qemu-img create -f qcow2 hda.qcow2 10G
|
||||||
|| exit 1
|
download_isos
|
||||||
fi
|
fi
|
||||||
|
|
||||||
qemu "$@" \
|
qemu "$@" \
|
||||||
|
@ -10,7 +10,7 @@ if ! [ -f hda.qcow2 ]; then
|
|||||||
|| exit 1
|
|| exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e 'User: \e[1m\e[31march:arch\e[0m'
|
echo "User: ${BOLD}${RED}arch:arch${NORMAL}"
|
||||||
read -rp 'Continue? '
|
read -rp 'Continue? '
|
||||||
|
|
||||||
qemu "$@" \
|
qemu "$@" \
|
||||||
|
@ -10,7 +10,7 @@ if ! [ -f hda.qcow2 ]; then
|
|||||||
|| exit 1
|
|| exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e 'User: \e[1m\e[31mroot:\e[0m'
|
echo "User: ${BOLD}${RED}root:${NORMAL}"
|
||||||
read -rp 'Continue? '
|
read -rp 'Continue? '
|
||||||
|
|
||||||
qemu "$@" \
|
qemu "$@" \
|
||||||
|
16
fedora39/run.sh
Executable file
16
fedora39/run.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/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
18
lib.sh
@ -3,6 +3,10 @@ DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|||||||
|
|
||||||
BRIDGE=virbr0
|
BRIDGE=virbr0
|
||||||
|
|
||||||
|
NORMAL=$'\e[0m'
|
||||||
|
BOLD=$'\e[1m'
|
||||||
|
RED=$'\e[31m'
|
||||||
|
|
||||||
function ask_yn() {
|
function ask_yn() {
|
||||||
local ans
|
local ans
|
||||||
|
|
||||||
@ -14,6 +18,19 @@ function ask_yn() {
|
|||||||
esac
|
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() {
|
function _getmaxram() {
|
||||||
local ram; ram="$(free -g | awk '/^Mem:/{print $2 - 2}')"
|
local ram; ram="$(free -g | awk '/^Mem:/{print $2 - 2}')"
|
||||||
|
|
||||||
@ -52,6 +69,7 @@ function qemu() {
|
|||||||
-device qemu-xhci \
|
-device qemu-xhci \
|
||||||
-object memory-backend-ram,id=mem,size=2G,share=on \
|
-object memory-backend-ram,id=mem,size=2G,share=on \
|
||||||
-numa node,memdev=mem \
|
-numa node,memdev=mem \
|
||||||
|
"${OPTS[@]}" \
|
||||||
"$@"
|
"$@"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
#!/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
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/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"
|
|
@ -2,12 +2,16 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
. ../lib.sh
|
. ../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
|
if ! [ -f hda.qcow2 ]; then
|
||||||
ask_yn "hda.qcow2 not found, create?" \
|
ask_yn 'hda not found, create?' || exit 1
|
||||||
&& bash ./create.sh \
|
qemu-img create -f qcow2 hda.qcow2 40G
|
||||||
|| exit 1
|
download_isos
|
||||||
fi
|
fi
|
||||||
|
|
||||||
qemu "$@" \
|
qemu "$@" \
|
||||||
-drive file=virtio.iso,media=cdrom,readonly=on \
|
|
||||||
#-device usb-host,vendorid=0xffff,productid=0xffff
|
#-device usb-host,vendorid=0xffff,productid=0xffff
|
||||||
|
Loading…
Reference in New Issue
Block a user