diff options
author | Jonathan Bauer | 2019-05-24 12:21:56 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-05-24 12:21:56 +0200 |
commit | 0ede25d6b57919702f25253c7ab6121240f092fa (patch) | |
tree | 51a5d94b3aa9bf6d9b707ae895cd1cd167b6f473 | |
parent | Merge branch 'master' into installer (diff) | |
parent | [xorg] Clean up required packages (diff) | |
download | mltk-0ede25d6b57919702f25253c7ab6121240f092fa.tar.gz mltk-0ede25d6b57919702f25253c7ab6121240f092fa.tar.xz mltk-0ede25d6b57919702f25253c7ab6121240f092fa.zip |
Merge branch 'master' into installer
64 files changed, 530 insertions, 864 deletions
diff --git a/core/bin/setup_target b/core/bin/setup_target index 6b577e00..216bffd1 100755 --- a/core/bin/setup_target +++ b/core/bin/setup_target @@ -55,15 +55,13 @@ CORE_DIR="${ROOT_DIR}/core" OVERLAY_DIR="${ROOT_DIR}/overlay" EXPORT_DIR="/export/build" [ -z "$REMOTE_EXPORT_DIR" ] || EXPORT_DIR=$REMOTE_EXPORT_DIR -# Keep track of processed modules so we don't -# build a module multiple times when following dependencies -PROCESSED_MODULES="" initial_checks () { get_kernel_version detect_distribution } +# WTF!? set_target_dir () { if [ -d "${OVERLAY_DIR}/targets/${TARGET}" ]; then TARGET_DIR="${OVERLAY_DIR}/targets/${TARGET}" @@ -314,9 +312,26 @@ generate_target() { initial_checks - TARGET=$1 && shift + TARGET="$1" + shift set_target_dir - TARGET_BUILD_DIR="${ROOT_DIR}/var/builds/${TARGET}" + if [[ "$TARGET" == *@* ]]; then + VARNAME="${TARGET#*@}" + TARGET="${TARGET%@*}" + for VERSION in ${!VARNAME}; do + TARGET_BUILD_DIR="${ROOT_DIR}/var/builds/${TARGET}@${VERSION}" + generate_target_real "$@" + done + else + TARGET_BUILD_DIR="${ROOT_DIR}/var/builds/${TARGET}" + generate_target_real "$@" + fi +} + +generate_target_real() { + # Keep track of processed modules so we don't + # build a module multiple times when following dependencies + local PROCESSED_MODULES= [ -e "${ROOT_DIR}/var/log/${TARGET}.size" ] && . "${ROOT_DIR}/var/log/${TARGET}.size" || echo "declare -A BUILD_SIZE" >> "${ROOT_DIR}/var/log/${TARGET}.size" [ -d "$TARGET_DIR" ] || perror "Given target directory does not exist: $TARGET_DIR" @@ -330,7 +345,7 @@ generate_target() { # if no arguments assume all. if [ "x$1" = "x" -o "x$1" = "xall" ]; then - MODULES=$(ls ${TARGET_DIR}) + MODULES=$( ls "${TARGET_DIR}" ) set -- $MODULES else # tools = arguments given @@ -536,10 +551,10 @@ clean_modules() { if [ -e "${ROOT_DIR}/var/log/${TARGET}.size" ]; then rm "${ROOT_DIR}/var/log/${TARGET}.size" || perror "Could not delete var/log/${TARGET}.size" fi - if [ -d "${TARGET_BUILD_DIR}" ]; then - pinfo "Cleaning '${TARGET_BUILD_DIR}'" \ - && rm -rf "${TARGET_BUILD_DIR}"/* \ - || perror "Error deleting $TARGET_BUILD_DIR" + if [[ "$TARGET" == *@* ]]; then + rm -rf -- "${TARGET_BUILD_DIR%@*}"@* || perror "Could not delete target build dirs for $TARGET" + else + rm -rf -- "${TARGET_BUILD_DIR}" || perror "Could not delete target build dir for $TARGET" fi # exclude kernel on "all" set -- $(ls "${TARGET_DIR}" | grep -vE "^kernel$") diff --git a/core/modules/gfx-driver/data/opt/openslx/scripts/systemd-load_gfx_driver b/core/modules/gfx-driver/data/opt/openslx/scripts/systemd-load_gfx_driver index e31fdd70..6faba19a 100755 --- a/core/modules/gfx-driver/data/opt/openslx/scripts/systemd-load_gfx_driver +++ b/core/modules/gfx-driver/data/opt/openslx/scripts/systemd-load_gfx_driver @@ -2,21 +2,14 @@ export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin -PCIFILE=/tmp/lspci-output - -if ! lspci -n > "$PCIFILE"; then - echo "lspci -n failed..." - exit 1 -fi - if lsmod | grep -q '^nvidia\s'; then # nvidia kernel module was loaded in stage31 - download libs - echo "Proprietary nvidia kernel drivers loaded - fetch user space libs" - systemctl start setup-slx-addon@nvidia_libs & - #echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config" -elif grep -q -E ' (8086:0102|8086:0152|8086:0162|8086:0412|8086:0416|8086:041e|8086:0a16|8086:1626|8086:1912|8086:3e92|8086:5912|1002:6779|1002:68f9)( |$)' "$PCIFILE"; then - echo "i915 - enable 3D" - #echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config" + version=$( cat /sys/module/nvidia/version ) + if [ -n "$version" ]; then + echo "Proprietary nvidia kernel drivers v$version loaded - fetch user space libs" + /opt/openslx/scripts/systemd-download_slx_addons "nvidia-libs@$version" + /opt/openslx/scripts/systemd-setup_slx_addons "nvidia-libs@$version" || exit 1 + fi fi # Seems we can finally always do that; in fact, not doing so seems to crash VMs left and right diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/50-allow_root b/core/modules/idleaction/data/etc/X11/Xsession.d/50-allow_root new file mode 100644 index 00000000..663250d3 --- /dev/null +++ b/core/modules/idleaction/data/etc/X11/Xsession.d/50-allow_root @@ -0,0 +1,6 @@ +#!/bin/ash sourced + +# Allow root to connect to the x server +xhost +si:localuser:root &> /dev/null +: + diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms b/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms new file mode 100644 index 00000000..3459a503 --- /dev/null +++ b/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms @@ -0,0 +1,18 @@ +#!/bin/ash sourced + +# Set DPMS values in Xsession. This will apply for user sessions + +if [ -z "$SLX_PXE_SERVER_IP" ] && [ -z "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then + . /opt/openslx/config # Not sourced yet +fi + +xset s off +if [ -n "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then + xset dpms 0 0 0 &> /dev/null + xset +dpms &> /dev/null +else + xset -dpms &> /dev/null +fi + +: + diff --git a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver index 8953aa83..6e4d93f8 100755 --- a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver +++ b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver @@ -1,7 +1,7 @@ #!/bin/ash -DPMS=False if which xscreensaver; then + AUTOLOCK=True secsToTime() { local NUM SECS MINS HRS NUM="$1" @@ -13,35 +13,12 @@ if which xscreensaver; then [ -z "$UID" ] && UID=$(id -u) [ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')" . /opt/openslx/config - SBY=${SLX_SCREEN_STANDBY_TIMEOUT} if [ -n "${SLX_EXAM}" ]; then - SLX_LOGOUT_TIMEOUT=0 - SBY=0 - elif [ -z "$SBY" ]; then - SBY=0 - elif [ "$SBY" -gt 0 ] && [ "$SBY" -lt 60 ]; then - SBY=60 - elif ! [ "$SBY" -ge 0 ]; then # isNumeric? - SBY=0 + SLX_SCREEN_SAVER_GRACE_TIME= fi - # Make sure standby timeout is less than logout timeout, otherwise, disable standby - if [ "$SBY" -gt 0 ]; then - if [ "$SLX_LOGOUT_TIMEOUT" -gt 0 ]; then - if [ "$SBY" -lt 300 ]; then - SBY=300 - fi - if [ "$SLX_LOGOUT_TIMEOUT" -lt "$SBY" ]; then - SBY=0 - fi - fi - fi - # Create config value for standby timeout - [ "$SBY" -gt 0 ] && DPMS=True - STANDBY="$( secsToTime "$SBY" )" - # Explicit screen saver timeout set - TIMEOUT="$( secsToTime "$SLX_SCREEN_SAVER_TIMEOUT" )" if [ -z "$SLX_SCREEN_SAVER_GRACE_TIME" ]; then - GRACE="00:00:15" + GRACE="99:00:00" + AUTOLOCK=False else GRACE="$( secsToTime "$SLX_SCREEN_SAVER_GRACE_TIME" )" fi @@ -49,15 +26,11 @@ if which xscreensaver; then cat > "$HOME/.xscreensaver" <<EOF mode: one cycle: 99:00:00 -timeout: $TIMEOUT -lock: True +timeout: 99:00:00 +lock: $AUTOLOCK lockTimeout: $GRACE fade: False unfade: False -dpmsEnabled: $DPMS -dpmsStandby: $STANDBY -dpmsSuspend: $STANDBY -dpmsOff: $STANDBY dpmsFullThrottle: True newLoginCommand: externalUngrabCommand: /opt/openslx/xscreensaver/ungrab diff --git a/core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms b/core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms new file mode 100644 index 00000000..c036e22a --- /dev/null +++ b/core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms @@ -0,0 +1,20 @@ +#!/bin/ash sourced + +# Set DPMS values in Xsetup. These will apply for the login screen. + +if [ -z "$SLX_PXE_SERVER_IP" ] && [ -z "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then + . /opt/openslx/config # Not sourced yet +fi + +( + sleep 1 + xset s off + if [ -n "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then + xset dpms "$SLX_SCREEN_STANDBY_TIMEOUT" "$SLX_SCREEN_STANDBY_TIMEOUT" "$SLX_SCREEN_STANDBY_TIMEOUT" &> /dev/null + else + xset -dpms + fi +) & + +: + diff --git a/core/modules/idleaction/data/etc/cron.d/openslx-idleaction b/core/modules/idleaction/data/etc/cron.d/openslx-idleaction deleted file mode 100644 index a7f342a0..00000000 --- a/core/modules/idleaction/data/etc/cron.d/openslx-idleaction +++ /dev/null @@ -1,7 +0,0 @@ -# Trigger scripts that checks idle status of machine and triggers actions - -SHELL=/bin/ash -PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin - -* * * * * root /opt/openslx/scripts/idleaction-cron_script - diff --git a/core/modules/idleaction/data/etc/systemd/system/idle-daemon.service b/core/modules/idleaction/data/etc/systemd/system/idle-daemon.service new file mode 100644 index 00000000..c6a65c20 --- /dev/null +++ b/core/modules/idleaction/data/etc/systemd/system/idle-daemon.service @@ -0,0 +1,7 @@ +[Unit] +Description=OpenSLX idle-daemon + +[Service] +ExecStart=/opt/openslx/scripts/idle-daemon-launcher +Restart=on-failure +RestartSec=1 diff --git a/core/modules/idleaction/data/etc/systemd/system/multi-user.target.wants/idle-daemon.service b/core/modules/idleaction/data/etc/systemd/system/multi-user.target.wants/idle-daemon.service new file mode 120000 index 00000000..1d1dce02 --- /dev/null +++ b/core/modules/idleaction/data/etc/systemd/system/multi-user.target.wants/idle-daemon.service @@ -0,0 +1 @@ +../idle-daemon.service
\ No newline at end of file diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher new file mode 100755 index 00000000..3f20ca5e --- /dev/null +++ b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher @@ -0,0 +1,36 @@ +#!/bin/ash + +. /opt/openslx/config + +CMD= + +[ -n "$SLX_SHUTDOWN_TIMEOUT" ] && CMD="$CMD --poweroff-timeout $SLX_SHUTDOWN_TIMEOUT" + +if [ -z "${SLX_EXAM}" ]; then + # Exam mode inactive + [ -n "$SLX_LOGOUT_TIMEOUT" ] && CMD="$CMD --logout-timeout $SLX_LOGOUT_TIMEOUT" + [ -n "$SLX_SYSTEM_STANDBY_TIMEOUT" ] && CMD="$CMD --suspend-timeout $SLX_SYSTEM_STANDBY_TIMEOUT" + + [ -n "$SLX_SCREEN_SAVER_TIMEOUT" ] && CMD="$CMD --screensaver-timeout $SLX_SCREEN_SAVER_TIMEOUT" + [ -n "$SLX_SCREEN_STANDBY_TIMEOUT" ] && CMD="$CMD --dpms-timeout $SLX_SCREEN_STANDBY_TIMEOUT" + [ -n "$SLX_SCREEN_SAVER_GRACE_TIME" ] && CMD="$CMD --grace-period $SLX_SCREEN_SAVER_GRACE_TIME" +else + # Exam mode active + CMD="$CMD --min-idle 7200" # Ignore schedule if idle time is lower than 2h + # Add additional times -- We might miss tightly scheduled ones because of --min-idle + if [ -n "$SLX_SHUTDOWN_SCHEDULE" ]; then + SLX_SHUTDOWN_SCHEDULE="$SLX_SHUTDOWN_SCHEDULE 23:00 4:00" + elif [ -n "$SLX_REBOOT_SCHEDULE" ]; then + SLX_REBOOT_SCHEDULE="$SLX_REBOOT_SCHEDULE 23:00 4:00" + fi +fi + +for t in $SLX_REBOOT_SCHEDULE; do + CMD="$CMD --reboot $t" +done +for t in $SLX_SHUTDOWN_SCHEDULE; do + CMD="$CMD --poweroff $t" +done + + +exec /opt/openslx/sbin/idle-daemon $CMD diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script deleted file mode 100755 index 4867883e..00000000 --- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/ash - -. /opt/openslx/config || exit 1 - -CRONFILE="/etc/cron.d/idleaction-shutdown_schedule" - -# If existent, no session is open. Will contain timestamp of last activity. -# If not existent, at least one user is logged in -IDLEHINT="/run/openslx/idlehint" -NOW=$(date +%s) - -get_sessions() { - local LEGEND State Class - LEGEND= - loginctl --help 2>&1 | grep -q -- '--no-legend' && LEGEND="--no-legend" - for SESSION in $(loginctl $LEGEND | awk '{print $1}'); do - unset Display Remote State - eval $(loginctl -p State -p Class show-session "$SESSION") - if [ "$State" = "active" -o "$State" = "online" ] && [ "$Class" = "user" ]; then - echo "$SESSION" - fi - done -} - -gen_runfile() { - # Calc next reboot/shutdown/standby - local i dateline ts - dateline= - for i in $SLX_REBOOT_SCHEDULE $SLX_SHUTDOWN_SCHEDULE; do - ts=$(date -d "today $i" +%s) - [ "$ts" -gt 0 ] || continue # NaN - ts=$(( ts + 300 )) # Account for the 5 minute delay if someone is logged in - if [ "$ts" -lt "$NOW" ]; then - ts=$(date -d "tomorrow $i" +%s) - ts=$(( ts + 300 )) # Account for the 5 minute delay if someone is logged in - fi - [ "$ts" -gt "$NOW" ] || continue - if [ -z "$dateline" ] || [ "$ts" -lt "$dateline" ]; then - dateline="$ts" - fi - done - cat <<EDOC -[General] -lockDeadline=0 -shutdownDeadline=$dateline -EDOC -} - -# -# 1) Check for idle timeout -# -if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then - # Logout timeout is set, see which users we should kick - IS_IDLE=yes - # get all sessions - SESSIONS=$(get_sessions) - if [ -n "$SESSIONS" ]; then - TMP="/run/openslx/idlecheck.tmp" - # Iterate over sessions - for ses in $SESSIONS; do - # Get information - loginctl show-session "$ses" > "$TMP" - NAME=$(grep '^Name=' "$TMP" | cut -c 6-) - [ -z "$NAME" ] && continue # No name - should not happen - export DISPLAY=$(grep '^Display=' "$TMP" | cut -c 9-) - # X11 - if [ -n "$DISPLAY" ]; then - # Seems to be x11 - IDLE= - LOCK= - export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') - [ -n "$XAUTHORITY" ] && [ -f "$XAUTHORITY" ] && IDLE=$(xprintidle) - # Now that we have DISPLAY and XAUTHORITY set, xprintidle should work - if [ -z "$IDLE" ]; then - # Try user's xauth - USERID=$(id -u "$NAME") - [ -z "$USERID" ] && USERID="$NAME" - USRHOME=$(/usr/bin/getent passwd "$USERID" | awk -F ':' '{print $6}') - export XAUTHORITY="$USRHOME/.Xauthority" - fi - if [ -n "$XAUTHORITY" ] && [ -f "$XAUTHORITY" ]; then - LOCK=$(xprintlocktime) - [ -z "$IDLE" ] && IDLE=$(xprintidle) - [ -n "$IDLE" ] && IDLE=$(( NOW - ( IDLE / 1000 ) )) - fi - # Now consider locking - if the screen is locked, we don't want to consider the current idle time, but - # the idle time of when the screen was locked - look it up and if not found, write current value - RUNFILE="/run/openslx/idleaction-$DISPLAY" - [ -f "$RUNFILE" ] || gen_runfile > "$RUNFILE" - OLDLOCKTIME=$(awk -F= '{if ($1 == "lockTime") { print $2; exit } }' "$RUNFILE") - [ -z "$OLDLOCKTIME" ] && OLDLOCKTIME=0 - if [ -z "$LOCK" ] || [ "$(( OLDLOCKTIME - LOCK ))" -gt 120 ] || [ "$(( LOCK - OLDLOCKTIME ))" -gt 120 ]; then - # Not locked anymore, or lock time has changed (= unlock and relock), nuke old value - sed -i '/^lockIdleTime=/d;/^lockTime=/d' "$RUNFILE" - if [ -n "$LOCK" ] && [ "$OLDLOCKTIME" -gt 0 ]; then - TIMEOUT=$(( LOCK + SLX_LOGOUT_TIMEOUT )) - sed -i "s/^lockDeadline=.*\$/lockDeadline=$TIMEOUT/" "$RUNFILE" - fi - fi - if [ -n "$LOCK" ]; then - # Screen is locked, ignore further idle time updates - RET=$(awk -F= '{if ($1 == "lockIdleTime") { print $2; exit } }' "$RUNFILE") - if [ -z "$RET" ]; then - if [ -z "$IDLE" ]; then - IDLE="$LOCK" - fi - { - echo "lockIdleTime=$IDLE" - echo "lockTime=$LOCK" - } >> "$RUNFILE" - else - # Use previous value - IDLE="$RET" - fi - fi - if [ -z "$IDLE" ] && [ -n "$LOCK" ]; then - IDLE="$LOCK" - fi - if [ -n "$IDLE" ] && [ "$IDLE" -gt 0 ]; then - if [ -z "$LOCK" ] || grep -Fxq 'lockDeadline=0' "$RUNFILE"; then - # Only update if screen is unlocked, or no deadline was recorded yet - TIMEOUT=$(( IDLE + SLX_LOGOUT_TIMEOUT )) - sed -i "s/^lockDeadline=.*\$/lockDeadline=$TIMEOUT/" "$RUNFILE" - else - # Use stored value - RET=$(awk -F= '{if ($1 == "lockDeadline") { print $2; exit } }' "$RUNFILE") - if [ -n "$RET" ]; then - TIMEOUT="$RET" - else - TIMEOUT=$(( IDLE + SLX_LOGOUT_TIMEOUT )) - echo "lockDeadline=$TIMEOUT" >> "$RUNFILE" - fi - fi - - if [ "$TIMEOUT" -lt "$NOW" ]; then - rm -f -- "$RUNFILE" - date +%s > /run/openslx/session-killed - loginctl terminate-session "$ses" - else - # Give user a chance to see that it's going to logout in 5 mins - [ "$(( TIMEOUT - NOW ))" -lt 310 ] && xset dpms force on - IS_IDLE=no - fi - else - # xprint* did not work? - IS_IDLE=no - fi - RUNFILE= - continue # Done with this session, skip normal tty/ssh checks - fi - # end X11 - # other sessions - IDLE=$(grep '^IdleSinceHint=' "$TMP" | cut -c 15-) - if [ "${#IDLE}" -lt 7 ]; then # wah wah waaaah - IS_IDLE=no - continue - fi - # divide by 1000000 by chopping of last 6 chars - number might be too large for $(( )) - IDLE=$(echo "$IDLE" | cut -c "-$(( ${#IDLE} - 6 ))") - [ "$IDLE" -gt "$NOW" ] && IDLE="$NOW" - IDLE=$(( $NOW - $IDLE )) - if [ "$IDLE" -lt "$SLX_LOGOUT_TIMEOUT" ]; then - IS_IDLE=no - else - date +%s > /run/openslx/session-killed - loginctl terminate-session "$ses" - fi - # end other sessions - done - rm -f -- "$TMP" - fi - if [ "$IS_IDLE" = "yes" ]; then - [ ! -e "$IDLEHINT" ] && echo "$NOW" > "$IDLEHINT" - else - rm -f -- "$IDLEHINT" - fi -else - # No logout timeout is set, take shortcut for shutdown/suspend timeout (if set) - if [ -n "$SLX_SHUTDOWN_TIMEOUT" ] || [ -n "$SLX_SYSTEM_STANDBY_TIMEOUT" ]; then - SESSIONS=$(get_sessions) - if [ -z "$SESSIONS" ]; then - [ ! -e "$IDLEHINT" ] && echo "$NOW" > "$IDLEHINT" - else - rm -f -- "$IDLEHINT" - gen_runfile > "/run/openslx/idleaction-:0" # hard-code for primary X session - fi - fi -fi - -# -# 2) Check for no-session shutdown/suspend timeout -# -if [ -e "$IDLEHINT" ]; then - IDLE=$(cat "$IDLEHINT") - [ "$IDLE" -gt "$NOW" ] && IDLE="$NOW" - IDLE=$(( $NOW - $IDLE )) - if [ -n "${SLX_SHUTDOWN_TIMEOUT}" ] && [ "${SLX_SHUTDOWN_TIMEOUT}" -gt 0 ] && [ "$IDLE" -gt "$SLX_SHUTDOWN_TIMEOUT" ]; then - poweroff & - exit 0 - elif [ -n "${SLX_SYSTEM_STANDBY_TIMEOUT}" ] && [ "${SLX_SYSTEM_STANDBY_TIMEOUT}" -gt 0 ] && [ "$IDLE" -gt "$SLX_SYSTEM_STANDBY_TIMEOUT" ]; then - rm -f -- "$IDLEHINT" - if ! systemctl suspend; then - slxlog --sync "idleaction-no-suspend" "Client does not support standby/suspend, doing nothing" - fi - exit 0 - fi -fi - -# -# 3) Check for hard scheduled shutdown/reboot -# -# A cron file is created dynamically here so there's everything -# in one module and you don't need to repack config.tgz - -invalid_time () -{ - slxlog "idleaction-schedule" "Invalid shutdown time: '$time'. Expected HH:MM format." - return 0 -} - -write_crontab () -{ - local ACTION time HOUR MINUTE - [ $# -lt 1 ] && return - ACTION=$1 - shift - for time in $*; do - HOUR=${time%%:*} - MINUTE=${time##*:} - [ -z "$HOUR" -o -z "$MINUTE" ] && invalid_time && continue - [ "$HOUR" -lt 0 -o "$HOUR" -gt 23 ] && invalid_time && continue - [ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue - echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_action $ACTION --time $time" >> "$CRONFILE" - done -} - -if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRONFILE" ]; then - { - echo "# OpenSLX: Trigger poweroff/reboot at certain time of day" - echo "SHELL=/bin/ash" - echo "PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin" - echo "" - } > "$CRONFILE" - write_crontab "poweroff" "$SLX_SHUTDOWN_SCHEDULE" - write_crontab "reboot" "$SLX_REBOOT_SCHEDULE" - # Might want to re-set rtcwake timestamp periodically - if [ -n "$SLX_WAKEUP_SCHEDULE" ]; then - echo "0 * * * * root /opt/openslx/scripts/systemd-idleaction_init" >> "$CRONFILE" - fi - touch "/etc/cron.d" # Aufs bug where it won't update dir mtime when creating the file within -fi - diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action index 35b31748..38be4f79 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action +++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action @@ -7,39 +7,66 @@ if ! touch "/run"; then exit 1 fi -DETACH= if [ "$1" = "--detach" ]; then - DETACH=yes - shift + shift # Legacy, ignored fi if [ $# -lt 1 ]; then - echo "$0 [--detach] <reboot|poweroff|kexec-reboot> [delay_minutes]" >&2 + echo "$0 <reboot|poweroff|kexec-reboot> [--delay minutes] [--time <now as hh:mm>] [--uuid thismachine]" >&2 exit 2 fi +MODE=$1 + DELAY= TS= -MODE=$1 +WANTUUID= shift while [ $# -gt 0 ]; do - if [ "$1" == "--time" ]; then - TS=$2 + if [ "$1" = "--time" ]; then + TS="$2" + shift + elif [ "$1" = "--delay" ]; then + DELAY="$2" shift - elif [ "$1" == "--delay" ]; then - DELAY=$2 + elif [ "$1" = "--uuid" ]; then + WANTUUID="$2" shift else break fi shift done -[ -n "$1" ] && [ -z "$DELAY" ] && DELAY=$1 +# Legacy cmdline format +if [ -n "$1" ] && [ -z "$DELAY" ]; then + DELAY="$1" + shift +fi +if [ -n "$1" ] && [ -z "$WANTUUID" ]; then + WANTUUID="$1" + shift +fi + +if [ -n "$WANTUUID" ] && [ -s "/etc/system-uuid" ]; then + WANTUUID="$( echo "$WANTUUID" | tr 'a-f' 'A-F' )" + ISUUID="$( cat /etc/system-uuid )" + if [ "$ISUUID" != "$WANTUUID" ]; then + echo "ERROR: Sanity check failed: System-UUID mismatch." >&2 + echo "Is: '$ISUUID', want: '$WANTUUID'" >&2 + exit 1 + fi +fi + +if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ] && [ "$MODE" != "kexec-reboot" ]; then + slxlog --echo "idleaction-failed-call" "Invalid call to idleaction-scheduled_action. Mode '$MODE' unknown." >&2 + exit 3 +fi if [ -n "$TS" ]; then - # Sanity check for trigger by cron - # Sleep first so the clock has time to get adjusted + # Sanity check: If passing time, this has to be from when the request was thought to be triggered. + # Mostly useful if you remotely trigger this and want to make sure your request arrives in time. + # Sleep first so the clock has time to get adjusted in case of bootup or wakeup sleep 10 NOW=$(date +%s) SHOULD=$(date -d "today $TS" +%s) @@ -51,117 +78,8 @@ if [ -n "$TS" ]; then fi fi -if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ] && [ "$MODE" != "kexec-reboot" ]; then - slxlog --echo "idleaction-failed-call" "Invalid call to idleaction-scheduled_action. Mode '$MODE' unknown." >&2 - exit 3 -fi - -NUM=$(who | wc -l) -if [ -z "$DELAY" ] && [ "$NUM" = "0" ]; then - # Easy way out - machine is idle and no delay - ( - # Detach, close all in/out fds - needed for some ssh clients to rpevent them from hanging - exec < /dev/null &> /dev/null - sleep 1 - $MODE - ) & - disown - exit 0 -fi - -NOW=$(date +%s) -timeout=$(( 300 + NOW )) # 5 minute delay for logged in user -if [ -n "$DELAY" ] && [ "$DELAY" -gt 0 ]; then - timeout=$(( timeout + ( DELAY * 60 ) )) -fi - -for f in /run/openslx/idleaction-*; do - [ -f "$f" ] || continue - grep -q '^shutdownDeadline=' "$f" || continue - RET=$(awk -F= '{if ($1 == "shutdownDeadline") { print $2; exit } }' "$f") - if [ -z "$RET" ] || [ "$RET" -eq 0 ] || ! [ "$RET" -lt "$timeout" ] || [ 333 -lt "$(( NOW - RET ))" ]; then - sed -i "s/^shutdownDeadline=.*$/shutdownDeadline=$timeout/" "$f" - fi -done - -runaction () { - # Someone logged in or delay requested - [ -n "$DETACH" ] && sleep 1 - if [ -n "$DELAY" ] && [ "$DELAY" -gt 0 ]; then - echo "Doing $MODE in $DELAY minutes!" - sleep $(( DELAY * 60 )) - fi - for MINUTES in 5 X X X X X X X 3 X X X 2 X X X 1 X X X; do - if [ -f "/run/openslx/demo-no-logout-delay" ]; then - NUM=$(who | grep -v '^demo ' | wc -l) - else - NUM=$(who | wc -l) - fi - [ "$NUM" = "0" ] && break - if [ "$MINUTES" != "X" ]; then - USERS=0 - if [ "${MODE#*-}" = "reboot" ]; then - MESSAGE="Das System wird in $MINUTES Minute(n) neugestartet, bitte beenden Sie Ihre Sitzung. - The system will reboot in $MINUTES minute(s). Please save your work and end the session." - else - MESSAGE="Dieser Rechner wird in $MINUTES Minute(n) abgeschaltet, bitte beenden Sie Ihre Sitzung. - The system will power off in $MINUTES minute(s). Please save your work and end the session." - fi - for d in $(who | awk '{print $2 " " $NF}' | sort -u); do - if [ "${d:0:1}" = ":" ]; then - # X11 - export DISPLAY=$d - export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') - # Make sure user sees warning - xset dpms force on - # TODO: Don't look... We need to pick a proper util for this - /opt/openslx/cups/printergui --error "$MESSAGE" & - unset DISPLAY XAUTHORITY - USERS=$(( $USERS + 1 )) - elif [ "${d:0:3}" = "tty" ]; then - # Regular tty - cat > "/dev/$d" <<-EOF - * - *************************** - $MESSAGE - *************************** - * - EOF - USERS=$(( $USERS + 1 )) - elif [ "${d:0:3}" = "pts" ]; then - # pts - xterm or ssh session - cat > "/dev/pts/${d:3}" <<-EOF - * - *************************** - $MESSAGE - *************************** - * - EOF - USERS=$(( $USERS + 1 )) - fi - done - FILE=$(mktemp) - who > "$FILE" - slxlog "idleaction-busy" "Postponed $MODE ($MINUTES minutes max.) - $USERS user(s) still active" - sleep 1 - rm -- "$FILE" - fi - sleep 15 - done - - $MODE -} - -if [ -n "$DETACH" ]; then - ( - # Detach, see above - exec < /dev/null &> /dev/null - runaction - ) & - disown - exit 0 -fi - -runaction -exit 0 +# Fire away +[ -z "$DELAY" ] && DELAY=0 +DELAY="$(( DELAY * 60 ))" +idle-daemon --send "${MODE%-reboot} $DELAY" diff --git a/core/modules/idleaction/data/opt/openslx/vmchooser/sessionstart.d/write-screensaver-flag b/core/modules/idleaction/data/opt/openslx/vmchooser/sessionstart.d/write-screensaver-flag new file mode 100755 index 00000000..88dd4c83 --- /dev/null +++ b/core/modules/idleaction/data/opt/openslx/vmchooser/sessionstart.d/write-screensaver-flag @@ -0,0 +1,12 @@ +#!/bin/ash + +[ -z "$HOME" ] && HOME=$( getent passwd "$(id -u)" | awk -F: '{print $6}' ) + +if [ "$VMCHOOSER_DISABLE_SCREENSAVER" = "TRUE" ]; then + touch "$HOME/.no-saver" +else + rm -f -- "$HOME/.no-saver" +fi + +exit 0 + diff --git a/core/modules/idleaction/module.build b/core/modules/idleaction/module.build index fcae45e0..6aac9d93 100644 --- a/core/modules/idleaction/module.build +++ b/core/modules/idleaction/module.build @@ -1,6 +1,6 @@ #!/bin/bash fetch_source() { - : + autoclone } build() { @@ -11,6 +11,15 @@ build() { || perror "Compilation of xprintidle failed!" gcc -std=c99 -o "$MODULE_BUILD_DIR/opt/openslx/bin/xprintlocktime" "$MODULE_DIR/xprintlocktime.c" -lX11 \ || perror "Compilation of xprintlocktime failed!" + # idle-daemon + local SRCDIR="${MODULE_WORK_DIR}/src/idle-daemon" + + mkdir -p "$MODULE_BUILD_DIR/opt/openslx/sbin" + cd "${MODULE_BUILD_DIR}/opt/openslx/sbin" || perror "Could not cd!" + pinfo "Running cmake" + cmake "$SRCDIR" || perror "'cmake $SRCDIR' failed." + pinfo "Running make" + make || perror "'make' failed." } post_copy() { diff --git a/core/modules/idleaction/module.conf b/core/modules/idleaction/module.conf index e706b838..503a35a7 100644 --- a/core/modules/idleaction/module.conf +++ b/core/modules/idleaction/module.conf @@ -3,7 +3,12 @@ REQUIRED_MODULES=" slxlog " REQUIRED_BINARIES=" + idle-daemon xprintidle xprintlocktime " +REQUIRED_GIT=" + https://git.openslx.org/openslx-ng/idle-daemon.git +" + diff --git a/core/modules/iptables-helper/module.conf b/core/modules/iptables-helper/module.conf index 16da527b..2c41c13c 100644 --- a/core/modules/iptables-helper/module.conf +++ b/core/modules/iptables-helper/module.conf @@ -1,5 +1,5 @@ #!/bin/bash -# requires some rootfs that provies iptables REQUIRED_MODULES=" slxlog + iptables " diff --git a/core/modules/iptables/module.build b/core/modules/iptables/module.build new file mode 100644 index 00000000..4012ec43 --- /dev/null +++ b/core/modules/iptables/module.build @@ -0,0 +1,20 @@ +#!/bin/bash +fetch_source() { + : +} + +build() { + local BIN_LOCATION + for BIN in $REQUIRED_BINARIES; do + BIN_LOCATION="$(which ${BIN})" + pinfo "$BIN_LOCATION" + if [ -z "$BIN_LOCATION" ]; then + perror "'$BIN' not found on the system. Install it." + fi + tarcopy "$(get_link_chain ${BIN_LOCATION})" "${MODULE_BUILD_DIR}" + done +} + +post_copy() { + : +} diff --git a/core/modules/iptables/module.conf b/core/modules/iptables/module.conf new file mode 100644 index 00000000..353859e6 --- /dev/null +++ b/core/modules/iptables/module.conf @@ -0,0 +1,7 @@ +REQUIRED_BINARIES=" + iptables + ip6tables +" +REQUIRED_SYSTEM_FILES+=" + /usr/lib/x86_64-linux-gnu/xtables +" diff --git a/core/modules/iptables/module.conf.ubuntu b/core/modules/iptables/module.conf.ubuntu new file mode 100644 index 00000000..01b6d246 --- /dev/null +++ b/core/modules/iptables/module.conf.ubuntu @@ -0,0 +1,3 @@ +REQUIRED_INSTALLED_PACKAGES=" + iptables +" diff --git a/core/modules/kdm/data/etc/systemd/system/kdm.service b/core/modules/kdm/data/etc/systemd/system/kdm.service index e77d1cbd..97749a16 100644 --- a/core/modules/kdm/data/etc/systemd/system/kdm.service +++ b/core/modules/kdm/data/etc/systemd/system/kdm.service @@ -1,7 +1,7 @@ [Unit] Description=KDM Display Manager Conflicts=getty@tty7.service -After=systemd-user-sessions.service getty@tty7.service setup-slx-addon@nvidia_libs.service setup-slx-addon@vmware.service +After=systemd-user-sessions.service getty@tty7.service load-gfx-driver.service setup-slx-addon@vmware.service setup-slx-addon@virtualbox.service [Service] ExecStartPre=-/opt/openslx/bin/killall fbsplash diff --git a/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot b/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot index 60197f50..2cfae96f 100755 --- a/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot +++ b/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot @@ -1,4 +1,3 @@ #!/bin/ash -exec systemctl start kexec.target - +exec systemctl isolate kexec.target diff --git a/core/modules/kiosk-chromium/data/opt/openslx/scripts/systemd-setup_kiosk.d/00-chromium-policies b/core/modules/kiosk-chromium/data/opt/openslx/scripts/systemd-setup_kiosk.d/00-chromium-policies index 31aec39f..9e60d7fa 100644 --- a/core/modules/kiosk-chromium/data/opt/openslx/scripts/systemd-setup_kiosk.d/00-chromium-policies +++ b/core/modules/kiosk-chromium/data/opt/openslx/scripts/systemd-setup_kiosk.d/00-chromium-policies @@ -19,13 +19,14 @@ chromium_policies() { cat <<- EOF > "$chromium_policy_file" { + "AutoFillEnabled": false, "BackgroundModeEnabled": false, "BookmarkBarEnabled": $bookmarkbar, "DefaultBrowserSettingEnabled": true, "DownloadRestrictions": 3, + "PasswordManagerEnabled": false, "ShowAppsShortcutInBookmarkBar": false, - "TranslateEnabled": false, - "PasswordManagerEnabled": false + "TranslateEnabled": false } EOF } diff --git a/core/modules/lightdm/data/etc/systemd/system/lightdm.service b/core/modules/lightdm/data/etc/systemd/system/lightdm.service index d4721241..b7144a71 100644 --- a/core/modules/lightdm/data/etc/systemd/system/lightdm.service +++ b/core/modules/lightdm/data/etc/systemd/system/lightdm.service @@ -1,7 +1,7 @@ [Unit] Description=LightDM Display Manager Conflicts=getty@tty7.service -After=systemd-user-sessions.service setup-slx-addon@nvidia_libs.service setup-slx-addon@vmware.service +After=systemd-user-sessions.service load-gfx-driver.service setup-slx-addon@vmware.service [Service] ExecStart=/usr/sbin/lightdm diff --git a/core/modules/networkd-dispatcher/data/etc/networkd-dispatcher/routable.d/00-fallback-dns-lookup.sh b/core/modules/networkd-dispatcher/data/etc/networkd-dispatcher/routable.d/00-fallback-dns-lookup.sh index a422b52b..84f85258 100755 --- a/core/modules/networkd-dispatcher/data/etc/networkd-dispatcher/routable.d/00-fallback-dns-lookup.sh +++ b/core/modules/networkd-dispatcher/data/etc/networkd-dispatcher/routable.d/00-fallback-dns-lookup.sh @@ -8,14 +8,21 @@ check_dns() { local fqdn host_out - host_out="$(host $ADDR)" - if [ $? -ne 0 ]; then - echo "Failed to retrieve FQDN through reverse lookup on '$ADDR'." - echo "Falling back to IP-Address if needed." - fqdn= - else - local fqdn="$(<<< $host_out grep -E "$(awk -F. '{print $4"."$3"."$2"."$1}' <<< $ADDR )" | awk '{sub(".$",""); print $5}')" - fi + for timeout in 1 1 1 2 2 3 5 5 END; do + if [ "$timeout" = "END" ]; then + echo "Falling back to IP address if needed." + fqdn= + break + fi + host_out="$(host $ADDR)" + if [ $? -ne 0 ]; then + echo "Failed to retrieve FQDN through reverse lookup on '$ADDR'." + sleep $timeout + else + local fqdn="$(<<< $host_out grep -E "$(awk -F. '{print $4"."$3"."$2"."$1}' <<< $ADDR )" | awk '{sub(".$",""); print $5}')" + break + fi + done # check domain local domain="${fqdn#*.}" @@ -85,4 +92,6 @@ for timeout in 1 1 1 2 2 3 5 5 END; do sleep "$timeout" done +sleep 1 + check_dns diff --git a/core/modules/nvidia-common/module.build b/core/modules/nvidia-common/module.build index d43ce83f..9bf73af8 100644 --- a/core/modules/nvidia-common/module.build +++ b/core/modules/nvidia-common/module.build @@ -39,6 +39,10 @@ build() { /NVIDIA/nvidia-installer --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check \ --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent \ --kernel-source-path "/$KERNEL_HEADERS_DIR" + grep -qF '.ko failed to build' /var/log/nvidia-installer.log \ + || /NVIDIA/nvidia-installer --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check \ + --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent \ + --no-kernel-module exit 0 # Fake it since it will try to load the module and probably fail EOF if grep -qF '.ko failed to build' "${builddir}/var/log/nvidia-installer.log"; then @@ -47,14 +51,14 @@ build() { fi pinfo "chroot terminated, cleaning up" - # move whiteout list to its /opt/openslx/etc/nvidia.whiteout + # move whiteout list to its /opt/openslx/etc/nvidia.whiteout (inside $builddir, for lib target) if [ -e "${builddir}/overlay.whiteout.list" ]; then mkdir -p "${builddir}/opt/openslx/etc" mv "${builddir}/overlay.whiteout.list" "${builddir}/opt/openslx/etc/nvidia.whiteout" fi -# SNIP - NVIDIA_MODULES="${builddir}/lib/modules/nvidia/${version}" + # Kernel related - outside of version subdir ($builddir) + NVIDIA_MODULES="${MODULE_BUILD_DIR}/lib/modules/nvidia/${version}" mkdir -p "$NVIDIA_MODULES" pinfo "Copying kernel modules..." for file in nvidia.ko nvidia-uvm.ko nvidia-modeset.ko nvidia-drm.ko; do @@ -65,10 +69,10 @@ build() { cp "$RESULT" "$NVIDIA_MODULES" || perror "Could not copy $file" done - mkdir -p "${builddir}/drm.cfg.d" - drmfile="${builddir}/drm.cfg.d/$(( filenum++ ))-nvidia" + mkdir -p "${MODULE_BUILD_DIR}/drm.cfg.d" + drmfile="${MODULE_BUILD_DIR}/drm.cfg.d/$(( filenum++ ))-nvidia-$version" cat > "$drmfile" <<-BLOFF - @nvidia-${version} acpi_ipmi nvidia-$version/nvidia.ko nvidia-$version/nvidia-uvm.ko nvidia-$version/nvidia-modeset.ko nvidia-$version/nvidia-drm.ko + @nvidia-${version} acpi_ipmi nvidia/$version/nvidia.ko nvidia/$version/nvidia-uvm.ko nvidia/$version/nvidia/modeset.ko nvidia-$version/nvidia/drm.ko @nvidia-${version}_fallback nouveau BLOFF if ! [ -s "${builddir}/supportedchips.html" ]; then diff --git a/core/modules/nvidia-common/module.conf b/core/modules/nvidia-common/module.conf index 7645cb2e..f1327ca8 100644 --- a/core/modules/nvidia-common/module.conf +++ b/core/modules/nvidia-common/module.conf @@ -2,9 +2,6 @@ REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/%VERSION%/NVIDIA-Linux-x86_64-%VERSION%.run" REQUIRED_HTML="http://download.nvidia.com/XFree86/Linux-x86_64/%VERSION%/README/supportedchips.html" -# Here? No REQUIRED_ prefix so it won't get cleaned... -:; NVIDIA_VERSIONS="418.56 390.116" - REQUIRED_MODULES=" kernel " diff --git a/core/modules/nvidia-kernel/module.build b/core/modules/nvidia-kernel/module.build new file mode 100644 index 00000000..38c96a75 --- /dev/null +++ b/core/modules/nvidia-kernel/module.build @@ -0,0 +1,12 @@ +#!/bin/bash + +module_load() { + [ -z "$NVIDIA_VERSIONS" ] && perror "No NVIDIA_VERSIONS set in config" + local version + for version in $NVIDIA_VERSIONS; do + [ -d "${ROOT_DIR}/tmp/work/nvidia-common/build/${version}" ] || perror "nvidia-common did not build $version" + done + # XXX Now we change out build dir to that of nvidia-common + MODULE_BUILD_DIR="${ROOT_DIR}/tmp/work/nvidia-common/build" +} + diff --git a/core/modules/nvidia-kernel/module.conf b/core/modules/nvidia-kernel/module.conf new file mode 100644 index 00000000..193994e3 --- /dev/null +++ b/core/modules/nvidia-kernel/module.conf @@ -0,0 +1,9 @@ +#!/bin/bash +REQUIRED_DIRECTORIES=" + /lib/modules/nvidia + /drm.cfg.d +" +REQUIRED_MODULES=" + kernel + nvidia-common +" diff --git a/core/modules/nvidia_libs/data/addon-init b/core/modules/nvidia-libs/data/addon-init index 6587c981..6587c981 100755 --- a/core/modules/nvidia_libs/data/addon-init +++ b/core/modules/nvidia-libs/data/addon-init diff --git a/core/modules/nvidia_libs/data/addon-required b/core/modules/nvidia-libs/data/addon-required index a7b59f91..a7b59f91 100644 --- a/core/modules/nvidia_libs/data/addon-required +++ b/core/modules/nvidia-libs/data/addon-required diff --git a/core/modules/nvidia-libs/module.build b/core/modules/nvidia-libs/module.build new file mode 100644 index 00000000..b35e6fd2 --- /dev/null +++ b/core/modules/nvidia-libs/module.build @@ -0,0 +1,11 @@ +#!/bin/bash + +module_load() { + [ -z "$VERSION" ] && perror "Not run from an @ target" + local SRC + SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$VERSION" + [ -d "$SRC" ] || perror "nvidia-common did not build $VERSION" + # XXX Now we override the MODULE_BUILD_DIR, where mltk will then grab alle the required files from + MODULE_BUILD_DIR="$SRC" +} + diff --git a/core/modules/nvidia_libs/module.conf.ubuntu b/core/modules/nvidia-libs/module.conf.ubuntu index 5135d91e..5135d91e 100644 --- a/core/modules/nvidia_libs/module.conf.ubuntu +++ b/core/modules/nvidia-libs/module.conf.ubuntu diff --git a/core/modules/nvidia_kernel/module.build b/core/modules/nvidia_kernel/module.build deleted file mode 100644 index 77b0f6d6..00000000 --- a/core/modules/nvidia_kernel/module.build +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -fetch_source() { - local url="$REQUIRED_URL_BASE/$REQUIRED_VERSION/$REQUIRED_NVIDIA" - mkdir -p src 2>/dev/null - cd src || perror "Could not change into src directory." - download "$REQUIRED_URL_BASE/$REQUIRED_VERSION/README/supportedchips.html" - download "$url" -} - -build() { - local ROOTUPPERDIR="$MODULE_WORK_DIR/rootupper" - - local NVIDIA="$MODULE_WORK_DIR/src/$REQUIRED_NVIDIA" - local NVIDIAEXTRACTDIR="$ROOTUPPERDIR/NVIDIA" - - [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" - pinfo "Unpacking NVidia archive ($NVIDIA) ..." - sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." - - pinfo "Ready to chroot - compiling may take some time." - pdebug "--- chroot ---------------------------------------------------------------------" - pdebug "- -" - pdebug "- Notice: This may take a while! -" - pdebug "- -" - pdebug "- Please keep note the Nvidia installer _will_ complain about -" - pdebug "- several warnings and errors. It will do this in any case. -" - pdebug "- -" - pdebug "- This does _not_ mean the kernel module compilation was unsuccessful! -" - pdebug "- -" - pdebug "--------------------------------------------------------------------------------" - - - chroot_run "$ROOTUPPERDIR" <<-EOF - /NVIDIA/nvidia-installer --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent --kernel-source-path /"$KERNEL_HEADERS_DIR" # Do the work! - # fake success since the installer will exit with an error due to the module not loading properly. - exit 0 - EOF - pinfo "chroot terminated." - - local file - local RESULT - local NVIDIA_MODULES="$MODULE_BUILD_DIR/lib/modules/${TARGET_KERNEL_LONG}/kernel/drivers/gpu/drm/nvidia/" - mkdir -p "$NVIDIA_MODULES" - pinfo "Copying kernel modules..." - for file in nvidia.ko nvidia-uvm.ko nvidia-modeset.ko nvidia-drm.ko; do - RESULT=$(find "$ROOTUPPERDIR/NVIDIA/kernel" -name "$file" | head -n 1) - [ -z "$RESULT" ] && perror "Could not find built module $file in ./NVIDIA/kernel" - pinfo "Fetching ${file} from '${RESULT}'..." - strip -g "$RESULT" || pwarning "Could not strip $file" - cp "$RESULT" "$NVIDIA_MODULES" || perror "Could not copy $file" - done - rm -rf "$MODULE_BUILD_DIR/NVIDIA" - - mkdir -p "$MODULE_BUILD_DIR/drm.cfg.d" - local drmfile="$MODULE_BUILD_DIR/drm.cfg.d/00-nvidia" - cat > "$drmfile" <<-BLOFF - @nvidia acpi_ipmi nvidia/nvidia.ko nvidia/nvidia-uvm.ko nvidia/nvidia-modeset.ko nvidia/nvidia-drm.ko - @nvidia_fallback nouveau -BLOFF - if ! [ -s "$MODULE_WORK_DIR/src/supportedchips.html" ]; then - pwarning "No supportedchips.html -- using wildcard drm.cfg" - echo "10de @nvidia" >> "$drmfile" - else - local mode line name dev version - pinfo "Creating drm.cfg" - mode=0 - version= - while read -r line; do - if [[ "$line" =~ '<a name="legacy_' ]]; then - version=$(echo "$line" | sed -r 's/^.*name="legacy_([^"]+)".*$/\1/') - break # For now, we stop here; later on we could support legacy drivers - # By appending $version below and then having different locations for - # the modules, and in stage3.2 load different sqfs containers - elif [[ "$mode" = 0 ]] && [[ "$line" =~ ^'<tr' ]]; then - mode=1 - elif [[ "$mode" = 1 ]] && [[ "$line" =~ ^'<td' ]]; then - mode=2 - name=$(echo "$line" | sed -r 's/^.*<td[^>]*>([^<]+)<.*$/\1/') - elif [[ "$mode" = 2 ]] && [[ "$line" =~ ^'<td'[^'>']*'>'[0-9A-F]{4}'<' ]]; then - mode=0 - dev=$(echo "$line" | sed -r 's/^.*<td[^>]*>([0-9A-Fa-f]{4})<.*$/\1/' | tr 'A-Z' 'a-z') - echo "10de:$dev @nvidia$version" - else - mode=0 - name= - dev= - fi - done < "$MODULE_WORK_DIR/src/supportedchips.html" >> "$drmfile" - fi - -} - -post_copy() { - # rebuild modules.{alias,dep,...} - depmod -a -b "${TARGET_BUILD_DIR}" "${TARGET_KERNEL_LONG}" -} - diff --git a/core/modules/nvidia_kernel/module.conf b/core/modules/nvidia_kernel/module.conf deleted file mode 100644 index 4227e5a8..00000000 --- a/core/modules/nvidia_kernel/module.conf +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -REQUIRED_VERSION="418.56" -REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" -REQUIRED_URL_BASE="http://download.nvidia.com/XFree86/Linux-x86_64" - -REQUIRED_DIRECTORIES=" - /lib/modules - /drm.cfg.d -" -REQUIRED_MODULES=" - kernel -" diff --git a/core/modules/nvidia_libs/module.build b/core/modules/nvidia_libs/module.build deleted file mode 100644 index c168025d..00000000 --- a/core/modules/nvidia_libs/module.build +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -fetch_source() { - mkdir -p src - cd src || perror "Could not change into src directory." - download "$REQUIRED_URL" - cd .. -} - -build() { - local NVIDIA="${MODULE_WORK_DIR}/src/$REQUIRED_NVIDIA" - local NVIDIAEXTRACTDIR="$MODULE_BUILD_DIR/NVIDIA" - - pdebug "Unpacking NVidia-Installer ..." - [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" - sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." - - pinfo "Ready to chroot - may take some time." - pdebug "--- chroot ---------------------------------------------------------------------" - pdebug "- -" - pdebug "- Notice: This may take a while! -" - pdebug "- -" - pdebug "- Please keep note the Nvidia installer _will_ complain about -" - pdebug "- several warnings and errors. It will do this in any case. -" - pdebug "- -" - pdebug "- This does _not_ mean the library module compilation was unsuccessful! -" - pdebug "- -" - pdebug "--------------------------------------------------------------------------------" - - chroot_run "${MODULE_BUILD_DIR}" <<-EOF - /NVIDIA/nvidia-installer --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent --no-kernel-module - ldconfig - EOF - pinfo "chroot terminated, moving ld cache / whiteout list and cleaning up" - mkdir -p "${MODULE_BUILD_DIR}/opt/openslx/etc" - if [ -e "${MODULE_BUILD_DIR}/etc/ld.so.cache" ]; then - mv "${MODULE_BUILD_DIR}/etc/ld.so.cache" "${MODULE_BUILD_DIR}/opt/openslx/etc/${MODULE}.ld.so.cache" - fi - # move whiteout list to its /opt/openslx/etc/nvidia.whiteout - if [ -e "${MODULE_BUILD_DIR}/overlay.whiteout.list" ]; then - mv "${MODULE_BUILD_DIR}/overlay.whiteout.list" "${MODULE_BUILD_DIR}/opt/openslx/etc/${MODULE}.whiteout" - fi - - rm -rf "$MODULE_BUILD_DIR/NVIDIA" -} - -post_copy() { - : -} - diff --git a/core/modules/nvidia_libs/module.conf b/core/modules/nvidia_libs/module.conf deleted file mode 100644 index 53484960..00000000 --- a/core/modules/nvidia_libs/module.conf +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -REQUIRED_VERSION="418.56" -REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" -REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/$REQUIRED_VERSION/$REQUIRED_NVIDIA" - -REQUIRED_FILES=" - /etc/OpenCL/vendors/nvidia.icd - /usr/local/share/applications/nvidia-settings.desktop -" - -REQUIRED_DIRECTORIES=" - /opt/openslx - /usr/bin - /usr/lib - /var/lib/nvidia - /usr/share/nvidia - /usr/share/egl - /usr/share/glvnd - /usr/share/X11 -" - diff --git a/core/modules/run-virt/README b/core/modules/run-virt/README new file mode 100644 index 00000000..d3368ede --- /dev/null +++ b/core/modules/run-virt/README @@ -0,0 +1,59 @@ +Configuring run-virt: + +## /opt/openslx/vmchooser/config/resource_urls.conf + +url_lecture_netrules: URL to download firewall rules from +url_lecture_metadata: URL to download lecture metadata.tgz from + +## /opt/openslx/vmchooser/hooks/* + +Several sub directories for different hooks. These can contain files named +*.sh, which will be executed, or *.inc, which will be sourced. + +The following hooks exist: + +# download.d/ + +Executed in order to obtain the VMX/metadata. +In *.sh form, the first parameter ($1) will be the target directory, where the script is supposed to +put the downloaded files. In the *.inc form, the destination directory is $CONFDIR, and also in $1. +The files to place there have to be named as follows: + +"vmx": +The machine description, a vmx file for vmware, and xml file for virtualbox, etc... + +"runscript": +Optional script that will be executed by the openslx.exe +The first line is abused to pass further information along and has the format +key=value;key2=value2;key3=value3 ... +Currently in use are +ext=bat (to signify the type of script being executed, batch in this case) +visibility=0 (whether the script is hidden while running (0 = hidden, 1 = normal, 2 = minimized) +soundMuted=1 (whether sound is muted by default in the VM (0 = no, 1 = yes, -1 = let SLX_VM_SOUND decide) + +"netshares": Optional file defining the network shares to be mounted by openslx.exe + +Also there can be a sub-directory for additional runscripts called "adminrun" containing files in the format +[index]-[visibility]-[passcreds].[ext] +e.g. 001-1-1.bat +index is just used for sorting, visibility is explained above, and passcreds decides whether the script gets +passed the username and password via parameters. + +If your .sh is responsible for downloading the meta data, it should exit 0. Any other exit code tells run-virt +that your script was only meant for some preparation work and run-virt should download the meta data on its +own. Likewise for an .inc, it should return 0 to signify that downloading was done (or at least attempted) by +your include, and run-virt should not try to download anything. + +For cleanliness you should prefer writing .sh hooks, .inc should only be used if you really need to modify the +environment of run-virt. For *.sh hooks, the environment will provide $TMPDIR, $IMGUUID and $USER. + +# floppy.d/ + +Hook to add more files to the virtual floppy. $1 is the directory you should copy your files to. +Symlinks work too, mcopy will follow them and copy the linked file. +Note that this is a floppy, not the cloud, so you're limited to 1.44MB of storage. + +# image-access.d/ + +Hook to set up read or write access to image. Here, only *.inc type hooks make sense, since they're +expected to set either VM_DISKFILE_RO or VM_DISKFILE_RW, depending on desired access.
\ No newline at end of file diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/download_vm_metadata.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/download_vm_metadata.inc index 17b679ea..dd3f63e3 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/download_vm_metadata.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/download_vm_metadata.inc @@ -6,16 +6,32 @@ # Legacy mode: As runvirt has been before. # New mode: uuid in xml _and_ vmx given via http. download_metadata() { - local TRIES EXTRA_ERROR WLOG TMPFILE RET ERRCODE CMDLINE + local EXTRA_ERROR= + declare -rg TMPCONFIG="$CONFDIR/vmx" + + # Run hooks + if ! run_hooks "download" "$CONFDIR"; then + # No hooks found + download_metadata_default + fi + [ -s "$TMPCONFIG" ] && return 0 + # Seems we are in legacy mode, which is no longer supported. Warn user and exit + EXIT_TYPE="user" EXIT_REASON="msg.vm.no-metadata +Die Metadaten der Lehrumgebung konnten nicht vom bwLehrpool-Satelliten +heruntergeladen werden. Bitte versuchen Sie es in wenigen Minuten erneut +und wenden Sie sich an den Support, wenn das Problem bestehen bleibt. +$EXTRA_ERROR +" cleanexit 1 +} + +download_metadata_default() { + local TRIES WLOG TMPFILE RET ERRCODE CMDLINE # Sanity checks - if ! check_dep wget; then + if ! check_dep curl; then writelog "Could not find 'wget' in PATH: $PATH" EXIT_TYPE="internal" EXIT_REASON="Fehlendes Dienstprogramm 'wget'!" cleanexit 1 fi - writelog "Detecting current/legacy mode..." - declare -rg TMPCONFIG="$CONFDIR/vmx" - # Try new unified .tar.gz way TMPFILE="$TMPDIR/metadata.tgz" WLOG="$TMPDIR/wget-metadata.log" @@ -26,51 +42,14 @@ download_metadata() { RET=$? if [ "$RET" = 0 ] && [ -n "$ERRCODE" ] && [ "$ERRCODE" -ge 200 ] && [ "$ERRCODE" -lt 300 ]; then # Success, see if data is usable - if tar -C "$CONFDIR" -x -f "$TMPFILE" && [ -s "$CONFDIR/vmx" ]; then + if tar -C "$CONFDIR" -x -f "$TMPFILE" && [ -s "$TMPCONFIG" ]; then return 0 fi rm -rf -- "$TMPFILE" - writelog "Extracting metadata.tgz failed. Trying legacy mode." + writelog "Extracting metadata.tgz failed. Cannot start VM." else - writelog "Downloading metadata.tgz failed (HTTP $ERRCODE). Trying legacy mode." - #slxlog --delete "run-virt-wget" "Downloading MetaData failed" "$WLOG" + writelog "Downloading metadata.tgz failed (HTTP $ERRCODE). Cannot start VM." "$WLOG" fi - - TRIES=0 - while [ "$TRIES" -lt 3 ]; do - TRIES=$(( TRIES + 1 )) - writelog "wget try $TRIES" - WLOG="$TMPDIR/wget-${TRIES}.log" - if wget -T 6 -O "$TMPCONFIG" "${url_lecture_config}" &>"$WLOG"; then - rm -f -- "$WLOG" - writelog "Downloaded VM description from '${url_lecture_config}' successfully." - if [ -s "$TMPCONFIG" ]; then - # Downloaded a non-zero VM description file, all good - return 0 - else - writelog "Server sent zero byte virtual machine description file." - EXTRA_ERROR="(Der Server hat eine leere Antwort gesendet)" - fi - else - ERRCODE=$(grep -m1 -o -E '\b[0-9]{3}\b' "$WLOG") - if [ -n "$ERRCODE" ]; then - EXTRA_ERROR="(HTTP Error Code $ERRCODE)" - else - EXTRA_ERROR="(Der Server ist nicht erreichbar)" - fi - writelog "wget failed." - fi - done - - slxlog --delete "run-virt-wget" "Downloading VMX/Metadata failed" "$WLOG" - - # Seems we are in legacy mode, which is no longer supported. Warn user and exit - EXIT_TYPE="user" EXIT_REASON="msg.vm.no-metadata -Die Metadaten der Lehrumgebung konnten nicht vom bwLehrpool-Satelliten -heruntergeladen werden. Bitte versuchen Sie es in wenigen Minuten erneut -und wenden Sie sich an den Support, wenn das Problem bestehen bleibt. -$EXTRA_ERROR -" cleanexit 1 } ## Main ## diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/load_configs.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/load_configs.inc index 0f1fab39..7a132fcc 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/load_configs.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/load_configs.inc @@ -17,9 +17,6 @@ load_configs() { # Load general virtualization information $(safesource --exit "$VMCHOOSER_CONF_DIR/virtualization.conf") - - # Load general openslx config - $(safesource --exit "/opt/openslx/config") # Load config for resource URLs $(safesource "$VMCHOOSER_CONF_DIR/resource_urls.conf") diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_image_access.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_image_access.inc index ea8afc7e..b10623be 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_image_access.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_image_access.inc @@ -33,7 +33,6 @@ setup_dnbd3 () { # Mount path for images mounted with dnbd3-fuse declare -rg DNBD3_MOUNT_POINT="${TMPDIR}/dnbd3fuse.mnt" mkdir -p "${DNBD3_MOUNT_POINT}" - mkdir -p "${DNBD3_MOUNT_POINT}" # start dnbd3-fuse in subshell local DNBD3_TMPLOG="${TMPDIR}/dnbd3fuse.log" local DNBD3_EXITFLAG="${TMPDIR}/dnbd3exit$RANDOM" @@ -66,8 +65,6 @@ setup_dnbd3 () { if isempty VM_DISKFILE_RO; then slxlog "virt-dnbd3" "No dnbd3 server for ${SRC_IMG_RELATIVE} found, trying NFS/CIFS..." "$DNBD3_TMPLOG" writelog "No working dnbd3 server found :-(" - else - readonly VM_DISKFILE_RO fi } @@ -82,32 +79,27 @@ setup_fallback() { # try name we got from xml in the first place VM_DISKFILE_RO="${SRC_IMG_ABSOLUTE}" fi - readonly VM_DISKFILE_RO -} - -setup_jambo() { - declare -r CMDLOG="$TMPDIR/sshfs.jambo" - declare -rg CLIENTPARTITION_ADMIN="/var/lib/vmware_admin" - #declare -r UPLOAD_KEYFILE="/var/lib/uploaduser" - #sudo -n sshfs "uploaduser@$JAMBOSERVER:/vms/bwlehrpool_store" "$CLIENTPARTITION_ADMIN" -o allow_other -o PreferredAuthentications=publickey -o IdentityFile="$UPLOAD_KEYFILE" -o IdentitiesOnly=yes &> "$CMDLOG" - sudo -n sshfs "uploaduser@$JAMBOSERVER:/vms/bwlehrpool_store" "$CLIENTPARTITION_ADMIN" -o allow_other -o PreferredAuthentications=publickey &> "$CMDLOG" - RET=$? - if [ "$RET" != "0" ]; then - writelog "SSHFS Failed - $(cat "$CMDLOG")" - EXIT_TYPE="user" EXIT_REASON="Schreibbarer VM-Speicher konnte nicht eingebunden werden. Adminmodus fehlgeschlagen." cleanexit 1 - fi - declare -rg VM_DISKFILE_RW="$CLIENTPARTITION_ADMIN/$SRC_IMG_RELATIVE" } - ## MAIN PART / Sanity checks ## setup_image_access() { writelog "Setting up virtual hard disk access for virtualizer/emulator ..." + unset VM_DISKFILE_RO VM_DISKFILE_RW + declare -g VM_DISKFILE_RO VM_DISKFILE_RW - if [ "$VMCHOOSER_ADMIN_MODE" = "TRUE" ] && [ -n "$SLX_JAMBOSERVER" ]; then - setup_jambo - writelog "\tVM disk file RW:\t\t$VM_DISKFILE_RW" + run_hooks "image-access" + + if [ -n "$VM_DISKFILE_RW" ]; then + writelog "A hook in setup_image_access supplied a writable diskfile. Not running default setup." + elif [ -n "$VM_DISKFILE_RO" ]; then + writelog "A hook in setup_image_access supplied a read-only diskfile. Not running default setup." + else + setup_image_access_default + fi + readonly VM_DISKFILE_RO VM_DISKFILE_RW + + if [ -n "$VM_DISKFILE_RW" ]; then + writelog "\tVM disk file (RW):\t\t$VM_DISKFILE_RW" if ! [ -s "$VM_DISKFILE_RW" ]; then writelog ".... not found!" EXIT_TYPE="user" EXIT_REASON="Schreibbare VM nicht gefunden. Adminmodus fehlgeschlagen." cleanexit 1 @@ -116,12 +108,22 @@ setup_image_access() { writelog ".... not writable!" EXIT_TYPE="user" EXIT_REASON="VM-Image auf schreibbarem VM-Speicher nicht schreibbar. Adminmodus fehlgeschlagen." cleanexit 1 fi - return 0 + elif [ -n "$VM_DISKFILE_RO" ]; then + writelog "\tVM disk file (RO):\t\t$VM_DISKFILE_RO" + if ! [ -s "$VM_DISKFILE_RO" ]; then + writelog ".... not found!" + EXIT_TYPE="user" EXIT_REASON="VM-Image nicht gefunden." cleanexit 1 + fi + if ! [ -r "$VM_DISKFILE_RO" ]; then + writelog ".... not readable!" + EXIT_TYPE="user" EXIT_REASON="VM-Image nicht lesbar." cleanexit 1 + fi + else + EXIT_TYPE="user" EXIT_REASON="Kein VM-Image Dateiname angegeben/gefunden." cleanexit 1 fi - - unset VM_DISKFILE_RO - declare -g VM_DISKFILE_RO - +} + +setup_image_access_default() { # See if we should setup dnbd3 image access at all if ! check_dep dnbd3-fuse fusermount; then writelog "\tCan't use dnbd3 as dnbd3-fuse/fusermount binaries are not in PATH" @@ -141,14 +143,6 @@ setup_image_access() { writelog "Trying fallback image access via NFS/CIFS..." setup_fallback fi - - # Check if we finally found a valid, readable container - if isempty VM_DISKFILE_RO || [ ! -r "${VM_DISKFILE_RO}" ]; then - writelog "Virtual machine image ${VM_DISKFILE_RO} not found!" - EXIT_TYPE="user" EXIT_REASON="Konnte virtuelle Festplatte der gewählten VM nicht finden!" cleanexit 1 - fi - - writelog "\tVM disk file:\t\t${VM_DISKFILE_RO}" } call_post_source setup_image_access 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 932c4aad..7b4554ea 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 @@ -220,6 +220,34 @@ translate() { fi } +## +# run_hooks type args... +# eg run_hooks "download" "$CONFDIR" +# returns 100 if no hooks exist +run_hooks() { + local dir file retval r + declare -a files + dir="$BASEDIR/hooks/${1}.d" + [ -d "$dir" ] || return 100 + shift + files=( "${dir}"/* ) + retval=100 + for file in "${files[@]}"; do + [ -e "${file}" ] || continue + r=100 + if [ "${file##*.}" = "sh" ] && [ -x "$file" ]; then + export TMPDIR IMGUUID USER + "$file" "$@" + r="$?" + elif [ "${file##.*}" = "inc" ]; then + . "$file" + r="$?" + fi + [ "$r" -lt "$retval" ] && retval="$r" + done + return "$retval" +} + ################# SOURCING FUNCTIONS ################# # Wrapped 'source' that first checks for existence and # syntax before actually sourcing the given file. diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc index e302bdd7..c077bb42 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc @@ -4,7 +4,7 @@ ## Functions ## setup_virtual_floppy() { declare -rg SLX_FLOPPY_IMG="${TMPDIR}/floppy.img" - declare -rg TMPHOME="${HOME}" + declare -r TMPHOME="${HOME}" # create floppy disk file + filesystem dd "if=/dev/zero" "of=${SLX_FLOPPY_IMG}" count=1440 bs=1024 @@ -13,10 +13,15 @@ setup_virtual_floppy() { if [ -s "${TMPHOME}/.openslx/shares" ]; then $(safesource "${TMPHOME}/.openslx/shares") - else + elif [ -s "/opt/openslx/inc/shares" ]; then $(safesource "/opt/openslx/inc/shares") fi + # Directory for files that go into the virtual floppy + declare -r FLOPPYDIR="$TMPDIR/floppy" + mkdir -p "$FLOPPYDIR" + chmod 0700 "$FLOPPYDIR" + if notempty SHARE_REMAP_MODE; then local SHARE_REMAP_MODE_INI="$SHARE_REMAP_MODE" else @@ -25,24 +30,16 @@ setup_virtual_floppy() { fi notempty SHARE_CREATE_MISSING_REMAP || local SHARE_CREATE_MISSING_REMAP="1" - # Legacy: openslx.exe expects HOSTRES.TXT - local RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \ - | grep -o -E -m1 '[0-9]+x[0-9]+') - # TODO fallback if this fails? this is currently never checked... - cat > "${TMPDIR}/HOSTRES.TXT" <<-EOF - ${RESOLUTION} - EOF - # Create file for network shares to mount - declare -g SHARES="${TMPDIR}/shares.dat" + declare -g SHARES="${FLOPPYDIR}/shares.dat" touch "${SHARES}" chmod 0600 "${SHARES}" if ! pwdaemon --query "${TMPHOME}/.pwsocket" > "${SHARES}"; then - slxlog "virt-pwdaemon" "Could not start pwdaemon" + slxlog "run-virt-pwdaemon" "Could not query pwdaemon" echo -e '-\t-\t-\t-\t-' > "${SHARES}" else sed -i 's/^/192.168.101.1\t/' "${SHARES}" # TODO: Depending on nettype (in case we have != nat some day) - if [ "${SHARE_REMAP_MODE}" = 1 -o "${SHARE_REMAP_MODE}" = 2 ] && [ -e "${TMPHOME}/.openslx/home" ]; then + if [ "${SHARE_REMAP_MODE}" = 1 -o "${SHARE_REMAP_MODE}" = 2 ] && [ -s "${TMPHOME}/.openslx/home" ]; then NETHOME=$(cat "${TMPHOME}/.openslx/home") notempty SHARE_HOME_DRIVE || local SHARE_HOME_DRIVE="H:" # Tab between items, so spaces can be used! @@ -53,25 +50,22 @@ setup_virtual_floppy() { done fi - local NETSHARES="$CONFDIR/netshares" - local RUNSCRIPT="$CONFDIR/runscript" - + declare -r NETSHARES="$CONFDIR/netshares" + declare -r RUNSCRIPT="$CONFDIR/runscript" ## Network shares # openslx.exe expects network shares line in the following format: # <path> <letter> <shortcut> <username> <password> # which is coincidentally the one we received from dmsd :) - if [ -f "$NETSHARES" ] || download_file "$url_lecture_netshares" "$NETSHARES"; then - if [ -s "${NETSHARES}" ]; then - # try to detect if we are running windows and replace '/' with '\' - # in an attempt to fix an improperly given samba path - cmd=(cat) - if [[ "$( tr '[A-Z]' '[a-z]' <<< ${VM_OS_TYPE})" = *windows* ]]; then - cmd=(tr / '\\') - fi - # replace the tag for the username, if present; the variable expansion escapes all ':' in $USER - sed -i "s:%loginuser%:${USER//:/\\:}:g" "${NETSHARES}" - < "${NETSHARES}" "${cmd[@]}" >> "${SHARES}" + if [ -f "$NETSHARES" ] && [ -s "${NETSHARES}" ]; then + # try to detect if we are running windows and replace '/' with '\' + # in an attempt to fix an improperly given samba path + cmd=(cat) + if [[ "$( tr 'A-Z' 'a-z' <<< ${VM_OS_TYPE})" = *windows* ]]; then + cmd=(tr / '\\') fi + # replace the tag for the username, if present; the variable expansion escapes all ':' in $USER + sed -i "s:%loginuser%:${USER//:/\\:}:g" "${NETSHARES}" + < "${NETSHARES}" "${cmd[@]}" >> "${SHARES}" fi ## Runscript @@ -79,17 +73,15 @@ setup_virtual_floppy() { # Check downloaded runscript and handle options like # extension, visibility flag, ... # options are 'key=value' pairs separated with ';' - if [ -f "$RUNSCRIPT" ] || download_file "$url_lecture_runscript" "$RUNSCRIPT"; then - if [ -s "$RUNSCRIPT" ]; then - IFS=$'\n' - for OPT in $(head -n 1 "$RUNSCRIPT" | tr ";" "\n"); do - KEY=$(cut -s -d '=' -f 1 <<< "${OPT^^}") - [ -n "$KEY" ] && OPTIONS["$KEY"]=$(cut -s -d '=' -f 2- <<< "$OPT") - done - unset IFS + if [ -f "$RUNSCRIPT" ] && [ -s "$RUNSCRIPT" ]; then + IFS=$'\n' + for OPT in $( head -n 1 "$RUNSCRIPT" | tr ";" "\n" ); do + KEY=$( cut -s -d '=' -f 1 <<< "${OPT^^}" ) + [ -n "$KEY" ] && OPTIONS["$KEY"]="$( cut -s -d '=' -f 2- <<< "$OPT" )" + done + unset IFS - [ ${OPTIONS[EXT]} ] && [ "x${OPTIONS[EXT]:0:1}" != "x." ] && OPTIONS[EXT]=".${OPTIONS[EXT]}" - fi + [ -n "${OPTIONS[EXT]}" ] && [ "x${OPTIONS[EXT]:0:1}" != "x." ] && OPTIONS[EXT]=".${OPTIONS[EXT]}" fi # Default to muted @@ -113,7 +105,14 @@ setup_virtual_floppy() { SHARE_NO_HOME_WARN=0 fi - cat > "${TMPDIR}/openslx.ini" <<-EOF + # Legacy: openslx.exe expects HOSTRES.TXT + local RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \ + | grep -o -E -m1 '[0-9]+x[0-9]+') + cat > "${FLOPPYDIR}/HOSTRES.TXT" <<-EOF + ${RESOLUTION} + EOF + + cat > "${FLOPPYDIR}/openslx.ini" <<-EOF [openslx] username=${UNAME} resolution=${RESOLUTION} @@ -135,35 +134,43 @@ setup_virtual_floppy() { other=${SHARE_OTHER} EOF - # Copy all them there filez into floppy image - mcopy -i "${SLX_FLOPPY_IMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "${VMCHOOSER_DIR}/data/openslx.exe" "::/" + ln -n -s "${VMCHOOSER_DIR}/data/openslx.exe" "${FLOPPYDIR}/openslx.exe" # If we have a kerberos ticket, copy that one too (TODO: Copy keytab too?) if [ -n "$KRB5CCNAME" ]; then kf=${KRB5CCNAME#FILE:} kf=${kf#file:} if [ -n "$kf" ] && [ -f "$kf" ]; then - mcopy -i "${SLX_FLOPPY_IMG}" "$kf" "::/krb5user.key" + ln -n -s "$kf" "${FLOPPYDIR}/krb5user.key" fi fi - # Copy guest configuration (with added information) config.xml to be accessed - # via virtual floppy - mcopy -i "${SLX_FLOPPY_IMG}" "$XML_FILE" "::/config.xml" - # Copying linux directory: - mcopy -s -i "${SLX_FLOPPY_IMG}" "$VMCHOOSER_DIR/data/linux" "::/" + # Linux directory + ln -n -s "$VMCHOOSER_DIR/data/linux" "${FLOPPYDIR}/linux" # User supplied runscript if [ -n "${OPTIONS[EXT]}" ]; then sed -i '1d' "${RUNSCRIPT}" - mcopy -i "${SLX_FLOPPY_IMG}" "${RUNSCRIPT}" "::/runscript${OPTIONS[EXT]}" + ln -n -s "${RUNSCRIPT}" "${FLOPPYDIR}/runscript${OPTIONS[EXT]}" fi # Admin supplied runscript(s) if [ -d "${CONFDIR}/adminrun" ]; then - mcopy -s -i "${SLX_FLOPPY_IMG}" "${CONFDIR}/adminrun" "::/" + ln -n -s "${CONFDIR}/adminrun" "${FLOPPYDIR}/adminrun" + fi + + # Hook + run_hooks "floppy" "$FLOPPYDIR" + + local size="$( du -s -l -L "${FLOPPYDIR}" | awk '{print $1}' )" + if [ -n "$size" ] && [ "$size" -ge 1400 ]; then + writelog "WARNING: Floppydir contains $size kb of data, will most likely not fit..." fi - rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" + if ! mcopy -s -i "${SLX_FLOPPY_IMG}" "${FLOPPYDIR}"/* "::/"; then + writelog "Error creating floppy image from ${FLOPPYDIR}" + elif ! $DEBUG; then + rm -rf -- "${FLOPPYDIR}" + fi } ## MAIN ## diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt index d8f7d6ba..4a4b8f16 100755 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt @@ -19,16 +19,39 @@ # tools and then include the specific plugin which configures the speci- # fied virtualization tool. ################################################################################ -SELF=$(readlink -f "$0") +SELF="$( readlink -f "${BASH_SOURCE[0]}" )" +if [ -z "$SELF" ] || ! [ -f "$SELF" ]; then + SELF="$( readlink -f "$0" )" +fi +if [ -z "$SELF" ] || ! [ -f "$SELF" ]; then + slxlog "run-virt" "Cannot find SELF" + exit 1 +fi +readonly SELF + +# Useless without this +. /opt/openslx/config + +# Debug mode? +if [ "x$1" = "x--debug" ]; then + shift + DEBUG=true +elif [ "$SLX_DEBUG_MODE" = "ON" ] || grep -qE '\bdebug\b' "/proc/cmdline"; then + DEBUG=true +else + DEBUG=false +fi # This script expects the path to the xml file describing the VM to be started declare -rg XML_FILE="$1" -# A path to the logfile can be given as second argument +# A path to the logfile can be given as second argument (will be set later if empty) declare -g LOGFILE="$2" # Functions needed by vmchooser-run_virt (writelog(), cleanexit(), safesource()) -declare -rg RUN_VIRT_INCLUDE_DIR="$(dirname $SELF)/run-virt-includes" +BASEDIR="$( dirname "${SELF}" )" +RUN_VIRT_INCLUDE_DIR="${BASEDIR}/run-virt-includes" +readonly BASEDIR RUN_VIRT_INCLUDE_DIR if ! source "${RUN_VIRT_INCLUDE_DIR}/vmchooser_runvirt_functions.inc"; then slxlog "run-virt" "Could not source ${RUN_VIRT_INCLUDE_DIR}/vmchooser_runvirt_functions.inc" exit 1 diff --git a/core/modules/run-virt/module.conf b/core/modules/run-virt/module.conf index 77cde6fe..0af71cbe 100644 --- a/core/modules/run-virt/module.conf +++ b/core/modules/run-virt/module.conf @@ -2,6 +2,7 @@ REQUIRED_MODULES=" busybox slxlog + iptables " REQUIRED_BINARIES=" lsusb diff --git a/core/modules/screen-standby/data/etc/X11/Xreset.d/screen-standby b/core/modules/screen-standby/data/etc/X11/Xreset.d/screen-standby deleted file mode 120000 index b25fe082..00000000 --- a/core/modules/screen-standby/data/etc/X11/Xreset.d/screen-standby +++ /dev/null @@ -1 +0,0 @@ -/opt/openslx/scripts/screen-standby
\ No newline at end of file diff --git a/core/modules/screen-standby/data/etc/X11/Xsession.d/screen-standby b/core/modules/screen-standby/data/etc/X11/Xsession.d/screen-standby deleted file mode 120000 index b25fe082..00000000 --- a/core/modules/screen-standby/data/etc/X11/Xsession.d/screen-standby +++ /dev/null @@ -1 +0,0 @@ -/opt/openslx/scripts/screen-standby
\ No newline at end of file diff --git a/core/modules/screen-standby/data/etc/X11/Xsetup.d/screen-standby b/core/modules/screen-standby/data/etc/X11/Xsetup.d/screen-standby deleted file mode 120000 index b25fe082..00000000 --- a/core/modules/screen-standby/data/etc/X11/Xsetup.d/screen-standby +++ /dev/null @@ -1 +0,0 @@ -/opt/openslx/scripts/screen-standby
\ No newline at end of file diff --git a/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby b/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby deleted file mode 100755 index 11691fbd..00000000 --- a/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/ash - -# This is usually sourced by Xstartup/session/reset - -do_standby_stuff () { - . /opt/openslx/config - # Make sure SLX_SCREEN_STANDBY_TIMEOUT is numeric - TO=${SLX_SCREEN_STANDBY_TIMEOUT} - [ -n "${SLX_EXAM}" ] && TO=0 - [ -z "${TO}" ] && TO=0 - [ "${TO}" -gt 0 ] || [ "${TO}" -lt 100 ] || TO=600 - [ "${TO}" -lt 0 ] && TO=0 - MIN=$(( TO / 60 )) - [ "$MIN" -gt 60 ] && MIN=60 - # Set - setterm -blank "$MIN" - setterm -powerdown "$MIN" - if [ "${TO}" = 0 ]; then - # Off - xset s "${TO}" "${TO}" - xset s off -dpms - else - xset +dpms - xset s "${TO}" "${TO}" - fi -} - -do_standby_stuff & -true - diff --git a/core/modules/screen-standby/module.build b/core/modules/screen-standby/module.build deleted file mode 100644 index 8de1bdd1..00000000 --- a/core/modules/screen-standby/module.build +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -fetch_source() { - : -} - -build() { - - for BIN in $REQUIRED_BINARIES; do - BIN_LOCATION=$(which ${BIN}) - if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ]; then - tarcopy "$(get_link_chain ${BIN_LOCATION})" "${MODULE_BUILD_DIR}" - else - perror "'${BIN}' not found on the system." - fi - done - - COPYLIST="list_dpkg_output" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" -} - -post_copy() { - : -} diff --git a/core/modules/screen-standby/module.conf b/core/modules/screen-standby/module.conf deleted file mode 100644 index 1e03a8b8..00000000 --- a/core/modules/screen-standby/module.conf +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -REQUIRED_MODULES=" - xorg -" -REQUIRED_BINARIES=" - setterm - xset -" -REQUIRED_LIBRARIES="" -REQUIRED_DIRECTORIES=" -" diff --git a/core/modules/xorg/module.conf.ubuntu.18 b/core/modules/xorg/module.conf.ubuntu.18 index 1d340d94..fea91625 100644 --- a/core/modules/xorg/module.conf.ubuntu.18 +++ b/core/modules/xorg/module.conf.ubuntu.18 @@ -6,8 +6,8 @@ REQUIRED_INSTALLED_PACKAGES=" ttf-dejavu-core xserver-xorg$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-core$UBUNTU_XORG_PKG_SUFFIX - libgl1-mesa-dri$UBUNTU_XORG_PKG_SUFFIX - libgl1-mesa-glx$UBUNTU_XORG_PKG_SUFFIX + libgl1-mesa-dri + libgl1-mesa-glx libglx0 libegl1 libegl1-mesa @@ -28,7 +28,6 @@ REQUIRED_INSTALLED_PACKAGES=" xserver-xorg-video-radeon$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-intel$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-nouveau$UBUNTU_XORG_PKG_SUFFIX - xserver-xorg-video-sisusb$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-vesa$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-vmware$UBUNTU_XORG_PKG_SUFFIX " @@ -39,11 +38,12 @@ REQUIRED_CONTENT_PACKAGES=" ttf-dejavu-core xserver-xorg$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-core$UBUNTU_XORG_PKG_SUFFIX - libgl1-mesa-dri$UBUNTU_XORG_PKG_SUFFIX - libgl1-mesa-glx$UBUNTU_XORG_PKG_SUFFIX + libgl1-mesa-dri + libgl1-mesa-glx libglx0 libglx-mesa0 libxcb-glx0 + @libgbm1 libegl1 libegl1-mesa libgbm1 @@ -63,7 +63,6 @@ REQUIRED_CONTENT_PACKAGES=" xserver-xorg-video-radeon$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-intel$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-nouveau$UBUNTU_XORG_PKG_SUFFIX - xserver-xorg-video-sisusb$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-vesa$UBUNTU_XORG_PKG_SUFFIX xserver-xorg-video-vmware$UBUNTU_XORG_PKG_SUFFIX @xserver-xorg-input-mouse$UBUNTU_XORG_PKG_SUFFIX diff --git a/core/modules/xscreensaver/module.build b/core/modules/xscreensaver/module.build index 676def43..e7e60e26 100644 --- a/core/modules/xscreensaver/module.build +++ b/core/modules/xscreensaver/module.build @@ -10,8 +10,10 @@ build() { mkdir -p "${MODULE_BUILD_DIR}/usr/bin" cde "$SRCDIR/xscreensaver" pinfo "Building xscreensaver" + # Disable DPMS handling since we're using idle-daemon + # which accounts for our beautiful vmware ungrab crap ./configure --enable-locking --disable-root-passwd \ - --with-dpms-ext --with-xinput-ext --with-xf86vmode-ext \ + --without-dpms-ext --with-xinput-ext --with-xf86vmode-ext \ --with-randr-ext --with-pam --with-login-manager \ --prefix=/usr --without-proc-interrupts $REQUIRED_CONFIGURE_OPTIONS \ || perror "'./configure' failed" diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network b/core/rootfs/rootfs-stage31/data/inc/setup_network index 1f7b2ec0..3e17cf85 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_network +++ b/core/rootfs/rootfs-stage31/data/inc/setup_network @@ -38,7 +38,7 @@ $IP_OUT --- Boot interface $MAC not found in interface list. NIC driver missing? -Check output of dmesg for missing firmware (dmesg | less)" +Check output of dmesg for missing firmware (dmesg | more)" : fi diff --git a/core/rootfs/rootfs-stage32/module.conf b/core/rootfs/rootfs-stage32/module.conf index 536d8d75..fd1347f2 100644 --- a/core/rootfs/rootfs-stage32/module.conf +++ b/core/rootfs/rootfs-stage32/module.conf @@ -39,8 +39,6 @@ REQUIRED_BINARIES=" bc dirname mkdosfs - iptables - ip6tables rdns find rpcbind diff --git a/core/rootfs/rootfs-stage32/module.conf.ubuntu b/core/rootfs/rootfs-stage32/module.conf.ubuntu index 7a66387a..b4598fe5 100644 --- a/core/rootfs/rootfs-stage32/module.conf.ubuntu +++ b/core/rootfs/rootfs-stage32/module.conf.ubuntu @@ -18,9 +18,6 @@ REQUIRED_CONTENT_PACKAGES=" REQUIRED_BINARIES+=" openssl " -REQUIRED_SYSTEM_FILES+=" - /usr/lib/x86_64-linux-gnu/xtables -" REQUIRED_FILES+=" /etc/X11/app-defaults/Xvidtune /usr/lib/ssl/openssl.cnf diff --git a/core/targets/nvidia-libs@NVIDIA_VERSIONS/kernel b/core/targets/nvidia-libs@NVIDIA_VERSIONS/kernel new file mode 120000 index 00000000..1369e8ff --- /dev/null +++ b/core/targets/nvidia-libs@NVIDIA_VERSIONS/kernel @@ -0,0 +1 @@ +../../modules/kernel-vanilla
\ No newline at end of file diff --git a/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-common b/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-common new file mode 120000 index 00000000..b44a22fe --- /dev/null +++ b/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-common @@ -0,0 +1 @@ +../../modules/nvidia-common
\ No newline at end of file diff --git a/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-libs b/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-libs new file mode 120000 index 00000000..9b2ea56f --- /dev/null +++ b/core/targets/nvidia-libs@NVIDIA_VERSIONS/nvidia-libs @@ -0,0 +1 @@ +../../modules/nvidia-libs
\ No newline at end of file diff --git a/core/targets/nvidia_libs/nvidia_libs b/core/targets/nvidia_libs/nvidia_libs deleted file mode 120000 index 27f398eb..00000000 --- a/core/targets/nvidia_libs/nvidia_libs +++ /dev/null @@ -1 +0,0 @@ -../../modules/nvidia_libs
\ No newline at end of file diff --git a/core/targets/stage31/nvidia-common b/core/targets/stage31/nvidia-common new file mode 120000 index 00000000..b44a22fe --- /dev/null +++ b/core/targets/stage31/nvidia-common @@ -0,0 +1 @@ +../../modules/nvidia-common
\ No newline at end of file diff --git a/core/targets/stage31/nvidia-kernel b/core/targets/stage31/nvidia-kernel new file mode 120000 index 00000000..41abd1ca --- /dev/null +++ b/core/targets/stage31/nvidia-kernel @@ -0,0 +1 @@ +../../modules/nvidia-kernel
\ No newline at end of file diff --git a/core/targets/stage31/nvidia_kernel b/core/targets/stage31/nvidia_kernel deleted file mode 120000 index be4a96a8..00000000 --- a/core/targets/stage31/nvidia_kernel +++ /dev/null @@ -1 +0,0 @@ -../../modules/nvidia_kernel
\ No newline at end of file diff --git a/core/targets/stage32-bwlp/iptables b/core/targets/stage32-bwlp/iptables new file mode 120000 index 00000000..1f5e94e4 --- /dev/null +++ b/core/targets/stage32-bwlp/iptables @@ -0,0 +1 @@ +../../modules/iptables
\ No newline at end of file diff --git a/core/targets/stage32-bwlp/screen-standby b/core/targets/stage32-bwlp/screen-standby deleted file mode 120000 index 7930482f..00000000 --- a/core/targets/stage32-bwlp/screen-standby +++ /dev/null @@ -1 +0,0 @@ -../../modules/screen-standby
\ No newline at end of file |