mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Add reactos (#423)
* Add initial support for ReactOS * Move code block to be able to override default cdrom settings
This commit is contained in:
parent
52f298ba8b
commit
600ada52ae
2 changed files with 65 additions and 15 deletions
51
quickemu
51
quickemu
|
@ -509,6 +509,14 @@ function vm_boot() {
|
||||||
MACHINE_TYPE="pc"
|
MACHINE_TYPE="pc"
|
||||||
NET_DEVICE="rtl8139"
|
NET_DEVICE="rtl8139"
|
||||||
;;
|
;;
|
||||||
|
reactos)
|
||||||
|
CPU="-cpu qemu32,kvm=on"
|
||||||
|
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
|
||||||
|
CPU="${CPU},topoext"
|
||||||
|
fi
|
||||||
|
MACHINE_TYPE="pc"
|
||||||
|
NET_DEVICE="e1000"
|
||||||
|
;;
|
||||||
macos)
|
macos)
|
||||||
#https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/
|
#https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/
|
||||||
# A CPU with SSE4.1 support is required for >= macOS Sierra
|
# A CPU with SSE4.1 support is required for >= macOS Sierra
|
||||||
|
@ -1003,6 +1011,27 @@ function vm_boot() {
|
||||||
-drive if=pflash,format=raw,unit=1,file="${EFI_VARS}")
|
-drive if=pflash,format=raw,unit=1,file="${EFI_VARS}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${iso}" ] && [ "${guest_os}" == "freedos" ]; then
|
||||||
|
# FreeDOS reboots after partitioning the disk, and QEMU tries to boot from disk after first restart
|
||||||
|
# This flag sets the boot order to cdrom,disk. It will persist until powering down the VM
|
||||||
|
args+=(-boot order=dc)
|
||||||
|
elif [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then
|
||||||
|
# Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2
|
||||||
|
# shellcheck disable=SC2054
|
||||||
|
args+=(-drive media=cdrom,index=2,file="${iso}")
|
||||||
|
iso=""
|
||||||
|
elif [ -n "${iso}" ] && [ "${guest_os}" == "reactos" ]; then
|
||||||
|
# shellcheck disable=SC2054
|
||||||
|
# https://reactos.org/wiki/QEMU
|
||||||
|
args+=(-boot order=d
|
||||||
|
-drive if=ide,index=2,media=cdrom,file="${iso}")
|
||||||
|
iso=""
|
||||||
|
elif [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then
|
||||||
|
# Attach the unattended configuration to Windows guests when booting from ISO
|
||||||
|
# shellcheck disable=SC2054
|
||||||
|
args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${floppy}" ]; then
|
if [ -n "${floppy}" ]; then
|
||||||
# shellcheck disable=SC2054
|
# shellcheck disable=SC2054
|
||||||
args+=(-drive if=floppy,format=raw,file="${floppy}")
|
args+=(-drive if=floppy,format=raw,file="${floppy}")
|
||||||
|
@ -1018,21 +1047,6 @@ function vm_boot() {
|
||||||
args+=(-drive media=cdrom,index=1,file="${fixed_iso}")
|
args+=(-drive media=cdrom,index=1,file="${fixed_iso}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${iso}" ] && [ "${guest_os}" == "freedos" ]; then
|
|
||||||
# FreeDOS reboots after partitioning the disk, and QEMU tries to boot from disk after first restart
|
|
||||||
# This flag sets the boot order to cdrom,disk. It will persist until powering down the VM
|
|
||||||
args+=(-boot order=dc)
|
|
||||||
elif [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then
|
|
||||||
# Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2
|
|
||||||
# shellcheck disable=SC2054
|
|
||||||
args+=(-drive media=cdrom,index=2,file="${iso}")
|
|
||||||
iso=""
|
|
||||||
elif [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then
|
|
||||||
# Attach the unattended configuration to Windows guests when booting from ISO
|
|
||||||
# shellcheck disable=SC2054
|
|
||||||
args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${guest_os}" == "macos" ]; then
|
if [ "${guest_os}" == "macos" ]; then
|
||||||
# shellcheck disable=SC2054
|
# shellcheck disable=SC2054
|
||||||
args+=(-device ahci,id=ahci
|
args+=(-device ahci,id=ahci
|
||||||
|
@ -1053,12 +1067,19 @@ function vm_boot() {
|
||||||
args+=(-device ahci,id=ahci
|
args+=(-device ahci,id=ahci
|
||||||
-device ide-hd,bus=ahci.0,drive=SystemDisk
|
-device ide-hd,bus=ahci.0,drive=SystemDisk
|
||||||
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO})
|
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO})
|
||||||
|
|
||||||
elif [ "${guest_os}" == "batocera" ] ; then
|
elif [ "${guest_os}" == "batocera" ] ; then
|
||||||
# shellcheck disable=SC2054,SC2206
|
# shellcheck disable=SC2054,SC2206
|
||||||
args+=(-device virtio-blk-pci,drive=BootDisk
|
args+=(-device virtio-blk-pci,drive=BootDisk
|
||||||
-drive id=BootDisk,if=none,format=raw,file="${img}"
|
-drive id=BootDisk,if=none,format=raw,file="${img}"
|
||||||
-device virtio-blk-pci,drive=SystemDisk
|
-device virtio-blk-pci,drive=SystemDisk
|
||||||
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO})
|
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO})
|
||||||
|
|
||||||
|
elif [ "${guest_os}" == "reactos" ]; then
|
||||||
|
# shellcheck disable=SC2054,SC2206
|
||||||
|
# https://reactos.org/wiki/QEMU
|
||||||
|
args+=(-drive if=ide,index=0,media=disk,file="${disk_img}")
|
||||||
|
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2054,SC2206
|
# shellcheck disable=SC2054,SC2206
|
||||||
args+=(-device virtio-blk-pci,drive=SystemDisk
|
args+=(-device virtio-blk-pci,drive=SystemDisk
|
||||||
|
|
29
quickget
29
quickget
|
@ -57,6 +57,7 @@ function pretty_name() {
|
||||||
opensuse) PRETTY_NAME="openSUSE";;
|
opensuse) PRETTY_NAME="openSUSE";;
|
||||||
oraclelinux) PRETTY_NAME="Oracle Linux";;
|
oraclelinux) PRETTY_NAME="Oracle Linux";;
|
||||||
popos) PRETTY_NAME="Pop!_OS";;
|
popos) PRETTY_NAME="Pop!_OS";;
|
||||||
|
reactos) PRETTY_NAME="ReactOS";;
|
||||||
regolith) PRETTY_NAME="Regolith Linux";;
|
regolith) PRETTY_NAME="Regolith Linux";;
|
||||||
rockylinux) PRETTY_NAME="Rocky Linux";;
|
rockylinux) PRETTY_NAME="Rocky Linux";;
|
||||||
ubuntu-budgie) PRETTY_NAME="Ubuntu Budgie";;
|
ubuntu-budgie) PRETTY_NAME="Ubuntu Budgie";;
|
||||||
|
@ -196,6 +197,7 @@ function os_support() {
|
||||||
opensuse \
|
opensuse \
|
||||||
oraclelinux \
|
oraclelinux \
|
||||||
popos \
|
popos \
|
||||||
|
reactos \
|
||||||
regolith \
|
regolith \
|
||||||
rockylinux \
|
rockylinux \
|
||||||
slackware \
|
slackware \
|
||||||
|
@ -437,6 +439,10 @@ function editions_popos() {
|
||||||
echo intel nvidia
|
echo intel nvidia
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function releases_reactos() {
|
||||||
|
echo latest
|
||||||
|
}
|
||||||
|
|
||||||
function releases_regolith() {
|
function releases_regolith() {
|
||||||
echo focal impish
|
echo focal impish
|
||||||
}
|
}
|
||||||
|
@ -719,6 +725,9 @@ function make_vm_config() {
|
||||||
openbsd)
|
openbsd)
|
||||||
GUEST="openbsd"
|
GUEST="openbsd"
|
||||||
IMAGE_TYPE="iso";;
|
IMAGE_TYPE="iso";;
|
||||||
|
reactos)
|
||||||
|
GUEST="reactos"
|
||||||
|
IMAGE_TYPE="iso";;
|
||||||
windows)
|
windows)
|
||||||
GUEST="windows"
|
GUEST="windows"
|
||||||
IMAGE_TYPE="iso";;
|
IMAGE_TYPE="iso";;
|
||||||
|
@ -765,6 +774,11 @@ EOF
|
||||||
echo "disk_size=\"2G\"" >> "${CONF_FILE}"
|
echo "disk_size=\"2G\"" >> "${CONF_FILE}"
|
||||||
echo "ram=\"128M\"" >> "${CONF_FILE}"
|
echo "ram=\"128M\"" >> "${CONF_FILE}"
|
||||||
;;
|
;;
|
||||||
|
reactos)
|
||||||
|
echo "boot=\"legacy\"" >> "${CONF_FILE}"
|
||||||
|
echo "disk_size=\"12G\"" >> "${CONF_FILE}"
|
||||||
|
echo "ram=\"2048M\"" >> "${CONF_FILE}"
|
||||||
|
;;
|
||||||
macos) echo "macos_release=\"${RELEASE}\"" >> "${CONF_FILE}";;
|
macos) echo "macos_release=\"${RELEASE}\"" >> "${CONF_FILE}";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -1307,6 +1321,16 @@ function get_popos() {
|
||||||
echo "${URL} ${HASH}"
|
echo "${URL} ${HASH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_reactos() {
|
||||||
|
local HASH=""
|
||||||
|
local URL=""
|
||||||
|
local TMPURL=""
|
||||||
|
|
||||||
|
TMPURL=$(wget -q -S -O- --max-redirect=0 "https://sourceforge.net/projects/reactos/files/latest/download" 2>&1 | grep Location | cut -d' ' -f4)
|
||||||
|
URL=${TMPURL%\?*}
|
||||||
|
echo "${URL} ${HASH}"
|
||||||
|
}
|
||||||
|
|
||||||
function get_regolith() {
|
function get_regolith() {
|
||||||
local EDITION="${1:-}"
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
|
@ -1843,6 +1867,11 @@ create_vm() {
|
||||||
ISO="${ISO/.gz/}"
|
ISO="${ISO/.gz/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ${OS} == "reactos" ] && [[ $ISO =~ ".zip" ]]; then
|
||||||
|
unzip ${VM_PATH}/${ISO} -d ${VM_PATH}
|
||||||
|
ISO=$(ls ${VM_PATH} | grep -i '.iso' | grep -v '.zip')
|
||||||
|
fi
|
||||||
|
|
||||||
make_vm_config "${ISO}"
|
make_vm_config "${ISO}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue