summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/XX_vmchooser.sh
diff options
context:
space:
mode:
authorMichael Janczyk2009-11-03 18:08:39 +0100
committerMichael Janczyk2009-11-03 18:08:39 +0100
commit841a2d9b44e1e12332fe12bf25aea667f1758668 (patch)
treefc8d9a5ccece0604241084a4642fa04b74114606 /os-plugins/plugins/vmchooser/XX_vmchooser.sh
parentdefault directories introduced. please test and say what you think. examples ... (diff)
downloadcore-841a2d9b44e1e12332fe12bf25aea667f1758668.tar.gz
core-841a2d9b44e1e12332fe12bf25aea667f1758668.tar.xz
core-841a2d9b44e1e12332fe12bf25aea667f1758668.zip
BINPATH added to PATH
support for vmplayer3 further simplifications through DEFAULTDIRS git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3180 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmchooser/XX_vmchooser.sh')
-rw-r--r--os-plugins/plugins/vmchooser/XX_vmchooser.sh42
1 files changed, 24 insertions, 18 deletions
diff --git a/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
index 1cb827a3..0b417e77 100644
--- a/os-plugins/plugins/vmchooser/XX_vmchooser.sh
+++ b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
@@ -17,6 +17,9 @@
CONFFILE="/initramfs/plugin-conf/vmchooser.conf"
ETCDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}
+PLUGINCONFDIR=${ETCDIR}/plugins/vmchooser
+BINDIR=/mnt/${OPENSLX_DEFAULT_BINDIR}
+PLUGINDIR=${OPENSLX_DEFAULT_DIR}/plugin-repo/vmchooser
VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}
if [ -e $CONFFILE ]; then
@@ -24,18 +27,14 @@ if [ -e $CONFFILE ]; then
if [ $vmchooser_active -ne 0 ] ; then
[ $DEBUGLEVEL -gt 0 ] \
&& echo "vmchooser: copying stage3 configuration file ..."
- cp $CONFFILE ${ETCDIR}/vmchooser-stage3.conf
+ testmkd ${PLUGINCONFDIR}/loopimg
+ testmkd ${PLUGINCONFDIR}/fd-loop 1777
+ cp $CONFFILE ${PLUGINCONFDIR}/vmchooser.conf
- testmkd /mnt/var/X11R6/bin
- ln -s /opt/openslx/plugin-repo/vmchooser/run-virt.sh \
- /mnt/var/X11R6/bin/run-virt.sh
- ln -s /opt/openslx/plugin-repo/vmchooser/vmchooser \
- /mnt/var/X11R6/bin/vmchooser
+ ln -s ${PLUGINDIR}/run-virt.sh ${BINDIR}/run-virt.sh
+ ln -s ${PLUGINDIR}/vmchooser ${BINDIR}/vmchooser
# setup all generic virtualization / starting stuff like the floppy image
- testmkd ${VIRTDIR}/vmchooser/fd-loop 1777
- testmkd ${VIRTDIR}/vmchooser/loopimg
-
# loop file for exchanging information between linux and vm guest
if modprobe ${MODPRV} loop; then
mdev -s
@@ -44,34 +43,41 @@ if [ -e $CONFFILE ]; then
fi
# mount a clean tempfs (bug in UnionFS prevents loopmount to work)
grep -qE "unionfs |aufs " /proc/mounts && \
- mount -n -o size=1500k -t tmpfs vm-loopimg ${VIRTDIR}/vmchooser/loopimg
+ mount -n -o size=1500k -t tmpfs vm-loopimg ${PLUGINCONFDIR}/loopimg
# create an empty floppy image of 1.4MByte size
- dd if=/dev/zero of=${VIRTDIR}/vmchooser/loopimg/fd.img count=2880 bs=512 \
+ dd if=/dev/zero of=${PLUGINCONFDIR}/loopimg/fd.img count=2880 bs=512 \
2>/dev/null
- chmod 0777 ${VIRTDIR}/vmchooser/loopimg/fd.img
+ chmod 0777 ${PLUGINCONFDIR}/loopimg/fd.img
# use dos formatter copied into stage3
- mkdosfs ${VIRTDIR}/vmchooser/loopimg/fd.img >/dev/null 2>&1 #|| error
- mount -n -t msdos -o loop,umask=000 ${VIRTDIR}/vmchooser/loopimg/fd.img \
- ${VIRTDIR}/vmchooser/fd-loop
+ mkdosfs ${PLUGINCONFDIR}/loopimg/fd.img >/dev/null 2>&1 #|| error
+ mount -n -t msdos -o loop,umask=000 ${PLUGINCONFDIR}/loopimg/fd.img \
+ ${PLUGINCONFDIR}/fd-loop
# create run-virt.include header (and fill in information on removable
# devices if present
echo -e "# run-virt.include created by $0 during stage3 plugin setup" \
- >${ETCDIR}/run-virt.include
+ >${PLUGINCONFDIR}/run-virt.include
waitfor /etc/hwinfo.cdrom
j=0
for i in $(cat /etc/hwinfo.cdrom); do
- echo "cdrom_$j=$i" >>${ETCDIR}/run-virt.include
+ echo "cdrom_$j=$i" >>${PLUGINCONFDIR}/run-virt.include
j=$(expr $j + 1)
done
waitfor /etc/hwinfo.floppy
j=0
for i in $(cat /etc/hwinfo.floppy); do
- echo "floppy_$j=$i" >>${ETCDIR}/run-virt.include
+ echo "floppy_$j=$i" >>${PLUGINCONFDIR}/run-virt.include
j=$(expr $j + 1)
done
+
+ CPU_CORES=$(grep 'processor.*:' /proc/cpuinfo | wc -l)
+ if [ "${CPU_CORES}" -gt "1" 2>/dev/null ]; then
+ echo 'cpu_cores="${CPU_CORES}")' >>${PLUGINCONFDIR}/run-virt.include
+ else
+ echo 'cpu_cores="1"' >>${PLUGINCONFDIR}/run-virt.include
+ fi
# finished ...
[ $DEBUGLEVEL -gt 0 ] && echo "done with 'vmchooser' os-plugin ..."