From 310d2d3aa1028775fa50e13a0cfce1a32f810b93 Mon Sep 17 00:00:00 2001 From: Vitaliy Krylov Date: Wed, 22 Dec 2021 00:13:47 +0300 Subject: [PATCH 1/2] Adding KolibriOS support It can download and boot this OS. There is one requirement: 7z. Its not completed yet (at least internet and sound dont work) --- quickemu | 2 +- quickget | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/quickemu b/quickemu index 550758020b..78a3c740b1 100755 --- a/quickemu +++ b/quickemu @@ -451,7 +451,7 @@ function vm_boot() { # Make any OS specific adjustments case ${guest_os} in - freebsd|linux|openbsd) + freebsd|kolibrios|linux|openbsd) CPU="-cpu host,kvm=on" if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then CPU="${CPU},topoext" diff --git a/quickget b/quickget index 235fd9a362..f4fa47e223 100755 --- a/quickget +++ b/quickget @@ -42,6 +42,7 @@ function pretty_name() { freebsd) PRETTY_NAME="FreeBSD";; garuda) PRETTY_NAME="Garuda Linux";; kdeneon) PRETTY_NAME="KDE Neon";; + kolibrios) PRETTY_NAME="KolibriOS";; linuxmint-cinnamon) PRETTY_NAME="Linux Mint Cinnamon";; linuxmint-mate) PRETTY_NAME="Linux Mint MATE";; linuxmint-xfce) PRETTY_NAME="Linux Mint XFCE";; @@ -170,6 +171,7 @@ function os_support() { garuda \ kali \ kdeneon \ + kolibrios \ kubuntu \ linuxmint-cinnamon \ linuxmint-mate \ @@ -274,6 +276,10 @@ function releases_kdeneon() { developer } +function releases_kolibrios() { + echo latest-iso +} + function releases_linuxmint(){ echo 20.2 } @@ -540,6 +546,9 @@ function make_vm_config() { elif [ "${OS}" == "kdeneon" ]; then GUEST="linux" IMAGE_TYPE="iso" + elif [ "${OS}" == "kolibrios" ]; then + GUEST="kolibrios" + IMAGE_TYPE="iso" elif [[ "${OS}" == *"linuxmint"* ]]; then GUEST="linux" IMAGE_TYPE="iso" @@ -596,9 +605,16 @@ EOF if [ -n "${ISO_FILE}" ]; then echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${OS}-${RELEASE}.conf" fi + if [ "${OS}" == "alma" ] && [ ${ISOTYPE} == "dvd" ]; then echo "disk_size=\"32G\"" >> "${OS}-${RELEASE}.conf" fi + + if [ "${OS}" == "kolibrios" ]; then + echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf" + echo "disk_size=\"256M\"" >> "${OS}-${RELEASE}.conf" + fi + if [ "${OS}" == "openbsd" ]; then echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf" fi @@ -828,6 +844,21 @@ function get_kdeneon() { make_vm_config "${ISO}" } +function get_kolibrios() { + local HASH="" + local ISO="" + local URL="" + + validate_release "releases_kolibrios" + URL="https://builds.kolibrios.org/eng/${RELEASE}.7z" + web_get "${URL}" "${VM_PATH}" + 7z e "${VM_PATH}/${RELEASE}.7z" "kolibri.iso" + ISO="kolibrios-${RELEASE}.iso" + mv "kolibri.iso" "${VM_PATH}/${ISO}" + rm "${VM_PATH}/${RELEASE}.7z" + make_vm_config "${ISO}" +} + function get_linuxmint() { local FLAVOR="" local HASH="" @@ -1657,6 +1688,8 @@ if [ -n "${2}" ]; then get_kali elif [ "${OS}" == "kdeneon" ]; then get_kdeneon + elif [ "${OS}" == "kolibrios" ]; then + get_kolibrios elif [[ "${OS}" == *"linuxmint-"* ]]; then get_linuxmint elif [[ "${OS}" == *"nixos-"* ]]; then @@ -1746,6 +1779,8 @@ else releases_garuda elif [ "${OS}" == "kali" ]; then releases_kali + elif [ "${OS}" == "kolibrios" ]; then + releases_kolibrios elif [[ "${OS}" == *"linuxmint-"* ]]; then releases_linuxmint elif [[ "${OS}" == *"nixos-"* ]]; then From 82be8d324ccb947a36c82476d6ea79d88f2a2101 Mon Sep 17 00:00:00 2001 From: Vitaliy Krylov Date: Thu, 23 Dec 2021 20:36:34 +0300 Subject: [PATCH 2/2] Improved support of KolibriOS: CD-ROM (iso), Disk, Internet and Audio are working now. Also added forced LiveCD booting (because release named latest-iso, not latest-img). Did some tweaks with '-machine' and '-cpu'. Now these VMs will run with 'qemu32' processor since KolibriOS throw an MTRR error (I didnt get how to fix it by any other way). --- quickemu | 31 ++++++++++++++++++++++++++++--- quickget | 1 - 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/quickemu b/quickemu index 78a3c740b1..f0a44a3de8 100755 --- a/quickemu +++ b/quickemu @@ -228,6 +228,7 @@ function vm_boot() { local KERNEL_NODE="" local KERNEL_VER="?" local LSB_DESCRIPTION="Unknown OS" + local MACHINETYPE="q35" local MAC_BOOTLOADER="" local MAC_MISSING="" local MAC_DISK_DEV="ide-hd,bus=ahci.2" @@ -451,7 +452,7 @@ function vm_boot() { # Make any OS specific adjustments case ${guest_os} in - freebsd|kolibrios|linux|openbsd) + freebsd|linux|openbsd) CPU="-cpu host,kvm=on" if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then CPU="${CPU},topoext" @@ -463,6 +464,18 @@ function vm_boot() { disk_size="16G" fi ;; + kolibrios) + CPU="-cpu qemu32,kvm=on" + if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then + CPU="${CPU},topoext" + fi + MACHINETYPE="pc" + NET_DEVICE="rtl8139" + GUEST_TWEAKS="-boot d" + if [ -z "${disk_size}" ]; then + disk_size="256M" + fi + ;; macos) #https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/ # A CPU with SSE4.1 support is required for >= macOS Sierra @@ -591,7 +604,7 @@ function vm_boot() { fi fi - if [ "${DISK_USED}" == "yes" ]; then + if [ "${DISK_USED}" == "yes" ] && [ "${guest_os}" != "kolibrios" ]; then # If there is a disk image that appears to be used do not boot from installation media. iso="" img="" @@ -833,7 +846,7 @@ function vm_boot() { # shellcheck disable=SC2054,SC2206,SC2140 args+=(-name ${VMNAME},process=${VMNAME} -pidfile "${VMDIR}/${VMNAME}.pid" - -enable-kvm -machine q35,smm=${SMM},vmport=off ${GUEST_TWEAKS} + -enable-kvm -machine ${MACHINETYPE},smm=${SMM},vmport=off ${GUEST_TWEAKS} ${CPU} ${SMP} -m ${RAM_VM} ${BALLOON} -smbios type=2,manufacturer="Quickemu Project",product="Quickemu",version="${VERSION}",serial="0xDEADBEEF",location="quickemu.com",asset="${VMNAME}" @@ -891,6 +904,13 @@ function vm_boot() { args+=(-drive if=floppy,format=raw,file="${floppy}") fi + # Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2 + if [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then + # shellcheck disable=SC2054 + args+=(-drive media=cdrom,index=2,file="${iso}") + iso="" + fi + if [ -n "${iso}" ]; then # shellcheck disable=SC2054 args+=(-drive media=cdrom,index=0,file="${iso}") @@ -922,6 +942,11 @@ function vm_boot() { # shellcheck disable=SC2054,SC2206 args+=(-device ${MAC_DISK_DEV},drive=SystemDisk -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) + elif [ "${guest_os}" == "kolibrios" ]; then + # shellcheck disable=SC2054,SC2206 + args+=(-device ahci,id=ahci + -device ide-hd,bus=ahci.0,drive=SystemDisk + -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) else # shellcheck disable=SC2054,SC2206 args+=(-device virtio-blk-pci,drive=SystemDisk diff --git a/quickget b/quickget index f4fa47e223..76f2cf3643 100755 --- a/quickget +++ b/quickget @@ -612,7 +612,6 @@ EOF if [ "${OS}" == "kolibrios" ]; then echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf" - echo "disk_size=\"256M\"" >> "${OS}-${RELEASE}.conf" fi if [ "${OS}" == "openbsd" ]; then