Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding KolibriOS support #286

Merged
merged 2 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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";;
Expand Down Expand Up @@ -170,6 +171,7 @@ function os_support() {
garuda \
kali \
kdeneon \
kolibrios \
kubuntu \
linuxmint-cinnamon \
linuxmint-mate \
Expand Down Expand Up @@ -274,6 +276,10 @@ function releases_kdeneon() {
developer
}

function releases_kolibrios() {
echo latest-iso
}

function releases_linuxmint(){
echo 20.2
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -596,9 +605,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 @@ -828,6 +843,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 @@ -1657,6 +1687,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 @@ -1746,6 +1778,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