From eaeb75d858f45447c4b3d17f33b6183f95b98466 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Tue, 2 Feb 2021 10:42:07 +0100 Subject: [qemu] Rename 'qemukvm' core module to 'qemu' --- core/modules/qemu/data/addon-init | 8 ++ core/modules/qemu/data/etc/qemu/bridge.conf | 6 ++ .../system/graphical.target.wants/qemukvm.service | 1 + .../qemu/data/etc/systemd/system/qemukvm.service | 9 +++ .../data/opt/openslx/scripts/systemd-qemukvm_env | 28 +++++++ .../opt/openslx/vmchooser/plugins/qemukvm/README | 1 + .../includes/determine_hardware_limitations.inc | 89 ++++++++++++++++++++++ .../qemukvm/includes/finalize_start_command.inc | 49 ++++++++++++ .../plugins/qemukvm/includes/init_core.inc | 54 +++++++++++++ .../qemukvm/includes/log_config_summary.inc | 35 +++++++++ .../plugins/qemukvm/includes/setup_network.inc | 56 ++++++++++++++ .../plugins/qemukvm/includes/setup_rw_layer.inc | 25 ++++++ .../vmchooser/plugins/qemukvm/run-virt.include | 44 +++++++++++ core/modules/qemu/module.build | 18 +++++ core/modules/qemu/module.conf | 5 ++ core/modules/qemu/module.conf.debian | 15 ++++ core/modules/qemu/module.conf.ubuntu | 15 ++++ core/modules/qemukvm/data/addon-init | 8 -- core/modules/qemukvm/data/etc/qemu/bridge.conf | 6 -- .../system/graphical.target.wants/qemukvm.service | 1 - .../data/etc/systemd/system/qemukvm.service | 9 --- .../data/opt/openslx/scripts/systemd-qemukvm_env | 28 ------- .../opt/openslx/vmchooser/plugins/qemukvm/README | 1 - .../includes/determine_hardware_limitations.inc | 89 ---------------------- .../qemukvm/includes/finalize_start_command.inc | 49 ------------ .../plugins/qemukvm/includes/init_core.inc | 54 ------------- .../qemukvm/includes/log_config_summary.inc | 35 --------- .../plugins/qemukvm/includes/setup_network.inc | 56 -------------- .../plugins/qemukvm/includes/setup_rw_layer.inc | 25 ------ .../vmchooser/plugins/qemukvm/run-virt.include | 44 ----------- core/modules/qemukvm/module.build | 18 ----- core/modules/qemukvm/module.conf | 5 -- core/modules/qemukvm/module.conf.debian | 15 ---- core/modules/qemukvm/module.conf.ubuntu | 15 ---- 34 files changed, 458 insertions(+), 458 deletions(-) create mode 100755 core/modules/qemu/data/addon-init create mode 100644 core/modules/qemu/data/etc/qemu/bridge.conf create mode 120000 core/modules/qemu/data/etc/systemd/system/graphical.target.wants/qemukvm.service create mode 100644 core/modules/qemu/data/etc/systemd/system/qemukvm.service create mode 100755 core/modules/qemu/data/opt/openslx/scripts/systemd-qemukvm_env create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/README create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc create mode 100644 core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include create mode 100644 core/modules/qemu/module.build create mode 100644 core/modules/qemu/module.conf create mode 100644 core/modules/qemu/module.conf.debian create mode 100644 core/modules/qemu/module.conf.ubuntu delete mode 100755 core/modules/qemukvm/data/addon-init delete mode 100644 core/modules/qemukvm/data/etc/qemu/bridge.conf delete mode 120000 core/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service delete mode 100644 core/modules/qemukvm/data/etc/systemd/system/qemukvm.service delete mode 100755 core/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc delete mode 100644 core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include delete mode 100644 core/modules/qemukvm/module.build delete mode 100644 core/modules/qemukvm/module.conf delete mode 100644 core/modules/qemukvm/module.conf.debian delete mode 100644 core/modules/qemukvm/module.conf.ubuntu diff --git a/core/modules/qemu/data/addon-init b/core/modules/qemu/data/addon-init new file mode 100755 index 00000000..cccc1e8a --- /dev/null +++ b/core/modules/qemu/data/addon-init @@ -0,0 +1,8 @@ +#!/bin/ash + +systemctl daemon-reload +systemctl start qemukvm.service + +# this seems to be necessary due to the misbehaviour of udevd +# in view of the undetected ENV dev_type +systemctl restart systemd-udevd diff --git a/core/modules/qemu/data/etc/qemu/bridge.conf b/core/modules/qemu/data/etc/qemu/bridge.conf new file mode 100644 index 00000000..b8478434 --- /dev/null +++ b/core/modules/qemu/data/etc/qemu/bridge.conf @@ -0,0 +1,6 @@ +# These needs to be compatible with the +# bridge's names generated by +# /opt/openslx/scripts/systemd-run_virt_env +allow br0 +allow nat1 +allow vsw2 diff --git a/core/modules/qemu/data/etc/systemd/system/graphical.target.wants/qemukvm.service b/core/modules/qemu/data/etc/systemd/system/graphical.target.wants/qemukvm.service new file mode 120000 index 00000000..89d8afbf --- /dev/null +++ b/core/modules/qemu/data/etc/systemd/system/graphical.target.wants/qemukvm.service @@ -0,0 +1 @@ +../qemukvm.service \ No newline at end of file diff --git a/core/modules/qemu/data/etc/systemd/system/qemukvm.service b/core/modules/qemu/data/etc/systemd/system/qemukvm.service new file mode 100644 index 00000000..f1f3dec6 --- /dev/null +++ b/core/modules/qemu/data/etc/systemd/system/qemukvm.service @@ -0,0 +1,9 @@ +[Unit] +Description=Sets up the virtual box environment +Requires=run-virt-env.service +After=run-virt-env.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/opt/openslx/scripts/systemd-qemukvm_env start diff --git a/core/modules/qemu/data/opt/openslx/scripts/systemd-qemukvm_env b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemukvm_env new file mode 100755 index 00000000..631c159f --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemukvm_env @@ -0,0 +1,28 @@ +#!/bin/ash +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2017..2018 bwLehrpool-Projektteam +# +# This program/file is free software distributed under the GPL version 2. +# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# If you have any feedback please consult https://bwlehrpool.de and +# send your feedback to bwlehrpool@hs-offenburg.de. +# +# General information about bwLehrpool can be found at https://bwlehrpool.de +# +# ----------------------------------------------------------------------------- +# systemd-qemukvm_env +# - This is the preparation script for the configuration of Linux Qemu/KVM. +################################################################################ + +# lazy load all kvm related modules +modprobe kvm +modprobe kvm_amd +modprobe kvm_intel + +if [ ! -e /dev/kvm ]; then + slxlog "qemukvm-modules" "/dev/kvm not found! Missing kvm kernel module(s)?" + exit 1 +fi + diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/README b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/README new file mode 100644 index 00000000..549d0037 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/README @@ -0,0 +1 @@ +Not tested since refactoring! (January 2017) diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc new file mode 100644 index 00000000..dd83b587 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc @@ -0,0 +1,89 @@ +################################################################## +# qemu/kvm include: determine virtual hardware based on guest OS # +################################################################## + +set_vm_hw_limits() { + # FIXME when we have better metadata for qemu + if isempty VM_OS_TYPE; then + writelog "VM_OS_TYPE is empty! This should have been parsed from the XML file" + EXIT_TYPE="user" EXIT_REASON="Konnte Gastbetriebsystems der virtuellen Maschine nicht ermitteln!" cleanexit 1 + fi + + # define global hardware-related variables + declare -g MAXMEM="9999999" + declare -g MAXCORES="4" + declare -g SOUND_DEV="es1370" + + # determine if we need a 32bit or 64bit machine + # FIXME depending on the guest OS for now + # (sadly does not support all the exotic OSs the + # the world has even seen like vmware plugin :<) + local bits=64 + case "${VM_OS_TYPE}" in + beos*) + bits=32 + SOUND_DEV="sb16" + ;; + win3*|win*3*|Win*3*) + bits=32 + SOUND_DEV="sb16" + MAXMEM=32 + ;; + win95*|Win*95) + bits=32 + MAXMEM=96 + ;; + win98) + bits=32 + MAXMEM=256 + ;; + winme*|windowsme*) + bits=32 + SOUND_DEV="ac97" + MAXMEM=384 + ;; + winxp*64|windowsxp*64) + SOUND_DEV="ac97" + ;; + windows7|windows8|windows9) + SOUND_DEV="ac97" + MAXMEM="8000" + MAXCORES="4" + ;; + windows7-64|windows8-64|windows9-64) + SOUND_DEV="ac97" + MAXMEM="32000" + MAXCORES="8" + ;; + *64) + MAXMEM="16000" + MAXCORES="4" + ;; + *) + bits=32 + MAXMEM="8000" + MAXCORES="1" + ;; + esac + declare -g VIRTCMD + if [ "$bits" = 32 ]; then + declare -rg VIRTCMD="qemu-system-i386" + VIRTCMDOPTS+=( "-machine" "accel=tcg" ) # TODO: 32bit VMs can't use kvm!? + else # 64 bit + declare -rg VIRTCMD="qemu-system-x86_64" + VIRTCMDOPTS+=( "-machine" "accel=kvm" ) + fi + + + # check for allocated cores + declare -g CPU_CORES="${HW_THREADS:-1}" + declare -rg HOST_CORE_COUNT="${CPU_CORES}" + [ "${CPU_CORES}" -gt "${MAXCORES}" ] && CPU_CORES="${MAXCORES}" + + # check if memory set by the generic run-virt is above the threshold + [ "${VM_MEM}" -gt "${MAXMEM}" ] && VM_MEM="${MAXMEM}" + return 0 +} + +## MAIN ## +call_post_source set_vm_hw_limits diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc new file mode 100644 index 00000000..6d9df363 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc @@ -0,0 +1,49 @@ +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2009..2018 bwLehrpool-Projektteam +# +# This program/file is free software distributed under the GPL version 2. +# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# If you have any feedback please consult https://bwlehrpool.de and +# send your feedback to bwlehrpool@hs-offenburg.de. +# +# General information about bwLehrpool can be found at https://bwlehrpool.de +# +# ----------------------------------------------------------------------------- +# run-virt.include +# - Include script for running the QEMU/Linux KVM virtual machine on an +# OpenSLX client via the run-virt.sh or run-vmgrid.sh +################################################################################ + +# set options that depend on previous includes +# and build the final start command +finalize_start_command() { + + # set cpu type + VIRTCMDOPTS+=( "-cpu" "host" ) + # set cpu cores + VIRTCMDOPTS+=( "-smp" "${CPU_CORES}" ) + + # set RAM + VIRTCMDOPTS+=( "-m" "${VM_MEM}" ) + + # special feature for real and virtual floppy disks + isset FLOPPY_0 && VIRTCMDOPTS+=( "-fda" "${FLOPPY_0}" ) + isset SLX_FLOPPY_IMG && VIRTCMDOPTS+=( "-fdb" "${SLX_FLOPPY_IMG}" ) + + # add optical drive if available + isset CDROM_0 && VIRTCMDOPTS+=( "-cdrom" "${CDROM_0}" ) + + # audio + isset SOUND_DEV && VIRTCMDOPTS+=( "-soundhw" "${SOUND_DEV}" ) + + # serial devices TODO test + if isset SERIAL_PORTS; then + for DEV in $SERIAL_PORTS; do + : # buggeh: VIRTCMDOPTS+=( "-serial" "${DEV}" ) + done + fi +} + +call_post_source finalize_start_command diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc new file mode 100644 index 00000000..fee2cd1c --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc @@ -0,0 +1,54 @@ +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2009..2018 bwLehrpool-Projektteam +# +# This program/file is free software distributed under the GPL version 2. +# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# If you have any feedback please consult https://bwlehrpool.de and +# send your feedback to bwlehrpool@hs-offenburg.de. +# +# General information about bwLehrpool can be found at https://bwlehrpool.de +# +# ----------------------------------------------------------------------------- +# run-virt.include +# - Include script for running the QEMU/Linux KVM virtual machine on an +# OpenSLX client via the run-virt.sh or run-vmgrid.sh +################################################################################ + +# check if kvm kernel module are available +if [ ! -c /dev/kvm ]; then + writelog "KVM kernel modules not loaded!" + EXIT_TYPE="internal" EXIT_REASON="QEMU/KVM Virtualisierer nicht initialisiert!" cleanexit 1 +fi + +# check if qemu binaries are available +if ! check_dep qemu-system-{i386,x86_64}; then + writelog "QEMU binaries not available!" + EXIT_TYPE="internal" EXIT_REASON="QEMU/KVM Virtualisierer nicht initialisiert!" cleanexit 1 +fi + +# set general purpose options here, mostly evaluates information +# contained in /opt/openslx/vmchooser/config/virtualization.conf + +# TODO some options should come from the server, in particular +# - disk controller type (virtio, scsi, ide...) +# - arch to emulate (x86_64, i386, ...) +# - graphics mode? +# - sound dev? +# - tbd + +# display name, remove blanks because of cmdline problems +declare -rg CMD_DISPLAYNAME=$(echo ${VM_DISPLAYNAME} | sed -e "s, ,-,g;s,(,[,g;s,),],g") +VIRTCMDOPTS+=( "-name" "${CMD_DISPLAYNAME}" ) + +# graphical start: vga, vmware, qxl, spice? +VIRTCMDOPTS+=( "-vga" "std" "-full-screen" ) + +# hot keys ALT+CTRL+SHIFT (does not work properly!?) +VIRTCMDOPTS+=( "-alt-grab" ) + +# TODO support other types of boot? any usecase for network boot? +# for now just boot from disk +VIRTCMDOPTS+=( "-boot" "c" ) + diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc new file mode 100644 index 00000000..6b4b279f --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc @@ -0,0 +1,35 @@ +################################################## +# Include: Print vm config summary into log file # +################################################## + +log_config_summary() { + writelog "Directories:" + writelog "\tTMPDIR:\t\t\t$TMPDIR" + writelog "Disk image:" + writelog "\tSource disk:\t\t$VM_DISKFILE_RO" + if [ -e "${VM_DISKFILE_RW}" ]; then + writelog "\tDisk mode:\t\twritable" + writelog "\tRW-Layer:\t\t$VM_DISKFILE_RW" + else + writelog "\tDisk mode:\t\tread-only" + fi + + writelog "Virtual Hardware:" + writelog "\tvCPU cores:\t\t${CPU_CORES}" + writelog "\tGuest RAM:\t\t${VM_MEM} MB" + + # echo nur wenn HOST_MEM_REMAINING gesetzt + if isset HOST_MEM_REMAINING; then + writelog "\tHost RAM:\t\t${HOST_MEM_REMAINING} MB" + fi + writelog "\tMAC address:\t\t${VM_MAC_ADDR}" + writelog "\tNetwork card:\t\t${NIC_MODEL}" + writelog "\tNetwork kind:\t\t${NETWORK_MODE}" + writelog "\tCD-ROM1:\t${CDROM_0}" + writelog "\tCD-ROM2:\t${CDROM_1}" + writelog "\tFloppy_A:\t${FLOPPY_0}" + writelog "\tFloppy_B:\t${SLX_FLOPPY_IMG}" + #writelog "\tShared Folders 'home':\t/home/${USER}" +} + +call_post_source log_config_summary diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc new file mode 100644 index 00000000..73fb2518 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc @@ -0,0 +1,56 @@ +################################### +# qemu/kvm include: Network setup # +################################### +# This now makes use of the qemu's bridge helper +# which creates a tap device and adds it to the +# bridge corresponding to the network type +# TODO configurable network type +setup_network() { + # list available models with: + # qemu-system-x86_64 -net nic,model=? + # e.g. as of 2.0.0: + # ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio + declare -rg NIC_MODEL="e1000" + + # add MAC address and network card model + VIRTCMDOPTS+=( "-device" "${NIC_MODEL},mac=${VM_MAC_ADDR},netdev=guestnet0" ) + + # TODO support different network kinds for lectures in bwlehrpool-suite, just NAT for now + declare -g NETWORK_MODE="nat" + + # detect if qemu's bridge helper binary is available + declare -g QEMU_BRIDGE_HELPER= + for HELPER_PATH in /usr/lib/qemu-bridge-helper /usr/local/libexec/qemu-bridge-helper; do + if [ -x "${HELPER_PATH}" ] && [ -u "${HELPER_PATH}" ]; then + QEMU_BRIDGE_HELPER="${HELPER_PATH}" + readonly QEMU_BRIDGE_HELPER + break + fi + done + if isempty QEMU_BRIDGE_HELPER; then + writelog "Could not find qemu-bridge-helper on this machine. Setting network mode to user." + # Even though falling back to creating tap devices ourselves, we should instead + # garantee the existance of qemu's helper on minilinux build time. + # qemu's user network mode allows tcp/udp connections in a nat-fashion and + # it allows access to the web which seems suffisant for a fallback. + NETWORK_MODE="user" + fi + + case "${NETWORK_MODE}" in + nat*) + VIRTCMDOPTS+=( "-netdev" "bridge,br=nat1,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) + ;; + bridge*) + VIRTCMDOPTS+=( "-netdev" "bridge,br=br0,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) + ;; + host*) + VIRTCMDOPTS+=( "-netdev" "bridge,br=vsw2,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) + ;; + user*|*) + VIRTCMDOPTS+=( "-netdev" "user,id=guestnet0" ) + ;; + esac +} + +## MAIN ## +call_post_source setup_network diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc new file mode 100644 index 00000000..32637e5d --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc @@ -0,0 +1,25 @@ + +setup_rw_layer() { + if isempty VM_DISKFILE_RO; then + writelog "No source diskfile found! This should be specified in the given XML file. Is it valid?" + EXIT_TYPE="user" EXIT_REASON="Keine virtuelle Festplatte zu dieser Veranstaltung angegeben!" cleanexit 1 + fi + + # setup qcow2 backing file for that disk file + writelog "Creating backing file for '${VM_DISKFILE_RO}'..." + # TODO: WTF? This is fucked up, VM_DISKFILE_RW is set if we want to run in persistent mode, + # this plugin shouldn't mess around with it.... + declare -rg VM_DISKFILE_RW="${TMPDIR}/$(basename ${VM_DISKFILE_RO}).qcow2" + if qemu-img create -f qcow2 -b "${VM_DISKFILE_RO}" "${VM_DISKFILE_RW}"; then + # all good, use it as main disk drive + # TODO: determine the proper type of controller to use, ideally virtio? + VIRTCMDOPTS+=("-drive" "if=virtio,format=qcow2,file=${VM_DISKFILE_RW}" ) + else + writelog "Error creating backing file for '${VM_DISKFILE_RO}'" + # TODO use -snapshot as fallback, test it! + # How is this supposed to even work without a disk? + VIRTCMDOPTS+=( "-snapshot" ) + fi +} + +call_post_source setup_rw_layer diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include new file mode 100644 index 00000000..7d1149b0 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include @@ -0,0 +1,44 @@ +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2009..2018 bwLehrpool-Projektteam +# +# This program/file is free software distributed under the GPL version 2. +# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +# +# If you have any feedback please consult https://bwlehrpool.de and +# send your feedback to bwlehrpool@hs-offenburg.de. +# +# General information about bwLehrpool can be found at https://bwlehrpool.de +# +# ----------------------------------------------------------------------------- +# run-virt.include +# - qemu/kvm plugin for vmchooser run-virt +################################################################################ + +# BASH_SOURCE[0] contains the file being sourced, namely this one +declare -rg QEMUKVM_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")" +declare -rg QEMUKVM_INCLUDE_DIR="${QEMUKVM_PLUGIN_DIR}/includes" + +# TODO make this part of the metadata coming from the server +# TBD: "firewall printer usb slxfloppy sound netshares" +declare -rg PLUGIN_FEATURES="slxfloppy" + +run_plugin() { + # declaration of default functions and variables for vmware + $(safesource --exit "${QEMUKVM_INCLUDE_DIR}/init_core.inc") + + # determine limitations wrt RAM and CPU count of VM + $(safesource "${QEMUKVM_INCLUDE_DIR}/determine_hardware_limitations.inc") + + # setup networking + $(safesource "${QEMUKVM_INCLUDE_DIR}/setup_network.inc") + + # setup rw layer for ro image + $(safesource "${QEMUKVM_INCLUDE_DIR}/setup_rw_layer.inc") + + # build the final start command + $(safesource "${QEMUKVM_INCLUDE_DIR}/finalize_start_command.inc") + + # print summary - needs writelog() from vmchooser-run_virt + $(safesource "${QEMUKVM_INCLUDE_DIR}/log_config_summary.inc") +} diff --git a/core/modules/qemu/module.build b/core/modules/qemu/module.build new file mode 100644 index 00000000..f2a0df9e --- /dev/null +++ b/core/modules/qemu/module.build @@ -0,0 +1,18 @@ +#!/bin/bash +fetch_source() { + : +} + +build() { + COPYLIST="list_dpkg_output" + [ -e "$COPYLIST" ] && rm "$COPYLIST" + list_packet_files >> "$COPYLIST" + + + tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" +} + +post_copy() { + # qemu-bridge-helper needs suid to be called within run-virt + find ${TARGET_BUILD_DIR} -type f -executable -name "*qemu-bridge-helper*" -exec chmod u+s {} \; +} diff --git a/core/modules/qemu/module.conf b/core/modules/qemu/module.conf new file mode 100644 index 00000000..0cf394cf --- /dev/null +++ b/core/modules/qemu/module.conf @@ -0,0 +1,5 @@ +#!/bin/bash +REQUIRED_MODULES="" +REQUIRED_DIRECTORIES=" + / +" diff --git a/core/modules/qemu/module.conf.debian b/core/modules/qemu/module.conf.debian new file mode 100644 index 00000000..4773a871 --- /dev/null +++ b/core/modules/qemu/module.conf.debian @@ -0,0 +1,15 @@ +#!/bin/bash +REQUIRED_INSTALLED_PACKAGES=" + qemu + qemu-kvm +" + +REQUIRED_CONTENT_PACKAGES=" + qemu + qemu-kvm + qemu-system-common + qemu-system-x86 + qemu-user + qemu-utils + seabios +" diff --git a/core/modules/qemu/module.conf.ubuntu b/core/modules/qemu/module.conf.ubuntu new file mode 100644 index 00000000..4773a871 --- /dev/null +++ b/core/modules/qemu/module.conf.ubuntu @@ -0,0 +1,15 @@ +#!/bin/bash +REQUIRED_INSTALLED_PACKAGES=" + qemu + qemu-kvm +" + +REQUIRED_CONTENT_PACKAGES=" + qemu + qemu-kvm + qemu-system-common + qemu-system-x86 + qemu-user + qemu-utils + seabios +" diff --git a/core/modules/qemukvm/data/addon-init b/core/modules/qemukvm/data/addon-init deleted file mode 100755 index cccc1e8a..00000000 --- a/core/modules/qemukvm/data/addon-init +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/ash - -systemctl daemon-reload -systemctl start qemukvm.service - -# this seems to be necessary due to the misbehaviour of udevd -# in view of the undetected ENV dev_type -systemctl restart systemd-udevd diff --git a/core/modules/qemukvm/data/etc/qemu/bridge.conf b/core/modules/qemukvm/data/etc/qemu/bridge.conf deleted file mode 100644 index b8478434..00000000 --- a/core/modules/qemukvm/data/etc/qemu/bridge.conf +++ /dev/null @@ -1,6 +0,0 @@ -# These needs to be compatible with the -# bridge's names generated by -# /opt/openslx/scripts/systemd-run_virt_env -allow br0 -allow nat1 -allow vsw2 diff --git a/core/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service b/core/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service deleted file mode 120000 index 89d8afbf..00000000 --- a/core/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service +++ /dev/null @@ -1 +0,0 @@ -../qemukvm.service \ No newline at end of file diff --git a/core/modules/qemukvm/data/etc/systemd/system/qemukvm.service b/core/modules/qemukvm/data/etc/systemd/system/qemukvm.service deleted file mode 100644 index f1f3dec6..00000000 --- a/core/modules/qemukvm/data/etc/systemd/system/qemukvm.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Sets up the virtual box environment -Requires=run-virt-env.service -After=run-virt-env.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/opt/openslx/scripts/systemd-qemukvm_env start diff --git a/core/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env b/core/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env deleted file mode 100755 index 631c159f..00000000 --- a/core/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/ash -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2017..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to bwlehrpool@hs-offenburg.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# systemd-qemukvm_env -# - This is the preparation script for the configuration of Linux Qemu/KVM. -################################################################################ - -# lazy load all kvm related modules -modprobe kvm -modprobe kvm_amd -modprobe kvm_intel - -if [ ! -e /dev/kvm ]; then - slxlog "qemukvm-modules" "/dev/kvm not found! Missing kvm kernel module(s)?" - exit 1 -fi - diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README deleted file mode 100644 index 549d0037..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README +++ /dev/null @@ -1 +0,0 @@ -Not tested since refactoring! (January 2017) diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc deleted file mode 100644 index dd83b587..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc +++ /dev/null @@ -1,89 +0,0 @@ -################################################################## -# qemu/kvm include: determine virtual hardware based on guest OS # -################################################################## - -set_vm_hw_limits() { - # FIXME when we have better metadata for qemu - if isempty VM_OS_TYPE; then - writelog "VM_OS_TYPE is empty! This should have been parsed from the XML file" - EXIT_TYPE="user" EXIT_REASON="Konnte Gastbetriebsystems der virtuellen Maschine nicht ermitteln!" cleanexit 1 - fi - - # define global hardware-related variables - declare -g MAXMEM="9999999" - declare -g MAXCORES="4" - declare -g SOUND_DEV="es1370" - - # determine if we need a 32bit or 64bit machine - # FIXME depending on the guest OS for now - # (sadly does not support all the exotic OSs the - # the world has even seen like vmware plugin :<) - local bits=64 - case "${VM_OS_TYPE}" in - beos*) - bits=32 - SOUND_DEV="sb16" - ;; - win3*|win*3*|Win*3*) - bits=32 - SOUND_DEV="sb16" - MAXMEM=32 - ;; - win95*|Win*95) - bits=32 - MAXMEM=96 - ;; - win98) - bits=32 - MAXMEM=256 - ;; - winme*|windowsme*) - bits=32 - SOUND_DEV="ac97" - MAXMEM=384 - ;; - winxp*64|windowsxp*64) - SOUND_DEV="ac97" - ;; - windows7|windows8|windows9) - SOUND_DEV="ac97" - MAXMEM="8000" - MAXCORES="4" - ;; - windows7-64|windows8-64|windows9-64) - SOUND_DEV="ac97" - MAXMEM="32000" - MAXCORES="8" - ;; - *64) - MAXMEM="16000" - MAXCORES="4" - ;; - *) - bits=32 - MAXMEM="8000" - MAXCORES="1" - ;; - esac - declare -g VIRTCMD - if [ "$bits" = 32 ]; then - declare -rg VIRTCMD="qemu-system-i386" - VIRTCMDOPTS+=( "-machine" "accel=tcg" ) # TODO: 32bit VMs can't use kvm!? - else # 64 bit - declare -rg VIRTCMD="qemu-system-x86_64" - VIRTCMDOPTS+=( "-machine" "accel=kvm" ) - fi - - - # check for allocated cores - declare -g CPU_CORES="${HW_THREADS:-1}" - declare -rg HOST_CORE_COUNT="${CPU_CORES}" - [ "${CPU_CORES}" -gt "${MAXCORES}" ] && CPU_CORES="${MAXCORES}" - - # check if memory set by the generic run-virt is above the threshold - [ "${VM_MEM}" -gt "${MAXMEM}" ] && VM_MEM="${MAXMEM}" - return 0 -} - -## MAIN ## -call_post_source set_vm_hw_limits diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc deleted file mode 100644 index 6d9df363..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc +++ /dev/null @@ -1,49 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2009..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to bwlehrpool@hs-offenburg.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# run-virt.include -# - Include script for running the QEMU/Linux KVM virtual machine on an -# OpenSLX client via the run-virt.sh or run-vmgrid.sh -################################################################################ - -# set options that depend on previous includes -# and build the final start command -finalize_start_command() { - - # set cpu type - VIRTCMDOPTS+=( "-cpu" "host" ) - # set cpu cores - VIRTCMDOPTS+=( "-smp" "${CPU_CORES}" ) - - # set RAM - VIRTCMDOPTS+=( "-m" "${VM_MEM}" ) - - # special feature for real and virtual floppy disks - isset FLOPPY_0 && VIRTCMDOPTS+=( "-fda" "${FLOPPY_0}" ) - isset SLX_FLOPPY_IMG && VIRTCMDOPTS+=( "-fdb" "${SLX_FLOPPY_IMG}" ) - - # add optical drive if available - isset CDROM_0 && VIRTCMDOPTS+=( "-cdrom" "${CDROM_0}" ) - - # audio - isset SOUND_DEV && VIRTCMDOPTS+=( "-soundhw" "${SOUND_DEV}" ) - - # serial devices TODO test - if isset SERIAL_PORTS; then - for DEV in $SERIAL_PORTS; do - : # buggeh: VIRTCMDOPTS+=( "-serial" "${DEV}" ) - done - fi -} - -call_post_source finalize_start_command diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc deleted file mode 100644 index fee2cd1c..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/init_core.inc +++ /dev/null @@ -1,54 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2009..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to bwlehrpool@hs-offenburg.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# run-virt.include -# - Include script for running the QEMU/Linux KVM virtual machine on an -# OpenSLX client via the run-virt.sh or run-vmgrid.sh -################################################################################ - -# check if kvm kernel module are available -if [ ! -c /dev/kvm ]; then - writelog "KVM kernel modules not loaded!" - EXIT_TYPE="internal" EXIT_REASON="QEMU/KVM Virtualisierer nicht initialisiert!" cleanexit 1 -fi - -# check if qemu binaries are available -if ! check_dep qemu-system-{i386,x86_64}; then - writelog "QEMU binaries not available!" - EXIT_TYPE="internal" EXIT_REASON="QEMU/KVM Virtualisierer nicht initialisiert!" cleanexit 1 -fi - -# set general purpose options here, mostly evaluates information -# contained in /opt/openslx/vmchooser/config/virtualization.conf - -# TODO some options should come from the server, in particular -# - disk controller type (virtio, scsi, ide...) -# - arch to emulate (x86_64, i386, ...) -# - graphics mode? -# - sound dev? -# - tbd - -# display name, remove blanks because of cmdline problems -declare -rg CMD_DISPLAYNAME=$(echo ${VM_DISPLAYNAME} | sed -e "s, ,-,g;s,(,[,g;s,),],g") -VIRTCMDOPTS+=( "-name" "${CMD_DISPLAYNAME}" ) - -# graphical start: vga, vmware, qxl, spice? -VIRTCMDOPTS+=( "-vga" "std" "-full-screen" ) - -# hot keys ALT+CTRL+SHIFT (does not work properly!?) -VIRTCMDOPTS+=( "-alt-grab" ) - -# TODO support other types of boot? any usecase for network boot? -# for now just boot from disk -VIRTCMDOPTS+=( "-boot" "c" ) - diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc deleted file mode 100644 index 6b4b279f..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc +++ /dev/null @@ -1,35 +0,0 @@ -################################################## -# Include: Print vm config summary into log file # -################################################## - -log_config_summary() { - writelog "Directories:" - writelog "\tTMPDIR:\t\t\t$TMPDIR" - writelog "Disk image:" - writelog "\tSource disk:\t\t$VM_DISKFILE_RO" - if [ -e "${VM_DISKFILE_RW}" ]; then - writelog "\tDisk mode:\t\twritable" - writelog "\tRW-Layer:\t\t$VM_DISKFILE_RW" - else - writelog "\tDisk mode:\t\tread-only" - fi - - writelog "Virtual Hardware:" - writelog "\tvCPU cores:\t\t${CPU_CORES}" - writelog "\tGuest RAM:\t\t${VM_MEM} MB" - - # echo nur wenn HOST_MEM_REMAINING gesetzt - if isset HOST_MEM_REMAINING; then - writelog "\tHost RAM:\t\t${HOST_MEM_REMAINING} MB" - fi - writelog "\tMAC address:\t\t${VM_MAC_ADDR}" - writelog "\tNetwork card:\t\t${NIC_MODEL}" - writelog "\tNetwork kind:\t\t${NETWORK_MODE}" - writelog "\tCD-ROM1:\t${CDROM_0}" - writelog "\tCD-ROM2:\t${CDROM_1}" - writelog "\tFloppy_A:\t${FLOPPY_0}" - writelog "\tFloppy_B:\t${SLX_FLOPPY_IMG}" - #writelog "\tShared Folders 'home':\t/home/${USER}" -} - -call_post_source log_config_summary diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc deleted file mode 100644 index 73fb2518..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc +++ /dev/null @@ -1,56 +0,0 @@ -################################### -# qemu/kvm include: Network setup # -################################### -# This now makes use of the qemu's bridge helper -# which creates a tap device and adds it to the -# bridge corresponding to the network type -# TODO configurable network type -setup_network() { - # list available models with: - # qemu-system-x86_64 -net nic,model=? - # e.g. as of 2.0.0: - # ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio - declare -rg NIC_MODEL="e1000" - - # add MAC address and network card model - VIRTCMDOPTS+=( "-device" "${NIC_MODEL},mac=${VM_MAC_ADDR},netdev=guestnet0" ) - - # TODO support different network kinds for lectures in bwlehrpool-suite, just NAT for now - declare -g NETWORK_MODE="nat" - - # detect if qemu's bridge helper binary is available - declare -g QEMU_BRIDGE_HELPER= - for HELPER_PATH in /usr/lib/qemu-bridge-helper /usr/local/libexec/qemu-bridge-helper; do - if [ -x "${HELPER_PATH}" ] && [ -u "${HELPER_PATH}" ]; then - QEMU_BRIDGE_HELPER="${HELPER_PATH}" - readonly QEMU_BRIDGE_HELPER - break - fi - done - if isempty QEMU_BRIDGE_HELPER; then - writelog "Could not find qemu-bridge-helper on this machine. Setting network mode to user." - # Even though falling back to creating tap devices ourselves, we should instead - # garantee the existance of qemu's helper on minilinux build time. - # qemu's user network mode allows tcp/udp connections in a nat-fashion and - # it allows access to the web which seems suffisant for a fallback. - NETWORK_MODE="user" - fi - - case "${NETWORK_MODE}" in - nat*) - VIRTCMDOPTS+=( "-netdev" "bridge,br=nat1,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) - ;; - bridge*) - VIRTCMDOPTS+=( "-netdev" "bridge,br=br0,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) - ;; - host*) - VIRTCMDOPTS+=( "-netdev" "bridge,br=vsw2,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" ) - ;; - user*|*) - VIRTCMDOPTS+=( "-netdev" "user,id=guestnet0" ) - ;; - esac -} - -## MAIN ## -call_post_source setup_network diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc deleted file mode 100644 index 32637e5d..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc +++ /dev/null @@ -1,25 +0,0 @@ - -setup_rw_layer() { - if isempty VM_DISKFILE_RO; then - writelog "No source diskfile found! This should be specified in the given XML file. Is it valid?" - EXIT_TYPE="user" EXIT_REASON="Keine virtuelle Festplatte zu dieser Veranstaltung angegeben!" cleanexit 1 - fi - - # setup qcow2 backing file for that disk file - writelog "Creating backing file for '${VM_DISKFILE_RO}'..." - # TODO: WTF? This is fucked up, VM_DISKFILE_RW is set if we want to run in persistent mode, - # this plugin shouldn't mess around with it.... - declare -rg VM_DISKFILE_RW="${TMPDIR}/$(basename ${VM_DISKFILE_RO}).qcow2" - if qemu-img create -f qcow2 -b "${VM_DISKFILE_RO}" "${VM_DISKFILE_RW}"; then - # all good, use it as main disk drive - # TODO: determine the proper type of controller to use, ideally virtio? - VIRTCMDOPTS+=("-drive" "if=virtio,format=qcow2,file=${VM_DISKFILE_RW}" ) - else - writelog "Error creating backing file for '${VM_DISKFILE_RO}'" - # TODO use -snapshot as fallback, test it! - # How is this supposed to even work without a disk? - VIRTCMDOPTS+=( "-snapshot" ) - fi -} - -call_post_source setup_rw_layer diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include deleted file mode 100644 index 7d1149b0..00000000 --- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include +++ /dev/null @@ -1,44 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2009..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to bwlehrpool@hs-offenburg.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# run-virt.include -# - qemu/kvm plugin for vmchooser run-virt -################################################################################ - -# BASH_SOURCE[0] contains the file being sourced, namely this one -declare -rg QEMUKVM_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")" -declare -rg QEMUKVM_INCLUDE_DIR="${QEMUKVM_PLUGIN_DIR}/includes" - -# TODO make this part of the metadata coming from the server -# TBD: "firewall printer usb slxfloppy sound netshares" -declare -rg PLUGIN_FEATURES="slxfloppy" - -run_plugin() { - # declaration of default functions and variables for vmware - $(safesource --exit "${QEMUKVM_INCLUDE_DIR}/init_core.inc") - - # determine limitations wrt RAM and CPU count of VM - $(safesource "${QEMUKVM_INCLUDE_DIR}/determine_hardware_limitations.inc") - - # setup networking - $(safesource "${QEMUKVM_INCLUDE_DIR}/setup_network.inc") - - # setup rw layer for ro image - $(safesource "${QEMUKVM_INCLUDE_DIR}/setup_rw_layer.inc") - - # build the final start command - $(safesource "${QEMUKVM_INCLUDE_DIR}/finalize_start_command.inc") - - # print summary - needs writelog() from vmchooser-run_virt - $(safesource "${QEMUKVM_INCLUDE_DIR}/log_config_summary.inc") -} diff --git a/core/modules/qemukvm/module.build b/core/modules/qemukvm/module.build deleted file mode 100644 index f2a0df9e..00000000 --- a/core/modules/qemukvm/module.build +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -fetch_source() { - : -} - -build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - - - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" -} - -post_copy() { - # qemu-bridge-helper needs suid to be called within run-virt - find ${TARGET_BUILD_DIR} -type f -executable -name "*qemu-bridge-helper*" -exec chmod u+s {} \; -} diff --git a/core/modules/qemukvm/module.conf b/core/modules/qemukvm/module.conf deleted file mode 100644 index 0cf394cf..00000000 --- a/core/modules/qemukvm/module.conf +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -REQUIRED_MODULES="" -REQUIRED_DIRECTORIES=" - / -" diff --git a/core/modules/qemukvm/module.conf.debian b/core/modules/qemukvm/module.conf.debian deleted file mode 100644 index 4773a871..00000000 --- a/core/modules/qemukvm/module.conf.debian +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -REQUIRED_INSTALLED_PACKAGES=" - qemu - qemu-kvm -" - -REQUIRED_CONTENT_PACKAGES=" - qemu - qemu-kvm - qemu-system-common - qemu-system-x86 - qemu-user - qemu-utils - seabios -" diff --git a/core/modules/qemukvm/module.conf.ubuntu b/core/modules/qemukvm/module.conf.ubuntu deleted file mode 100644 index 4773a871..00000000 --- a/core/modules/qemukvm/module.conf.ubuntu +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -REQUIRED_INSTALLED_PACKAGES=" - qemu - qemu-kvm -" - -REQUIRED_CONTENT_PACKAGES=" - qemu - qemu-kvm - qemu-system-common - qemu-system-x86 - qemu-user - qemu-utils - seabios -" -- cgit v1.2.3-55-g7522