Skip to content

Commit

Permalink
Merge remote-tracking branch 'kolibri/master' into merging-updated-di…
Browse files Browse the repository at this point in the history
…stros
  • Loading branch information
philclifford committed Jan 17, 2022
2 parents dc901fa + 82be8d3 commit 1d0312f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
29 changes: 27 additions & 2 deletions quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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";;
Expand Down Expand Up @@ -172,6 +173,7 @@ function os_support() {
garuda \
kali \
kdeneon \
kolibrios \
kubuntu \
linuxmint-cinnamon \
linuxmint-mate \
Expand Down Expand Up @@ -280,6 +282,10 @@ function releases_kdeneon() {
developer
}

function releases_kolibrios() {
echo latest-iso
}

function releases_linuxmint(){
echo 20.2
}
Expand Down Expand Up @@ -550,6 +556,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"
Expand Down Expand Up @@ -606,9 +615,15 @@ 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"
fi

if [ "${OS}" == "openbsd" ]; then
echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf"
fi
Expand Down Expand Up @@ -853,6 +868,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=""
Expand Down Expand Up @@ -1684,6 +1714,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
Expand Down Expand Up @@ -1775,6 +1807,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
Expand Down

0 comments on commit 1d0312f

Please sign in to comment.