diff options
Diffstat (limited to 'core/modules')
9 files changed, 76 insertions, 67 deletions
diff --git a/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf b/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf new file mode 100644 index 00000000..2f8aed56 --- /dev/null +++ b/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf @@ -0,0 +1,7 @@ +[Login] +KillUserProcesses=yes +KillExcludeUsers=root +IdleAction=ignore +HandleLidSwitch=ignore +HandleLidSwitchDocked=ignore + diff --git a/core/modules/lightdm-greeter-bwlp/data/etc/systemd/system/lightdm.service.d/download-news.conf b/core/modules/lightdm-greeter-bwlp/data/etc/systemd/system/lightdm.service.d/download-news.conf new file mode 100644 index 00000000..c0ab14cb --- /dev/null +++ b/core/modules/lightdm-greeter-bwlp/data/etc/systemd/system/lightdm.service.d/download-news.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=-/opt/openslx/scripts/lightdm-download_news diff --git a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-download_news b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-download_news new file mode 100755 index 00000000..c1d7c97a --- /dev/null +++ b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-download_news @@ -0,0 +1,36 @@ +#!/bin/ash + +. /opt/openslx/config + +. /opt/openslx/bin/slx-tools + +dlfile="/tmp/news-raw.$$$RANDOM" +newsfile="/opt/openslx/lightdm/news.html" + +if [ -n "$SLX_VMCHOOSER_BASE_URL" ]; then + URL="$SLX_VMCHOOSER_BASE_URL" +elif [ -n "$SLX_PXE_SERVER_IP" ]; then + URL="http://$SLX_PXE_SERVER_IP/vmchooser/" +else + exit 0 +fi + +download_retry -o "$dlfile" "$URL/login-news" + +if [ -s "$dlfile" ]; then + hl="$( xml_get "//news/headline" "$dlfile" | str_trim )" + body="$( xml_get "//news/info" "$dlfile" | str_trim )" + if [ "${#hl}${#body}" != "00" ]; then + printf "%s" "<h1>$hl</h1>$body" > "$newsfile" + mkdir -p "/etc/lightdm/qt-lightdm-greeter.conf.d" + cat > "/etc/lightdm/qt-lightdm-greeter.conf.d/10-bwlp-news.conf" <<EOF +[General] +news-html-file = $newsfile +EOF + fi +fi + +rm -f -- "$dlfile" + +exit 0 + diff --git a/core/modules/nvidia-common/module.build b/core/modules/nvidia-common/module.build index 9bf73af8..bed7f4ca 100644 --- a/core/modules/nvidia-common/module.build +++ b/core/modules/nvidia-common/module.build @@ -72,7 +72,7 @@ build() { 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/pam-slx-plug/data/opt/openslx/scripts/pam_script_ses_close.d/zz-killall-umount b/core/modules/pam-slx-plug/data/opt/openslx/scripts/pam_script_ses_close.d/zz-killall-umount deleted file mode 100644 index 0d226acc..00000000 --- a/core/modules/pam-slx-plug/data/opt/openslx/scripts/pam_script_ses_close.d/zz-killall-umount +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/ash -- sourced - -# do not kill all root processes :) -[ "x${PAM_USER}" = "xroot" ] && return 0 - -USERID=$(id -u "$PAM_USER") -[ -z "$USERID" ] && USERID="$PAM_USER" - -# Async block: Check if user has no session open anymore, if not -# kill any remaining processes belonging to the user and unmount -# everything at $USERHOME and below. -{ - sleep 2 # Give things some time - # Use who (utmp) to determine sessions by the user. loginctl might be nicer, but - # a simple show-user $USER will also include detached sessions (eg. screen) which - # makes this quite pointless. This needs to be investigated some day. - SESSIONCOUNT=$(who | grep "^${PAM_USER}\\s" | wc -l) - if [ "$SESSIONCOUNT" = "0" ]; then - - # last session, close all ghost user processes - pkill -u "${USERID}" - - # check if user's processes are still running - for TIMEOUT in 1 1 1 FAIL; do - if ! ps -o pid,s -u "$USERID" -U "$USERID" | grep -q -v -E "PID|Z"; then - # nothing running anymore - break - fi - if [ "$TIMEOUT" = "FAIL" ]; then - # still something running, send SIGKILL - pkill -9 -u "${USERID}" - else - # give some time - sleep "${TIMEOUT}" - fi - done - - fi - - # just to be sure we check again, since the pkilling above might have taken some time... - SESSIONCOUNT=$(who | grep "^${PAM_USER}\\s" | wc -l) - if [ "$SESSIONCOUNT" = "0" ]; then - - # unmount the home directory structure - USER_HOME=$(getent passwd "$USERID" | awk -F ':' '{print $6}') - if [ -n "$USER_HOME" ]; then - for TIMEOUT in 0 0 1 2 FAIL; do - OK=yes - UOPT= - [ "$TIMEOUT" = "FAIL" ] && UOPT="-l" - for dir in $( < "/proc/mounts" awk '{print $2}' | grep -e "^${USER_HOME}\$" -e "^${USER_HOME}/" | sort -r ); do - umount $UOPT "$dir" || OK=no # no quotes - done - [ "$TIMEOUT" = "FAIL" -o "$OK" = "yes" ] && break - sleep "$TIMEOUT" - done - fi - - fi - -} & - -true - diff --git a/core/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials b/core/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials index cdf5ed2c..613c66ca 100644 --- a/core/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials +++ b/core/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials @@ -8,7 +8,7 @@ if [ -n "$TEMP_HOME_DIR" ]; then PERSISTENT_NETPATH=$(grep -m1 -F " ${PERSISTENT_HOME_DIR} " "/proc/mounts" | awk '{print $1}') fi if [ -n "$PERSISTENT_NETPATH" ]; then - [ "x${PERSISTENT_NETPATH:0:2}" = "x//" ] && PERSISTENT_NETPATH=$(echo "$PERSISTENT_NETPATH" | tr '/' '\') + [ "x${PERSISTENT_NETPATH:0:2}" = "x//" ] && PERSISTENT_NETPATH=$(echo "$PERSISTENT_NETPATH" | tr '/' '\\') echo "${PERSISTENT_NETPATH}" > "${TEMP_HOME_DIR}/.openslx/home" chmod 0644 "${TEMP_HOME_DIR}/.openslx/home" fi diff --git a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode index 4c3195f7..eeaf34b1 100755 --- a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode +++ b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode @@ -31,7 +31,8 @@ systemd_config() { # No idleaction rm -- "/etc/cron.d/openslx-idleaction" # Ignore everything but power button, no VTs - cat > "${FUTURE_ROOT}/etc/systemd/logind.conf" <<EOF + mkdir -p "/etc/systemd/logind.conf.d" + cat > "/etc/systemd/logind.conf.d/99-exam.conf" <<EOF [Login] NAutoVTs=0 ReserveVT=0 diff --git a/core/modules/slx-tools/module.build b/core/modules/slx-tools/module.build new file mode 100644 index 00000000..6d6ec4cf --- /dev/null +++ b/core/modules/slx-tools/module.build @@ -0,0 +1,13 @@ +#!/bin/bash +fetch_source() { + autoclone +} + +build() { + cde "${MODULE_WORK_DIR}/src/slx-tools" + ./make.sh "$REQUIRED_BASE_DIR" || perror "Could not generate slx-tools" + mkdir -p "$MODULE_BUILD_DIR/opt/openslx/"{bin,slx-tools} + cp slx-tools "$MODULE_BUILD_DIR/opt/openslx/bin/slx-tools" || perror "Could not copy slx-tools main script" + cp -r modules "$MODULE_BUILD_DIR/opt/openslx/slx-tools/modules" || perror "Could not copy slx-tools modules" +} + diff --git a/core/modules/slx-tools/module.conf b/core/modules/slx-tools/module.conf new file mode 100644 index 00000000..461760ca --- /dev/null +++ b/core/modules/slx-tools/module.conf @@ -0,0 +1,14 @@ +#!/bin/bash + +REQUIRED_GIT="https://git.openslx.org/openslx-ng/slx-tools.git" + +REQUIRED_BASE_DIR="/opt/openslx/slx-tools" + +REQUIRED_FILES=" + /opt/openslx/bin/slx-tools +" + +REQUIRED_DIRECTORIES=" + $REQUIRED_BASE_DIR/modules +" + |