From 9be038292dc709336cdc02afbf37f5327d525af8 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sat, 4 Jun 2011 12:44:28 +0200 Subject: Changes for common subdirectory for virtual machines, nofuse fix in init. --- src/initramfs/scripts/bin/hwautocfg | 2 +- src/initramfs/scripts/init | 2 +- src/os-plugins/plugins/virtualbox/files/run-virt.include | 2 +- .../plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm | 12 ++++++++++++ src/os-plugins/plugins/vmchooser/XX_vmchooser.sh | 12 +++++++++++- src/os-plugins/plugins/vmware/XX_vmware.sh | 11 ++++++----- 6 files changed, 32 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/initramfs/scripts/bin/hwautocfg b/src/initramfs/scripts/bin/hwautocfg index bd920d50..384d8a44 100755 --- a/src/initramfs/scripts/bin/hwautocfg +++ b/src/initramfs/scripts/bin/hwautocfg @@ -277,7 +277,7 @@ case $1 in # if required and mounting) disk) # try to enable compressed RAM SWAP - if modprobe ${MODPRV} ramzswap && [ -f /usr/bin/rzscontrol ] ; then + if modprobe ${MODPRV} ramzswap 2>/dev/null && [ -f /usr/bin/rzscontrol ] ; then mdev -s rzscontrol /dev/ramzswap0 --init swapon /dev/ramzswap0 diff --git a/src/initramfs/scripts/init b/src/initramfs/scripts/init index 3571e789..716bab2b 100755 --- a/src/initramfs/scripts/init +++ b/src/initramfs/scripts/init @@ -747,7 +747,7 @@ if [ -z ${union_type} ] && [ ${unionfs} -eq 1 ]; then fi fi -if [ -z ${union_type} ] && [ ! -z ${fuse} ]; then +if [ -z ${union_type} ] && [ ${fuse} -eq 1 ]; then fuse_in_kernel=$(grep -c fuse /proc/filesystems) if [ ${fuse_in_kernel} -eq 0 ]; then modprobe ${MODPRV} fuse 2>/dev/null diff --git a/src/os-plugins/plugins/virtualbox/files/run-virt.include b/src/os-plugins/plugins/virtualbox/files/run-virt.include index 2efcc779..ebf58eba 100644 --- a/src/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/src/os-plugins/plugins/virtualbox/files/run-virt.include @@ -33,7 +33,7 @@ fi PLUGINCONFVIRTUALBOX="${PLUGINCONFROOT}/${self}" PLUGINDIRVIRTUALBOX="${OPENSLX_DEFAULT_DIR}/plugin-repo/${self}" # create TMPDIR for all users -TMPDIR=/tmp/${self} +TMPDIR=/tmp/virt/${self} mkdir -m 1777 ${TMPDIR} 2>/dev/null # dir for configs confdir="/tmp/${self}/${USER}/${VM_ID}" diff --git a/src/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm b/src/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm index f3428e1a..02381d33 100644 --- a/src/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm +++ b/src/os-plugins/plugins/vmchooser/OpenSLX/OSPlugin/vmchooser.pm @@ -109,6 +109,18 @@ sub getAttrInfo content_descr => 'path to xml files', default => '/var/lib/virt', }, + 'vmchooser::scratch' => { + applies_to_systems => 1, + applies_to_clients => 1, + description => unshiftHereDoc(<<' End-of-Here'), + location URI of scratch space (local disk, TempFS, NFS or NBD) for + virtual machine redo files + End-of-Here + #TODO: + #content_regex => qr{^(0|1)$}, + content_descr => 'Allowed values: local or URI', + default => '', + }, }; } diff --git a/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh index 4afeb1e9..2428622e 100644 --- a/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh +++ b/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh @@ -1,5 +1,5 @@ # Copyright (c) 2008, 2009 - RZ Uni Freiburg -# Copyright (c) 2008..2010 - OpenSLX GmbH +# Copyright (c) 2008..2011 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -72,6 +72,16 @@ if [ -e $CONFFILE ]; then sed -i /mnt/usr/share/xsessions/default.desktop \ -e "s,vmchooser$,vmchooser --pvs," fi + # setup more scratch space for virtual machines, if configured + testmkd /mnt/var/lib/virt/vmscratch + testmkd /mnt/tmp/virt + + # enable normal users to setup the extended virtual machine redo file space + cat >> /mnt/etc/sudoers << EOF +# allow to start and stop the special /tmp redo file space (RAM + NBD/NFS server RAID) +ALL ALL=NOPASSWD: /sbin/losetup /dev/loop* +ALL ALL=NOPASSWD: /sbin/mdadm -C /dev/md0 -l linear --raid-devices=2 /dev/loop* /dev/* +EOF # finished ... [ $DEBUGLEVEL -gt 0 ] && echo "done with 'vmchooser' os-plugin ..." diff --git a/src/os-plugins/plugins/vmware/XX_vmware.sh b/src/os-plugins/plugins/vmware/XX_vmware.sh index 4ed01e51..59996db6 100644 --- a/src/os-plugins/plugins/vmware/XX_vmware.sh +++ b/src/os-plugins/plugins/vmware/XX_vmware.sh @@ -1,5 +1,5 @@ # Copyright (c) 2007..2009 - RZ Uni Freiburg -# Copyright (c) 2008..2010 - OpenSLX GmbH +# Copyright (c) 2008..2011 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -43,7 +43,7 @@ if [ -e /initramfs/plugin-conf/vmware.conf ]; then # Load general configuration . /initramfs/machine-setup - testmkd /mnt/tmp/vmware 1777 + testmkd /mnt/tmp/virt/vmware 1777 testmkd /dev/shm/vmware 1777 testmkd /mnt/var/run/vmware 1777 testmkd ${PLUGINCONFDIR} @@ -182,11 +182,12 @@ prefvmx.useRecommendedLockedMemSize = "TRUE"' | sed -e "s/^ *//" \ cat ${PLUGINDIR}/${vmware_kind}/vmware.conf >>${PLUGINCONFDIR}/vmware.conf # if /tmp resides on nfs: create an empty container file for vmware *.vmem - # it does not like to live on NFS exports (still needed??) + # it does not like to live on NFS exports + # stuff moved more generic to vmchooser plugin #if [ cat /proc/mounts|grep -qe "^/tmp "|grep -qe "nfs" ] ; then # dd if=/dev/zero of=/mnt/tmp/vm-container count=1 seek=2048000 - # diskfm /mnt/tmp/vm-container /mnt/tmp/vmware - # chmod a+rwxt /mnt/tmp/vmware + # diskfm /mnt/tmp/vm-container /mnt/tmp/virt + # chmod a+rwxt /mnt/tmp/virt #fi [ $DEBUGLEVEL -gt 0 ] && echo "done with 'vmware' os-plugin ..." -- cgit v1.2.3-55-g7522