diff options
34 files changed, 383 insertions, 90 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc index 9f5c110f..027f5404 100644 --- a/helper/fileutil.inc +++ b/helper/fileutil.inc @@ -38,10 +38,21 @@ list_packet_files() { [ "x$OPTIONAL" = "x@" ] && PACKAGE="$(echo "$PACKAGE" | cut -c 2-)" local FILES="" if [ "$PACKET_HANDLER" = "dpkg" ]; then - FILES="$(dpkg -L "$PACKAGE" | grep "^/" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")" + PACKAGECOMMAND="dpkg -L" elif [ "$PACKET_HANDLER" = "rpm" ]; then - FILES="$(rpm -ql "$PACKAGE" | grep "^/" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")" + PACKAGECOMMAND="rpm -ql" fi + + if [ -n "$REQUIRED_PACKET_FILES_BLACKLIST" ]; then + FILES="$($PACKAGECOMMAND "$PACKAGE" | grep "^/" | \ + grep -v "$REQUIRED_PACKET_FILES_BLACKLIST" | \ + grep -v -E 'share/(man|doc)|/var/run|/var/log'; \ + echo ":###:${PIPESTATUS[0]}")" + else + FILES="$($PACKAGECOMMAND "$PACKAGE" | grep "^/" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")" + fi +# FILES="$(rpm -ql "$PACKAGE" | grep "^/" | grep -v -E 'share/(man|doc)|/var/run|/var/log'; echo ":###:${PIPESTATUS[0]}")" + # ugly hack to get our return value #local LPRET=$(echo "$FILES" | tail -1 | sed 's/^.*:###:\([0-9]*\)$/\1/g') #FILES=$(echo "$FILES" | sed 's/^\(.*\):###:[0-9]*$/\1/g') @@ -102,14 +102,25 @@ print_usage() { check_devtools() { # Checking for needed development tools, compilers etc. # Required: m4 make gcc g++ binutils - DEVTOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs pkg-config" # 'strip' as marker for binutils - for i in $DEVTOOLS; do - which "$i" 2>/dev/null 1>&2 || { echo "Essential development tool $i not found - exiting."; exit 1; } + local DEV_TOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs pkg-config qmake" # 'strip' as marker for binutils + + # DEV_CHECK marks missing dev-tools + local DEV_TOOLS_MISSING="" + for i in $DEV_TOOLS; do + which "$i" 2>/dev/null 1>&2 || DEV_TOOLS_MISSING+="$i " done - - # TODO make the script install the dev-stuff automaticly. - # Ubuntu: 'build-essential', 'm4', 'squashfs-tools' - # OpenSUSE: ??? + + if [ -n "$DEV_TOOLS_MISSING" ]; then + pinfo "You appear to be missing following development tools." + pinfo "Missing tools are: $DEV_TOOLS_MISSING" + pinfo "For $SYS_DISTRIBUTION you probably need to run:" + case $SYS_DISTRIBUTION in + ubuntu | debian) pinfo "apt-get install build-essential m4 squashfs-tools" ;; + opensuse) pinfo "zypper install -t pattern devel_basis" ;; + *) perror "Cannot determine SYS_DISTRIBUTION: $SYS_DISTRIBUTION unknown!" ;; + esac + + fi } initial_checks() { diff --git a/remote/modules/beamer/beamer.build b/remote/modules/beamer/beamer.build deleted file mode 100644 index bd189b66..00000000 --- a/remote/modules/beamer/beamer.build +++ /dev/null @@ -1,17 +0,0 @@ -fetch_source() { - : -} - -build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - - return 0 -} - -post_copy() { - : -} diff --git a/remote/modules/beamer/beamer.conf b/remote/modules/beamer/beamer.conf deleted file mode 100644 index 16f54fcf..00000000 --- a/remote/modules/beamer/beamer.conf +++ /dev/null @@ -1,3 +0,0 @@ -REQUIRED_BINARIES=" - zenity -" diff --git a/remote/modules/beamer/beamer.conf.opensuse b/remote/modules/beamer/beamer.conf.opensuse deleted file mode 100644 index 459dd079..00000000 --- a/remote/modules/beamer/beamer.conf.opensuse +++ /dev/null @@ -1,6 +0,0 @@ -REQUIRED_INSTALLED_PACKAGES=" - zenity -" -REQUIRED_CONTENT_PACKAGES=" - zenity -" diff --git a/remote/modules/beamer/TODO b/remote/modules/beamergui/TODO index 651759eb..651759eb 100644 --- a/remote/modules/beamer/TODO +++ b/remote/modules/beamergui/TODO diff --git a/remote/modules/beamergui/beamergui.build b/remote/modules/beamergui/beamergui.build new file mode 100644 index 00000000..e27cf0b3 --- /dev/null +++ b/remote/modules/beamergui/beamergui.build @@ -0,0 +1,19 @@ +#!/bin/bash + +fetch_source() { + git clone "${REQUIRED_GIT}" src +} + +build() { + local SRCDIR="${MODULE_DIR}/src/" + + mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin" + cd "${MODULE_BUILD_DIR}/opt/openslx/bin" || perror "Could not cd!" + pinfo "Running qmake" + qmake "$SRCDIR/src/beamergui.pro" -r -spec linux-g++ || perror "'qmake' failed." + pinfo "Running make" + make || perror "'make' failed." +} +post_copy() { + : +} diff --git a/remote/modules/beamergui/beamergui.conf b/remote/modules/beamergui/beamergui.conf new file mode 100644 index 00000000..da786271 --- /dev/null +++ b/remote/modules/beamergui/beamergui.conf @@ -0,0 +1,9 @@ +REQUIRED_GIT="git://git.openslx.org/openslx-ng/beamergui.git" +REQUIRED_BINARIES=" + beamergui +" +REQUIRED_LIBRARIES=" +" +REQUIRED_SYSTEM_FILES=" +" +# TODO add libraries diff --git a/remote/modules/beamer/beamer.conf.ubuntu b/remote/modules/beamergui/beamergui.conf.debian index 459dd079..ea4cd194 100644 --- a/remote/modules/beamer/beamer.conf.ubuntu +++ b/remote/modules/beamergui/beamergui.conf.debian @@ -1,6 +1,8 @@ REQUIRED_INSTALLED_PACKAGES=" - zenity +libqt4-dev +libxrandr-dev " REQUIRED_CONTENT_PACKAGES=" - zenity +libqt4-dev +libxrandr-dev " diff --git a/remote/modules/beamer/beamer.conf.debian b/remote/modules/beamergui/beamergui.conf.ubuntu index 459dd079..ea4cd194 100644 --- a/remote/modules/beamer/beamer.conf.debian +++ b/remote/modules/beamergui/beamergui.conf.ubuntu @@ -1,6 +1,8 @@ REQUIRED_INSTALLED_PACKAGES=" - zenity +libqt4-dev +libxrandr-dev " REQUIRED_CONTENT_PACKAGES=" - zenity +libqt4-dev +libxrandr-dev " diff --git a/remote/modules/beamer/data/opt/openslx/bin/screenRecognizer.sh b/remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh index feabe7ee..feabe7ee 100755 --- a/remote/modules/beamer/data/opt/openslx/bin/screenRecognizer.sh +++ b/remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh diff --git a/remote/modules/consolekit/consolekit.conf.opensuse b/remote/modules/consolekit/consolekit.conf.opensuse index ef8eff2b..d0f46410 100644 --- a/remote/modules/consolekit/consolekit.conf.opensuse +++ b/remote/modules/consolekit/consolekit.conf.opensuse @@ -1,3 +1,7 @@ +REQUIRED_INSTALLED_PACKAGES=" + ConsoleKit + ConsoleKit-x11 +" REQUIRED_CONTENT_PACKAGES=" ConsoleKit ConsoleKit-x11 diff --git a/remote/modules/printergui/printergui.build b/remote/modules/printergui/printergui.build index b414230c..f6139ba6 100644 --- a/remote/modules/printergui/printergui.build +++ b/remote/modules/printergui/printergui.build @@ -8,9 +8,9 @@ build() { local SRCDIR="${MODULE_DIR}/src/" mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin" - cd "${MODULE_BUILD_DIR}/opt/openslx/bin" || perror "Cpdspofj not cd!" + cd "${MODULE_BUILD_DIR}/opt/openslx/bin" || perror "Could not cd!" pinfo "Running qmake" - qmake-qt4 "$SRCDIR/src/printergui.pro" -r -spec linux-g++ || perror "'qmake' failed." + qmake "$SRCDIR/src/printergui.pro" -r -spec linux-g++ || perror "'qmake' failed." pinfo "Running make" make || perror "'make' failed." } diff --git a/remote/modules/beamer/beamer.conf.scientific b/remote/modules/printergui/printergui.conf.opensuse index 459dd079..2d4c7a95 100644 --- a/remote/modules/beamer/beamer.conf.scientific +++ b/remote/modules/printergui/printergui.conf.opensuse @@ -1,6 +1,7 @@ REQUIRED_INSTALLED_PACKAGES=" - zenity +cups-devel +libqt4-devel " REQUIRED_CONTENT_PACKAGES=" - zenity +cups-devel " diff --git a/remote/modules/printergui/printergui.conf.ubuntu b/remote/modules/printergui/printergui.conf.ubuntu index 3dc662fd..2f679912 100644 --- a/remote/modules/printergui/printergui.conf.ubuntu +++ b/remote/modules/printergui/printergui.conf.ubuntu @@ -1,5 +1,6 @@ REQUIRED_INSTALLED_PACKAGES=" libcups2-dev +libqt4-dev " REQUIRED_CONTENT_PACKAGES=" libcups2-dev diff --git a/remote/modules/samba/samba.build b/remote/modules/samba/samba.build index bd189b66..a0a60831 100644 --- a/remote/modules/samba/samba.build +++ b/remote/modules/samba/samba.build @@ -6,9 +6,18 @@ build() { COPYLIST="list_dpkg_output" [ -e "$COPYLIST" ] && rm "$COPYLIST" + if [ "x$PACKET_MANAGER" == "xzypper" ]; then + if [ $(zypper lr | grep -ci filesystems) -eq 0 ]; then + zypper addrepo http://download.opensuse.org/repositories/filesystems/openSUSE_${SYS_VERSION} Filesystems + pinfo "Repository added: OpenSuse Build filesystems" + fi + # Ubuntu writes to /etc, Suse does not: + mkdir "$MODULE_BUILD_DIR"/etc/ + cp /usr/share/doc/packages/smbnetfs/smbnetfs.conf "$MODULE_BUILD_DIR"/etc/ + fi + list_packet_files >> "$COPYLIST" tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - return 0 } diff --git a/remote/modules/samba/samba.conf.opensuse b/remote/modules/samba/samba.conf.opensuse new file mode 100644 index 00000000..fd06e50a --- /dev/null +++ b/remote/modules/samba/samba.conf.opensuse @@ -0,0 +1,24 @@ +REQUIRED_INSTALLED_PACKAGES=" + samba + samba-client + samba-winbind + krb5-client + cifs-utils + smbnetfs + fuse + keyutils +" +REQUIRED_CONTENT_PACKAGES=" + samba + samba-client + samba-winbind + krb5-client + cifs-utils + smbnetfs + fuse + keyutils +" + +# This is just a list for grep excludes used in samba.build opensuse branch +# Please use pipe symbol and backslash (\|) as separator as being used in grep +REQUIRED_PACKET_FILES_BLACKLIST="/etc/samba/smbpasswd\|/ding/dong" 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 ec860b3c..4a0ba8c6 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -428,6 +428,7 @@ if [ "$vtflag" = "1" -a -n "$kvm_module" ]; then modprobe "$kvm_module" fi + # # # # # # Start printer daemon # # # # # # # USER="$(whoami)" SPOOLDIR="/var/spool" @@ -436,7 +437,10 @@ QUEUE="STANDARD" # Start the lpdaemon listening on the given port busybox tcpsvd -E 0.0.0.0 5515 \ busybox lpd "$SPOOLDIR" \ - sh -c "printergui $USER $SPOOOLDIR/$QUEUE/\$DATAFILE" & + sh -c "printergui $USER $SPOOLDIR/$QUEUE/\$DATAFILE" & + +# PID to kill the process +PID_LPD="$!" # Copy guest configuration (with added information) config.xml to be accessed @@ -451,7 +455,7 @@ cp "/opt/openslx/etc/vmchooser/openslx.exe" "/opt/openslx/etc/vmchooser/fd-loop/ unset vm_diskfile unset vm_revision unset dnbd3 -if [ -n "$SLX_DNBD3_SERVERS" ]; then +if [ -n "$SLX_DNBD3_SERVERS" -a "x$SLX_VM_DNBD3" = "xyes" ]; then if [ -e "/dev/dnbd0" -a -e "/var/run/dnbd3.socket" ]; then # Shuffle server list TMP_SERVERS=$(for SRV in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SRV"; done | sort -u | sed -r 's/^[0-9]+ //') @@ -527,5 +531,9 @@ if [ -n "${POSTRUN}" ]; then eval ${POSTRUN} >/dev/null 2>&1 fi +# Kill LPD +kill $PID_LPD + + cleanexit 0 exit 0 diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter index 3e0ee42d..4faea740 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter @@ -30,44 +30,44 @@ . /opt/openslx/config if [ -f ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf ]; then - . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf + . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf fi function handlePersistentVM() { - if [[ "$(grep --extended-regexp \ - "<persistent param=\"(|.+:)$USER(|:.+)\"" "$1")" ]]; then - # If this virtual machine is useable as persistent version for current - # user we provide an additional persistent version. - local imageName=$(basename "$(grep -io '<image_name param=.*"' "$1" | \ - sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')") && \ - eval export SLX_VM_PERSISTENT_PATH="${SLX_VM_PERSISTENT_PATH}" && \ - local imagePath="${SLX_VM_PERSISTENT_PATH}${imageName}" - local persistentConfigVersionFilePath="$(mktemp --directory)/$(basename \ - "$1")" && \ - local vmchooserFilePath="$(dirname "$0")/vmchooser-clc" && \ - if [ ! -f "$vmchooserFilePath" ]; then - vmchooserFilePath='/opt/openslx/plugin-repo/vmchooser/vmchooser-clc' - fi - bash "$vmchooserFilePath" "$1" "$persistentConfigVersionFilePath" \ - --create-persistent-config "$imagePath" && \ - echo "$persistentConfigVersionFilePath" - fi -} - -for FILE in $(find -L "$1" -iname "*.xml"); do - # filter all xmls which aren't set active - if [ $(grep "<active param=.*true.*" "$FILE" | wc -l) -eq 1 ]; then - if [ -n "${vmchooser_env}" ]; then - # filter all xmls with pool-param not equal to vmchooser::env - if [ $(grep "<pools param=\"${vmchooser_env}\"" "$FILE" | wc -l) -eq 1 ] - then - handlePersistentVM "$FILE" - echo "$FILE" - fi - else - handlePersistentVM "$FILE" - # if there is no pool set, just take all available xmls - echo "$FILE" - fi - fi -done + if [[ "$(grep --extended-regexp \ + "<persistent param=\"(|.+:)$USER(|:.+)\"" "$1")" ]]; then + # If this virtual machine is useable as persistent version for current + # user we provide an additional persistent version. + local imageName=$(basename "$(grep -io '<image_name param=.*"' "$1" | \ + sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')") && \ + eval export SLX_VM_PERSISTENT_PATH="${SLX_VM_PERSISTENT_PATH}" && \ + local imagePath="${SLX_VM_PERSISTENT_PATH}${imageName}" + local persistentConfigVersionFilePath="$(mktemp --directory)/$(basename \ + "$1")" && \ + local vmchooserFilePath="$(dirname "$0")/vmchooser-clc" && \ + if [ ! -f "$vmchooserFilePath" ]; then + vmchooserFilePath='/opt/openslx/plugin-repo/vmchooser/vmchooser-clc' + fi + bash "$vmchooserFilePath" "$1" "$persistentConfigVersionFilePath" \ + --create-persistent-config "$imagePath" && \ + echo "$persistentConfigVersionFilePath" + fi + } + + for FILE in $(find -L "$1" -iname "*.xml"); do + # filter all xmls which aren't set active + grep -i -q "<active param=.*true.*" "$FILE" || continue + # HACK: filter all virtualbox images, as vbox is not ready yet + grep -i -q "<virtualmachine param=.*virtualbox.*" "$FILE" && continue + if [ -n "${vmchooser_env}" ]; then + # filter all xmls with pool-param not equal to vmchooser::env + if [ $(grep "<pools param=\"${vmchooser_env}\"" "$FILE" | wc -l) -eq 1 ]; then + handlePersistentVM "$FILE" + echo "$FILE" + fi + else + handlePersistentVM "$FILE" + # if there is no pool set, just take all available xmls + echo "$FILE" + fi + done diff --git a/remote/modules/vmware/data/etc/systemd/system/vmware.service b/remote/modules/vmware/data/etc/systemd/system/vmware.service index 30bb42ff..1f47ac8c 100644 --- a/remote/modules/vmware/data/etc/systemd/system/vmware.service +++ b/remote/modules/vmware/data/etc/systemd/system/vmware.service @@ -1,7 +1,7 @@ [Unit] Description=Sets up the vmware environment -Requires=vmchooser.service -After=vmchooser.service +Requires=vmchooser.service network.target +After=vmchooser.service network.target [Service] Type=oneshot diff --git a/remote/modules/vmware/data/opt/openslx/scripts/systemd-vmware_env b/remote/modules/vmware/data/opt/openslx/scripts/systemd-vmware_env index 4103eae6..175f3bef 100755 --- a/remote/modules/vmware/data/opt/openslx/scripts/systemd-vmware_env +++ b/remote/modules/vmware/data/opt/openslx/scripts/systemd-vmware_env @@ -57,7 +57,7 @@ option dns ${SLX_DNS} option subnet 255.255.255.0 option router CNETWORK.1 option wins CNETWORK.10 -option domain virtual.site ${domain_name} +option domain ${SLX_NET_DOMAIN} virtual.site ${wpad_config} # additional options known to udhcpd diff --git a/remote/modules/vmware/vmware.build b/remote/modules/vmware/vmware.build new file mode 100644 index 00000000..85929c17 --- /dev/null +++ b/remote/modules/vmware/vmware.build @@ -0,0 +1,162 @@ +fetch_source() { + [ -e "./src" ] && { rm -r ./src || perror "Could not delete old src dir."; } + mkdir -p "./src" || perror "Could not mkdir src" + cd "./src" || perror "cd fail." + # Get directory listing + wget -O "index.html" "$REQUIRED_DOWNLOAD_BASE" || perror "Could not download vmware dir index" + # # Try to treat it as version listing + # local LATEST=$(grep -o -E '"[0-9]+\.[0-9]+\.[0-9]+/' "index.html" | cut -c 2- | sort --version-sort | tail -n 1) + # if [ -n "$LATEST" ]; then + # REQUIRED_DOWNLOAD_BASE+="$LATEST" + # # Determine latest build + # fi + local FILE=$(grep -E -o -i "href=\"VMware-$REQUIRED_TYPE-[^\"]+[\._\-]$ARCHREGEX[\._\-][^\"]+\"" "index.html" | head -n 1 | awk -F '"' '{printf $2}') + [ -z "$FILE" ] && perror "Could not determine vmware $REQUIRED_TYPE bundle file for current arch from $MODULE_DIR/src/index.html" + # Download file + wget -O "$FILE" "$REQUIRED_DOWNLOAD_BASE/$FILE" || perror "Could not download $FILE from $REQUIRED_DOWNLOAD_BASE" + if [[ "$FILE" == *.tar ]]; then + tar -x "${FILE%.tar}" -f "$FILE" || perror "Could not untar downloaded $FILE" + unlink "$FILE" + FILE="${FILE%.tar}" + fi + pinfo "Extracting bundle of VMware $(echo "$FILE" | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') build $(echo "$FILE" | grep -o -E '[0-9]{7,9}') for $(echo "$FILE" | grep -o -E "$ARCHREGEX")" + ./$FILE -x "./bundle/" || perror "Extracting the vmware bundle failed." + pinfo "done" +} + +build() { + local SRCDIR="./src/bundle" + [ ! -d "$SRCDIR" ] && perror "Extracted vmplayer bundle not found in $SRCDIR - please clean vmplayer module." + local TARGET="$MODULE_BUILD_DIR/usr/lib/vmware/" + mkdir -p "$TARGET"{lib,share,bin} + pinfo "Copying data to build dir" + cp -r ./$SRCDIR/vmware-installer/lib/lib* "$TARGET" || perror "Could not copy libs from vmware-installer" + cp -r ./$SRCDIR/vmware-network-editor/lib "$MODULE_BUILD_DIR/usr/" || perror "Could not copy libs from vmware-network-config" + cp -r ./$SRCDIR/vmware-$REQUIRED_TYPE/lib/share "$TARGET" || perror "Could not copy lib/share from vmware-player" + cp -r ./$SRCDIR/vmware-$REQUIRED_TYPE/share "$MODULE_BUILD_DIR/usr/" || perror "C0oudld not copy share from vmware-player" + cp -r ./$SRCDIR/vmware-player-app/etc "$MODULE_BUILD_DIR/" || perror "Could not copy bin and etc from vmware-player-app." + cp -r ./$SRCDIR/vmware-player-app/lib/* "$TARGET" || perror "Could not copy lib subtree from vmware-player-app." + cp -r ./$SRCDIR/vmware-player-app/{bin,share} "$MODULE_BUILD_DIR/usr/" || perror "could not copy share from vmware-player-app." + cp -r ./$SRCDIR/vmware-usbarbitrator/bin "$MODULE_BUILD_DIR/usr/" || perror "Could not copy bin from vmware-usbarbitrator." + cp -r ./$SRCDIR/vmware-vmx/{bin,etc,sbin} "$MODULE_BUILD_DIR/usr/" || perror "could not copy bin,etc,sbin to usr for vmare-vmx." + cp -r ./$SRCDIR/vmware-vmx/lib/{bin,icu,lib,libconf,scripts} "$TARGET" || perror "Could not copy many things from vmware-vmx." + [ -d "./$SRCDIR/vmware-workstation-server" ] && cp -r ./$SRCDIR/vmware-workstation-server/{bin,lib} "$TARGET" || perror "Could not copy many things from vmware-workstation-server." + [ ! -L "$TARGET/bin/vmplayer" ] && { ln -s /usr/lib/vmware/bin/appLoader "$TARGET/bin/vmplayer" || perror "Could not link vmplayer to appLoader."; } + chmod +x "$TARGET"/bin/* + chmod u+s "$TARGET"/bin/vmware-vmx* || perror "Error setting suid-bit on vmware-vmx*" + chmod +x "$MODULE_BUILD_DIR"/usr/{bin,sbin}/* + chmod u+s "$MODULE_BUILD_DIR"/usr/bin/vmware-mount || perror "Error setting suid-bit on vmware-mount" + chmod u+s "$MODULE_BUILD_DIR"/usr/sbin/vmware-authd || perror "Error setting suid-bit on vmware-authd" + chmod +x "$TARGET"/lib/*.sh + find "$MODULE_BUILD_DIR" -name '*.sh' -exec chmod +x {} \; + for file in $(grep -rl -E "^#!/" "$MODULE_BUILD_DIR"); do + chmod +x "$file" + done + pinfo "Patching LIBCONF_DIR" + local file="" + for file in $(grep -rl "@@LIBCONF_DIR@@" "$MODULE_BUILD_DIR"); do + sed -i 's#@@LIBCONF_DIR@@#/usr/lib/vmware/libconf#g' "$file" + done + + # Compile kernel modules + pinfo "Compiling required kernel modules." + # build modules + build_modules + +} + +post_copy() { + # FIXME: gconftool is copied without dependencies + tarcopy "$(find /usr/lib/ /usr/lib64 -name gconv -type d)" "$TARGET_BUILD_DIR" + #Update Icon cache for vmplayer + gtk-update-icon-cache-3.0 "${TARGET_BUILD_DIR}/usr/share/icons/hicolor/" || pwarning "update-icon-cache-3.0 failed." + #fix vmware-usbarbotrator bug + date +'%Y.%m.%d' >"${TARGET_BUILD_DIR}/etc/arch-release" + copy_modules +} + +build_modules() { + # need to be in src + cd "$MODULE_DIR/src" || perror "Could not cd to '$MODULE_DIR/src'" + local VMWARE_MODCONFIG="$MODULE_DIR/$SRCDIR/vmware-vmx/bin/vmware-modconfig" + [ -e "$VMWARE_MODCONFIG" ] && chmod +x "$VMWARE_MODCONFIG" || perror "Could not find $VMWARE_MODCONFIG" + # link vmware-modconfig-console in the build dir + local MANIFEST="$MODULE_DIR/$SRCDIR/vmware-vmx/manifest.xml" + local BUILD_NUMBER="$(grep -o -E '<buildNumber>[0-9]*</buildNumber>' "$MANIFEST"|grep -o -E '[0-9]*')" + local VERSION="$(grep -o -E '<version>[0-9\.]*</version>' "$MANIFEST"|grep -o -E '[0-9\.]*')" + local CORE_VERSION="$(grep -o -E '<coreVersion>[0-9\.]*</coreVersion>' "$MANIFEST"|grep -o -E '[0-9\.]*')" + # /etc/vmware/config gen + + sed -i.bak1 '/^ETCDIR/d;/^VMISETCDIR/d;/bootstrap/d' "$VMWARE_MODCONFIG" + sed -i.bak2 "s/libdir=.*/libdir=$(echo $MODULE_BUILD_DIR | escape_replace)\/usr\/lib\/vmware/g" "$VMWARE_MODCONFIG" + sed -i.bak3 "s#set -e#set -e\nPREFIX=\"/usr\"\nBINDIR=\"/usr/bin\"\nSBINDIR=\"/usr/sbin\"\nLIBDIR=\"/usr/lib\"\nDATADIR=\"/usr/share\"\nSYSCONFDIR=\"/etc\"\nDOCDIR=\"/usr/share/doc\"\nMANDIR=\"/usr/share/man\"\nINCLUDEDIR=\"/usr/include\"\nINITDIR=\"/etc\"\nINITSCRIPTDIR=\"/etc/init.d\"\nVMWARE_INSTALLER=\"/usr/lib/vmware-installer/$CORE_VERSION\"\nVERSION=\"$CORE_VERSION\"\nVMISVERSION=\"$CORE_VERSION\"\nVMISPYVERSION=\"25\"#g" "$VMWARE_MODCONFIG" + + + [ -e "/etc/vmware/config" ] && cp "/etc/vmware/config" "/etc/vmware/config.mltk.bak" + mkdir -p "/etc/vmware" || perror "Could not create /etc/vmware" + cat > "/etc/vmware/config" << EOF +.encoding = "UTF-8" +installerDefaults.componentDownloadEnabled = "yes" +installerDefaults.dataCollectionEnabled = "no" +installerDefaults.transferVersion = "1" +installerDefaults.autoSoftwareUpdateEnabled = "yes" +NETWORKING = "yes" +VMBLOCK_CONFED = "yes" +gksu.rootMethod = "sudo" +libdir = "$MODULE_BUILD_DIR/usr/lib/vmware" +VMCI_CONFED = "yes" +VSOCK_CONFED = "yes" +initscriptdir = "/etc/init.d" +authd.fullpath = "/usr/sbin/vmware-authd" +bindir = "/usr/bin" +vmware.fullpath = "/usr/bin/vmware" +vix.libdir = "/usr/lib/vmware-vix" +vix.config.version = "1" +player.product.version = "$VERSION" +product.buildNumber = "$BUILD_NUMBER" +authd.client.port = "902" +authd.proxy.nfc = "vmware-hostd:ha-nfc" +authd.soapserver = "TRUE" +product.version = "$VERSION" +workstation.product.version = "$VERSION" +product.name = "VMware Workstation" +EOF + mkdir -p "$MODULE_BUILD_DIR/usr/lib/vmware/modules" + ln -sf "$MODULE_DIR/$SRCDIR/vmware-vmx/extra/modules.xml" "$MODULE_BUILD_DIR/usr/lib/vmware/modules/" + ln -sf "$MODULE_DIR/$SRCDIR/vmware-vmx/lib/modules/source" "$MODULE_BUILD_DIR/usr/lib/vmware/modules/" + + ln -sf "appLoader" "$MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig" + ln -sf "appLoader" "$MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig-console" + + [ ! -e "$MODULES_DIR/kernel/ksrc/include/generated/utsrelease.h" ] && perror "Could not find uts release!!!" + local UTS_RELEASE="$(cat "$MODULES_DIR/kernel/ksrc/include/generated/utsrelease.h" | awk -F '"' '{print $2}')" + pinfo "Patching vmblock.tar" + cd "$MODULE_BUILD_DIR/usr/lib/vmware/modules/source" || perror "cd failed." + tar xf "vmblock.tar" || perror "untar of vmblock.tar failed." + for sourcefile in $(grep -l -r -E '\sputname' "vmblock-only/"); do + sed -r -i 's/\sputname/__putname/g' "$sourcefile" || perror "sed of $sourcefile failed." + done + tar cf "vmblock.tar" "vmblock-only/" || perror "repacking of vmblock.tar failed." + cd - + + pinfo "KOMPILIERE VMWARE KERNEL MODULE" + for MOD in vsock vmblock vmmon vmnet vmci; do + pinfo "Kompiliere $MOD" + [ -s "/lib/modules/$UTS_RELEASE/vmplayer/$MOD.ko" ] && unlink "/lib/modules/$UTS_RELEASE/vmplayer/$MOD.ko" + "$VMWARE_MODCONFIG" --console --build-mod -k "$UTS_RELEASE" "$MOD" "$(which gcc)" "$MODULES_DIR/kernel/ksrc/include" "vmplayer" "$MOD" + [ ! -s "/lib/modules/$UTS_RELEASE/vmplayer/$MOD.ko" ] && perror "Error compiling via $VMWARE_MODCONFIG" + done + + cd - + + [ -e /etc/vmware/config ] && rm -f /etc/vmware/config + cp /etc/vmware/config.mltk.bak /etc/vmware/config + +} + +function copy_modules() { + local UTS_RELEASE="$(cat "$MODULES_DIR/kernel/ksrc/include/generated/utsrelease.h" | awk -F '"' '{print $2}')" + mkdir -p "$TARGET_BUILD_DIR/lib/modules/vmware/" + cp "/lib/modules/$UTS_RELEASE/vmplayer/"* "$TARGET_BUILD_DIR/lib/modules/vmware/" || perror "Could not cp vmware modules to target!" +} + diff --git a/remote/modules/vmware/vmware.conf b/remote/modules/vmware/vmware.conf new file mode 100644 index 00000000..11b7ca71 --- /dev/null +++ b/remote/modules/vmware/vmware.conf @@ -0,0 +1,4 @@ +REQUIRED_DIRECTORIES="/etc /usr" +REQUIRED_DOWNLOAD_BASE="http://softwareupdate.vmware.com/cds/vmw-desktop/ws/10.0.0/1295980/linux/core/" +REQUIRED_TYPE="workstation" + diff --git a/remote/rootfs/rootfs-stage32/TODO b/remote/rootfs/rootfs-stage32/TODO index 823c72d3..046b40d2 100644 --- a/remote/rootfs/rootfs-stage32/TODO +++ b/remote/rootfs/rootfs-stage32/TODO @@ -1,2 +1,4 @@ libmdns needed? /etc/modprobe.d/blacklist.conf needed? + +Support for rpc.statd and rpcbind for OpenSuSE diff --git a/remote/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf b/remote/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf new file mode 100644 index 00000000..c12705b9 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf @@ -0,0 +1,7 @@ +# Common configuration file for rpc-services. + +# Options for rpcbind +BIND_OPTS="-w" + +# Options for rpc.statd +STATD_OPTS="-L" diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service new file mode 100644 index 00000000..903a3b1a --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service @@ -0,0 +1,9 @@ +[Unit] +Description=NFSv2/3 Network Status Monitor Daemon +After=rpcbind.service +Requires=rpcbind.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/sbin/rpc.statd $STATD_OPTS diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service new file mode 100644 index 00000000..7dc4dcc2 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service @@ -0,0 +1,11 @@ +[Unit] +Description=RPC Bind +After=network.target +Wants=rpcbind.target +Before=rpcbind.target + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/sbin/rpcbind $BIND_OPTS +Restart=always diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons index b5e2040b..06460506 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons @@ -60,7 +60,10 @@ if [ $# -eq 1 ]; then # download the addon from the given URL ADDON_TARGET_PATH="${SYS_TMP}/$(basename "$ADDON").sqfs" - download "${SLX_BASE_PATH}/${ADDON}.sqfs" "${ADDON_TARGET_PATH}" + if ! download "${SLX_BASE_PATH}/${ADDON}.sqfs" "${ADDON_TARGET_PATH}"; then + echo "Download of ${ADDON} failed." + exit 1 + fi # now mount it to $SLX_MNT/<addon-name> ADDON_MOUNT_POINT="${SLX_BASE_MNT}/$(basename "$ADDON")" diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx index 178e3611..d3310bec 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx @@ -48,7 +48,7 @@ case "$1" in CONF="" if [ -n "$domain" ]; then printf -v CONF "domain $domain\nsearch $domain\n" - elif [ -n "$SLX_NET_DOMAIN" ]; then + elif [ -n "$SLX_NET_DOMAIN" ]; then printf -v CONF "domain $SLX_NET_DOMAIN\nsearch $SLX_NET_DOMAIN\n" fi for i in $dns; do @@ -91,6 +91,17 @@ case "$1" in echo "# Config written by openslx-dhcp-script (1)" >> /opt/openslx/config echo "SLX_HOSTNAME='$dns_host'" >> /opt/openslx/config fi + + # if domain is given from dhcp, save it to openslx config for later use in VMs + if [ -n "$domain" ]; then + # check if SLX_NET_DOMAIN is in the config at all + if grep '^SLX_NET_DOMAIN=' /opt/openslx/config 2>/dev/null; then + sed -i "s/^\(SLX_NET_DOMAIN=\).*$/\1'$domain'/" /opt/openslx/config + else + # not set, add it + echo "SLX_NET_DOMAIN='$domain'" >> /opt/openslx/config + fi + fi # Update /etc/issue for proper spacing /opt/openslx/scripts/openslx-create_issue fi diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf index 1dd76e68..88953780 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf @@ -34,6 +34,8 @@ REQUIRED_BINARIES=" ntpdate rdns find + rpcbind + rpc.statd " REQUIRED_LIBRARIES=" libcap diff --git a/remote/targets/stage32/beamer b/remote/targets/stage32/beamer deleted file mode 120000 index 0fbeaeca..00000000 --- a/remote/targets/stage32/beamer +++ /dev/null @@ -1 +0,0 @@ -../../modules/beamer/
\ No newline at end of file diff --git a/remote/targets/stage32/beamergui b/remote/targets/stage32/beamergui new file mode 120000 index 00000000..5e863316 --- /dev/null +++ b/remote/targets/stage32/beamergui @@ -0,0 +1 @@ +../../modules/beamergui
\ No newline at end of file diff --git a/server/blacklists/desktop-sessions/filter b/server/blacklists/desktop-sessions/filter new file mode 100644 index 00000000..66d3589a --- /dev/null +++ b/server/blacklists/desktop-sessions/filter @@ -0,0 +1,4 @@ +- /usr/share/xsessions/* ++ /usr/share/xsessions/gnome.desktop ++ /usr/share/xsessions/kde-plasma.desktop ++ /usr/share/xsessions/ubuntu.desktop diff --git a/server/blacklists/quickfix/vmware-tools b/server/blacklists/quickfix/vmware-tools new file mode 100644 index 00000000..f6dd61cc --- /dev/null +++ b/server/blacklists/quickfix/vmware-tools @@ -0,0 +1,3 @@ +# TODO: Make vmware-tools work properly in our system +- /usr/lib/vmware-tools + |
