summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorSebastian Schmelzer2009-05-29 21:57:33 +0200
committerSebastian Schmelzer2009-05-29 21:57:33 +0200
commit06fe0f0e0ebeca52027604a4f89db196379c30b1 (patch)
treeffecbd7781fde2a13fc9888a3fe96c9b001e6af2 /os-plugins
parentStarting to enable the CGI script to write configurations ... (diff)
downloadcore-06fe0f0e0ebeca52027604a4f89db196379c30b1.tar.gz
core-06fe0f0e0ebeca52027604a4f89db196379c30b1.tar.xz
core-06fe0f0e0ebeca52027604a4f89db196379c30b1.zip
testversion of kiosk plugin with "profiles"
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2909 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/kiosk/OpenSLX/OSPlugin/kiosk.pm20
-rw-r--r--os-plugins/plugins/kiosk/XX_kiosk.sh15
l---------os-plugins/plugins/kiosk/files/profiles/plain/.bashrc1
-rw-r--r--os-plugins/plugins/kiosk/files/profiles/plain/bashrc (renamed from os-plugins/plugins/kiosk/files/bashrc)0
l---------os-plugins/plugins/kiosk/files/profiles/vmchooser/.bashrc1
l---------os-plugins/plugins/kiosk/files/profiles/vmchooser/.xinitrc1
-rw-r--r--os-plugins/plugins/kiosk/files/profiles/vmchooser/bashrc4
-rw-r--r--os-plugins/plugins/kiosk/files/profiles/vmchooser/xinitrc5
8 files changed, 42 insertions, 5 deletions
diff --git a/os-plugins/plugins/kiosk/OpenSLX/OSPlugin/kiosk.pm b/os-plugins/plugins/kiosk/OpenSLX/OSPlugin/kiosk.pm
index 8fe66450..6c42a6c2 100644
--- a/os-plugins/plugins/kiosk/OpenSLX/OSPlugin/kiosk.pm
+++ b/os-plugins/plugins/kiosk/OpenSLX/OSPlugin/kiosk.pm
@@ -17,6 +17,8 @@ use warnings;
use base qw(OpenSLX::OSPlugin::Base);
+use File::Path;
+
use OpenSLX::Basics;
use OpenSLX::Utils;
@@ -32,7 +34,9 @@ sub new
my $self = {
name => 'kiosk',
};
-
+
+ mkpath("$openslxConfig{'config-path'}/plugins/kiosk/profiles");
+
return bless $self, $class;
}
@@ -64,6 +68,18 @@ sub getAttrInfo
content_descr => '1 means active - 0 means inactive',
default => '1',
},
+ 'kiosk::profile' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ should the 'kiosk'-plugin setup a specific profile for the
+ kiosk user? (profile data should be placed in
+ /etc/opt/openslx/plugins/kiosk/profiles/<profilename>/)
+ End-of-Here
+ #content_regex => qr{^(0|1)$},
+ content_descr => 'name of profile',
+ default => 'plain',
+ },
};
}
@@ -83,6 +99,8 @@ sub installationPhase
copyFile("$filesDir/bashrc","$pluginRepoPath");
copyFile("$filesDir/kgetty","$pluginRepoPath");
+ system(qq{cp -r $filesDir/profiles/* $openslxConfig{'config-path'}/plugins/kiosk/profiles/});
+
my $scriptpath = "$pluginRepoPath/setup.kgetty";
my $script = $self->{distro}->getKgettySetupScript();
diff --git a/os-plugins/plugins/kiosk/XX_kiosk.sh b/os-plugins/plugins/kiosk/XX_kiosk.sh
index e835bed1..4e3bc91f 100644
--- a/os-plugins/plugins/kiosk/XX_kiosk.sh
+++ b/os-plugins/plugins/kiosk/XX_kiosk.sh
@@ -22,9 +22,16 @@ if [ -e /initramfs/plugin-conf/kiosk.conf ]; then
if [ $kiosk_active -ne 0 ]; then
[ $DEBUGLEVEL -gt 0 ] && echo "executing the 'kiosk' os-plugin ...";
- # create new user
- chroot /mnt useradd -s /bin/bash -m kiosk
- cp /mnt/opt/openslx/plugin-repo/kiosk/bashrc /mnt/home/kiosk/.bashrc
+
+ profile_path="/etc/opt/openslx/plugins/kiosk/profiles/"
+
+ if [ -e /mnt/$profile_path/$kiosk_profile/ ]; then
+ # create new user
+ chroot /mnt useradd -s /bin/bash -k $profile_path/$kiosk_profile/ -m kiosk
+ chroot /mnt chown kiosk /home/kiosk/ -R
+ else
+ chroot /mnt useradd -s /bin/bash -k $profile_path/plain/ -m kiosk
+ fi
# setup custom rungetty
mkdir -p /mnt/root/bin
@@ -38,4 +45,4 @@ if [ -e /initramfs/plugin-conf/kiosk.conf ]; then
fi
-fi \ No newline at end of file
+fi
diff --git a/os-plugins/plugins/kiosk/files/profiles/plain/.bashrc b/os-plugins/plugins/kiosk/files/profiles/plain/.bashrc
new file mode 120000
index 00000000..cee304e6
--- /dev/null
+++ b/os-plugins/plugins/kiosk/files/profiles/plain/.bashrc
@@ -0,0 +1 @@
+bashrc \ No newline at end of file
diff --git a/os-plugins/plugins/kiosk/files/bashrc b/os-plugins/plugins/kiosk/files/profiles/plain/bashrc
index 28694f85..28694f85 100644
--- a/os-plugins/plugins/kiosk/files/bashrc
+++ b/os-plugins/plugins/kiosk/files/profiles/plain/bashrc
diff --git a/os-plugins/plugins/kiosk/files/profiles/vmchooser/.bashrc b/os-plugins/plugins/kiosk/files/profiles/vmchooser/.bashrc
new file mode 120000
index 00000000..cee304e6
--- /dev/null
+++ b/os-plugins/plugins/kiosk/files/profiles/vmchooser/.bashrc
@@ -0,0 +1 @@
+bashrc \ No newline at end of file
diff --git a/os-plugins/plugins/kiosk/files/profiles/vmchooser/.xinitrc b/os-plugins/plugins/kiosk/files/profiles/vmchooser/.xinitrc
new file mode 120000
index 00000000..5539532c
--- /dev/null
+++ b/os-plugins/plugins/kiosk/files/profiles/vmchooser/.xinitrc
@@ -0,0 +1 @@
+xinitrc \ No newline at end of file
diff --git a/os-plugins/plugins/kiosk/files/profiles/vmchooser/bashrc b/os-plugins/plugins/kiosk/files/profiles/vmchooser/bashrc
new file mode 100644
index 00000000..28694f85
--- /dev/null
+++ b/os-plugins/plugins/kiosk/files/profiles/vmchooser/bashrc
@@ -0,0 +1,4 @@
+if [ "x$(tty)" == "x/dev/tty1" ]; then
+ startx
+ exit
+fi
diff --git a/os-plugins/plugins/kiosk/files/profiles/vmchooser/xinitrc b/os-plugins/plugins/kiosk/files/profiles/vmchooser/xinitrc
new file mode 100644
index 00000000..c50baf70
--- /dev/null
+++ b/os-plugins/plugins/kiosk/files/profiles/vmchooser/xinitrc
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+xsetroot -bg navy
+vmchooser -p /dev/null
+bash