diff options
| author | Manuel Schneider | 2013-10-16 14:09:45 +0200 |
|---|---|---|
| committer | Manuel Schneider | 2013-10-16 14:09:45 +0200 |
| commit | 9dba936ce697fa612ee327384e9291e319337169 (patch) | |
| tree | bc7267372173b5cda99f7dd2b0e17d0cf0d0bc6b /remote | |
| parent | [printergui] Changed qmake-qt4 to qmake. (diff) | |
| parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
| download | tm-scripts-9dba936ce697fa612ee327384e9291e319337169.tar.gz tm-scripts-9dba936ce697fa612ee327384e9291e319337169.tar.xz tm-scripts-9dba936ce697fa612ee327384e9291e319337169.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote')
42 files changed, 425 insertions, 730 deletions
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/cups/cups.conf.opensuse b/remote/modules/cups/cups.conf.opensuse new file mode 100644 index 00000000..1ce46e5f --- /dev/null +++ b/remote/modules/cups/cups.conf.opensuse @@ -0,0 +1,8 @@ +REQUIRED_INSTALLED_PACKAGES=" + cups + cups-libs +" +REQUIRED_CONTENT_PACKAGES=" + cups + cups-libs +" diff --git a/remote/modules/printergui/printergui.conf.opensuse b/remote/modules/printergui/printergui.conf.opensuse new file mode 100644 index 00000000..2d4c7a95 --- /dev/null +++ b/remote/modules/printergui/printergui.conf.opensuse @@ -0,0 +1,7 @@ +REQUIRED_INSTALLED_PACKAGES=" +cups-devel +libqt4-devel +" +REQUIRED_CONTENT_PACKAGES=" +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 new file mode 100644 index 00000000..a0a60831 --- /dev/null +++ b/remote/modules/samba/samba.build @@ -0,0 +1,26 @@ +fetch_source() { + : +} + +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 +} + +post_copy() { + : +} diff --git a/remote/modules/samba/samba.conf b/remote/modules/samba/samba.conf new file mode 100644 index 00000000..00063187 --- /dev/null +++ b/remote/modules/samba/samba.conf @@ -0,0 +1,24 @@ +REQUIRED_BINARIES=" + smbd + nmbd + smbclient + winbindd + smbnetfs + fusermount + keyctl + request-key + key.dns_resolver +" +REQUIRED_FILES=" + /etc/smbnetfs.conf + /etc/request-key.conf + /etc/request-key.d +" +# TODO dont copy all the binaries, strip the list down. +REQUIRED_DIRECTORIES=" + /usr/bin +" +# TODO check if the /var/lib/samba/*.tdg can be generated by mltk. +REQUIRED_SYSTEM_FILES=" + /var/lib/samba +" 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/samba/samba.conf.ubuntu b/remote/modules/samba/samba.conf.ubuntu new file mode 100644 index 00000000..20bb46ba --- /dev/null +++ b/remote/modules/samba/samba.conf.ubuntu @@ -0,0 +1,20 @@ +REQUIRED_INSTALLED_PACKAGES=" + samba + smbclient + winbind + krb5-user + cifs-utils + smbnetfs + fuse + keyutils +" +REQUIRED_CONTENT_PACKAGES=" + samba + smbclient + winbind + krb5-user + cifs-utils + smbnetfs + fuse + keyutils +" diff --git a/remote/modules/vbox/data/opt/openslx/etc/vbox/run-virt.include b/remote/modules/vbox/data/opt/openslx/etc/vbox/run-virt.include deleted file mode 100755 index b755133f..00000000 --- a/remote/modules/vbox/data/opt/openslx/etc/vbox/run-virt.include +++ /dev/null @@ -1,642 +0,0 @@ -# run-virt.include -# ----------------------------------------------------------------------------- -# Copyright (c) 2009..2012 - RZ Uni Freiburg -# Copyright (c) 2009..2013 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your suggestions, praise, or complaints to feedback@openslx.org -# -# General information about OpenSLX can be found at http://openslx.org/ -# ----------------------------------------------------------------------------- -# run-virt.include -# - component for vmware/player of the vmchooser plugin run-virt.sh -################################################################################ - -# configuration writer functions -################################################################################ - -function clean_string () -{ - if [ "$#" -ge 1 ]; then - echo "$@" | tr '[A-Z]' '[a-z]' | tr -d '\t _./' - else - cat - | tr '[A-Z]' '[a-z]' | tr -d '\t _./' - fi -} - -vmostype=$(clean_string "$vmostype") - -runvmwareconfheader () -{ - echo "# This configuration file was generated by $0" > "$conffile" - - MAXMEM="9999999" - MAXCORES="256" - - # check for the ostype - # 1) memory limits - case "$vmostype" in - win31*|windows31*) - MAXMEM="32" - vmostype="win31" - ;; - winnt*|windowsnt*) - MAXMEM="1000" - vmostype="winnt" - ;; - win95*|windows95*) - MAXMEM="96" - vmostype="win95" - ;; - win98*|windows98*) - MAXMEM="384" - vmostype="win98" - ;; - winme*|windowsme*) - MAXMEM="384" - vmostype="winme" - ;; - win2000|windows2000|win2000pro*) - MAXMEM="4000" - vmostype="win2000pro" - ;; - win2000srv*|windows2000srv*|win2000serv*|windows2000serv*) - MAXMEM="4000" - vmostype="win2000serv" - ;; - win2000adv*|windows2000adv*|win2000dat*|windows2000dat*) - MAXMEM="8000" - vmostype="win2000advserv" - ;; - winnet*64|win*2003*64|windowsnet*64) - MAXMEM="8000" - vmostype="winnetstandard-64" - ;; - winnet*|win*2003*|windowsnet*) - MAXMEM="4000" - vmostype="winnetstandard" - ;; - winxphome*|windowsxphome*) - MAXMEM="4000" - vmostype="winxphome" - ;; - winxp*64|windowsxp*64) - MAXMEM="8000" - vmostype="winxppro-64" - ;; - winxp*|windowsxp*) - MAXMEM="4000" - vmostype="winxppro" - ;; - winvista*64|windowsvista*64) - MAXMEM="16000" - vmostype="winvista-64" - ;; - winvista*|windowsvista*) - MAXMEM="8000" - vmostype="winvista" - ;; - win7*64|windows7*64) - MAXMEM="32000" - vmostype="windows7-64" - ;; - win7*|windows7*) - MAXMEM="8000" - vmostype="windows7" - ;; - win*64) - MAXMEM="16000" - ;; - win*) - MAXMEM="8000" - ;; - dos|msdos*|ms-dos*) - MAXMEM="128" - vmostype="dos" - ;; - *64) - MAXMEM="123456" - ;; - *) - MAXMEM="8000" - ;; - esac - - # 2) other hardware + capabilities - shfolders="FALSE" - case "$vmostype" in - win31) - MAXCORES="1" - sound="sb16" - ;; - winnt) - MAXCORES="2" - sound="sb16" - ;; - win95|win98|winme) - MAXCORES="1" - ;; - win2000pro) # Don't know if Win 2000 supports shared folders, disabled to be safe - MAXCORES="2" - ;; - win2000serv) - MAXCORES="4" - ;; - win2000advserv) - MAXCORES="8" - ;; - winxphome) - MAXCORES="1" - shfolders="TRUE" - ;; - winxp*|winvista*|windows7*) - shfolders="TRUE" - ;; - winnet*) - shfolders="TRUE" - ;; - linux*|ubuntu*|suse*|debian*) - shfolders="TRUE" - ;; - macos*64) - MAXCORES="2" - vmostype="freebsd-64" - ;; - macos*) - MAXCORES="1" - vmostype="freebsd" - ;; - beos*) - vmostype="other" - ;; - # Unknown guestOS setting in .xml - use conservative defaults - *64) - vmostype="other-64" - ;; - *) - vmostype="other" - ;; - 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 our windows 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 = "$network_kind" -#ethernet1.connectionType = "custom" -#ethernet1.vnet = "/dev/vmnet2" -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" - -# 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 -} - -preferencesheader () -{ - cat > "$vmhome/preferences" <<HEREEND -.encoding = "UTF-8" -# This configuration file was generated by $0 - -# updates/tips -webUpdate.enabled = "FALSE" -pref.downloadPermission = "deny" -pref.vmplayer.downloadPermission = "deny" -pref.vmplayer.webUpdateOnStartup = "FALSE" -pref.tip.startup = "FALSE" -hints.hideAll = "TRUE" -hint.vmui.showAllUSBDevs = "FALSE" - -# configs -prefvmx.defaultVMPath = "$vmhome" -prefvmx.mru.config = "$conffile:" - -# hot keys -pref.hotkey.control = "true" -pref.hotkey.alt = "true" -pref.hotkey.shift = "true" -pref.hotkey.gui = "true" -gui.restricted = "true" - -# fullscreen/mouse/keyboard -pref.fullscreen.toolbarPixels = "0" -pref.vmplayer.fullscreen.autohide = "TRUE" -pref.grabOnMouseClick = "TRUE" -pref.grabOnKeyPress = "FALSE" -pref.motionGrab = "TRUE" -pref.motionUngrab = "TRUE" -pref.hideCursorOnUngrab = "TRUE" -pref.autoFit = "TRUE" -pref.autoFitFullScreen = "fitGuestToHost" -pref.vmplayer.exit.vmAction = "poweroff" -pref.vmplayer.confirmOnExit = "TRUE" - -# shared folders -pref.enableAllSharedFolders = "TRUE" - -# eula - -HEREEND - - # different eula parameters from Workstation 9+/ Player 5+ - case "$vmversion" in - 3.*|4.*|7.*|8.*) - cat >> "$vmhome/preferences" <<HEREEND -pref.eula.size = "2" -pref.eula.0.appName = "VMware Player" -pref.eula.0.buildNumber = "$vmbuild" -pref.eula.1.appName = "VMware Workstation" -pref.eula.1.buildNumber = "$vmbuild" -HEREEND - ;; - 5.*|9.*) - # code - cat >> "$vmhome/preferences" <<HEREEND -pref.eula.count = "2" -pref.eula0.product = "VMware Player" -pref.eula0.build = "$vmbuild" -pref.eula1.product = "VMware Workstation" -pref.eula1.build = "$vmbuild" -HEREEND - ;; - esac - -} - - -# declaration of default variables -################################################################################ - - -[ "$mem" -gt 3800 -a "$(uname -m)" != "x86_64" ] && mem=3800 - -# VM-ID static (0D), remove if changed to 00 -VM_ID="0D" -# should be dynamic -if [ "x$(which bc)" != "x" ]; then - VM_ID=$(echo "obase=16; $$" | bc) - VM_ID=$(expr substr $VM_ID $(expr ${#VM_ID} - 1) 2) -else - VM_ID=$[ $$ % 100 ] -fi -# temporary disk space for logs, etc... -redodir=/tmp/vmware/${USER}.$$ -# dir for configs and vmem file -confdir=/tmp/vmware/${USER}.$$ -# configfile -conffile="${confdir}/run-vmware.conf" -# diskfile -diskfile="${vmpath}" -# users vmware config folder -vmhome="${HOME}/.vmware" - -# get several version infos for vmware/player -. /opt/openslx/etc/vmware/vmware.conf -vmbuild=$buildversion -vmversion=$version - -# VMware start options -# "-X": start in fullscreen -vmopt="-X" - - -# hardware checks -################################################################################ - -# use different network card (default e1000, vlance, vmxnet) -if [ -n "${network_card}" ]; then - network_virtualDev="ethernet0.virtualDev = \"${network_card}\"" -else - network_virtualDev='# using default virtualDev for ethernet0' -fi - -# set standard sound card, overwrite depending on OS (options sb16, es1371, hdaudio) -sound="es1371" - -# check for 3D configuration setting -case "$(clean_string "$enable3d")" in - true|yes) - enable3d="TRUE" - ;; - *) - enable3d="FALSE" - ;; -esac - -# check for whitelisted HW-3D -. /opt/openslx/config -FORCE3D="" -if [ -n "$SLX_VMWARE_3D" ]; then - FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"' -fi - -# serial/parallel port defined (e.g. "ttyS0, lp0" or "autodetect") -case "$serial" in - tty*) - if [ -e "/dev/$serial" ]; then - serialdev="serial0.filename = \"/dev/${serial}\"" - serial="TRUE" - else - serialdev="# no serial port configured" - serial="FALSE" - fi - ;; - auto*) - serialdev="serial0.autodetect = \"TRUE\"" - serial="TRUE" - ;; - *) - serialdev="# no serial port configured" - serial="FALSE" - ;; -esac - -case "$parallel" in - lp*|parport*) - if [ -e "/dev/$parallel" ]; then - paraldev="parallel0.filename = \"/dev/${parallel}\"" - paralbidi="TRUE" - parallel="TRUE" - else - paraldev="# no parallel port configured" - paralbidi="FALSE" - parallel="FALSE" - fi - ;; - auto*) - paraldev="parallel0.autodetect = \"TRUE\"" - paralbidi="TRUE" - parallel="TRUE" - ;; - *) - paraldev="# no parallel port configured" - paralbidi="FALSE" - parallel="FALSE" - ;; -esac - -# check if ide/scsi and hwver of image -# read only the first 30 lines to be sure -imghead=$(head -n 30 "${diskfile}") -## Added to handle persistent snapshots. -if [[ "$originalVMDKFilePath" ]]; then - echo "Select \"${originalVMDKFilePath}\" as information base for \"${diskfile}\"." - imghead=$(head -n 30 "$originalVMDKFilePath") && \ - # Support suspend mode. - stateFilePath="$(readlink -f "$(dirname "$diskfile")/"*.vmss)" && \ - if [ -f "$stateFilePath" ]; then - echo "Found state file \"$stateFilePath\"." && \ - stateFileConfiguration=" -checkpoint.vmState = \"$stateFilePath\"" - fi - POSTRUN="stateFilePath=\"\$(readlink -f \"${confdir}/\"*.vmss)\" && memoryFilePath=\"\$(readlink -f \"${confdir}/\"*.vmem)\" && [ -f \"\$stateFilePath\" ] && echo \"Saving state and memory file \\\"\$stateFilePath\\\" and \\\"\$memoryFilePath\\\".\" && mv -f \"\$stateFilePath\" \"$(dirname "$diskfile")/\" && mv -f \"\$memoryFilePath\" \"$(dirname "$diskfile")/\"" -fi -## -hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}') -hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}') -case "${hddrv}" in - ide) - ide="TRUE" - scsi="FALSE" - ;; - lsilogic|buslogic) - ide="FALSE" - scsi="TRUE" - ;; -esac - -# write configuration files -################################################################################ - -# create vmware directories -mkdir -p "$redodir" >/dev/null 2>&1 -mkdir -p "$confdir" >/dev/null 2>&1 -mkdir -p "$vmhome/dndlogs" >/dev/null 2>&1 -touch "$vmhome/dndlogs/dndlog.conf" >/dev/null 2>&1 - -# create preferences -preferencesheader - -# create VMware startup file -runvmwareconfheader - -# link to conffile if confdir != redodir -ln -s "$conffile" "$redodir/run-vmware.conf" >/dev/null 2>&1 - -# sync is needed to ensure that data is really written to virtual disk -sync - -# own nvram. We need it for floppy drive b, default nvram has just drive a -# TODO: optimize, currently kinda inefficient, too much copys, but we -# don't know which one is installed... -cp "/opt/openslx/etc/vmware/nvram" "$confdir/nvram" 2>/dev/null - - -# logging and stdout -################################################################################ - -# log script information -writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n" -## Edited for persistent mode. -writelog "Starting with ${diskmode} mode ...\n" -## - -# write all results to logfile -# log disksetup -writelog "Directories:" -writelog "\tConfdir:\t${confdir}" -writelog "\tConffile:\t${conffile}" -writelog "\tRedodir:\t${redodir}" -writelog "\tVMhome:\t\t${vmhome}" -writelog "\t/tmp info: \ -$(grep "/tmp " /proc/mounts) $(df -h | grep " /tmp$" | awk '{print $2}')" -# hw setup -writelog "Hardware:" -writelog "\tMAC:\t\t00:50:56:${VM_ID}:${machostpart}" -if [ -n "${network_card}" ]; then - writelog "\tNet Adaptor:\t${network_card}" -fi -writelog "\tMem:\t\t${mem} MB" -# echo nur wenn hostmem gesetzt -[ -n "${hostmem}" ] && writelog "\tHostmem:\t${hostmem} MB" -writelog "\tMax. res.:\t${xres}x${yres}" -writelog "\tCD-ROM1:\t${cdrom0}" -writelog "\tCD-ROM2:\t${cdrom1}" -writelog "\tFloppy_A:\t${floppy0}" -if [ "${serial}" = "TRUE" ]; then - writelog "\tSerial Port:\t${serialdev}" -fi -if [ "${parallel}" = "TRUE" ]; then - writelog "\tParallel Port:\t${paraldev}" -fi -# image -writelog "Diskimage:" -writelog "\tDiskfile:\t${diskfile}" -writelog "\tDisktype:\t${hddrv}" -writelog "\tHWVersion:\t${hwver}" -writelog "\tVMostype:\t${vmostype}" -# misc -writelog "Misc:" -writelog "\tDisplayname:\t${displayname}" -if [ "${cap3d}" = "TRUE" -a "${enable3d}" = "TRUE" ]; then - writelog "\t3D Graphics:\tenabled" -fi -# empty line at end -writelog "" - - -# finally set env for run-virt.sh -################################################################################ - -# configure and start samba service to provide user's home directory -#if [ -f /usr/sbin/smbd ] ; then -# sudo /opt/openslx/bin/sed -i /etc/vmware/smb.conf -e "s,USER,$USER," -# sudo /usr/sbin/nmbd -s /etc/vmware/smb.conf -# sudo /usr/sbin/smbd -s /etc/vmware/smb.conf -#fi - -# For debugging -cp "$conffile" "/tmp/vmware-last-config" - -# using the modified version of the wrapper script -VIRTCMD="/opt/openslx/bin/vmplayer" -VIRTCMDOPTS="${vmopt} ${conffile}" -RMDIRS="${redodir} ${conffile}" diff --git a/remote/modules/vbox/data/opt/openslx/etc/vbox/vbox.conf b/remote/modules/vbox/data/opt/openslx/etc/vbox/vbox.conf deleted file mode 100644 index 8a7a58e4..00000000 --- a/remote/modules/vbox/data/opt/openslx/etc/vbox/vbox.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Todo: Good setting -export VBOX_USER_HOME="" 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 10a6283d..ec860b3c 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -383,6 +383,7 @@ cdtest=${cdrom_1:+"TRUE"} cdrom1=${cdtest:-"FALSE"} # IDE is expected default, test for the virtual disk image type should # be done while creating the runscripts ... +# TODO enable SCSI support instead of just disabling it. ide="TRUE" scsi="FALSE" hddrv="ide" 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/vmplayer/vmplayer.conf b/remote/modules/vmplayer/vmplayer.conf deleted file mode 100644 index 2797303e..00000000 --- a/remote/modules/vmplayer/vmplayer.conf +++ /dev/null @@ -1,5 +0,0 @@ -#REQUIRED_INSTALLED_PACKAGES="libgconf-2-4 fontconfig-config" -#REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config" -REQUIRED_BINARIES="" -REQUIRED_SYSTEM_FILES="" -REQUIRED_DIRECTORIES="/etc /usr" diff --git a/remote/modules/vmplayer/data/addon-init b/remote/modules/vmware/data/addon-init index 01acb3b4..01acb3b4 100755 --- a/remote/modules/vmplayer/data/addon-init +++ b/remote/modules/vmware/data/addon-init diff --git a/remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service b/remote/modules/vmware/data/etc/systemd/system/graphical.target.wants/vmware.service index 7deb4820..7deb4820 120000 --- a/remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service +++ b/remote/modules/vmware/data/etc/systemd/system/graphical.target.wants/vmware.service diff --git a/remote/modules/vmplayer/data/etc/systemd/system/vmware.service b/remote/modules/vmware/data/etc/systemd/system/vmware.service index 30bb42ff..1f47ac8c 100644 --- a/remote/modules/vmplayer/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/vmplayer/data/etc/vmware/config b/remote/modules/vmware/data/etc/vmware/config index eb5d01c0..eb5d01c0 100644 --- a/remote/modules/vmplayer/data/etc/vmware/config +++ b/remote/modules/vmware/data/etc/vmware/config diff --git a/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer b/remote/modules/vmware/data/opt/openslx/bin/vmplayer index 147f514f..147f514f 100755 --- a/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer +++ b/remote/modules/vmware/data/opt/openslx/bin/vmplayer diff --git a/remote/modules/vmplayer/data/opt/openslx/bin/vmware b/remote/modules/vmware/data/opt/openslx/bin/vmware index 1fe9b11d..1fe9b11d 100755 --- a/remote/modules/vmplayer/data/opt/openslx/bin/vmware +++ b/remote/modules/vmware/data/opt/openslx/bin/vmware diff --git a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/nvram b/remote/modules/vmware/data/opt/openslx/etc/vmware/nvram Binary files differindex 85125f1e..85125f1e 100644 --- a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/nvram +++ b/remote/modules/vmware/data/opt/openslx/etc/vmware/nvram diff --git a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/etc/vmware/run-virt.include index e60d5a5b..e60d5a5b 100755 --- a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/etc/vmware/run-virt.include diff --git a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/vmware.conf b/remote/modules/vmware/data/opt/openslx/etc/vmware/vmware.conf index 210b814f..210b814f 100644 --- a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/vmware.conf +++ b/remote/modules/vmware/data/opt/openslx/etc/vmware/vmware.conf diff --git a/remote/modules/vmplayer/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/vmplayer/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/vmplayer/data/usr/share/icons/hicolor/index.theme b/remote/modules/vmware/data/usr/share/icons/hicolor/index.theme index 5c9c50ad..5c9c50ad 100644 --- a/remote/modules/vmplayer/data/usr/share/icons/hicolor/index.theme +++ b/remote/modules/vmware/data/usr/share/icons/hicolor/index.theme diff --git a/remote/modules/vmplayer/vmplayer.build b/remote/modules/vmware/vmplayer.build index 89e3f87b..85929c17 100644 --- a/remote/modules/vmplayer/vmplayer.build +++ b/remote/modules/vmware/vmplayer.build @@ -1,34 +1,46 @@ fetch_source() { - #mount vmware bundle directory - [ ! -d /mnt/store ] && mkdir -p /mnt/store - if [ "x$(ls /mnt/store/vmware/*.bundle)" == "x" ]; then - mount -t nfs -o ro,async,nolock 132.230.8.113:/srv/vmext /mnt/store || perror "Could not mount vmware bundle directory. Exiting." - fi - ARCH="$(uname -m)" - [ "$ARCH" = "i686" ] && ARCH=i386 - local BUNDLE="$(find /mnt/store/vmware -type f -name "VMware-Player*.${ARCH}.bundle" | head -1)" - [ -z "$BUNDLE" ] && perror "Could not find vmplayer at /mnt/store for ARCH = $ARCH" [ -e "./src" ] && { rm -r ./src || perror "Could not delete old src dir."; } - pinfo "Extracting bundle" - $BUNDLE -x ./src/ || perror "Extracting the vmplayer bundle failed." + 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() { - [ ! -d "./src/vmware-player" ] && perror "Extracted vmplayer bundle not found in ./src - please clean vmplayer module." + 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 ./src/vmware-installer/lib/lib* "$TARGET" || perror "Could not copy libs from vmware-installer" - cp -r ./src/vmware-network-editor/lib "$MODULE_BUILD_DIR/usr/" || perror "Could not copy libs from vmware-network-config" - cp -r ./src/vmware-player/lib/share "$TARGET" || perror "Could not copy lib/share from vmware-player" - cp -r ./src/vmware-player/share "$MODULE_BUILD_DIR/usr/" || perror "C0oudld not copy share from vmware-player" - cp -r ./src/vmware-player-app/etc "$MODULE_BUILD_DIR/" || perror "Could not copy bin and etc from vmware-player-app." - cp -r ./src/vmware-player-app/lib/* "$TARGET" || perror "Could not copy lib subtree from vmware-player-app." - cp -r ./src/vmware-player-app/{bin,share} "$MODULE_BUILD_DIR/usr/" || perror "could not copy share from vmware-player-app." - cp -r ./src/vmware-usbarbitrator/bin "$MODULE_BUILD_DIR/usr/" || perror "Could not copy bin from vmware-usbarbitrator." - cp -r ./src/vmware-vmx/{bin,etc,sbin} "$MODULE_BUILD_DIR/usr/" || perror "could not copy bin,etc,sbin to usr for vmare-vmx." - cp -r ./src/vmware-vmx/lib/{bin,icu,lib,libconf,scripts} "$TARGET" || perror "Could not copy many things from vmware-vmx." + 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*" @@ -45,14 +57,7 @@ build() { for file in $(grep -rl "@@LIBCONF_DIR@@" "$MODULE_BUILD_DIR"); do sed -i 's#@@LIBCONF_DIR@@#/usr/lib/vmware/libconf#g' "$file" done - - # REMOVED: libgconf stuff was an old hackfix? seems not needed anymore - # Extract libgconf-2 stuff - #COPYLIST="list_dpkg_output" - #[ -e "${COPYLIST}" ] && rm "${COPYLIST}" - #list_packet_files >> "${COPYLIST}" - #tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" # Compile kernel modules pinfo "Compiling required kernel modules." # build modules @@ -73,13 +78,13 @@ post_copy() { build_modules() { # need to be in src cd "$MODULE_DIR/src" || perror "Could not cd to '$MODULE_DIR/src'" - local VMWARE_MODCONFIG="$MODULE_DIR/src/vmware-vmx/bin/vmware-modconfig" + 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/src/vmware-vmx/manifest.xml" + 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.]*')" + 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" @@ -112,13 +117,13 @@ product.buildNumber = "$BUILD_NUMBER" authd.client.port = "902" authd.proxy.nfc = "vmware-hostd:ha-nfc" authd.soapserver = "TRUE" -product.version = "9.0.1" -workstation.product.version = "9.0.1" +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/src/vmware-vmx/extra/modules.xml" "$MODULE_BUILD_DIR/usr/lib/vmware/modules/" - ln -sf "$MODULE_DIR/src/vmware-vmx/lib/modules/source" "$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" diff --git a/remote/modules/vmware/vmplayer.conf b/remote/modules/vmware/vmplayer.conf new file mode 100644 index 00000000..11b7ca71 --- /dev/null +++ b/remote/modules/vmware/vmplayer.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/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/setup_target b/remote/setup_target index dc8bd151..86da6d4c 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -322,6 +322,7 @@ process_module() { pinfo "## Reading build" read_build pinfo "## Installing dependencies" + cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." install_dependencies pinfo "## Fetching source" [ -e "${MODULE_DIR}/.fetched_source" ] || { fetch_source && touch "${MODULE_DIR}/.fetched_source"; } @@ -330,6 +331,7 @@ process_module() { else pinfo "## Building" mkdir -p "${MODULE_BUILD_DIR}" || perror "Could not create build dir" + cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." build # calls perror if something fails, no need to do that here touch "${MODULE_DIR}/.built" || pwarning "Error setting built-flag" fi @@ -337,12 +339,15 @@ process_module() { [ -d "${MODULE_BUILD_DIR}" ] && find "${MODULE_BUILD_DIR}" -name '*.la' -exec rm -f {} \; [ -d "${TARGET_BUILD_DIR}" ] && TARGET_BUILD_SIZE=$(du -bc "${TARGET_BUILD_DIR}" | awk 'END {print $1}') || TARGET_BUILD_SIZE=0 pinfo "## Copying files with dependencies" + cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." copy_files_with_deps pinfo "## Copying required system files" # REQUIRED_SYSTEM_FILES + cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." copy_system_files pinfo "## Copying static module files" copy_static_data pinfo "## Post copy" + cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." post_copy # Sanity checks [ -e "$TARGET_BUILD_DIR/var/run" -a ! -L "$TARGET_BUILD_DIR/var/run" ] && perror "Messup datected: $TARGET_BUILD_DIR/var/run exists and is not a symlink!" diff --git a/remote/targets/stage32-opensuse/beamer b/remote/targets/stage32-opensuse/beamer new file mode 120000 index 00000000..4711f10e --- /dev/null +++ b/remote/targets/stage32-opensuse/beamer @@ -0,0 +1 @@ +../../modules/beamer
\ No newline at end of file diff --git a/remote/targets/stage32-opensuse/cups b/remote/targets/stage32-opensuse/cups new file mode 120000 index 00000000..0ff7101d --- /dev/null +++ b/remote/targets/stage32-opensuse/cups @@ -0,0 +1 @@ +../../modules/cups
\ No newline at end of file diff --git a/remote/targets/stage32-opensuse/printergui b/remote/targets/stage32-opensuse/printergui new file mode 120000 index 00000000..6ccbb628 --- /dev/null +++ b/remote/targets/stage32-opensuse/printergui @@ -0,0 +1 @@ +../../modules/printergui
\ No newline at end of file diff --git a/remote/targets/stage32/samba b/remote/targets/stage32/samba new file mode 120000 index 00000000..c8dcfc0b --- /dev/null +++ b/remote/targets/stage32/samba @@ -0,0 +1 @@ +../../modules/samba
\ No newline at end of file diff --git a/remote/targets/vmware/vmplayer b/remote/targets/vmware/vmplayer deleted file mode 120000 index 9303aa6a..00000000 --- a/remote/targets/vmware/vmplayer +++ /dev/null @@ -1 +0,0 @@ -../../modules/vmplayer
\ No newline at end of file diff --git a/remote/targets/vmware/vmware b/remote/targets/vmware/vmware new file mode 120000 index 00000000..81fa2c91 --- /dev/null +++ b/remote/targets/vmware/vmware @@ -0,0 +1 @@ +../../modules/vmware
\ No newline at end of file |
