diff options
author | Simon Rettberg | 2024-05-23 16:32:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-05-23 16:32:00 +0200 |
commit | 7359f61fc04981ccef48fccee299e14a6066ce4b (patch) | |
tree | 6cefa55b72b9dd7dd58cd1988d9c7a02eccaf754 | |
parent | [systemd] Remove module (diff) | |
download | mltk-7359f61fc04981ccef48fccee299e14a6066ce4b.tar.gz mltk-7359f61fc04981ccef48fccee299e14a6066ce4b.tar.xz mltk-7359f61fc04981ccef48fccee299e14a6066ce4b.zip |
Big round of cleanup
- Remove a lot of TODOs, either by fixing them or because they became
irrelevant
- Change all git:// to https://
- Move hwreport and hwinfo from /run to /run/openslx
- Minor script style cleanups
- Remove dead code and functions in various scripts
43 files changed, 61 insertions, 191 deletions
diff --git a/core/modules/beamergui/module.conf b/core/modules/beamergui/module.conf index baf892c2..699b075c 100644 --- a/core/modules/beamergui/module.conf +++ b/core/modules/beamergui/module.conf @@ -3,7 +3,7 @@ REQUIRED_MODULES=" parse-edid qt5core " -REQUIRED_GIT="git://git.openslx.org/openslx-ng/beamergui.git|2.0" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/beamergui.git|2.0" REQUIRED_BINARIES=" beamergui " diff --git a/core/modules/busybox/module.conf b/core/modules/busybox/module.conf index f9072efe..6bd50337 100644 --- a/core/modules/busybox/module.conf +++ b/core/modules/busybox/module.conf @@ -1,5 +1,5 @@ #!/bin/bash -REQUIRED_GIT="git://git.busybox.net/busybox||1_31_1" +REQUIRED_GIT="https://git.busybox.net/busybox||1_31_1" REQUIRED_BINARIES="busybox" REQUIRED_DIRECTORIES=" / diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info index ae35b33a..545cb4bc 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info @@ -9,8 +9,8 @@ export LANG=C.UTF-8 export LC_ALL=C.UTF-8 -declare -rg REPORTFILE="/run/hwreport" -declare -rg jsonfile="/run/hwreport.json" +declare -rg REPORTFILE="/run/openslx/hwreport" +declare -rg jsonfile="/run/openslx/hwreport.json" # new json-based reporting, run first in background and wait at the end of script # This is only supported by Sat3.11, released 12-2023, so keep creating the old format @@ -292,7 +292,7 @@ echo "Created report file" ################################################################################ # Save information to local file for later use # -cat > "/run/hwinfo" <<HORST +cat > "/run/openslx/hwinfo" <<HORST HW_KVM='${VT}' HW_ID44='${ID44}' HW_MAC='${MAC}' diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report index 64d0f090..bf1fe6ee 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report @@ -8,23 +8,21 @@ disable_remote_logging() { } # sends the hardware information of this machine generated by -# systemd-hardware_stats_gather in /run/hwreport and /run/hwinfo +# systemd-hardware_stats_gather in /run/openslx/hwreport and /run/openslx/hwinfo report_hardware_info() { local uptime hwreport hwinfo uuid model subnet ret runmode jsonfile if [ -z "$SLX_REMOTE_LOG" ]; then disable_remote_logging return 1 fi - hwreport="/run/hwreport" - jsonfile="/run/hwreport.json" + hwreport="/run/openslx/hwreport" + jsonfile="/run/openslx/hwreport.json" if ! [ -s "$hwreport" ] && ! [ -s "$jsonfile" ]; then echo "Missing hwreport file: $hwreport AND $jsonfile" - # TODO send data without? - return 1 fi # Read generated data and current uptime and send it - hwinfo="/run/hwinfo" + hwinfo="/run/openslx/hwinfo" if [ ! -s "$hwinfo" ]; then echo "Missing hwinfo file: $hwinfo" return 1 @@ -80,8 +78,8 @@ report_hardware_info() { fi echo "succeeded." rm -f -- "$hwreport" "$jsonfile" - START=$(( $RANDOM % 5 )) - DELAY=$(( $RANDOM % 20 )) + START=$(( RANDOM % 5 )) + DELAY=$(( RANDOM % 20 )) # Do not move/rename this file, we check its existence in other scripts cat > "/etc/cron.d/usage_stats" <<-EOF # Update usage statistics on server @@ -90,9 +88,6 @@ report_hardware_info() { ${START}-59/5 * * * * root sleep ${DELAY}; /opt/openslx/scripts/cron-system_usage_update --full EOF - # TODO remove this hack one day: Sometimes, aufs doesn't update the mtime of dirs - # when creating files, so cron would not rescan the cron directory. - touch "/etc/cron.d" # Trigger right now so resource usage gets updated /opt/openslx/scripts/cron-system_usage_update --full return 0 diff --git a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings index 3e8f8210..627b94fd 100755 --- a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings +++ b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings @@ -3,7 +3,7 @@ # If a first parameter is given, we write to that file instead of stdout. . /opt/openslx/config -. /run/hwinfo +. /run/openslx/hwinfo if [ -n "$1" ]; then exec >> "$1" diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver index 86a9995a..baef2a2a 100755 --- a/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver +++ b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver @@ -18,8 +18,8 @@ if command -v xscreensaver; then SBY="${SLX_SCREEN_STANDBY_TIMEOUT}" SVR="${SLX_SCREEN_SAVER_TIMEOUT}" if [ -n "${SLX_REMOTE_VNC}" ]; then - # TODO Remove after 2021-07-01, variables should be set by slx-admin - SVR=0 + AUTOLOCK=False + NEVER_LOCK=True fi if [ -n "${SLX_EXAM}" ]; then SLX_SCREEN_SAVER_GRACE_TIME= diff --git a/core/modules/kernel-vanilla/module.build b/core/modules/kernel-vanilla/module.build index ec40e649..dfbf3edb 100644 --- a/core/modules/kernel-vanilla/module.build +++ b/core/modules/kernel-vanilla/module.build @@ -229,7 +229,7 @@ patch_aufs() { [ -d "${AUFS}-standalone/.git" ] && rm -rf "${AUFS}-standalone" # if already there, kill it. # git: --depth 1 won't work here due to later "checkout origin/branch" if [ "$KERNEL_MAJOR" = "3" ]; then - git clone "git://aufs.git.sourceforge.net/gitroot/aufs/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed." + git clone "https://aufs.git.sourceforge.net/gitroot/aufs/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed." else git clone "https://github.com/sfjro/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed." #git clone "https://github.com/bnied/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed." diff --git a/core/modules/kernel-vanilla/module.conf b/core/modules/kernel-vanilla/module.conf index 35ad746a..51d1802a 100644 --- a/core/modules/kernel-vanilla/module.conf +++ b/core/modules/kernel-vanilla/module.conf @@ -6,4 +6,4 @@ REQUIRED_DIRECTORIES=" /usr/bin " REQUIRED_KERNEL="${CONFIG_KERNEL_VERSION:-"5.15.81"}" -REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" +REQUIRED_GIT="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" diff --git a/core/modules/kernel/module.build b/core/modules/kernel/module.build index 6df7464f..2f270476 100644 --- a/core/modules/kernel/module.build +++ b/core/modules/kernel/module.build @@ -118,7 +118,7 @@ patch_aufs() { cd "$MODULE_WORK_DIR" [ -d "aufs3-standalone/.git" ] && rm -rf "aufs3-standalone" # if already there, kill it. # git: --depth 1 won't work here due to later "checkout origin/branch" - git clone "git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git" || perror "Cloning aufs3 failed." + git clone "https://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git" || perror "Cloning aufs3 failed." # get the needed version [ ! -z ${SYSTEM_KERNEL_LONG} ] && local NEEDED_BRANCH=$(echo $SYSTEM_KERNEL_LONG | awk -F "." '{print $1"."$2}') \ || perror "SYSTEM_KERNEL_LONG not set, this should not happen!" diff --git a/core/modules/kernel/module.conf.centos b/core/modules/kernel/module.conf.centos index e8d7c344..0896c527 100644 --- a/core/modules/kernel/module.conf.centos +++ b/core/modules/kernel/module.conf.centos @@ -1,4 +1,4 @@ #!/bin/bash REQUIRED_GIT_BRANCH="v${SYSTEM_KERNEL_SHORT%.0}" -REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" +REQUIRED_GIT="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" diff --git a/core/modules/kernel/module.conf.debian b/core/modules/kernel/module.conf.debian index a35fbce1..94199074 100644 --- a/core/modules/kernel/module.conf.debian +++ b/core/modules/kernel/module.conf.debian @@ -1,3 +1,3 @@ #!/bin/bash REQUIRED_GIT_BRANCH="master" -REQUIRED_GIT="git://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" +REQUIRED_GIT="https://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" diff --git a/core/modules/kernel/module.conf.fedora b/core/modules/kernel/module.conf.fedora index 66391bbe..5552830c 100644 --- a/core/modules/kernel/module.conf.fedora +++ b/core/modules/kernel/module.conf.fedora @@ -1,4 +1,4 @@ #!/bin/bash REQUIRED_GIT_BRANCH="v${SYSTEM_KERNEL_SHORT}" -REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" +REQUIRED_GIT="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" diff --git a/core/modules/kernel/module.conf.opensuse b/core/modules/kernel/module.conf.opensuse index 38518d0d..1afad75e 100644 --- a/core/modules/kernel/module.conf.opensuse +++ b/core/modules/kernel/module.conf.opensuse @@ -1,4 +1,4 @@ #!/bin/bash REQUIRED_GIT_BRANCH="openSUSE-${SYS_VERSION}" -REQUIRED_GIT="git://kernel.opensuse.org/kernel.git" +REQUIRED_GIT="https://kernel.opensuse.org/kernel.git" diff --git a/core/modules/kernel/module.conf.ubuntu b/core/modules/kernel/module.conf.ubuntu index a35fbce1..94199074 100644 --- a/core/modules/kernel/module.conf.ubuntu +++ b/core/modules/kernel/module.conf.ubuntu @@ -1,3 +1,3 @@ #!/bin/bash REQUIRED_GIT_BRANCH="master" -REQUIRED_GIT="git://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" +REQUIRED_GIT="https://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" diff --git a/core/modules/kernel/module.conf.ubuntu.13.04 b/core/modules/kernel/module.conf.ubuntu.13.04 index cce71339..2ce3584d 100644 --- a/core/modules/kernel/module.conf.ubuntu.13.04 +++ b/core/modules/kernel/module.conf.ubuntu.13.04 @@ -1,3 +1,3 @@ #!/bin/bash REQUIRED_GIT_BRANCH="-b master" -REQUIRED_GIT="git://kernel.ubuntu.com/ubuntu-archive/ubuntu-${SYS_CODENAME}.git $REQUIRED_GIT_BRANCH" +REQUIRED_GIT="https://kernel.ubuntu.com/ubuntu-archive/ubuntu-${SYS_CODENAME}.git $REQUIRED_GIT_BRANCH" diff --git a/core/modules/kernel/module.conf.ubuntu.14.04 b/core/modules/kernel/module.conf.ubuntu.14.04 index 85a1b0f8..c9b55019 100644 --- a/core/modules/kernel/module.conf.ubuntu.14.04 +++ b/core/modules/kernel/module.conf.ubuntu.14.04 @@ -1,3 +1,3 @@ #!/bin/bash REQUIRED_GIT_BRANCH="lts-backport-vivid" -REQUIRED_GIT="git://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" +REQUIRED_GIT="https://kernel.ubuntu.com/ubuntu/ubuntu-${SYS_CODENAME}.git" diff --git a/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium b/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium index 4f5ba84e..e8c60fb4 100644 --- a/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium +++ b/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium @@ -66,7 +66,6 @@ EOF chromium_args=("--noerrdialogs" "--disable-translate" "--disable-new-avatar-menu" "--disable-infobars" "--test-type" "--fast" "--fast-start") # simulate a future build date to remove those update notification -# TODO properly disable auto update feature when chromium supports it chromium_args+=("--simulate-outdated-no-au=\"Tue, 31 Dec 2099 23:59:59 GMT\"") # default to maximized on startup diff --git a/core/modules/lightdm-greeter-bwlp/module.conf b/core/modules/lightdm-greeter-bwlp/module.conf index 7ceb0bc7..9a4513e8 100644 --- a/core/modules/lightdm-greeter-bwlp/module.conf +++ b/core/modules/lightdm-greeter-bwlp/module.conf @@ -2,7 +2,7 @@ REQUIRED_MODULEs=" lightdm qt5core " -REQUIRED_GIT="git://git.openslx.org/openslx-ng/slxgreeter" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/slxgreeter" REQUIRED_BINARIES=" qt-lightdm-greeter " diff --git a/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow b/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow index 3dfe5758..a3fe1476 100755 --- a/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow +++ b/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow @@ -256,8 +256,6 @@ do_resize() { fi if ! dmsetup table "$DEV" > "$new_table" || ! [ -s "$new_table" ]; then debug "Underlying data device is not a dm-device. TODO" - # TODO: Create a linear target in place, 1:1 mapping to the old device, then - # appending our new stuff. return 1 fi # We don't care too much what type of target the old data device is. Most likely linear, diff --git a/core/modules/printergui/data/opt/openslx/vmchooser/run-virt.d/setup_printer_lpd.inc b/core/modules/printergui/data/opt/openslx/vmchooser/run-virt.d/setup_printer_lpd.inc index 639b7bca..14ee0341 100644 --- a/core/modules/printergui/data/opt/openslx/vmchooser/run-virt.d/setup_printer_lpd.inc +++ b/core/modules/printergui/data/opt/openslx/vmchooser/run-virt.d/setup_printer_lpd.inc @@ -26,7 +26,6 @@ setup_virtual_printer() { fi # Start the lpdaemon listening on the given port - # TODO: externalize with something like runvirt.d (other parts might benefit from that too) tcpsvd -E 192.168.101.1 5515 \ lpd "$SPOOLDIR" \ ash -c "/opt/openslx/scripts/run-virt_print '${USER}' \"${SPOOLDIR}/${QUEUE}/\$DATAFILE\"" \ diff --git a/core/modules/printergui/module.conf b/core/modules/printergui/module.conf index 2668e076..8376c28d 100644 --- a/core/modules/printergui/module.conf +++ b/core/modules/printergui/module.conf @@ -2,7 +2,7 @@ REQUIRED_MODULES=" slxlog " -REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/printergui.git" REQUIRED_BINARIES=" printergui printpwgui diff --git a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient index 9f13ed4a..bc4726f4 100755 --- a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient +++ b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient @@ -9,7 +9,7 @@ if [ "$SESSION_TYPE" = "XSESSION" ]; then PVSMGR_SESSION_CMD= PVSMGR_XSESSION_FILE="pvs2mgr.desktop" # the second directory should not be needed, but lets be compatible with the old crap...... - for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do + for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions"; do if [ -f "${DIR}/${PVSMGR_XSESSION_FILE}" ]; then # extract the exact command string PVSMGR_SESSION_CMD="$(grep -E "^Exec=.*$" "${DIR}/${PVSMGR_XSESSION_FILE}" |cut -c 6-)" @@ -18,7 +18,7 @@ if [ "$SESSION_TYPE" = "XSESSION" ]; then done if [ -n "${PVSMGR_SESSION_CMD}" ]; then # do not start pvsclient if we are running the pvs manager session - [ "x${SESSION_CMD}" == "x${PVSMGR_SESSION_CMD}" ] && exit 0 + [ "${SESSION_CMD}" == "${PVSMGR_SESSION_CMD}" ] && exit 0 fi fi diff --git a/core/modules/pvs2/module.conf b/core/modules/pvs2/module.conf index 7d918d60..296251ab 100644 --- a/core/modules/pvs2/module.conf +++ b/core/modules/pvs2/module.conf @@ -1,5 +1,5 @@ #!/bin/bash -REQUIRED_GIT="git://git.openslx.org/pvs2.git" +REQUIRED_GIT="https://git.openslx.org/pvs2.git" REQUIRED_BINARIES=" pvsmgr pvsclient @@ -13,4 +13,3 @@ REQUIRED_MODULES=" qt5core x11vnc " -# TODO add libraries diff --git a/core/modules/qemu/runvirt-plugin-qemu/pom.xml b/core/modules/qemu/runvirt-plugin-qemu/pom.xml index a2e5c24e..1d64e065 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/pom.xml +++ b/core/modules/qemu/runvirt-plugin-qemu/pom.xml @@ -12,7 +12,7 @@ <url>https://git.openslx.org/openslx-ng/mltk.git/</url> <scm> - <connection>scm:git:git://git.openslx.org/openslx-ng/mltk.git</connection> + <connection>scm:git:https://git.openslx.org/openslx-ng/mltk.git</connection> </scm> <properties> diff --git a/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-xml_filter b/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-xml_filter deleted file mode 100755 index 2d2df304..00000000 --- a/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-xml_filter +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Probably needs bash somewhere -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2007..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 support@bwlehrpool.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# xmlfilter.sh -# - This script is invoked by the vmchooser tool. It simply filters xml- -# files (taking the path to these files in $1). You might modify it in any -# way to match your needs, e.g. ask some database instead. You can re- -# implement it in any other programming language too. You simply have to -# return a list of proper xml files to be interpreted by the vmchooser -# binary). Please check for vmchooser.sh too ... -# ----------------------------------------------------------------------------- - -# This script . -# -# currently: -# - filter for slxgrp (which comes from /etc/machine-setup) -# - -# include default directories -. /opt/openslx/config - -if [ -f "${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf" ]; then - . "${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf" -fi - -function handlePersistentVM() { - if grep --extended-regexp -q "<persistent param=\"(|.+:)$USER(|:.+)\"" "$1"; then - # If this virtual machine is useable as persistent version for current - # user we provide an additional persistent version. - # TODO: This evil black magic needs to be rewritten some day (by someone who understands it) - local originalImagePath=$(grep -io '<image_name param=.*"' "$1" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }') - local imageName=$(basename "$originalImagePath") - eval export SLX_VM_PERSISTENT_PATH="${SLX_VM_PERSISTENT_PATH}" && \ - local imagePath="${SLX_VM_PERSISTENT_PATH}${imageName}" - local persistentConfigVersionFilePath="$(mktemp --directory)/$(basename "$1")" - local vmchooserFilePath="$(dirname "$0")/vmchooser-clc" - if [ ! -f "$vmchooserFilePath" ]; then - vmchooserFilePath='/opt/openslx/scripts/vmchooser-clc' - fi - "$vmchooserFilePath" "$1" "$persistentConfigVersionFilePath" \ - --create-persistent-config "$imagePath" && \ - echo "$persistentConfigVersionFilePath" - fi -} - -for FILE in $(find -L "$1" -iname "*.xml"); do - # filter all xmls which aren't set active - grep -i -q "<active param=.*true.*" "$FILE" || continue - # HACK: filter all virtualbox images, as vbox is not ready yet - grep -i -q "<virtualmachine param=.*virtualbox.*" "$FILE" && continue - if [ -n "${SLX_VM_POOL_FILTER}" ]; then - # filter all xmls with pool-param not equal to vmchooser::env - if [ $(grep "<pools param=\"${SLX_VM_POOL_FILTER}\"" "$FILE" | wc -l) -eq 1 ]; then - handlePersistentVM "$FILE" - echo "$FILE" - fi - else - handlePersistentVM "$FILE" - # if there is no pool set, just take all available xmls - echo "$FILE" - fi -done - diff --git a/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt b/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt index 27d85164..61cba10b 100755 --- a/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt +++ b/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt @@ -2,7 +2,7 @@ . /opt/openslx/config . /opt/openslx/bin/slx-tools -. /run/hwinfo +. /run/openslx/hwinfo if [ -n "$1" ]; then exec >> "$1" diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc index 918a767f..2ae010b3 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc @@ -13,11 +13,11 @@ # Use: 00:FF:00 for firtual machines ;) ## Functions ## -# Import /run/hwinfo variables +# Import /run/openslx/hwinfo variables import_hwinfo() { - $(safesource "/run/hwinfo") + $(safesource "/run/openslx/hwinfo") } -# Sets the VM's hostname to the original hostname prefixed with a fixed string and its ID +# Sets the VM's hostname to the original hostname prefixed with a fixed string and its ID set_virt_hostname() { declare -rg HOSTNAME="virt${VM_ID}-$(hostname)" writelog "\tVM Hostname:\t\t$HOSTNAME" @@ -115,10 +115,10 @@ set_virt_mac() { # If the variables in virtualization.conf is set, "TRUE" is assigned, # "FALSE" otherwise. check_optical_drives() { - # TODO This should only handle exam mode here, maybe even have one function - # that prepares all exam mode related stuff. Then create the TRUE/FALSE - # variables somewhere in the vmware plugin, since it's specific to that - # plugin. + # TODO This should not handle exam mode here (and special cases in + # 100 other places), maybe have one function that prepares all exam + # mode related stuff. Then create the TRUE/FALSE variables somewhere + # in the vmware plugin, since it's specific to that plugin. FLOPPY0="FALSE" CDROM0="FALSE" CDROM1="FALSE" diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc index 80403356..081c2e79 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc @@ -66,7 +66,7 @@ $BODY" TITLE="ERROR" fi # Zenity should yield the nicest result - # TODO the title is only set as the window name, + # Note: the title is only set as the window name, # which cannot be seen without a window manager zenity --error --title "$TITLE" --text "$BODY" local RET=$? @@ -330,14 +330,17 @@ call_post_source() { # Helper called after sourcing the file via safesource. It just calls the # functions in the same order they were registered. run_post_source() { - [ $# -ne 1 ] && writelog "'${FUNCNAME[0]}' expects one argument only! $# given." && return 1 + if [ $# -ne 1 ]; then + writelog "'${FUNCNAME[0]}' expects one argument only! $# given." + EXIT_REASON="Interner Fehler in run_post_source" cleanexit 1 + fi local TASK RET "$DEBUG" && writelog "Running post-source hooks for ${1}..." for TASK in ${RUN_POST_SOURCE["${1}"]}; do # sanity checks if ! is_function "$TASK"; then writelog "\tRegistered function '$TASK' is not a function!" - return 1 # TODO maybe even cleanexit here as this seems very bad... + EXIT_REASON="Konnte safesource-hook nicht ausführen" cleanexit 1 fi "$DEBUG" && writelog " - ${TASK}" "${TASK}" @@ -498,22 +501,6 @@ check_dep() { isset ONEOF && return 1 || return 0 } -# TODO: This is only used once in the whole script: -# to cleanup the os string stored in the xml -# Since the rework of this script, the os strings come from -# the satellite server which already gives us a sanitized string -# thus this function might not be needed anymore, as calling it on -# new gen os strings effectively does nothing. -# Removes any non-alphanumerical and non-hyphen chars -# from the given parameters. -clean_string() { - if [ "$#" -ge 1 ]; then - echo "$@" | tr 'A-Z' 'a-z' | tr -d -c 'a-z0-9\-' - else - tr 'A-Z' 'a-z' | tr -d -c 'a-z0-9\-' - fi -} - # Helper to detect given cpu flags. # If more than one flag is given, assume that matching # any of them is sufficient. diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_firewall.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_firewall.inc index 92ff2186..097e9660 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_firewall.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_firewall.inc @@ -22,6 +22,5 @@ if check_dep slxfwtool; then reg_feature_handler "firewall" "setup_firewall" else writelog "Could not find 'slxfwtool' in PATH: $PATH. Netrules firewall will not work!" - error_user "Fehler" "Keine Unterstützung von veranstaltungspezifische Firewall-Regeln!" - # TODO handle + error_user "Fehler" "Keine Unterstützung für veranstaltungspezifische Firewall-Regeln!" fi diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_network_shares.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_network_shares.inc deleted file mode 100644 index 8809b218..00000000 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_network_shares.inc +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# TODO this currently is not used. -# This should be continued when we have a clear idea -# how we will embed network shares in VMs -set_network_shares() { - - # Add rw share for home dir - HOME_SHARE_PATH="${HOME}/PERSISTENT" - HOME_SHARE_NAME="home" - - # Add common share - COMMON_SHARE_PATH="${HOME}/SHARE" - COMMON_SHARE_NAME="share" -} - -reg_feature_handler "netshares" "set_network_shares" - diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc index 7313ccb6..cb85f7c5 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_sound.inc @@ -6,7 +6,7 @@ ## Functions ## setup_sound() { unset VOL - if $(safesource "/run/hwinfo") ; then + if $(safesource "/run/openslx/hwinfo") ; then # On startup, the volume of Master, PCM, Speaker, etc. will be set to 100% # Some hardware with builtin speakers might be a bit too loud then, so you can # define an exception table here. Array key is "Manufacturer//Model" @@ -64,8 +64,9 @@ set_sound_alsa() { writelog --quiet "\tSound card count: $SOUND_CARD_COUNT" # Adjust sound volume (playback)... Random mixer names we have encountered during testing - # TODO instead of trying to set volume blindly, why not use 'amixer scontrols' to find + # Instead of trying to set volume blindly, why not use 'amixer scontrols' to find # which mixer control exists and set these only? + # # ^ because lazy writelog --quiet "Setting up volume to '$VOL' via amixer..." amixer -q -c "$SOUND_CARD_INDEX" -s <<-EOF diff --git a/core/modules/slxbrowser/module.conf b/core/modules/slxbrowser/module.conf index cbf2e6b1..e937fe8a 100644 --- a/core/modules/slxbrowser/module.conf +++ b/core/modules/slxbrowser/module.conf @@ -2,7 +2,7 @@ REQUIRED_MODULES=" qt5core " -REQUIRED_GIT="git://git.openslx.org/openslx-ng/slxbrowser.git" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/slxbrowser.git" REQUIRED_PREFIX="/opt/openslx/bin" REQUIRED_BINARIES="slxbrowser" REQUIRED_LIBRARIES=" diff --git a/core/modules/speedcheck/module.conf b/core/modules/speedcheck/module.conf index 69fb2428..76b2e99e 100644 --- a/core/modules/speedcheck/module.conf +++ b/core/modules/speedcheck/module.conf @@ -1,4 +1,4 @@ #!/bin/bash -REQUIRED_GIT="git://git.openslx.org/openslx-ng/speedcheck.git" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/speedcheck.git" REQUIRED_PREFIX="/opt/openslx/bin" REQUIRED_BINARIES="speedcheck" diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc index 65c0b300..59f6ccc5 100755 --- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc +++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc @@ -141,7 +141,7 @@ setup_cpu_ram() { local nested="false" local cores="1" local ioapic="false" - if source /run/hwinfo && [ "${HW_KVM}" = "ENABLED" ]; then + if source /run/openslx/hwinfo && [ "${HW_KVM}" = "ENABLED" ]; then ioapic="true" kvm="true" cores="$CPU_CORES" diff --git a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser index 4889b5de..e433b095 100755 --- a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser +++ b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser @@ -26,7 +26,7 @@ if [ -s "$URLS_CONF" ]; then [ -n "$url_help" ] && EXTRA+=( "--url-help" "$url_help" ) fi -[ -s "/run/hwinfo" ] && . "/run/hwinfo" +[ -s "/run/openslx/hwinfo" ] && . "/run/openslx/hwinfo" if [ -z "$HW_MBRAM" ]; then MEM=$(grep -m1 '^MemTotal:' /proc/meminfo | awk '{print $2}') HW_MBRAM=$(( MEM / 1024 )) diff --git a/core/modules/vmchooser2/module.build b/core/modules/vmchooser2/module.build index 29bd4aeb..82c1c6c9 100644 --- a/core/modules/vmchooser2/module.build +++ b/core/modules/vmchooser2/module.build @@ -10,18 +10,6 @@ build() { [ ! -d "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" ] && mkdir -p "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" cd "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" - # patch globals.cpp and globals.h to use standardised paths /opt/openslx/... - if ! grep -q VMCHOOSER_SCRIPTS_PATH "$SRCDIR/src/globals.h"; then - sed -i 's/^#define VMCHOOSER_ETC_BASE_PATH.*/#define VMCHOOSER_ETC_BASE_PATH "\/opt\/openslx\/vmchooser\/config"/g' "${SRCDIR}/src/globals.h" - sed -i 's/^#define VMCHOOSER_BIN_PATH.*/#define VMCHOOSER_BIN_PATH "\/opt\/openslx\/bin"\n#define VMCHOOSER_SCRIPTS_PATH "\/opt\/openslx\/scripts"/g' "${SRCDIR}/src/globals.h" - sed -i 's/^#define VMCHOOSER_THEME_BASE.*/#define VMCHOOSER_THEME_BASE "\/opt\/openslx\/vmchooser\/themes"/g' "${SRCDIR}/src/globals.h" - - sed -i 's/^QString binPath(VMCHOOSER_BIN_PATH);/QString binPath(VMCHOOSER_BIN_PATH);\nQString scriptsPath(VMCHOOSER_SCRIPTS_PATH);/g' "${SRCDIR}/src/globals.cpp" - sed -i 's/^QString runVmScript(binPath + "\/run-virt.sh");/QString runVmScript(scriptsPath + "\/vmchooser-run_virt");/g' "${SRCDIR}/src/globals.cpp" - sed -i 's/^QString filterScript(binPath + "\/xmlfilter.sh");/QString filterScript(scriptsPath + "\/vmchooser-xml_filter");/g' "${SRCDIR}/src/globals.cpp" - sed -i 's/^#define VMCHOOSER_VMPATH.*/#define VMCHOOSER_VMPATH "\/mnt\/vmstore"/g' "${SRCDIR}/src/globals.h" - fi - pinfo "Running cmake" cmake "$SRCDIR" || perror "'cmake $SRCDIR' failed." make || perror "'make' failed." diff --git a/core/modules/vmchooser2/module.conf b/core/modules/vmchooser2/module.conf index c62a84c9..60772084 100644 --- a/core/modules/vmchooser2/module.conf +++ b/core/modules/vmchooser2/module.conf @@ -2,6 +2,6 @@ REQUIRED_MODULES=" qt5core " -REQUIRED_GIT="git://git.openslx.org/openslx-ng/vmchooser2.git" +REQUIRED_GIT="https://git.openslx.org/openslx-ng/vmchooser2.git" REQUIRED_PREFIX="/opt/openslx/bin" REQUIRED_BINARIES="vmchooser.real" diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc index 8df1ad9f..40675524 100644 --- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc +++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc @@ -290,10 +290,10 @@ setup_graphics() { finalize_hardware() { # Enable nested virtualization if not specified in remote vmx - if [ -e "/run/hwinfo" ] && ! grep -qi '^vhv\.enable' "${TMPCONFIG}" \ + if [ -e "/run/openslx/hwinfo" ] && ! grep -qi '^vhv\.enable' "${TMPCONFIG}" \ && detect_cpu_flag "ept" "npt" \ && [ "$VM_HW_VERSION" -ge "9" ]; then - . "/run/hwinfo" + . "/run/openslx/hwinfo" [ "${HW_KVM}" = "ENABLED" ] && echo 'vhv.enable = "TRUE"' >> "${TMPCONFIG}" fi diff --git a/core/modules/xorg/module.build b/core/modules/xorg/module.build index e720451a..bf2d36f4 100644 --- a/core/modules/xorg/module.build +++ b/core/modules/xorg/module.build @@ -8,7 +8,7 @@ fetch_source() { for drv in $REQUIRED_XORG_DRIVERS; do drv=${drv%//*} [ -d "${drv}/.git" ] && continue - git clone "git://anongit.freedesktop.org/xorg/driver/${drv}" "${drv}" || perror "Could not clone $drv" + git clone "https://anongit.freedesktop.org/xorg/driver/${drv}" "${drv}" || perror "Could not clone $drv" done cd - fi diff --git a/core/modules/xscreensaver/module.conf b/core/modules/xscreensaver/module.conf index 18a96089..ae196281 100644 --- a/core/modules/xscreensaver/module.conf +++ b/core/modules/xscreensaver/module.conf @@ -4,8 +4,8 @@ REQUIRED_MODULES=" " # Switch back to branch "openslx" once 6.x is fixed REQUIRED_GIT=" - git://git.openslx.org/openslx-ng/xscreensaver.git|openslx-5.x - git://git.openslx.org/openslx-ng/bwlp-screensaver.git + https://git.openslx.org/openslx-ng/xscreensaver.git|openslx-5.x + https://git.openslx.org/openslx-ng/bwlp-screensaver.git " REQUIRED_PREFIX="/opt/openslx/bin" REQUIRED_BINARIES=" diff --git a/core/rootfs/rootfs-stage31/data/inc/parse_kcl b/core/rootfs/rootfs-stage31/data/inc/parse_kcl index ba2fea8f..2eb722a6 100644 --- a/core/rootfs/rootfs-stage31/data/inc/parse_kcl +++ b/core/rootfs/rootfs-stage31/data/inc/parse_kcl @@ -40,10 +40,8 @@ for opts in ${KCL}; do ip=*) # process IP info parse_ip ${opts#ip=} ;; - nfs=*) # TODO: Still working? Still needed? Also see related code in setup_stage32 + nfs=*) NFS=${opts#nfs=} - NFSPATH=${NFS#*:} - NFSSERVER=${NFS%:/*} ;; BOOTIF=*) MAC="$( echo "$opts" | cut -b 11- | tr '-' ':' | tr '[A-Z]' '[a-z]' )" ;; # make mac lowercase for udev (see setup_network) diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_stage32 b/core/rootfs/rootfs-stage31/data/inc/setup_stage32 index 81a3da16..bab1cda1 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_stage32 +++ b/core/rootfs/rootfs-stage31/data/inc/setup_stage32 @@ -12,8 +12,8 @@ # if [ -n "$NFS" ]; then echo "Mounting stage 3.2 as NFS..." - busybox mount -n -t nfs -o ro,async,nolock ${NFSSERVER}:${NFSPATH} /rorootfs \ - || drop_shell "Problem mounting NFS-Directory from ${NFSSERVER}:${NFSPATH}." \ + busybox mount -n -t nfs -o ro,async,nolock "${NFS}" /rorootfs \ + || drop_shell "Problem mounting NFS-Directory from ${NFS}." \ || return 1 return 0 fi @@ -129,7 +129,6 @@ check_devtools() { pinfo "apt install build-essential m4 pkg-config cmake automake autoconf binutils lsb-release wget rsync diffutils lsof zstd" pinfo "to install missing development tools." ;; - # FIXME: Don't know how precise this filter works so we might want to have a better matching ... opensuse) pinfo "zypper install gcc gcc-c++ make m4 binutils git module-init-tools patch pkg-config cmake lsb-release wget rsync diffutils lsof zstd" pinfo "to install missing development tools." |