summaryrefslogtreecommitdiff
path: root/recipes/login-manager
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/login-manager
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/login-manager')
-rw-r--r--recipes/login-manager/files/login-manager102
-rw-r--r--recipes/login-manager/login-manager.bb18
2 files changed, 120 insertions, 0 deletions
diff --git a/recipes/login-manager/files/login-manager b/recipes/login-manager/files/login-manager
new file mode 100644
index 0000000000..deadaa61c2
--- /dev/null
+++ b/recipes/login-manager/files/login-manager
@@ -0,0 +1,102 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2005
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Date: 09-FEB-06
+#
+# This script checks if a keyboard is present and then runs a propper LM.
+# On devices w/o keyboard, a LM from the NO_KBD_LMS variable is selected.
+#
+# If more than one usable login-manager is found, the first one is used.
+#
+# Users can force their favorite login-manager to be selected via symlinking
+# a LM from /etc/X11/login-managers to /etc/X11/login-managers/default.
+#
+
+LM_PATH="/etc/X11/login-managers"
+
+# A list of login-manager which display an OSD keyboard
+NO_KBD_LMS="gpe-dm"
+
+#
+# * * * No user-variables behind this point * * *
+#
+
+run_wm() {
+ if test -z "$1"
+ then
+ echo -e "\t* No valid login-managers found"
+ exit 0
+ fi
+
+ echo "$1" > /tmp/_running_lm
+ echo -e "\t* Starting `basename "$1"`\n--\n"
+
+ "$1" start
+
+ exit 0
+}
+
+get_valid_lms() {
+ if test "$HAS_KBD" = no
+ then
+ for lm in $NO_KBD_LMS
+ do
+ if echo "$LM_FILES" | grep -iq "$lm"
+ then
+ test -x "$LM_PATH/$lm" && VALID_LMS="$VALID_LMS $lm" || echo -e "\t* Discarding [$lm]: Not executable"
+ fi
+ done
+ else
+ for lm in $LM_FILES
+ do
+ test -x "$LM_PATH/$lm" && VALID_LMS="$VALID_LMS $lm" || echo -e "\t* Discarding [$lm]: Not executable"
+ done
+ fi
+ SELECTED_LM="$LM_PATH/`echo "$VALID_LMS" | awk '{print $1}'`"
+}
+
+do_start(){
+# DISPLAY_MODE="$(fbset | grep mode | sed -n "s/.*\"\(.*\)\-.*/\1/p")"
+ HARDWARE_MODEL="`cat /proc/cpuinfo | sed -n "s/^Hardware.*\:\ \(.*\)/\1/p"`"
+ LM_FILES="`ls -1 "$LM_PATH" | grep -v default`"
+
+ echo "$HARDWARE_MODEL" | grep -iq "SHARP" && HAS_KBD=yes || HAS_KBD="no"
+
+ echo "Launching login-manager"
+ echo -e "\t* Model has keyboard: $HAS_KBD"
+
+ # The user is always right
+ if test -x "$LM_PATH/default" >/dev/null 2>&1
+ then
+ echo "\t* Using default manager"
+ run_wm "$LM_PATH/default"
+ fi
+
+ get_valid_lms
+
+ echo -e "\t* Valid modes:$VALID_LMS"
+
+ run_wm "$SELECTED_LM"
+}
+
+do_stop(){
+ echo "Stopping login-manager..."
+ `cat /tmp/_running_lm` stop
+
+ for x in Xfbdev Xomap Xorg Xepson
+ do
+ killall "$x" >/dev/null 2>&1
+ done
+}
+
+case "$1" in
+ start) do_start;;
+ stop) do_stop;;
+ restart) do_stop
+ do_start;;
+ *) echo "Usage: `basename $0` [start|stop|restart]"
+ exit 0;;
+esac
+
diff --git a/recipes/login-manager/login-manager.bb b/recipes/login-manager/login-manager.bb
new file mode 100644
index 0000000000..ada7c364e7
--- /dev/null
+++ b/recipes/login-manager/login-manager.bb
@@ -0,0 +1,18 @@
+LICENSE = "GPL"
+inherit update-rc.d
+
+DESCRIPTION = "Initscript for login-managers"
+SECTION = "base"
+PRIORITY = "optional"
+PR = "r1"
+
+INITSCRIPT_NAME = "login-manager"
+INITSCRIPT_PARAMS = "start 99 5 . stop 20 0 1 6 ."
+
+SRC_URI = "file://login-manager"
+
+do_install() {
+ install -d ${D}/etc/init.d
+ install -m 0755 ${WORKDIR}/login-manager ${D}/etc/init.d/
+}
+