From 37e74cb1cbf1033842c68ca919f701df3b250ef4 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 10 Sep 2013 14:55:17 +0200 Subject: [vbox] Standardization for run-virt --- .../opt/openslx/etc/virtualbox/run-virt.include | 642 +++++++++++++++++++++ 1 file changed, 642 insertions(+) create mode 100755 remote/modules/vbox/data/opt/openslx/etc/virtualbox/run-virt.include diff --git a/remote/modules/vbox/data/opt/openslx/etc/virtualbox/run-virt.include b/remote/modules/vbox/data/opt/openslx/etc/virtualbox/run-virt.include new file mode 100755 index 00000000..b755133f --- /dev/null +++ b/remote/modules/vbox/data/opt/openslx/etc/virtualbox/run-virt.include @@ -0,0 +1,642 @@ +# 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" </dev/null 2>&1 +} + +preferencesheader () +{ + cat > "$vmhome/preferences" <> "$vmhome/preferences" <> "$vmhome/preferences" </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}" -- cgit v1.2.3-55-g7522 From ca23b4dd11b1551186ba13db05afbf5d2125e9df Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 10 Sep 2013 14:56:00 +0200 Subject: [vbox] Standardization for run-virt --- remote/modules/vbox/data/opt/openslx/etc/virtualbox/virtualbox.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 remote/modules/vbox/data/opt/openslx/etc/virtualbox/virtualbox.conf diff --git a/remote/modules/vbox/data/opt/openslx/etc/virtualbox/virtualbox.conf b/remote/modules/vbox/data/opt/openslx/etc/virtualbox/virtualbox.conf new file mode 100644 index 00000000..8a7a58e4 --- /dev/null +++ b/remote/modules/vbox/data/opt/openslx/etc/virtualbox/virtualbox.conf @@ -0,0 +1,2 @@ +# Todo: Good setting +export VBOX_USER_HOME="" -- cgit v1.2.3-55-g7522 From 892c1567a81b11243427d9fed141dc17bc345d45 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 10 Sep 2013 16:09:04 +0200 Subject: [system.inc] Path variable LIB64 now generalized usable (dep. on $SYS_DISTRIBUTION) --- helper/system.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/helper/system.inc b/helper/system.inc index 7a9f8954..1d2bdf06 100644 --- a/helper/system.inc +++ b/helper/system.inc @@ -21,7 +21,12 @@ export MAKEFLAGS="-j$CPU_CORES" # Determine if we have lib64 if [ "$(uname -m)x" = "x86_64x" ]; then - LIB64="lib64" + # Setting LIB64, as openSuse differentiates but Ubuntu does not: + case $SYS_DISTRIBUTION in + ubuntu | debian) LIB64="lib" ;; + opensuse) LIB64="lib64" ;; + *) pwarning "Cannot set LIB64, SYS_DISTRIBUTION: $SYS_DISTRIBUTION unknown / not set!" ;; + esac AMD64_I386=amd64 X86_64_I586=x86_64 AMD64_X86=amd64 -- cgit v1.2.3-55-g7522 From 8205609508f54d3e1e0c5ec07715381ed657ba33 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 10 Sep 2013 16:10:33 +0200 Subject: [systemd] conf file updated (systemd-204, kmod-14) --- remote/modules/systemd/systemd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/modules/systemd/systemd.conf b/remote/modules/systemd/systemd.conf index ea042020..3cb6196a 100644 --- a/remote/modules/systemd/systemd.conf +++ b/remote/modules/systemd/systemd.conf @@ -1,6 +1,6 @@ REQUIRED_VERSION="systemd-204" REQUIRED_URL="http://www.freedesktop.org/software/systemd/${REQUIRED_VERSION}.tar.xz" -REQUIRED_LIBKMOD_VERSION="kmod-12" +REQUIRED_LIBKMOD_VERSION="kmod-14" REQUIRED_LIBKMOD_URL="http://www.kernel.org/pub/linux/utils/kernel/kmod/${REQUIRED_LIBKMOD_VERSION}.tar.gz" REQUIRED_DISABLED_SERVICES=" tmp.mount -- cgit v1.2.3-55-g7522 From cb37d5d66ab6a4a109cd9dd95ffae8bc3a3ce34c Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 10 Sep 2013 16:10:59 +0200 Subject: [systemd] Cave: Possible breaker: build file doesn't install kmod anymore into base system. --- remote/modules/systemd/systemd.build | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/remote/modules/systemd/systemd.build b/remote/modules/systemd/systemd.build index 3a5baf07..b1228f17 100644 --- a/remote/modules/systemd/systemd.build +++ b/remote/modules/systemd/systemd.build @@ -15,16 +15,29 @@ build () { cd "${MODULE_DIR}/src/$REQUIRED_LIBKMOD_VERSION" ./configure || perror "./configure kmod failed." make || perror "kmod make failed." - make install || perror "kmod make install failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "kmod make install failed." cd - &> /dev/null #build systemd pinfo "Building systemd" cd "${MODULE_DIR}/src/$REQUIRED_VERSION" pinfo "calling configure" + + # Save potentially pre-used paths/flages + OLDLDFLAGS="$LDFLAGS" + OLDCPPFLAGS="$CPPFLAGS" + OLDPKG_CONFIG_PATH="PKG_CONFIG_PATH" + + + LDFLAGS="$LDFLAGS -L${MODULE_BUILD_DIR}/usr/$LIB64" \ + CPPFLAGS="-I${MODULE_BUILD_DIR}/usr/include" + PKG_CONFIG_PATH="${MODULE_BUILD_DIR}/usr/$LIB64/pkgconfig" + + pinfo "-------- $KMOD_LIBS ----------" ./configure --disable-manpages --enable-split-usr --sysconfdir="/etc" --enable-gtk-doc-html=no --disable-nls \ --disable-microhttpd --disable-bootchart --disable-quotacheck --disable-hostnamed --disable-timedated \ --disable-localed --disable-coredump --disable-keymap --without-python --enable-blkid --enable-acl --enable-pam \ + --enable-kmod \ || perror "configure failed." pinfo "calling make" make || perror "make failed." @@ -32,6 +45,11 @@ build () { DESTDIR="${MODULE_BUILD_DIR}" make install || perror "make install failed." cd - &> /dev/null + # Restore used flags/paths: + LDFLAGS="$OLDLDFLAGS" + CPPFLAGS="$OLDCPPFLAGS" + PKG_CONFIG_PATH="$OLDPKG_CONFIG_PATH" + # Delete unneeded services pinfo "Deleting unneeded services" local SERVICE= -- cgit v1.2.3-55-g7522