diff options
| author | Manuel Schneider | 2014-04-22 15:58:35 +0200 |
|---|---|---|
| committer | Manuel Schneider | 2014-04-22 15:58:35 +0200 |
| commit | 6170a9e2db4bed1445480af0d8170a9b17da062e (patch) | |
| tree | 0bb3f89c75afd1723a9faee9d3a7944622d72e1d /remote | |
| parent | [beamergui] added missing ip (diff) | |
| parent | [pam] libncp, ncpfs and libpam-ncp (ncpfs depends on libpam-ncp) for Ubuntu 1... (diff) | |
| download | tm-scripts-6170a9e2db4bed1445480af0d8170a9b17da062e.tar.gz tm-scripts-6170a9e2db4bed1445480af0d8170a9b17da062e.tar.xz tm-scripts-6170a9e2db4bed1445480af0d8170a9b17da062e.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote')
| -rw-r--r-- | remote/includes/qt.inc | 18 | ||||
| -rw-r--r-- | remote/modules/alsa/module.conf.ubuntu | 2 | ||||
| -rw-r--r-- | remote/modules/nvidia_kernel/module.conf.ubuntu.14.04 | 4 | ||||
| -rw-r--r-- | remote/modules/nvidia_libs/module.conf | 2 | ||||
| -rw-r--r-- | remote/modules/nvidia_libs/module.conf.ubuntu.14.04 | 10 | ||||
| -rw-r--r-- | remote/modules/pam/module.build | 12 | ||||
| -rw-r--r-- | remote/modules/pam/module.conf.ubuntu.14 | 52 | ||||
| -rwxr-xr-x | remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include | 75 | ||||
| -rw-r--r-- | remote/modules/vbox/module.build | 4 | ||||
| -rw-r--r-- | remote/modules/vbox/module.conf | 8 | ||||
| -rw-r--r-- | remote/modules/vbox/module.conf.ubuntu | 5 | ||||
| -rw-r--r-- | remote/modules/vbox/module.conf.ubuntu.13.04 | 6 | ||||
| -rw-r--r-- | remote/modules/vbox/module.conf.ubuntu.13.10 | 7 | ||||
| -rw-r--r-- | remote/modules/vbox/module.conf.ubuntu.14.04 | 20 | ||||
| -rw-r--r-- | remote/modules/vmware/module.build | 51 | ||||
| -rw-r--r-- | remote/modules/vmware/patches/vmnet__3.13-9.9__1.0-100.0.patch | 27 |
16 files changed, 229 insertions, 74 deletions
diff --git a/remote/includes/qt.inc b/remote/includes/qt.inc index e14aed4b..f0e3f3e6 100644 --- a/remote/includes/qt.inc +++ b/remote/includes/qt.inc @@ -1,21 +1,29 @@ activate_qt() { [ $# -eq 1 ] || perror "activate_qt() requires the version as only argument, $# given." local QT_VERSION="$1" + # Handle environment + export QT_SELECT="qt${QT_VERSION}" + QTDIR="/usr/share/qt${QT_VERSION}" + [ -d "$QTDIR" ] && export QTDIR + # Handle qt chooser + [ -d "/usr/share/qtchooser" ] || return 0 # No qtchooser found, hope for the best... local QT_DEFAULT="$(readlink -f /usr/share/qtchooser/default.conf)" if [ -e "$QT_DEFAULT" ]; then [[ "$(basename "$QT_DEFAULT")" =~ ^qt$QT_VERSION.*\.conf$ ]] || perror "Something with QT4 is bad. Check '/usr/share/qtchooser'" else # no default active, try to set it - local QT_CANDIDATES="$(ls /usr/share/qtchooser | grep -v default.conf | grep qt$QT_VERSION)" - local QTS="$(echo $QT_CANDIDATES | wc -w)" + local QT_CANDIDATES="$(ls "/usr/share/qtchooser" | grep -v "default.conf" | grep "qt$QT_VERSION")" + local QTS="$(echo "$QT_CANDIDATES" | wc -w)" if [ "$QTS" -eq 1 ]; then # we found it, lets activate it and hope for the best - ln -sf /usr/share/qtchooser/$QT_CANDIDATES /usr/share/qtchooser/default.conf \ - || perror "Could not link 'default.conf' to '/usr/share/qtchooser/$QT_CANDIDATES'" + ln -sf "/usr/share/qtchooser/$QT_CANDIDATES" "/usr/share/qtchooser/default.conf" \ + || perror "Could not link 'default.conf' to '/usr/share/qtchooser/$QT_CANDIDATES'" + elif [ "$QTS" -eq 0 ]; then + perror "No qt ${QT_VERSION} config found in /usr/share/qtchooser" else # here we have the case with different qt4 files or none at all # in both cases, there is a bigger problem we shouldn't try to guess which one is correct - perror "Either none or more than 1 qt4 version found in '/usr/share/qtchooser'. The configuration is messy. Fix it first." + perror "More than one qt ${QT_VERSION} version found in '/usr/share/qtchooser'. The configuration is messy. Fix it first." fi fi } diff --git a/remote/modules/alsa/module.conf.ubuntu b/remote/modules/alsa/module.conf.ubuntu index b1f9f0e2..c07957ab 100644 --- a/remote/modules/alsa/module.conf.ubuntu +++ b/remote/modules/alsa/module.conf.ubuntu @@ -2,4 +2,6 @@ REQUIRED_CONTENT_PACKAGES=" alsa-utils alsa-base libasound2 + libasound2-data + libasound2-plugins " diff --git a/remote/modules/nvidia_kernel/module.conf.ubuntu.14.04 b/remote/modules/nvidia_kernel/module.conf.ubuntu.14.04 new file mode 100644 index 00000000..73887357 --- /dev/null +++ b/remote/modules/nvidia_kernel/module.conf.ubuntu.14.04 @@ -0,0 +1,4 @@ +REQUIRED_VERSION="337.12" +REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" +REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/$REQUIRED_VERSION/$REQUIRED_NVIDIA" + diff --git a/remote/modules/nvidia_libs/module.conf b/remote/modules/nvidia_libs/module.conf index 12748274..f54c114c 100644 --- a/remote/modules/nvidia_libs/module.conf +++ b/remote/modules/nvidia_libs/module.conf @@ -4,7 +4,7 @@ REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/$REQUIRED_VERSION/ REQUIRED_FILES=" /etc/OpenCL/vendors/nvidia.icd - /usr/share/nvidia/nvidia-application-profiles-331.38-rc + /usr/share/nvidia/nvidia-application-profiles-$REQUIRED_VERSION-rc /usr/share/applications/nvidia-settings.desktop /opt/openslx/etc/nvidia.whiteout " diff --git a/remote/modules/nvidia_libs/module.conf.ubuntu.14.04 b/remote/modules/nvidia_libs/module.conf.ubuntu.14.04 new file mode 100644 index 00000000..98083b50 --- /dev/null +++ b/remote/modules/nvidia_libs/module.conf.ubuntu.14.04 @@ -0,0 +1,10 @@ +REQUIRED_VERSION="337.12" +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/share/nvidia/nvidia-application-profiles-$REQUIRED_VERSION-rc + /usr/share/applications/nvidia-settings.desktop + /opt/openslx/etc/nvidia.whiteout +" + diff --git a/remote/modules/pam/module.build b/remote/modules/pam/module.build index 15828fb8..c6d92510 100644 --- a/remote/modules/pam/module.build +++ b/remote/modules/pam/module.build @@ -1,10 +1,22 @@ +#!/bin/bash + fetch_source() { # get pam-script source download_untar "$REQUIRED_PAM_SCRIPT_URL" "src/" + # Distribution switch: openSuse 13.1 has no package nss-ldap: if [[ "$SYS_DISTRIBUTION" == "opensuse" && "$SYS_VERSION" == "13.1" ]]; then pinfo "Downloading $REQUIRED_NSS_LDAPD_URL ..." download_untar "$REQUIRED_NSS_LDAPD_URL" "src/" fi + # Distribution switch: Ubuntu 14.04 dropped packages ncpfs and libncp: + if [[ "$SYS_DISTRIBUTION" == "ubuntu" && "$SYS_VERSION" == "14.04" ]]; then + for file in $REQUIRED_DOWNLOAD_URLS; do + local package="$(basename $file)" + pinfo "Downloading and installing package $package ..." + download_if_empty "$file" "src/$package" + dpkg -i "src/$package" || perror "Could not install package $package." + done + fi } build() { diff --git a/remote/modules/pam/module.conf.ubuntu.14 b/remote/modules/pam/module.conf.ubuntu.14 new file mode 100644 index 00000000..5d0c5803 --- /dev/null +++ b/remote/modules/pam/module.conf.ubuntu.14 @@ -0,0 +1,52 @@ +# TODO fix and re-add ncp support ! +REQUIRED_INSTALLED_PACKAGES=" + libpam-ldap + libnss-ldapd + nslcd + krb5-user + krb5-config + libpam-krb5 + libssl-dev + ldap-utils + libnfsidmap2 + nfs-common + libpam0g-dev + cifs-utils +" +REQUIRED_CONTENT_PACKAGES=" + libpam0g + libpam-modules + libpam-cap + libldap-2.4-2 + libpam-ldap + libnss-ldapd + nslcd + krb5-user + krb5-config + libpam-krb5 + ldap-utils + libnfsidmap2 + nfs-common + cifs-utils +" +REQUIRED_BINARIES+=" + mount.cifs +" +REQUIRED_DIRECTORIES+=" + /lib + /usr/lib +" +REQUIRED_SYSTEM_FILES+=" + /etc/pam.conf + /etc/default/locale + /lib/${ARCH_TRIPLET}/security + /sbin/mkhomedir_helper +" + +# For Ubuntu 14.04: Both packages were dropped from official repos. Do not change the +# order, as these packages will be installed via dpkg and depend on each other. +REQUIRED_DOWNLOAD_URLS=" + de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/libncp_2.2.6-9ubuntu1_amd64.deb + de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/libpam-ncp_2.2.6-9ubuntu1_amd64.deb + de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/ncpfs_2.2.6-9ubuntu1_amd64.deb +" diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include index 22c62513..161fcf5a 100755 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include @@ -19,13 +19,10 @@ ################################################################################ VMCHOOSERVBOX="/opt/openslx/vmchooser/${self}" -# create TMPDIR for all users -TMPDIR=/tmp/virt/${self} +TMPDIR=/tmp/virt/${self} # create TMPDIR for all users mkdir -m 1777 ${TMPDIR} 2>/dev/null -# dir for configs -confdir="/tmp/virt/${self}/${USER}/${VM_ID}" -# use alternate configuration directory instead of $HOME/.VirtualBox -export VBOX_USER_HOME=${confdir} +confdir="/tmp/virt/${self}/${USER}/${VM_ID}" # dir for configs +export VBOX_USER_HOME=${confdir} # instead of $HOME/.VirtualBox # define dirs and files which can be removed after exit, be carefull! RMDIRS="${snapshotdir} ${confdir} /tmp/virt/.vbox-${USER}-ipc" rm -rf ${RMDIRS} 2>/dev/null @@ -35,21 +32,15 @@ machconfig="${machfolder}/${vm_shortname}/${vm_shortname}.xml" diskfolder="${confdir}/HardDisks" snapshotdir=${machfolder}/${vm_shortname}/Snapshots mkdir -p ${diskfolder} ${snapshotdir} 2>/dev/null -# check if diskless var empty? -[ -z "${diskless}" ] && diskless=0 -# default guest audio controller (SB16, AC97, HDA) -guestaudio="HDA" -# default guest network adaptor (Am79C970A, Am79C973, 82540EM) -vb_network_card="82540EM" -# default setting for accelerated 2D grapics (OS dependent) -enable2d="true" -# set default graphics ram -vram="128" +[ -z "${diskless}" ] && diskless=0 # check if diskless var empty? +guestaudio="HDA" # default guest audio controller (SB16, AC97, HDA) +vb_network_card="82540EM" # default guest network adaptor (Am79C970A, Am79C973, 82540EM) +enable2d="true" # default setting for accelerated 2D grapics (OS dependent) +vram="128" # set default graphics ram # configure our own rwimg, empty image which we provide if [ "${imgmode}" = "rwimg" ]; then - # what is our rwimg called? - imgname="${vm_shortname}.vdi" + imgname="${vm_shortname}.vdi" # what is our rwimg called? vmpath=${imgpath}/${imgname} if ! [ -e "${vmpath}" ]; then cat /opt/openslx/vmchooser/virtualbox/rwimg.vdi.gz | gunzip > "${vmpath}" @@ -68,12 +59,9 @@ elif [ ${diskless} -eq 0 ]; then cleanexit 1 fi -# nested paging -npaging="false" -# enable VT -enablevt="false" -# check for VT, if not available use only 1 cpu (only 1 supported) -[ ${vtflag} -eq 0 ] && cpu_cores=1 +npaging="false" # nested paging: Default: not enabled +enablevt="false" # VT: Default: not enabled +[ ${vtflag} -eq 0 ] && cpu_cores=1 # check for VT, if not available only 1 cpu supported [ ${vtflag} -eq 1 ] && enablevt="true" # set some base configuration depending on the guest operating system @@ -173,19 +161,15 @@ writelog "\tMachine config:\t\t$machconfig" macaddr=$(echo ${macaddr} | sed 's/://g') vdemacaddr=$(echo ${macaddr} | sed 's/^..../00DE/g') -# machine UUID, MAC addr part of it -machineuuid="00000000-0000-0000-0000-${macaddr}" -# cosmetical, since UUID in lower case -machineuuid=$(echo ${machineuuid} | tr "[A-Z]" "[a-z]") +machineuuid="00000000-0000-0000-0000-${macaddr}" # machine UUID, MAC addr part of it +machineuuid=$(echo ${machineuuid} | tr "[A-Z]" "[a-z]") # cosmetical, since UUID in lower case # get UUID of VBox image, if not diskless [ ${diskless} -eq 0 ] && diskuuid=$(VBoxManage -q showvdiinfo ${diskfile} \ | grep UUID | grep -v "Parent UUID" | awk '{print $2}') -# make disk immutable -imgtype="Immutable" -# snapshot UUID is static -snapshotuuid="34f617be-192a-46b3-a8ae-bce1029e093f" -# imageuuid in machine.include, dafault snapshotuuid -imageuuid=${snapshotuuid} + +imgtype="Immutable" # make disk immutable +snapshotuuid="34f617be-192a-46b3-a8ae-bce1029e093f" # snapshot UUID is static +imageuuid=${snapshotuuid} # imageuuid in machine.include, default snapshotuuid # check if rw image # remove disk and add rwimg if set @@ -202,13 +186,10 @@ if echo "${imgmode}" | grep -q rw; then writelog "Please correct, exiting!" cleanexit 1 fi - # add lock - touch "${vmpath}.lock" - # remove lock after VM stopped - RMDIRS="${RMDIRS} ${vmpath}.lock" + touch "${vmpath}.lock" # add lock + RMDIRS="${RMDIRS} ${vmpath}.lock" # remove lock after VM stopped imgtype="Normal" - # replace image uuid in machine config - imageuuid=${diskuuid} + imageuuid=${diskuuid} # replace image uuid in machine config elif [ ${diskless} -eq 0 ]; then # use temp disk as snapshot cat ${VMCHOOSERVBOX}/empty-diff.vdi.gz \ @@ -297,10 +278,8 @@ case ${boot} in n*|tftp) boot="Network" if [ "${network_kind}" = "NAT" ] && [ -n "${virtualbox_tftpdir}" ]; then - # use vm_shortname to avoid Problems /w TFTP in NAT - vm_name=${vm_shortname} - # link TFTP dir for NAT TFTP boots - mkdir -p ${confdir}/TFTP + vm_name=${vm_shortname} # use vm_shortname to avoid Problems /w TFTP in NAT + mkdir -p ${confdir}/TFTP # link TFTP dir for NAT TFTP boots if [ -e ${virtualbox_tftpdir}/pxelinux.0 ]; then cp ${virtualbox_tftpdir}/pxelinux.0 ${confdir}/TFTP/${vm_name}.pxe else @@ -319,8 +298,7 @@ case ${boot} in ;; esac -# external GUI -vrdpport=${remotedesktopport} +vrdpport=${remotedesktopport} # external GUI [ ${diskless} -eq 0 ] && writelog "\tSnapshots dir:\t\t$snapshotdir" writelog "Diskimage:" @@ -357,7 +335,7 @@ writelog "\tShared Folders '${sharename}':\t${sharepath}" ################################################################################ # create Virtualbox.xml -. ${VMCHOOSERVBOX}/virtualbox.include +. ${VMCHOOSERVBOX}/virtualbox.include # create Virtualbox.xml # remove snapshot disk when using rw images if [ "${imgtype}" != "Immutable" ]; then @@ -367,8 +345,7 @@ fi # TODO: add rawdisk if requested #"raw.vmdk" format="VMDK" type="Writethrough"/> -# create machine.xml -. ${VMCHOOSERVBOX}/machine.include +. ${VMCHOOSERVBOX}/machine.include # create machine.xml # remove CD-ROM if not available if [ "${cdrom0}" != "TRUE" ]; then diff --git a/remote/modules/vbox/module.build b/remote/modules/vbox/module.build index f095b4e2..5a533089 100644 --- a/remote/modules/vbox/module.build +++ b/remote/modules/vbox/module.build @@ -77,6 +77,10 @@ build_modules() { fetch_source() { + if [ -z "$REQUIRED_VBOXBASEURL" -o -z "$REQUIRED_VBOXEXTURL" ]; then + perror "Virtualbox download URLs not set - please write a module.conf-file for your linux flavour." + fi + mkdir -p "src/vbox" cd src/vbox # pinfo "Downloading $REQUIRED_VBOXBASEURL" diff --git a/remote/modules/vbox/module.conf b/remote/modules/vbox/module.conf index 29067791..60cea223 100644 --- a/remote/modules/vbox/module.conf +++ b/remote/modules/vbox/module.conf @@ -1,7 +1,7 @@ -REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/4.2.16/Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack" - -# Just for local usage, development: -# REQUIRED_VBOXEXTURL="http://132.230.8.69/Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack" +REQUIRED_VBOX_VERSION_MAJOR="4.3" +REQUIRED_VBOX_VERSION_MINOR="8" +REQUIRED_VBOX_VERSION="$REQUIRED_VBOX_VERSION_MAJOR.$REQUIRED_VBOX_VERSION_MINOR" +REQUIRED_VBOX_VERSIONCODE="92456" REQUIRED_DIRECTORIES=" /etc diff --git a/remote/modules/vbox/module.conf.ubuntu b/remote/modules/vbox/module.conf.ubuntu index 4efbd571..acab7b4f 100644 --- a/remote/modules/vbox/module.conf.ubuntu +++ b/remote/modules/vbox/module.conf.ubuntu @@ -1,8 +1,3 @@ -REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/4.2.16/virtualbox-4.2_4.2.16-86992~Ubuntu~precise_${AMD64_I386}.deb" - -# Just for local usage, development: -# REQUIRED_VBOXBASEURL="http://132.230.8.69/virtualbox-4.2_4.2.16-86992~Ubuntu~precise_${AMD64_I386}.deb" - REQUIRED_CONTENT_PACKAGES=" libsdl1.2debian libpng12-0 diff --git a/remote/modules/vbox/module.conf.ubuntu.13.04 b/remote/modules/vbox/module.conf.ubuntu.13.04 index fbef8447..3008508f 100644 --- a/remote/modules/vbox/module.conf.ubuntu.13.04 +++ b/remote/modules/vbox/module.conf.ubuntu.13.04 @@ -1,7 +1,7 @@ -REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/4.2.16/virtualbox-4.2_4.2.16-86992~Ubuntu~raring_${AMD64_I386}.deb" +REQUIRED_VBOX_OSCODE='Ubuntu~raring' -# Just for local usage, development: -# REQUIRED_VBOXBASEURL="http://132.230.8.69/virtualbox-4.2_4.2.16-86992~Ubuntu~precise_${AMD64_I386}.deb" +REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/virtualbox-${REQUIRED_VBOX_VERSION_MAJOR}_${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}~${REQUIRED_VBOX_OSCODE}_${AMD64_I386}.deb" +REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/Oracle_VM_VirtualBox_Extension_Pack-${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}.vbox-extpack" REQUIRED_CONTENT_PACKAGES=" libsdl1.2debian diff --git a/remote/modules/vbox/module.conf.ubuntu.13.10 b/remote/modules/vbox/module.conf.ubuntu.13.10 index 463c26e2..f91fbcf1 100644 --- a/remote/modules/vbox/module.conf.ubuntu.13.10 +++ b/remote/modules/vbox/module.conf.ubuntu.13.10 @@ -1,11 +1,6 @@ -REQUIRED_VBOX_VERSION_MAJOR="4.3" -REQUIRED_VBOX_VERSION_MINOR="8" -REQUIRED_VBOX_VERSION="$REQUIRED_VBOX_VERSION_MAJOR.$REQUIRED_VBOX_VERSION_MINOR" -REQUIRED_VBOX_VERSIONCODE="92456" -REQUIRED_VBOX_OSCODE='Ubuntu~raring' +REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/virtualbox-${REQUIRED_VBOX_VERSION_MAJOR}_${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}~${REQUIRED_VBOX_OSCODE}_${AMD64_I386}.deb" - REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/Oracle_VM_VirtualBox_Extension_Pack-${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}.vbox-extpack" diff --git a/remote/modules/vbox/module.conf.ubuntu.14.04 b/remote/modules/vbox/module.conf.ubuntu.14.04 new file mode 100644 index 00000000..5691459b --- /dev/null +++ b/remote/modules/vbox/module.conf.ubuntu.14.04 @@ -0,0 +1,20 @@ +REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. Should be changed when + # version for 14.04 appears on virtualbox.org. + +REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/virtualbox-${REQUIRED_VBOX_VERSION_MAJOR}_${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}~${REQUIRED_VBOX_OSCODE}_${AMD64_I386}.deb" +REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/Oracle_VM_VirtualBox_Extension_Pack-${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}.vbox-extpack" + + +REQUIRED_CONTENT_PACKAGES=" + libsdl1.2debian + libpng12-0 +" + +REQUIRED_INSTALLED_PACKAGES=" + libsdl1.2debian + libpng12-0 +" + +REQUIRED_LIBRARIES=" + libpng12 +" diff --git a/remote/modules/vmware/module.build b/remote/modules/vmware/module.build index 98ee2b8d..57e8cb91 100644 --- a/remote/modules/vmware/module.build +++ b/remote/modules/vmware/module.build @@ -31,14 +31,51 @@ build() { # sanity check to see if KERNEL_HEADERS_PATH is set and exists [ -z "${KERNEL_HEADERS_PATH}" -o ! -e "${KERNEL_HEADERS_PATH}" ] && perror "KERNEL_HEADERS_PATH ('"${KERNEL_HEADERS_PATH}"') not found. Was the kernel module built?" + # build in two steps, to be able to use mltk function while patching modules pinfo "Installing vmware per chroot..." chroot_run "${MODULE_BUILD_DIR}" <<-EOF # PS1='\[\e[1;33m\](chroot) \u@\h:\w\$ \[\e[1;32m\]' /bin/bash -norc # un-comment for debugging within chroot $DELETE_FILES yes | sh /"${VMWARE_BUNDLE_FILE}" --eulas-agreed --console --required + EOF + # check if we need to patch modules + cd "${MODULE_BUILD_DIR}/usr/lib/vmware/modules/source" \ + || perror "Could not cd to '${MODULE_BUILD_DIR}/usr/lib/vmware/modules/source'" + + local KMOD SHORT PATCH MIN_KERN MAX_KERN + for KMOD in *.tar; do + SHORT="${KMOD%%.tar}" + [ -e ".${SHORT}.patched" ] && continue + for PATCH in $(find "${MODULE_DIR}/patches/" -name "${SHORT}__*__*.patch"); do + parse_patch_name "$PATCH" + [ -z "${MIN_KERN}" -o -z "${MAX_KERN}" ] && perror "Could not parse patch filename" + if version_lt "$SYS_KERNEL" "$MIN_KERN" || version_gt "$SYS_KERNEL" "$MAX_KERN"; then + pinfo "*NOT* applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$SYS_KERNEL)" + continue # Not suitable for our kernel + fi + pinfo "Applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$SYS_KERNEL)" + [ ! -d "${SHORT}-only" ] && tar xf "$KMOD" + [ ! -d "${SHORT}-only" ] && perror "untar of $KMOD failed." + cd "${SHORT}-only" || perror "Where is ${SHORT}-only?" + if ! patch -p1 < "$PATCH"; then + cd .. + rm -rf -- "${SHORT}-only" + perror "Applying $PATCH failed." + fi + cd .. + done + if [ -d "${SHORT}-only" ]; then + tar cf "$KMOD" "${SHORT}-only/" || perror "repacking of $KMOD failed." + rm -rf -- "${SHORT}-only" + touch ".${SHORT}.patched" + fi + done + cd "${MODULE_DIR}" || perror "Could not cd to '${MODULE_DIR}'" + + # now build modules inside the chroot + chroot_run "${MODULE_BUILD_DIR}" <<-EOF vmware-modconfig --console --build-mod -k "${SYS_UTS_RELEASE}" vmnet $(which gcc) "${KERNEL_HEADERS_PATH}/include" vmplayer vmnet vmware-modconfig --console --build-mod -k "${SYS_UTS_RELEASE}" vmmon $(which gcc) "${KERNEL_HEADERS_PATH}/include" vmplayer vmmon - # PS1='\[\e[1;33m\](chroot) \u@\h:\w\$ \[\e[1;32m\]' /bin/bash -norc # un-comment for debugging within chroot EOF # cleanup unneeded files @@ -63,3 +100,15 @@ post_copy() { cp "${MODULE_BUILD_DIR}/lib/modules/$SYS_UTS_RELEASE/vmplayer/"* "$TARGET_BUILD_DIR/lib/modules/vmware/" || perror "Could not cp vmware modules to target!" } +parse_patch_name() { + [ $# -ne 1 ] && perror "parse_patch_name: Wrong parameter count." + local PATCH="$1" + 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') + [[ "$MAX_KERN" == /* ]] && MAX_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)__[^_]+\.patch$/\1/g') + [[ "$MIN_KERN" == /* ]] && MIN_KERN= + [[ "$MAX_KERN" == /* ]] && MAX_KERN= + # TODO: Parse min and max vmplayer/workstation version +} + 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-9.9__1.0-100.0.patch new file mode 100644 index 00000000..54607506 --- /dev/null +++ b/remote/modules/vmware/patches/vmnet__3.13-9.9__1.0-100.0.patch @@ -0,0 +1,27 @@ +--- a/filter.c 2014-04-17 05:30:43.497846349 -0700 ++++ b/filter.c 2014-04-17 05:30:41.445846394 -0700 +@@ -203,7 +203,11 @@ + #endif + + static unsigned int ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) + VNetFilterHookFn(unsigned int hooknum, // IN: ++#else ++VNetFilterHookFn(const struct nf_hook_ops *ops, // IN: ++#endif + #ifdef VMW_NFHOOK_USES_SKB + struct sk_buff *skb, // IN: + #else +@@ -252,7 +256,11 @@ + + /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */ + /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */ +- transmit = (hooknum == VMW_NF_INET_POST_ROUTING); ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) ++ transmit = (hooknum == VMW_NF_INET_POST_ROUTING); ++ #else ++ transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING); ++ #endif + + packetHeader = compat_skb_network_header(skb); + ip = (struct iphdr*)packetHeader; |
