summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-08-06 10:35:09 +0200
committerDirk von Suchodoletz2008-08-06 10:35:09 +0200
commit7ff8a66fd6b0cad46405ecd0a505d3e6cde5dde4 (patch)
treef734ebe52eb0bda56faccd0b3c9911a63b027a4b
parentSmall dirty bug in XX_vmware.sh fixed (-p is unknown to testmkd) (diff)
downloadcore-7ff8a66fd6b0cad46405ecd0a505d3e6cde5dde4.tar.gz
core-7ff8a66fd6b0cad46405ecd0a505d3e6cde5dde4.tar.xz
core-7ff8a66fd6b0cad46405ecd0a505d3e6cde5dde4.zip
Formatting, unification of plugin stage3 scripts ...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1965 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--os-plugins/plugins/desktop/XX_desktop.sh17
-rw-r--r--os-plugins/plugins/example/XX_example.sh11
-rw-r--r--os-plugins/plugins/vmchooser/XX_vmchooser.sh21
-rw-r--r--os-plugins/plugins/x11vnc/XX_x11vnc.sh81
-rw-r--r--os-plugins/plugins/xen/XX_xen.sh26
5 files changed, 90 insertions, 66 deletions
diff --git a/os-plugins/plugins/desktop/XX_desktop.sh b/os-plugins/plugins/desktop/XX_desktop.sh
index c014c829..ff619bdc 100644
--- a/os-plugins/plugins/desktop/XX_desktop.sh
+++ b/os-plugins/plugins/desktop/XX_desktop.sh
@@ -1,5 +1,3 @@
-#!/bin/ash
-#
# Copyright (c) 2007..2008 - RZ Uni Freiburg
# Copyright (c) 2008 - OpenSLX GmbH
#
@@ -13,9 +11,9 @@
#
# stage3 part of 'desktop' plugin - the runlevel script
#
-. /etc/functions
-. /etc/distro-functions
-[ -d /etc/sysconfig ] && . /etc/sysconfig/config
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
+
if [ -e /initramfs/plugin-conf/desktop.conf ]; then
. /initramfs/plugin-conf/desktop.conf
if [ $desktop_active -ne 0 ]; then
@@ -28,16 +26,17 @@ if [ -e /initramfs/plugin-conf/desktop.conf ]; then
if [ -e /mnt/opt/openslx/plugin-repo/desktop/${desktop_manager}/desktop.sh ]
then . /mnt/opt/openslx/plugin-repo/desktop/${desktop_manager}/desktop.sh
else
- error fatal "This shouldn't fail - you might have forgotten to export \
-your system."
+ error "This shouldn't fail - you might have forgotten to export \
+your system." fatal
fi
# TODO: move the following stuff into the gdm-specific desktop.sh
# (and perhaps handle through a template?)
if [ "${desktop_manager}" = "XXXkdm" ]; then
cp -a /usr/share/themes/kdm /mnt/var/lib/openslx/themes
- sed -i "s,Theme=.*,Theme=/var/lib/openslx/themes/kdm," /mnt/etc/kde3/kdm/kdmrc
- sed -i "s,UseTheme=.*,UseTheme=true," /mnt/etc/kde3/kdm/kdmrc
+ sed "s,Theme=.*,Theme=/var/lib/openslx/themes/kdm," \
+ -i /mnt/etc/kde3/kdm/kdmrc
+ sed "s,UseTheme=.*,UseTheme=true," -i /mnt/etc/kde3/kdm/kdmrc
fi
[ $DEBUGLEVEL -gt 0 ] && echo "done with 'desktop' os-plugin ...";
diff --git a/os-plugins/plugins/example/XX_example.sh b/os-plugins/plugins/example/XX_example.sh
index dedcfc97..18f2e47d 100644
--- a/os-plugins/plugins/example/XX_example.sh
+++ b/os-plugins/plugins/example/XX_example.sh
@@ -1,4 +1,10 @@
-#!/bin/ash
+# Copyright (c) 2008 - OpenSLX GmbH
+#
+# This program/file 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 feedback to feedback@openslx.org
#
# stage3 part of 'example' plugin - the runlevel script
#
@@ -23,6 +29,9 @@
#
# if you have any questions regarding the use of this file, please drop a mail
# to: ot@openslx.com, or join the IRC-channel '#openslx' (on freenode).
+#
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
if [ -e /initramfs/plugin-conf/example.conf ]; then
. /initramfs/plugin-conf/example.conf
diff --git a/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
index 1bc964d0..bdce3429 100644
--- a/os-plugins/plugins/vmchooser/XX_vmchooser.sh
+++ b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
@@ -1,5 +1,3 @@
-#!/bin/ash
-#
# Copyright (c) 2008 - RZ Uni Freiburg
# Copyright (c) 2008 - OpenSLX GmbH
#
@@ -11,15 +9,20 @@
#
# General information about OpenSLX can be found at http://openslx.org
#
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
CONFFILE="/initramfs/plugin-conf/vmchooser.conf"
if [ -e $CONFFILE ]; then
- . $CONFFILE
- if [ $vmchooser_active -ne 0 ]; then
- [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'vmchooser' os-plugin ...";
- [ $DEBUGLEVEL -gt 0 ] && echo "copying default .desktop file ...";
- cp /mnt/opt/openslx/plugin-repo/vmchooser/default.desktop /mnt/etc/X11/sessions/
- [ $DEBUGLEVEL -gt 0 ] && echo "done with 'vmchooser' os-plugin ...";
- fi
+ . $CONFFILE
+ if [ $vmchooser_active -ne 0 ] ; then
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'vmchooser' os-plugin ..."
+ [ $DEBUGLEVEL -gt 0 ] && echo "copying default .desktop file ..."
+ # we expect to have this directory to be interpreted by gdm/kdm
+ testmkd /mnt/etc/X11/sessions
+ cp /mnt/opt/openslx/plugin-repo/vmchooser/default.desktop \
+ /mnt/etc/X11/sessions/
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'vmchooser' os-plugin ..."
+ fi
fi
diff --git a/os-plugins/plugins/x11vnc/XX_x11vnc.sh b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
index 327d247a..16327b0a 100644
--- a/os-plugins/plugins/x11vnc/XX_x11vnc.sh
+++ b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
@@ -1,5 +1,3 @@
-#!/bin/ash
-#
# Copyright (c) 2007..2008 - RZ Uni Freiburg
# Copyright (c) 2008 - OpenSLX GmbH
#
@@ -11,6 +9,9 @@
#
# General information about OpenSLX can be found at http://openslx.org
#
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
+
[ -e /etc/functions ] && . /etc/functions
[ -e /etc/distro-functions ] && . /etc/distro-functions
[ -d /etc/sysconfig ] && . /etc/sysconfig/config
@@ -20,7 +21,7 @@ if [ -e /initramfs/plugin-conf/x11vnc.conf ]; then
if [ $x11vnc_active -ne 0 ]; then
[ $DEBUGLEVEL -gt 0 ] && echo "executing the 'x11vnc' os-plugin ...";
# create config dir for stage 3
- mkdir -p /mnt/etc/x11vnc
+ mkdir -p /mnt/etc/x11vnc
# default parameters
PARAMS="-bg -forever"
# client restrictions
@@ -46,52 +47,54 @@ if [ -e /initramfs/plugin-conf/x11vnc.conf ]; then
echo "$x11vnc_viewonlypass" >> /mnt/etc/x11vnc/passwd
# multiuser handling
sed -i "s/,/\n/" /mnt/etc/x11vnc/passwd
- # add parameter to commandline
+ # add parameter to commandline
PARAMS="$PARAMS -passwdfile rm:/etc/x11vnc/passwd"
;;
rfbauth)
- # use rfbauth
- vncpasswd "$x11vnc_pass" > /mnt/etc/x11vnc/passwd
- PARAMS="$PARAMS -rfbauth /etc/x11vnc/passwd"
- ;;
- *)
- # no password
- PARAMS="$PARAMS -nopw"
- ;;
- esac
+ # use rfbauth
+ vncpasswd "$x11vnc_pass" > /mnt/etc/x11vnc/passwd
+ PARAMS="$PARAMS -rfbauth /etc/x11vnc/passwd"
+ ;;
+ *)
+ # no password
+ PARAMS="$PARAMS -nopw"
+ ;;
+ esac
- # force viewonly
- if [ "$x11vnc_force_viewonly" = "1" -o "$x11vnc_force_viewonly" = "yes" ]; then
- PARAMS="$PARAMS -viewonly"
- fi
+ # force viewonly
+ if [ "$x11vnc_force_viewonly" = "1" \
+ -o "$x11vnc_force_viewonly" = "yes" ]; then
+ PARAMS="$PARAMS -viewonly"
+ fi
- # force localhost
- if [ "$x11vnc_force_localhost" = "1" -o "$x11vnc_force_localhost" = "yes" ]; then
- PARAMS="$PARAMS -localhost"
- fi
+ # force localhost
+ if [ "$x11vnc_force_localhost" = "1" \
+ -o "$x11vnc_force_localhost" = "yes" ]; then
+ PARAMS="$PARAMS -localhost"
+ fi
- # enable logging
- if [ "$x11vnc_logging" = "1" -o "$x11vnc_logging" = "yes" ]; then
- PARAMS="$PARAMS -o /var/log/x11vnc.log"
- fi
+ # enable logging
+ if [ "$x11vnc_logging" = "1" -o "$x11vnc_logging" = "yes" ]; then
+ PARAMS="$PARAMS -o /var/log/x11vnc.log"
+ fi
- # shared desktops
- if [ "$x11vnc_shared" = "1" -o "$x11vnc_shared" = "yes" ]; then
- PARAMS="$PARAMS -shared"
- fi
+ # shared desktops
+ if [ "$x11vnc_shared" = "1" -o "$x11vnc_shared" = "yes" ]; then
+ PARAMS="$PARAMS -shared"
+ fi
- # scale desktop
- if [ "$x11vnc_scale" != "" ]; then
- $PARAMS="$PARAMS -scale $x11vnc_scale"
- fi
+ # scale desktop
+ if [ "$x11vnc_scale" != "" ]; then
+ $PARAMS="$PARAMS -scale $x11vnc_scale"
+ fi
- # write config file
- echo "# parameters generated by $0" > /mnt/etc/x11vnc/x11vnc.conf
- echo "X11VNC_PARAMS=\"$PARAMS\"" >> /mnt/etc/x11vnc/x11vnc.conf
- echo "X11VNC_X11=\"$X11VNC_X11\"" >> /mnt/etc/x11vnc/x11vnc.conf
+ # write config file
+ echo "# parameters generated by $0" > /mnt/etc/x11vnc/x11vnc.conf
+ echo "X11VNC_PARAMS=\"$PARAMS\"" >> /mnt/etc/x11vnc/x11vnc.conf
+ echo "X11VNC_X11=\"$X11VNC_X11\"" >> /mnt/etc/x11vnc/x11vnc.conf
- rllinker "x11vnc" 30 10
+ rllinker "x11vnc" 30 10
- [ $DEBUGLEVEL -gt 0 ] && echo "done with 'x11vnc' os-plugin ...";
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'x11vnc' os-plugin ...";
fi
fi
diff --git a/os-plugins/plugins/xen/XX_xen.sh b/os-plugins/plugins/xen/XX_xen.sh
index 4f545bbd..c98a707f 100644
--- a/os-plugins/plugins/xen/XX_xen.sh
+++ b/os-plugins/plugins/xen/XX_xen.sh
@@ -1,13 +1,23 @@
-#! /bin/sh
+# Copyright (c) 2007..2008 - RZ Uni Freiburg
+# Copyright (c) 2008 - OpenSLX GmbH
+#
+# This program/file 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 feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
#
# stage3 part of 'xen' plugin - the runlevel script
#
-mkdir -p /mnt/var/log/xen &
-mkdir -p /mnt/var/run/xend &
-mkdir -p /mnt/var/run/xenstored &
+# script is included from init via the "." load function - thus it has all
+# variables and functions available
+
+testmkd /mnt/var/log/xen
+testmkd /mnt/var/run/xend
+testmkd /mnt/var/run/xenstored
cd /mnt/etc/init.d/rc5.d
-ln -s ../xendomains K08xendomains
-ln -s ../xend K09xend
-ln -s ../xend S13xend
-ln -s ../xendomains S14xendomains
+rllinker "xendomains" 14 8
+rllinker "xend" 13 9
modprobe loop max_loop=64