summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorMichael Janczyk2010-08-22 23:03:48 +0200
committerMichael Janczyk2010-08-22 23:03:48 +0200
commit19ec30d3e2e52d87ddde96c8ee9b99224aaa8586 (patch)
tree46eaf198e882d473fe1f3a7d424ade08b4935de1 /os-plugins
parentMerge branch 'master' of openslx.org:openslx/core (diff)
downloadcore-19ec30d3e2e52d87ddde96c8ee9b99224aaa8586.tar.gz
core-19ec30d3e2e52d87ddde96c8ee9b99224aaa8586.tar.xz
core-19ec30d3e2e52d87ddde96c8ee9b99224aaa8586.zip
changed to 50% ram for vbox and vmware
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm19
-rw-r--r--os-plugins/plugins/bootsplash/XX_bootsplash.sh4
-rw-r--r--os-plugins/plugins/virtualbox/files/run-virt.include76
-rw-r--r--os-plugins/plugins/vmchooser/files/run-virt.sh8
-rw-r--r--os-plugins/plugins/vmware/files/run-virt.include83
5 files changed, 93 insertions, 97 deletions
diff --git a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm
index ec58d132..ef1db778 100644
--- a/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm
+++ b/os-plugins/plugins/bootsplash/OpenSLX/OSPlugin/bootsplash.pm
@@ -122,8 +122,8 @@ sub installationPhase
$self->{pluginRepositoryPath} = $info->{'plugin-repo-path'};
$self->{openslxBasePath} = $info->{'openslx-base-path'};
- my $splashyBinPath =
- "$self->{openslxBasePath}/lib/plugins/bootsplash/files/bin";
+ my $splashyPath =
+ "$self->{openslxBasePath}/lib/plugins/bootsplash/files";
my $pluginRepoPath = "$self->{pluginRepositoryPath}";
my $initFile = newInitFile();
@@ -158,11 +158,14 @@ sub installationPhase
);
# copy splashy(_update) into plugin-repo folder
- mkpath("$pluginRepoPath/bin");
+ mkpath("$pluginRepoPath/sbin");
mkpath("$pluginRepoPath/lib");
- slxsystem("cp -a $splashyBinPath/* $pluginRepoPath/bin") == 0
+ mkpath("$pluginRepoPath/usr/lib");
+ slxsystem("cp -a $splashyPath/sbin/* $pluginRepoPath/sbin/;
+ cp -p $splashyPath/lib/* $pluginRepoPath/lib/;
+ cp -p $splashyPath/usr/lib/* $pluginRepoPath/usr/lib/") == 0
or die _tr(
- "unable to copy splashy to $pluginRepoPath/bin"
+ "unable to copy splashy to $pluginRepoPath"
);
# create a proper (distro specific) runlevel script for halt
#my $initfile = newInitFile();
@@ -205,9 +208,11 @@ sub copyRequiredFilesIntoInitramfs
$splashyThemeDir = "$altThemeDir";
}
if (-d $splashyThemeDir) {
- my $splashyPath = "$bootsplashDir/files/bin";
+ my $splashyPath = "$bootsplashDir/files";
$makeInitRamFSEngine->addCMD(
- "cp -p $splashyPath/splashy* $targetPath/bin/"
+ "cp -p $splashyPath/sbin/splashy* $targetPath/sbin/;
+ cp -p $splashyPath/lib/lib* $targetPath/lib/;
+ cp -p $splashyPath/usr/lib/lib* $targetPath/usr/lib/"
);
$makeInitRamFSEngine->addCMD(
"mkdir -p $targetPath/etc/splashy/themes"
diff --git a/os-plugins/plugins/bootsplash/XX_bootsplash.sh b/os-plugins/plugins/bootsplash/XX_bootsplash.sh
index 77ae7bac..372e025d 100644
--- a/os-plugins/plugins/bootsplash/XX_bootsplash.sh
+++ b/os-plugins/plugins/bootsplash/XX_bootsplash.sh
@@ -21,7 +21,7 @@ if [ -e /initramfs/plugin-conf/bootsplash.conf ]; then
# create a runlevelscript that will stop splashy before the start of KDM
d_mkrlscript init splashy.boot ""
echo -e "\tLD_LIBRARY_PATH=/opt/openslx/uclib-rootfs/lib/ \
- /opt/openslx/plugin-repo/bootsplash/bin/splashy_update \
+ /opt/openslx/plugin-repo/bootsplash/sbin/splashy_update \
exit 2>/dev/null \
\n\ttype killall >/dev/null 2>&1 && killall -9 splashy" \
>>/mnt/etc/init.d/splashy.boot
@@ -42,7 +42,7 @@ if [ -e /initramfs/plugin-conf/bootsplash.conf ]; then
-e "s,#0x42#,# shutdown splashy - added by splashy plugin\n\t#0x42#," \
-e "s,#0x42#,if [ ! \"x$(ps aux |grep splashy |grep -v grep | wc -l)\" -eq \"x0\" ]; then\n\t#0x42#, " \
-e "s,#0x42#, LD_LIBRARY_PATH=/opt/openslx/uclib-rootfs/lib/ \\\\\n\t#0x42#," \
- -e "s,#0x42#, /opt/openslx/plugin-repo/bootsplash/bin/splashy_update exit \\\\\n\t#0x42#," \
+ -e "s,#0x42#, /opt/openslx/plugin-repo/bootsplash/sbin/splashy_update exit \\\\\n\t#0x42#," \
-e "s,#0x42#, 2>/dev/null \n\t#0x42#," \
-e "s,#0x42#,fi \n\t#0x42#," \
-e "s,#0x42#,#splashy-stop-done#," \
diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include
index a4b3454b..53120f2c 100644
--- a/os-plugins/plugins/virtualbox/files/run-virt.include
+++ b/os-plugins/plugins/virtualbox/files/run-virt.include
@@ -162,44 +162,44 @@ fi
# TODO: MEM muss noch angepasst werden. Maschine crasht wenn nehr als 50% MEM
# memory part equal to vmware plugin
# percentage of memory to use for virtualbox in standard case
-if [ -n "${forcemem}" ]; then
- mem="${forcemem}"
-else
- permem=30
- if [ "${totalmem}" -ge "1600" ]; then
- permem=40
- fi
- # check if /tmp is on harddisk
- if grep -qe "/dev/.* /tmp " /proc/mounts ; then
- permem=60
- id44="1"
- # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
- # (40% vmware | 40% confdir(vmem...) | 20% host
- # VMplayer 2+ issue
- # TODO: makes this sense for vbox?
- #if [ "${totalmem}" -ge "2500" ]; then
- #permem=40
- #rmdir ${snapshotdir}
- #snapshotdirold=${snapshotdir}
- #snapshotdir=/dev/shm/${self}/${USER}/${VM_ID}
- #mkdir -p ${snapshotdir}
- #ln -sf ${snapshotdir} ${snapshotdirold}
- #fi
- fi
- mem=$(expr ${totalmem} / 100 \* ${permem})
- if [ "${id44}" = "1" ]; then
- hostmem=$(expr ${totalmem} - ${mem})
- else
- hostmem=$(expr ${totalmem} - ${mem} - ${mem})
- fi
- #permem=40
- #mem=$(expr ${totalmem} * ${permem})
- if [ "${mem}" -lt "256" ] || [ "${hostmem}" -lt "256" ]; then
- writelog "Memory out of range: ${mem} MB (guest) / ${hostmem} MB (host)!"
- writelog "Min. 256 MB for host and guest!"
- cleanexit 1
- fi
-fi
+#if [ -n "${forcemem}" ]; then
+# mem="${forcemem}"
+#else
+# permem=30
+# if [ "${totalmem}" -ge "1600" ]; then
+# permem=40
+# fi
+# # check if /tmp is on harddisk
+# if grep -qe "/dev/.* /tmp " /proc/mounts ; then
+# permem=60
+# id44="1"
+# # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
+# # (40% vmware | 40% confdir(vmem...) | 20% host
+# # VMplayer 2+ issue
+# # TODO: makes this sense for vbox?
+# #if [ "${totalmem}" -ge "2500" ]; then
+# #permem=40
+# #rmdir ${snapshotdir}
+# #snapshotdirold=${snapshotdir}
+# #snapshotdir=/dev/shm/${self}/${USER}/${VM_ID}
+# #mkdir -p ${snapshotdir}
+# #ln -sf ${snapshotdir} ${snapshotdirold}
+# #fi
+# fi
+# mem=$(expr ${totalmem} / 100 \* ${permem})
+# if [ "${id44}" = "1" ]; then
+# hostmem=$(expr ${totalmem} - ${mem})
+# else
+# hostmem=$(expr ${totalmem} - ${mem} - ${mem})
+# fi
+# #permem=40
+# #mem=$(expr ${totalmem} * ${permem})
+# if [ "${mem}" -lt "256" ] || [ "${hostmem}" -lt "256" ]; then
+# writelog "Memory out of range: ${mem} MB (guest) / ${hostmem} MB (host)!"
+# writelog "Min. 256 MB for host and guest!"
+# cleanexit 1
+# fi
+#fi
# translate network cards
case "${network_card}" in
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index a644ea5b..23f026c7 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -283,10 +283,14 @@ VM_ID="00"
cpu_cores=${cpu_cores:-"1"}
# total amount of memory defined in stage 3
-permem=60
+permem=50
# get a result which can be divided through 4
mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
-[ -n "${mainvirtmem}" ] && forcemem=$(expr ${mainvirtmem} / 4 \* 4)
+if [ -n "${mainvirtmem}" ]; then
+ forcemem=$(expr ${mainvirtmem} / 4 \* 4)
+ mem=${forcemem}
+fi
+hostmem=$(expr ${totalmem} - ${mem})
# configuring ethernet mac address: first 3 bytes are fixed (00:50:56)
# 4th byte is the VM-ID (0D)
diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include
index 9472d87f..2010dc4b 100644
--- a/os-plugins/plugins/vmware/files/run-virt.include
+++ b/os-plugins/plugins/vmware/files/run-virt.include
@@ -236,8 +236,6 @@ conffile="${confdir}/run-vmware.conf"
diskfile=${vmpath}
# users vmware config folder
vmhome="${HOME}/.vmware"
-# logfile
-logfile=${OPENSLX_DEFAULT_LOGDIR}/run-vmware.${USER}.$$.log
# get several version infos for vmware/player
. ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmware/vmware.conf
@@ -302,41 +300,41 @@ case "$parallel" in
esac
# adjust memory available for vmware guests
-if [ -n "${forcemem}" ]; then
- mem="${forcemem}"
-else
- case "$vmversion" in
- 2.*|6.*)
- permem=30
- ;;
- 3.*|7.*)
- permem=25
- ;;
- esac
- if [ "${totalmem}" -ge "2500" ]; then
- permem=40
- fi
- # check if /tmp is on harddisk
- if grep -qe "/dev/.* /tmp " /proc/mounts ; then
- permem=60
- id44="1"
- # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
- # (40% vmware | 40% confdir(vmem...) | 20% host
- # VMplayer 2+ issue
- if [ "${totalmem}" -ge "2500" ]; then
- permem=40
- confdir=/dev/shm/vmware/$USER
- conffile=${confdir}/run-vmware.conf
- mkdir -p /dev/shm/vmware/$USER
- fi
- fi
- mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
- if [ "${id44}" = "1" ]; then
- hostmem=$(expr ${totalmem} - ${mem})
- else
- hostmem=$(expr ${totalmem} - ${mem} - ${mem})
- fi
-fi
+#if [ -n "${forcemem}" ]; then
+# mem="${forcemem}"
+#else
+# case "$vmversion" in
+# 2.*|6.*)
+# permem=30
+# ;;
+# 3.*|7.*)
+# permem=25
+# ;;
+# esac
+# if [ "${totalmem}" -ge "2500" ]; then
+# permem=40
+# fi
+# # check if /tmp is on harddisk
+# if grep -qe "/dev/.* /tmp " /proc/mounts ; then
+# permem=60
+# id44="1"
+# # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
+# # (40% vmware | 40% confdir(vmem...) | 20% host
+# # VMplayer 2+ issue
+# if [ "${totalmem}" -ge "2500" ]; then
+# permem=40
+# confdir=/dev/shm/vmware/$USER
+# conffile=${confdir}/run-vmware.conf
+# mkdir -p /dev/shm/vmware/$USER
+# fi
+# fi
+# mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
+# if [ "${id44}" = "1" ]; then
+# hostmem=$(expr ${totalmem} - ${mem})
+# else
+# hostmem=$(expr ${totalmem} - ${mem} - ${mem})
+# fi
+#fi
# check if ide/scsi and hwver of image
# read only the first 30 lines to be shure
@@ -387,16 +385,6 @@ done
# logging and stdout
################################################################################
-# function to write to stdout and logfile
-writelog ()
-{
- # write to stdout
- echo -e "$1"
-
- # log in file
- echo -e "$1" >>${logfile}
-}
-
# log script information
writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n"
writelog "Starting with non-persistent mode ...\n"
@@ -415,7 +403,6 @@ writelog "\tConfdir:\t${confdir}"
writelog "\tConffile:\t${conffile}"
writelog "\tRedodir:\t${redodir}"
writelog "\tVMhome:\t\t${vmhome}"
-writelog "\tLogfile:\t${logfile}"
writelog "\t/tmp info: \
$(grep "/tmp " /proc/mounts) $(df -h | grep " /tmp$" | awk '{print $2}')"
# hw setup