summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-12-22 23:43:43 +0100
committerDirk von Suchodoletz2008-12-22 23:43:43 +0100
commita8b7e47059359904a2953b99e3e634bac0331c71 (patch)
treeeee39a17237230516a76567425b5a38096f78e46
parentJust explained the use of the filter script: It allows to dynamically (diff)
downloadcore-a8b7e47059359904a2953b99e3e634bac0331c71.tar.gz
core-a8b7e47059359904a2953b99e3e634bac0331c71.tar.xz
core-a8b7e47059359904a2953b99e3e634bac0331c71.zip
A fix to the packet install mechanism in the x11vnc plugin. Added some
configuration scripting for x11gen mode of the plugin. See [wiki:x11vnc plugin info] for more information. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2451 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm13
-rw-r--r--os-plugins/plugins/x11vnc/XX_x11vnc.sh82
2 files changed, 56 insertions, 39 deletions
diff --git a/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm b/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm
index e86bbfcf..98667c3a 100644
--- a/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm
+++ b/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm
@@ -35,9 +35,10 @@ sub getInfo
my $self = shift;
return {
description => unshiftHereDoc(<<' End-of-Here'),
- enables x11vnc server
+ enables x11vnc server (user or xorg)
End-of-Here
- precedence => 50,
+ # depends on xorg to be configured
+ precedence => 80,
};
}
@@ -67,7 +68,7 @@ sub getAttrInfo
End-of-Here
content_regex => qr{^(x11user|x11gen|fb)$},
content_descr => 'x11user for user, x11gen for general X access or fb',
- default => 'x11user',
+ default => 'x11gen',
},
'x11vnc::scale' => {
@@ -174,7 +175,6 @@ sub getAttrInfo
content_descr => 'use 1 or yes to enable - 0 or no to disable',
default => 'yes',
},
-
};
}
@@ -189,9 +189,10 @@ sub installationPhase
# should we distinguish between the two different packages!?
# libvnc should be part of the xorg package!? (so no check needed)
+ my $engine = $self->{'os-plugin-engine'};
if (!isInPath('x11vnc')) {
- $self->{'distro'}->installPackages(
- $self->{'os-plugin-engine'}->getInstallablePackagesForSelection('x11vnc')
+ $engine->installPackages(
+ $engine->getInstallablePackagesForSelection('x11vnc')
);
} else {
vlog(3, "x11vnc is already installed");
diff --git a/os-plugins/plugins/x11vnc/XX_x11vnc.sh b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
index d1842e5f..98c29cce 100644
--- a/os-plugins/plugins/x11vnc/XX_x11vnc.sh
+++ b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
@@ -16,21 +16,33 @@
# configuration failed somehow
[ -d /initramfs/plugin-conf ] || error "${init_picfg}" nonfatal
+# function to add vnc functionality to xorg server
+addvnc2xorg () {
+ sed -e '/^# autog/a# modified by x11vnc plugin (adding vnc module config)' \
+ -e '/\"Module\"/a\\ \\ Load "vnc"' \
+ -e '/\"Device\"/a\\ \\ Option "rfbauth"\t "/etc/X11"' \
+ -e '/\"Device\"/a\\ \\ Option "usevnc"\t "yes"}' \
+ -i /mnt/etc/X11/xorg.conf
+}
+
+# main script
if [ -e /initramfs/plugin-conf/x11vnc.conf ]; then
. /initramfs/plugin-conf/x11vnc.conf
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
- # default parameters
- PARAMS="-bg -forever"
- # client restrictions
- if [ -z x11vnc_allowed_hosts ]; then
- PARAMS="$PARAMS -allow $x11vnc_allowd_hosts"
- fi
- # mode
+ # configure x11vnc user mode or framebuffer
+ if [ "$x11vnc_mode" = "x11user" || "$x11vnc_mode" = "fb" ] ; then
+ # create config dir for stage 3
+ mkdir -p /mnt/etc/x11vnc
+ # default parameters
+ PARAMS="-bg -forever"
+ # client restrictions
+ if [ -z x11vnc_allowed_hosts ]; then
+ PARAMS="$PARAMS -allow $x11vnc_allowd_hosts"
+ fi
+ # mode
case "$x11vnc_mode" in
- x11)
+ x11user)
PARAMS="$PARAMS -display :0"
X11VNC_X11=1
;;
@@ -67,34 +79,38 @@ if [ -e /initramfs/plugin-conf/x11vnc.conf ]; 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 ...";
+ # x11gen allows a general access to the running X server at every time
+ elif [ "$x11vnc_mode" = "x11gen" ]
+ ( waitfor /mnt/etc/X11/xorg.conf 10000; addvnc2xorg ) &
fi
fi