diff options
author | Manuel Schneider | 2014-09-30 15:01:05 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-09-30 15:01:05 +0200 |
commit | 930cd28a80eaaf66d499efc72a5f938d6b9d5e6d (patch) | |
tree | 4056c08a5fa07e117ca05eac223a0e6e2445b76c | |
parent | [cups] Do not accept color jobs on BW printers (diff) | |
parent | [alsa] Disable alsa config generation - breaks vmware mic input (diff) | |
download | tm-scripts-930cd28a80eaaf66d499efc72a5f938d6b9d5e6d.tar.gz tm-scripts-930cd28a80eaaf66d499efc72a5f938d6b9d5e6d.tar.xz tm-scripts-930cd28a80eaaf66d499efc72a5f938d6b9d5e6d.zip |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
19 files changed, 554 insertions, 167 deletions
diff --git a/remote/modules/alsa/data/etc/systemd/system/alsa-default-card.service b/remote/modules/alsa/data/etc/systemd/system/alsa-default-card.service new file mode 100644 index 00000000..db35eeb7 --- /dev/null +++ b/remote/modules/alsa/data/etc/systemd/system/alsa-default-card.service @@ -0,0 +1,11 @@ +[Unit] +Description=Set default card ALSA will use +DefaultDependencies=no +After=tmp.target +Wants=tmp.target + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/alsa-default_card +RemainAfterExit=yes + diff --git a/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card b/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card new file mode 100755 index 00000000..4edfcdd5 --- /dev/null +++ b/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card @@ -0,0 +1,47 @@ +#!/bin/ash + +PROC="/proc/asound/cards" + +if [ ! -r "$PROC" ]; then + echo "'${PROC}' not found or not readable." + exit 1 +fi + +if [ -w "/etc" ]; then + FILE="/etc/asound.conf" +elif [ -n "$HOME" ]; then + FILE="${HOME}/.asoundrc" +else + FILE="$(getent passwd root | awk -F ':' '{print $6}')/.asoundrc" +fi + +if [ -e "${FILE}" -a "x$1" != "x--force" ]; then + echo "'${FILE}' already exists, use --force to overwrite." + exit 1 +fi + +# Try to filter HDMI cards first +CARD=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1) +# If empty, try again with all +[ -z "${CARD}" ] && CARD=$(cat "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1) + +if [ -z "${CARD}" ]; then + echo "No sound card found." + exit 1 +fi + +cat > "${FILE}" <<HEREDOC +pcm.!default { + type hw + card $CARD +} +ctl.!default { + type hw + card $CARD +} +timer.!default { + type hw + card $CARD +} +HEREDOC + diff --git a/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter b/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter index 0ee6e274..503e44fa 100755 --- a/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter +++ b/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter @@ -36,15 +36,15 @@ XRANDRV=$( xrandr --verbose ) echo "$XRANDR" #echo "$XRANDRV" -# Get the names of the connected outputs +# Get the names of the connected outputs # This is a rigid approach to determine the connected outputs declare -a OUTPUTNAMES while read line; do - OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") -done < <( echo "$XRANDR" | grep -E ".*[[:digit:]]{1,}mm x [[:digit:]]{1,}mm" ) + OUTPUTNAMES+=("$(awk '{print $1}' <<<"$line" )") +done < <( echo "$XRANDR" | grep -E "[[:digit:]]+mm x [[:digit:]]+mm" ) echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" -# The goal is to add more modelines to the X server. While this is done the +# The goal is to add more modelines to the X server. While this is done the # screen is flickering. Hence this is just necessary if there is a beamer. Do # the flickering magic only if there are two outputs and one is a projector. @@ -54,15 +54,15 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then echo "Two outputs detected." # Either of them a projector? - if ( echo "$XRANDR" | grep -E "^${OUTPUTNAMES[0]}.*0mm x 0mm" > /dev/null \ - || echo "$XRANDR" | grep -E "^${OUTPUTNAMES[1]}.*0mm x 0mm" > /dev/null ) - then - - # Check which of the outputs is the beamer. - if [ -n "$(echo "$XRANDR" | grep -E "^${OUTPUTNAMES[0]}.*0mm x 0mm")" ] - then BEAMER=0; - else BEAMER=1; - fi + BEAMER= + for i in 0 1; do + WIDTH=$(grep -E "^${OUTPUTNAMES[$i]}.*[0-9]+mm x [0-9]+mm" <<<"$XRANDR" | head -n 1 | grep -o -E ' [0-9]+mm x' | grep -o -E '[0-9]+') + if [ -z "$WIDTH" ] || [ "$WIDTH" -eq 0 ] || [ "$WIDTH" -gt 900 ]; then + echo "Screen $i is beamer, width is '$WIDTH'" + BEAMER=$i + fi + done + if [ -n "$BEAMER" ]; then echo "${OUTPUTNAMES[$BEAMER]} is a beamer. " # Create all modes, so that X knows them by name "<width>x<height>" @@ -75,7 +75,7 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then echo -e "\e[31mFailed to create mode ${i%% *}!\e[0m" fi - for j in "${OUTPUTNAMES[@]}"; do + for j in "${OUTPUTNAMES[@]}"; do if xrandr --current --addmode $j $(echo $i| awk '{print $1;}'); then echo -e "Added mode ${i%% *} to $j." else @@ -111,17 +111,17 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then elif [[ -f "$CONFIGFILE" ]]; then - echo "Config file found." + echo "Config file found." # Get local ip . /opt/openslx/config # Try to get a probed mode PROBEDMODE=$(cat $CONFIGFILE | grep $SLX_PXE_CLIENT_IP | cut -d '=' -f2) - + # If a probed mode was found, .. if [[ -n "$PROBEDMODE" ]]; then - echo "Probed mode found in config file." + echo "Probed mode found in config file." # Apply the probed mode from the config file if xrandr \ --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $PROBEDMODE \ @@ -143,7 +143,7 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then --output ${OUTPUTNAMES[$BEAMER]} --mode 1024x768 \ --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} fi - else + else # In case of two monitors just sort the outputs lexicographically and apply # the preffered resolution echo "Dualhead setup deteced. Sorting outputs lexicographically." @@ -162,3 +162,4 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then else echo "\e[32mOther than two outputs.\e[0m" fi + diff --git a/remote/modules/cups/module.build b/remote/modules/cups/module.build index 0238f1bd..0128c3e6 100644 --- a/remote/modules/cups/module.build +++ b/remote/modules/cups/module.build @@ -5,12 +5,17 @@ fetch_source() { } build() { + local COPYLIST file COPYLIST="list_dpkg_output" [ -e "$COPYLIST" ] && rm "$COPYLIST" list_packet_files >> "$COPYLIST" tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + # cups insists on overriding PATH, so we need to fix any scripts + for file in "${MODULE_BUILD_DIR}"/usr/lib/cups/{filter,backend}/*; do + head -n 1 "$file" | grep -q '^#!/' && sed -i '/^#!\//a . \/etc\/environment' "$file" + done } post_copy() { diff --git a/remote/modules/cups/module.conf b/remote/modules/cups/module.conf index 2b904358..513389b5 100644 --- a/remote/modules/cups/module.conf +++ b/remote/modules/cups/module.conf @@ -6,5 +6,7 @@ REQUIRED_BINARIES=" REQUIRED_DIRECTORIES=" /usr/lib/cups/ /usr/share/cups/ + /usr/share/ghostscript/ + /usr/bin/ " REQUIRED_FILES="" diff --git a/remote/modules/cups/module.conf.ubuntu.14 b/remote/modules/cups/module.conf.ubuntu.14 index 23dcf226..23207e5b 100644 --- a/remote/modules/cups/module.conf.ubuntu.14 +++ b/remote/modules/cups/module.conf.ubuntu.14 @@ -5,6 +5,7 @@ REQUIRED_INSTALLED_PACKAGES=" cups-core-drivers cups-filters-core-drivers ghostscript + libgs9-common " REQUIRED_CONTENT_PACKAGES=" cups @@ -13,4 +14,5 @@ REQUIRED_CONTENT_PACKAGES=" cups-core-drivers cups-filters-core-drivers ghostscript + libgs9-common " diff --git a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc index 196e1ce7..0b283d2a 100644 --- a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc +++ b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc @@ -27,6 +27,8 @@ UseAdminSession=false AllowRootLogin=true AllowShutdown=All AutoLoginEnable=false +AutoLoginAgain=true +AutoLoginDelay=5 ServerAttempts=2 # Custom directory so kdm never sees any other sessions - it's up to the vmchooser to list them SessionsDirs=/opt/openslx/xsessions diff --git a/remote/modules/kdm/data/etc/systemd/system/kdm.service b/remote/modules/kdm/data/etc/systemd/system/kdm.service index 4f8ba944..e77d1cbd 100644 --- a/remote/modules/kdm/data/etc/systemd/system/kdm.service +++ b/remote/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 +After=systemd-user-sessions.service getty@tty7.service setup-slx-addon@nvidia_libs.service setup-slx-addon@vmware.service [Service] ExecStartPre=-/opt/openslx/bin/killall fbsplash diff --git a/remote/modules/kernel-vanilla/module.build b/remote/modules/kernel-vanilla/module.build new file mode 100644 index 00000000..f1dc10bd --- /dev/null +++ b/remote/modules/kernel-vanilla/module.build @@ -0,0 +1,146 @@ +# Customized kernel from system: fetch Distro's kernel sources, patch configuration, recompile + +# This overrides get_kernel_version from kernel.inc, so the variables will be set properly +get_kernel_version() { + # Do not use MODULE_DIR here as this function might run when we process another module! + [ -n "${TARGET_KERNEL_LONG}" ] && return 0 + [ ! -e "${TARGET_DIR}/kernel/ksrc/include/generated/utsrelease.h" ] && return 0 + # determine kernel version that will be running in the generated system + + # declare kernel version stuff + declare -rg TARGET_KERNEL_LONG=$(grep 'UTS_RELEASE' "${TARGET_DIR}/kernel/ksrc/include/generated/utsrelease.h" | awk -F '"' '{print $2}') + declare -rg TARGET_KERNEL_SHORT=$(echo "$TARGET_KERNEL_LONG" | grep -o -E '^[0-9\.]+') + + # declare path to kernel headers and modules/firmware + declare -rg KERNEL_HEADERS_DIR="${TARGET_DIR}/kernel/ksrc" + declare -rg KERNEL_BASE_DIR="${TARGET_DIR}/kernel/build" + + # print debug info + pinfo "TARGET_KERNEL_LONG: '$TARGET_KERNEL_LONG'" + pinfo "TARGET_KERNEL_SHORT: '$TARGET_KERNEL_SHORT'" + pdebug "KERNEL_BASE_DIR: '$KERNEL_BASE_DIR'" +} + +fetch_source() { + pdebug "getting kernel sources via git ...." + [ -d ./ksrc ] && rm -rf ./ksrc + git clone --depth 1 "${REQUIRED_GIT}" -b "v${REQUIRED_KERNEL}" ksrc || perror "Could not clone kernel git." + # check for aufs + local RSL=$(find ksrc/ -type d -name aufs) + if [ -z "$RSL" ]; then + pinfo "aufs not found in kernel sources, patching it..." + patch_aufs + else + pinfo "aufs detected in kernel source :)" + fi + # remember the current kernel version + echo "${SYSTEM_KERNEL_LONG}" > ksrc/KVERSION +} + +build() { + local TARGET_CONFIG_FILE="openslx.config" + rm -f "${TARGET_CONFIG_FILE}" + # update config and copy to ksrc + pinfo "Updating kernel config..." + update_config + cp "${TARGET_CONFIG_FILE}" "ksrc/.config" + # make kernel with the new config + cd ksrc || perror "Could not cd to ksrc, was the kernel source fetched properly?" + pinfo "Preparing kernel for new config ('make oldconfig')." + if [ "x$MLTK_QUIET" = "x1" ]; then + yes "" | make oldconfig || perror "make oldconfig failed." + else + make oldconfig || perror "make oldconfig failed." + fi + make prepare || perror "make prepare failed." + make scripts || perror "make scripts failed." + + pinfo "Compiling kernel... (this will take some time)" + # explicitly state number of cores here, as MAKEFLAGS seems to be overridden + make "-j$CPU_CORES" || perror "make failed." + + # install modules to build directory + pinfo "Installing kernel modules..." + if [ -d "${MODULE_BUILD_DIR}/lib/modules" ]; then + rm -r "${MODULE_BUILD_DIR}/lib/modules" || pwarning "Could not clean old modules." + fi + make INSTALL_MOD_PATH="${MODULE_BUILD_DIR}" INSTALL_MOD_STRIP=1 modules_install || perror "make modules_install failed in ${MODULE_BUILD_DIR}." + cd - 2> /dev/null + + # copy kernel to build + cp ksrc/arch/x86/boot/bzImage "${MODULE_BUILD_DIR}/kernel" + pinfo "Kernel was successfully built at ${MODULE_BUILD_DIR}/kernel" + [ -z "${KERNEL_BUILD_DIR}" ] && KERNEL_BUILD_DIR="${MODULE_BUILD_DIR}" +} + +post_copy() { + : +} + +# helper function to update the current kernel config with our parameters +update_config() { + + # first we need to update the current config + local BASE_CONFIG_FILE="/boot/config-$(uname -r)" + [ -e "${BASE_CONFIG_FILE}" ] || perror "$BASE_CONFIG_FILE could not be found! This should not happen." + + # check for our wanted config parameter + local OPENSLX_WANTED_CONFIG="${ROOT_DIR}/data/kernel.wanted.config" + + [ -e "${OPENSLX_WANTED_CONFIG}" ] || perror "$OPENSLX_WANTED_CONFIG does not exist! Please add a list of wanted kernel config parameters." + + # copy basic config file + cp "$BASE_CONFIG_FILE" "$TARGET_CONFIG_FILE" + + for WANTED_CONFIG in $(cat $OPENSLX_WANTED_CONFIG|sort -u); do + local CONFIG_PARAM_NAME="$(echo $WANTED_CONFIG | awk -F "=" '{print $1}')" + local SEARCH_RESULT="$(grep -E "^\s*$(echo "$CONFIG_PARAM_NAME" | escape_search)=" "$BASE_CONFIG_FILE")" + + #echo "Process: $SEARCH_RESULT" + # analyse results + if [ "x$SEARCH_RESULT" == "x" ]; then + # no match, add it + sed -i -r "s/^\s*#.*\s$(echo "$CONFIG_PARAM_NAME" | escape_search)[^_A-Z0-9].*$//" "$TARGET_CONFIG_FILE" + echo "$WANTED_CONFIG" >> "$TARGET_CONFIG_FILE" + else + # match, change to our setting if they differ + if [ "x$SEARCH_RESULT" != "x$WANTED_CONFIG" ]; then + sed -i "s/$(echo "$SEARCH_RESULT" | escape_search)/$(echo "$WANTED_CONFIG" | escape_replace)/" "$TARGET_CONFIG_FILE" + fi + fi + done +} + +# helper to patch aufs +patch_aufs() { + pinfo "Cloning aufs3 standalone git" + cd "$MODULE_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." + # get the needed version + [ -n "${SYSTEM_KERNEL_LONG}" ] && local NEEDED_BRANCH=$(echo $REQUIRED_KERNEL | awk -F "." '{print $1"."$2}') \ + || perror "REQUIRED_KERNEL not set, this should not happen!" + pinfo "Getting branch origin/$NEEDED_BRANCH" + cd "$MODULE_DIR/aufs3-standalone" || perror "Could not CD to aufs3-standalone" + git checkout "origin/aufs$NEEDED_BRANCH" || perror "Could not checkout needed branch." + pinfo "Starting to patch... $NEEDED_BRANCH" + tarcopy "Documentation fs" "$MODULE_DIR/ksrc" + + # Quick-and-dirty aufs_type.h copying: + [ -e "include/linux/aufs_type.h" ] && cp "include/linux/aufs_type.h" "$MODULE_DIR/ksrc/include/linux/" + [ -e "include/uapi/linux/aufs_type.h" ] && cp "include/uapi/linux/aufs_type.h" "$MODULE_DIR/ksrc/include/uapi/linux/" + + cd "$MODULE_DIR/ksrc" || perror "Could not CD to kernel-source dir ksrc" + + patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-kbuild.patch" || perror "aufs3-standalone/aufs3-kbuild.patch failed!" + patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-base.patch" || perror "aufs3-standalone/aufs3-base.patch failed!" + + # this following 'if' is a burning shame - caused as patching under eg. openSuse 13.1 is always unsuccessful due to hunk failing + if [ -f "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" ]; then + patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" || pwarning "Problem patching aufs3-mmap.patch: hunks failed?" + fi + pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}" + cd "$MODULE_DIR" +} + diff --git a/remote/modules/kernel-vanilla/module.conf b/remote/modules/kernel-vanilla/module.conf new file mode 100644 index 00000000..9eef1e85 --- /dev/null +++ b/remote/modules/kernel-vanilla/module.conf @@ -0,0 +1,5 @@ +REQUIRED_BINARIES="" +REQUIRED_LIBRARIES="" +REQUIRED_DIRECTORIES="" +REQUIRED_KERNEL="3.14.3" +REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt index d93bcd51..231ef6fe 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -139,25 +139,25 @@ filecheck () ################################################################################ ## Added for persistent support. -diskmode='nonpersistent' && \ +diskmode='nonpersistent' if [[ "$(grep --extended-regexp \ '< *short_description *param=".+ --persistent--"' "$1")" ]]; then - diskmode='persistent' && \ - imageFilePath="$(grep -io '<image_name param=.*"' "$1" \ - | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" && \ + diskmode='persistent' + imageFilePath="$(grep -io '<image_path param=.*"' "$1" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" + [ -z "$imageFilePath" ] && imageFilePath="$(grep -io '<image_name param=.*"' "$1" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" originalXMLFilePath="$(grep -io '<original_xml_file_path param=.*"' "$1" \ - | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" && \ + | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" originalImageFileName="$(grep -io '<image_name param=.*"' \ "$originalXMLFilePath" | sed -e "s/&.*;/; /g" | awk -F '"' \ - '{ print $2 }')" && \ + '{ print $2 }')" originalVMDKFilePath="$(dirname \ - "$originalXMLFilePath")/${originalImageFileName}" && \ + "$originalXMLFilePath")/${originalImageFileName}" # Added to workaround path prefix coming from temporary generated xml file # by vmchooser. if [[ "$(grep --extended-regexp '^/tmp/tmp\.[^\/]+/' <<< \ "$imageFilePath")" ]]; then imageFilePath=$(sed -r 's/^\/?tmp\/[^\/]+\///g' \ - <<< "$imageFilePath") && \ + <<< "$imageFilePath") sed -ir \ "s/(<image_name param=\")[^\"]*(\")/\\1$(sed -e \ 's/\\/\\\\/g' -e 's/\//\\\//g' -e \ @@ -236,7 +236,9 @@ writelog "Enable 3D:\t\t${enable3d}" writelog "VM config:" # Name of the virt image -imgname=$(grep -io '<image_name param=.*"' "${xmlfile}" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }') +imgname=$(grep -io '<image_path param=.*"' "${xmlfile}" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }') +imgrelpath=$(grep -io '<image_name param=.*"' "${xmlfile}" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }') +[ -z "$imgname" ] && imgname="${imgrelpath}" ## Added for persistent support. if [[ "$userBranchFilePath" ]]; then @@ -244,7 +246,7 @@ if [[ "$userBranchFilePath" ]]; then fi ## -# Imagename /w full path +# Imagename w/ full path if echo "${imgname}" | grep -q '^/'; then imgpath="$(dirname "${imgname}")" imgname="$(basename "${imgname}")" @@ -345,8 +347,6 @@ writelog "\tVM short name:\t\t$vm_shortname" ### Declaration of default variables ############################################################################### -# VM-ID static (00) -VM_ID="00" # take last two digits of current pid... VM_ID=$(expr substr $$ $(expr ${#$} - 1) 2) @@ -454,7 +454,7 @@ QUEUE="STANDARD" # This has to match the queue you configured in your VM USER="$(whoami)" SPOOLDIR= ### Disabled: 100megs is not enough, some jobs are HUGE, try to use temp which should be on disk -## Try using users tmpfs home first, as it gets wiped on logout +## Try using user's tmpfs home first, as it gets wiped on logout #if [ -n "${HOME}" ] && [ -w "${HOME}" ]; then # SPOOLDIR="${HOME}/.spool" # mkdir -p "${SPOOLDIR}/${QUEUE}" @@ -467,6 +467,7 @@ if [ -z "${SPOOLDIR}" ] || [ ! -w "${SPOOLDIR}/${QUEUE}" ]; then slxlog "virt-spooldir" "Could not create spool directory ($SPOOLDIR) for $USER - printing will not work!" # TODO: Warn user fi + chmod 0700 "${SPOOLDIR}/${QUEUE}" fi # Start the lpdaemon listening on the given port @@ -496,7 +497,7 @@ if [ -n "$SLX_DNBD3_SERVERS" -o -n "$SLX_DNBD3_PRIO_SERVERS" ] && [ "x$SLX_VM_DN # Shuffle server list [ -n "$SLX_DNBD3_SERVERS" ] && TMP_SERVERS=$(for SRV in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SRV"; done | sort -u | sed -r 's/^[0-9]+ //') for SRV in $SLX_DNBD3_PRIO_SERVERS $TMP_SERVERS; do - dnbd3=$(dnbd3-client -h "$SRV" -i "${vmpath#/mnt/vmstore/}" -r 0) + dnbd3=$(dnbd3-client -h "$SRV" -i "${imgrelpath}" -r 0) RET=$? if [ "$RET" = "0" ]; then vm_revision=$(cat "/sys/block/${dnbd3#/dev/}/net/rid") @@ -509,7 +510,7 @@ if [ -n "$SLX_DNBD3_SERVERS" -o -n "$SLX_DNBD3_PRIO_SERVERS" ] && [ "x$SLX_VM_DN usleep 200000 done if [ -z "$vm_diskfile" ]; then - slxlog "virt-dnbd3" "No dnbd3 server for ${vmpath#/mnt/vmstore/} found ($SLX_DNBD3_PRIO_SERVERS $TMP_SERVERS $dnbd3error), trying NFS..." + slxlog "virt-dnbd3" "No dnbd3 server for ${imgrelpath} found ($SLX_DNBD3_PRIO_SERVERS $TMP_SERVERS $dnbd3error), trying NFS/CIFS..." writelog "No working dnbd3 server found :-(" fi else @@ -519,6 +520,7 @@ else writelog "Won't use dnbd3 as no servers are given in config" fi +# $vm_diskfile will be empty if dnbd3 is not used or failed. Let's try to fall back to NFS/CIFS via file system if [ -z "$vm_diskfile" ]; then new_vmpath=$(ls "${vmpath}.r"* | grep -E -o '\.r[0-9]+$' | grep -o -E '[0-9]+' | sort -n | tail -1) [ -n "$new_vmpath" ] && vmpath="${vmpath}.r${new_vmpath}" diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt index 59cddfed..231ef6fe 100755 --- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt @@ -446,6 +446,7 @@ amixer -q sset Front "$VOL" unmute 2>/dev/null amixer -q sset Speaker "$VOL" unmute 2>/dev/null # annoying built-in speaker amixer -q sset 'Front Mic' "$VOL" unmute 2>/dev/null # to be checked if Mic is actually activated amixer -q sset 'Rear Mic' "$VOL" unmute 2>/dev/null # =""= +amixer -q sset 'Capture' "$VOL" cap unmute 2>/dev/null # to be checked if Mic is actually activated amixer -q -c pcsp sset Master "0%" mute 2>/dev/null # fix random static noise when starting vmplayer when module snd_pcsp (not pcspkr) is loaded # Start printer daemon @@ -482,7 +483,7 @@ PID_LPD="$!" # via virtual floppy cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml" # Add another file with resolution information -xrandr | grep -o -E 'connected\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" +xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" # Add our magic openslx binary that sets the correct guest resolution cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/" diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index e867a888..ef54218e 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -16,6 +16,7 @@ ################################################################################ ### configuration writer functions +### This needs bash, not dash or ash! (indented HEREDOC) ################################################################################ vmostype=$(rv_clean_string "$vmostype") @@ -172,152 +173,152 @@ runvmwareconfheader () MAXCORES="1" ;; esac - - svga_autodetect="TRUE" real_core_count="$cpu_cores" [ "$cpu_cores" -gt "$MAXCORES" ] && cpu_cores="$MAXCORES" # It currently makes no sense to set the virtual number of cores # to a different value than the virtual number of cores per virtual CPU. cores_per_socket="$cpu_cores" - + if [ "x$shfolders" != "xFALSE" ]; then ENABLE_SHARE='sharedFolder.option = "alwaysEnabled"' else ENABLE_SHARE='' fi - + [ "$mem" -ge "$MAXMEM" ] && mem="$MAXMEM" [ "$hwver" -lt "7" -a "$mem" -gt "3500" ] && mem="3500" - + cap3d="WHAT IS THIS VAR USED FOR?" # helper var for loging output - - cat >> "$conffile" <<HEREEND -.encoding = "UTF-8" -config.version = "8" - -# general hardware (ehci, 3d accel) -ehci.present = "TRUE" -$FORCE3D -mks.enable3d = "$enable3d" - -monitor.virtual_mmu = "automatic" -monitor.virtual_exec = "automatic" -floppy1.clientDevice = "FALSE" -floppy1.readonly = "TRUE" - -# id -virtualHW.version = "$hwver" -displayName = "$displayname" -guestOS = "$vmostype" - -# CPU/MEM -numvcpus = "$cpu_cores" -cpuid.coresPerSocket = "$cores_per_socket" -maxvcpus = "$real_core_count" -memsize = "$mem" -MemAllowAutoScaleDown = "FALSE" -MemTrimRate = "-1" - -# ide-disks -ide0:0.present = "$ide" -ide0:0.fileName = "$vm_diskfile" -## Edited for persistent mode. -ide0:0.mode = "independent-${diskmode}" -## -ide1:0.present = "$cdrom0" -ide1:0.autodetect = "TRUE" -ide1:0.fileName = "auto detect" -ide1:0.deviceType = "cdrom-raw" -ide1:1.present = "$cdrom1" -ide1:1.autodetect = "TRUE" -ide1:1.fileName = "auto detect" -ide1:1.deviceType = "cdrom-raw" - -# scsi-disks -scsi0.present = "$scsi" -scsi0:0.present = "$scsi" -scsi0:0.fileName = "$vm_diskfile" -scsi0.virtualDev = "$hddrv" -## Edited for persistent mode. -scsi0:0.mode = "independent-${diskmode}"$stateFileConfiguration -## -# floppies -floppy0.present = "$floppy0" -floppy0.startConnected = "FALSE" -floppy0.autodetect = "TRUE" -floppy0.fileName = "auto detect" - -# we need floppy b: for the client configuration -floppy1.present = "$floppy1" -floppy1.startConnected = "TRUE" -floppy1.fileType = "file" -floppy1.fileName = "$floppy1name" - -# nics -ethernet0.present = "TRUE" -ethernet0.addressType = "static" -$network_virtualDev -ethernet0.connectionType = "hostonly" -#ethernet1.connectionType = "custom" -ethernet0.vnet = "$hostdev" -ethernet0.address = "00:50:56:$macaddrsuffix" -ethernet0.wakeOnPcktRcv = "FALSE" - -# sound -sound.present = "TRUE" -sound.fileName = "-1" -sound.autodetect = "TRUE" -sound.virtualdev = "$sound" - -# svga -svga.autodetect = "$svga_autodetect" - -# usb -usb.present = "TRUE" -usb.generic.autoconnect = "TRUE" - -# pci configuration -usb.pciSlotNumber = "16" -ethernet0.pciSlotNumber = "17" -sound.pciSlotNumber = "18" -ehci.pciSlotNumber = "19" -scsi0.pciSlotNumber = "20" + cat >> "$conffile" <<-HEREEND + .encoding = "UTF-8" + config.version = "8" + + # general hardware (ehci, 3d accel) + ehci.present = "TRUE" + $FORCE3D + mks.enable3d = "$enable3d" + + monitor.virtual_mmu = "automatic" + monitor.virtual_exec = "automatic" + floppy1.clientDevice = "FALSE" + floppy1.readonly = "TRUE" + + # id + virtualHW.version = "$hwver" + displayName = "$displayname" + guestOS = "$vmostype" + + # CPU/MEM + numvcpus = "$cpu_cores" + cpuid.coresPerSocket = "$cores_per_socket" + maxvcpus = "$real_core_count" + memsize = "$mem" + MemAllowAutoScaleDown = "FALSE" + MemTrimRate = "-1" + + # ide-disks + ide0:0.present = "$ide" + ide0:0.fileName = "$vm_diskfile" + ## Edited for persistent mode. + ide0:0.mode = "independent-${diskmode}" + ## + ide1:0.present = "$cdrom0" + ide1:0.autodetect = "TRUE" + ide1:0.fileName = "auto detect" + ide1:0.deviceType = "cdrom-raw" + ide1:1.present = "$cdrom1" + ide1:1.autodetect = "TRUE" + ide1:1.fileName = "auto detect" + ide1:1.deviceType = "cdrom-raw" + + # scsi-disks + scsi0.present = "$scsi" + scsi0:0.present = "$scsi" + scsi0:0.fileName = "$vm_diskfile" + scsi0.virtualDev = "$hddrv" + ## Edited for persistent mode. + scsi0:0.mode = "independent-${diskmode}"$stateFileConfiguration + ## + + # floppies + floppy0.present = "$floppy0" + floppy0.startConnected = "FALSE" + floppy0.autodetect = "TRUE" + floppy0.fileName = "auto detect" + + # we need floppy b: for the client configuration + floppy1.present = "$floppy1" + floppy1.startConnected = "TRUE" + floppy1.fileType = "file" + floppy1.fileName = "$floppy1name" + + # nics + ethernet0.present = "TRUE" + ethernet0.addressType = "static" + $network_virtualDev + ethernet0.connectionType = "hostonly" + #ethernet1.connectionType = "custom" + ethernet0.vnet = "$hostdev" + ethernet0.address = "00:50:56:$macaddrsuffix" + ethernet0.wakeOnPcktRcv = "FALSE" + + # sound + sound.present = "TRUE" + sound.fileName = "-1" + sound.autodetect = "TRUE" + sound.virtualdev = "$sound" + pciSound.enableVolumeControl = "FALSE" + sound.enableVolumeControl = "FALSE" + + # svga + svga.autodetect = "TRUE" + + # usb + usb.present = "TRUE" + usb.generic.autoconnect = "TRUE" + + # pci configuration + usb.pciSlotNumber = "16" + ethernet0.pciSlotNumber = "17" + sound.pciSlotNumber = "18" + ehci.pciSlotNumber = "19" + scsi0.pciSlotNumber = "20" + + # shared folders + $ENABLE_SHARE + sharedFolder0.present = "$shfolders" + sharedFolder0.enabled = "$shfolders" + sharedFolder0.expiration = "never" + sharedFolder0.guestName = "$sharename" + sharedFolder0.hostPath = "$sharepath" + sharedFolder0.readAccess = "TRUE" + sharedFolder0.writeAccess = "TRUE" + sharedFolder.maxNum = "1" + + # dirs/configs + tmpDirectory = "$redodir" + redoLogDir = "$redodir" + mainMem.useNamedFile = "TRUE" + snapshot.disabled = "TRUE" + tools.syncTime = "TRUE" + isolation.tools.hgfs.disable = "FALSE" + hgfs.mapRootShare = "TRUE" + isolation.tools.dnd.disable = "FALSE" + isolation.tools.copy.enable = "TRUE" + isolation.tools.paste.enabled = "TRUE" + + # serial port + serial0.present = "$serial" + $serialdev + + # parallel port + parallel0.present = "$parallel" + parallel0.bidirectional = "$paralbidi" + $paraldev + HEREEND -# shared folders -$ENABLE_SHARE -sharedFolder0.present = "$shfolders" -sharedFolder0.enabled = "$shfolders" -sharedFolder0.expiration = "never" -sharedFolder0.guestName = "$sharename" -sharedFolder0.hostPath = "$sharepath" -sharedFolder0.readAccess = "TRUE" -sharedFolder0.writeAccess = "TRUE" -sharedFolder.maxNum = "1" - -# dirs/configs -tmpDirectory = "$redodir" -redoLogDir = "$redodir" -mainMem.useNamedFile = "TRUE" -snapshot.disabled = "TRUE" -tools.syncTime = "TRUE" -isolation.tools.hgfs.disable = "FALSE" -hgfs.mapRootShare = "TRUE" -isolation.tools.dnd.disable = "FALSE" -isolation.tools.copy.enable = "TRUE" -isolation.tools.paste.enabled = "TRUE" - -# serial port -serial0.present = "$serial" -$serialdev - -# parallel port -parallel0.present = "$parallel" -parallel0.bidirectional = "$paralbidi" -$paraldev -HEREEND - # set the appropriate permissions for the vmware config file chmod u+rwx "${conffile}" >/dev/null 2>&1 } diff --git a/remote/modules/vmware/module.build b/remote/modules/vmware/module.build index 094d5271..71319d3c 100644 --- a/remote/modules/vmware/module.build +++ b/remote/modules/vmware/module.build @@ -69,7 +69,7 @@ build() { rm -rf -- "${SHORT}-only" touch ".${SHORT}.patched" fi - done + done cd "${MODULE_DIR}" || perror "Could not cd to '${MODULE_DIR}'" # now build modules inside the chroot @@ -103,6 +103,7 @@ post_copy() { parse_patch_name() { [ $# -ne 1 ] && perror "parse_patch_name: Wrong parameter count." local PATCH="$1" + # Kernel restriction MIN_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)-[0-9\.]+__[^_]+\.patch$/\1/g') [[ "$MIN_KERN" == /* ]] && MIN_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)__[^_]+\.patch$/\1/g') MAX_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__[0-9\.]+-([0-9\.]+)__[^_]+\.patch$/\1/g') @@ -110,5 +111,12 @@ parse_patch_name() { [[ "$MIN_KERN" == /* ]] && MIN_KERN= [[ "$MAX_KERN" == /* ]] && MAX_KERN= # TODO: Parse min and max vmplayer/workstation version + # vmware restriction + MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)-[^_]+\.patch$/\1/g') + [[ "$MIN_VMWARE" == /* ]] && MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)\.patch$/\1/g') + MAX_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__[^_]+-([0-9\.]+)\.patch$/\1/g') + [[ "$MAX_VMWARE" == /* ]] && MAX_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)\.patch$/\1/g') + [[ "$MIN_VMWARE" == /* ]] && MIN_VMWARE= + [[ "$MAX_VMWARE" == /* ]] && MAX_VMWARE= } diff --git a/remote/modules/vmware/module.conf b/remote/modules/vmware/module.conf index 749a0838..34d16c94 100644 --- a/remote/modules/vmware/module.conf +++ b/remote/modules/vmware/module.conf @@ -1,4 +1,4 @@ -REQUIRED_DOWNLOAD_BASE="http://softwareupdate.vmware.com/cds/vmw-desktop/ws/10.0.1/1379776/linux/core/" +REQUIRED_DOWNLOAD_BASE="http://softwareupdate.vmware.com/cds/vmw-desktop/ws/10.0.3/1895310/linux/core/" REQUIRED_TYPE="workstation" REQUIRED_MODULES="kernel" REQUIRED_DIRECTORIES=" diff --git a/remote/modules/vmware/patches/vmnet__3.13-9.9__1.0-100.0.patch b/remote/modules/vmware/patches/vmnet__3.13-3.13__1.0-10.0.2.patch index 54607506..54607506 100644 --- a/remote/modules/vmware/patches/vmnet__3.13-9.9__1.0-100.0.patch +++ b/remote/modules/vmware/patches/vmnet__3.13-3.13__1.0-10.0.2.patch diff --git a/server/modules/pvs2-freiburg/opt/openslx/pvs2/pvs2.ini b/server/modules/pvs2-freiburg/opt/openslx/pvs2/pvs2.ini new file mode 100644 index 00000000..903c718d --- /dev/null +++ b/server/modules/pvs2-freiburg/opt/openslx/pvs2/pvs2.ini @@ -0,0 +1,140 @@ +# This denotes the groups that have to be available here +rooms=-100,-101,-113,-114 + +[-100] +mgrIP= +client/size=16 +client/1/ip=132.230.4.156 +client/1/pos=@Point(1 6) +client/2/ip=132.230.4.157 +client/2/pos=@Point(0 4) +client/3/ip=132.230.4.158 +client/3/pos=@Point(1 4) +client/4/ip=132.230.4.159 +client/4/pos=@Point(3 4) +client/5/ip=132.230.4.160 +client/5/pos=@Point(4 4) +client/6/ip=132.230.4.161 +client/6/pos=@Point(5 4) +client/7/ip=132.230.4.162 +client/7/pos=@Point(0 2) +client/8/ip=132.230.4.163 +client/8/pos=@Point(1 2) +client/9/ip=132.230.4.164 +client/9/pos=@Point(3 2) +client/10/ip=132.230.4.165 +client/10/pos=@Point(4 2) +client/11/ip=132.230.4.166 +client/11/pos=@Point(5 2) +client/12/ip=132.230.4.167 +client/12/pos=@Point(0 0) +client/13/ip=132.230.4.168 +client/13/pos=@Point(1 0) +client/14/ip=132.230.4.169 +client/14/pos=@Point(3 0) +client/15/ip=132.230.4.170 +client/15/pos=@Point(4 0) +client/16/ip=132.230.4.171 +client/16/pos=@Point(5 0) + +[-101] +mgrIP= +client/size=16 +client/1/ip=132.230.4.140 +client/1/pos=@Point(6 2) +client/2/ip=132.230.4.141 +client/2/pos=@Point(4 0) +client/3/ip=132.230.4.142 +client/3/pos=@Point(4 1) +client/4/ip=132.230.4.143 +client/4/pos=@Point(4 2) +client/5/ip=132.230.4.144 +client/5/pos=@Point(4 4) +client/6/ip=132.230.4.145 +client/6/pos=@Point(4 5) +client/7/ip=132.230.4.146 +client/7/pos=@Point(2 0) +client/8/ip=132.230.4.147 +client/8/pos=@Point(2 1) +client/9/ip=132.230.4.148 +client/9/pos=@Point(2 2) +client/10/ip=132.230.4.149 +client/10/pos=@Point(2 4) +client/11/ip=132.230.4.150 +client/11/pos=@Point(2 5) +client/12/ip=132.230.4.151 +client/12/pos=@Point(0 0) +client/13/ip=132.230.4.152 +client/13/pos=@Point(0 1) +client/14/ip=132.230.4.153 +client/14/pos=@Point(0 2) +client/15/ip=132.230.4.154 +client/15/pos=@Point(0 4) +client/16/ip=132.230.4.155 +client/16/pos=@Point(0 5) + +[-113] +mgrIP=132.230.4.30 +client/size=16 +client/1/ip=132.230.4.120 +client/1/pos=@Point(3 3) +client/2/ip=132.230.4.121 +client/2/pos=@Point(6 4) +client/3/ip=132.230.4.122 +client/3/pos=@Point(6 3) +client/4/ip=132.230.4.123 +client/4/pos=@Point(6 2) +client/5/ip=132.230.4.124 +client/5/pos=@Point(6 1) +client/6/ip=132.230.4.125 +client/6/pos=@Point(6 0) +client/7/ip=132.230.4.126 +client/7/pos=@Point(4 0) +client/8/ip=132.230.4.127 +client/8/pos=@Point(4 1) +client/9/ip=132.230.4.128 +client/9/pos=@Point(4 2) +client/10/ip=132.230.4.129 +client/10/pos=@Point(2 0) +client/11/ip=132.230.4.130 +client/11/pos=@Point(2 1) +client/12/ip=132.230.4.131 +client/12/pos=@Point(2 2) +client/13/ip=132.230.4.132 +client/13/pos=@Point(0 0) +client/14/ip=132.230.4.133 +client/14/pos=@Point(0 1) +client/15/ip=132.230.4.134 +client/15/pos=@Point(0 2) +client/16/ip=132.230.4.135 +client/16/pos=@Point(0 3) + +[-114] +mgrIP= +client/size=13 +client/1/ip=132.230.4.100 +client/1/pos=@Point(4 3) +client/2/ip=132.230.4.101 +client/2/pos=@Point(3 5) +client/3/ip=132.230.4.102 +client/3/pos=@Point(3 6) +client/4/ip=132.230.4.103 +client/4/pos=@Point(4 5) +client/5/ip=132.230.4.104 +client/5/pos=@Point(0 6) +client/6/ip=132.230.4.105 +client/6/pos=@Point(3 1) +client/7/ip=132.230.4.106 +client/7/pos=@Point(1 5) +client/8/ip=132.230.4.107 +client/8/pos=@Point(1 1) +client/9/ip=132.230.4.108 +client/9/pos=@Point(0 0) +client/10/ip=132.230.4.109 +client/10/pos=@Point(0 6) +client/11/ip=132.230.4.110 +client/11/pos=@Point(3 0) +client/12/ip=132.230.4.111 +client/12/pos=@Point(4 1) +client/13/ip=132.230.4.112 +client/13/pos=@Point(0 1) diff --git a/server/modules/pvs2mgr-freiburg/opt/openslx/scripts/setup-pvsmgr b/server/modules/pvs2mgr-freiburg/opt/openslx/scripts/setup-pvsmgr new file mode 100755 index 00000000..dedb0995 --- /dev/null +++ b/server/modules/pvs2mgr-freiburg/opt/openslx/scripts/setup-pvsmgr @@ -0,0 +1,4 @@ +#!/bin/ash + +openbox & +exec /opt/openslx/bin/pvsmgr diff --git a/server/modules/pvs2mgr-freiburg/opt/openslx/xsessions/default.desktop b/server/modules/pvs2mgr-freiburg/opt/openslx/xsessions/default.desktop new file mode 100755 index 00000000..b718716a --- /dev/null +++ b/server/modules/pvs2mgr-freiburg/opt/openslx/xsessions/default.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=PVS MNGR +Name[de]=PVS +Comment=PVS TEST +Comment[de]=PVS TEST +Exec=/opt/openslx/scripts/setup-pvsmgr +TryExec=/opt/openslx/bin/pvsmgr +Icon= +Type=Application |