summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2008-12-09 20:26:27 +0100
committerKoen Kooi <koen@openembedded.org>2008-12-09 20:26:27 +0100
commit093fba6f31eb53630978c28f847d6ec1ce70daf5 (patch)
tree669b2b2a3cc132d96c14782ee6fa99cbd85dc7cc /packages
parent14fdac3e6a1556fd9857c31cd22c2eade619ec84 (diff)
gdm: start adding infrastructure to make it start on boot and do something usefull
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/gnome/gdm/gdm73
-rw-r--r--packages/gnome/gdm/gdm.conf80
-rw-r--r--packages/gnome/gdm_2.24.1.bb42
3 files changed, 193 insertions, 2 deletions
diff --git a/packages/gnome/gdm/gdm b/packages/gnome/gdm/gdm
new file mode 100755
index 0000000000..0d43a6f91a
--- /dev/null
+++ b/packages/gnome/gdm/gdm
@@ -0,0 +1,73 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: gdm
+# Should-Start: console-screen acpid dbus hal network-manager
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: GNOME Display Manager
+# Description: Debian init script for the GNOME Display Manager
+### END INIT INFO
+#
+# Author: Ryan Murray <rmurray@debian.org>
+#
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/gdm
+
+test -x $DAEMON || exit 0
+
+if [ -r /etc/default/locale ]; then
+ . /etc/default/locale
+ export LANG LANGUAGE
+fi
+
+# To start gdm even if it is not the default display manager, change
+# HEED_DEFAULT_DISPLAY_MANAGER to "false."
+HEED_DEFAULT_DISPLAY_MANAGER=true
+DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
+
+case "$1" in
+ start)
+ CONFIGURED_DAEMON=$(basename "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2> /dev/null)")
+ if grep -wqs text /proc/cmdline; then
+ echo "Not starting GNOME Display Manager (gdm); found 'text' in kernel commandline."
+ elif [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ] && \
+ [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && \
+ [ "$CONFIGURED_DAEMON" != gdm ] ; then
+ echo "Not starting GNOME Display Manager; it is not the default display manager"
+ else
+ echo "Starting GNOME Display Manager" "gdm"
+ start-stop-daemon --start --quiet --exec $DAEMON
+ fi
+ ;;
+ stop)
+ echo "Stopping GNOME Display Manager" "gdm"
+ set +e
+ start-stop-daemon --stop --quiet --pidfile /var/run/gdm.pid \
+ --name gdm --retry 5
+ set -e
+ ;;
+ reload)
+ echo "Scheduling reload of GNOME Display Manager configuration" "gdm"
+ set +e
+ start-stop-daemon --stop --signal USR1 --quiet --pidfile \
+ /var/run/gdm.pid --name gdm
+ set -e
+ ;;
+ status)
+ status_of_proc -p "$PIDFILE" "$DAEMON" gdm && exit 0 || exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/gdm {start|stop|restart|reload|force-reload|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/packages/gnome/gdm/gdm.conf b/packages/gnome/gdm/gdm.conf
new file mode 100644
index 0000000000..559823b863
--- /dev/null
+++ b/packages/gnome/gdm/gdm.conf
@@ -0,0 +1,80 @@
+# GDM Custom Configuration file.
+#
+# This file is the appropriate place for specifying your customizations to the
+# GDM configuration. If you run gdmsetup, it will automatically edit this
+# file for you and will cause the daemon and any running GDM GUI programs to
+# automatically update with the new configuration. Not all configuration
+# options are supported by gdmsetup, so to modify some values it may be
+# necessary to modify this file directly by hand.
+#
+# This file overrides the default configuration settings. These settings
+# are stored in the GDM System Defaults configuration file, which is found
+# at the following location.
+#
+# /usr/share/gdm/defaults.conf.
+#
+# This file contains comments about the meaning of each configuration option,
+# so is also a useful reference. Also refer to the documentation links at
+# the end of this comment for further information. In short, to hand-edit
+# this file, simply add or modify the key=value combination in the
+# appropriate section in the template below this comment section.
+#
+# For example, if you want to specify a different value for the Enable key
+# in the "[debug]" section of your GDM System Defaults configuration file,
+# then add "Enable=true" in the "[debug]" section of this file. If the
+# key already exists in this file, then simply modify it.
+#
+# Older versions of GDM used the "gdm.conf" file for configuration. If your
+# system has an old gdm.conf file on the system, it will be used instead of
+# this file - so changes made to this file will not take effect. Consider
+# migrating your configuration to this file and removing the gdm.conf file.
+#
+# If you hand edit a GDM configuration file, you can run the following
+# command and the GDM daemon will immediately reflect the change. Any
+# running GDM GUI programs will also be notified to update with the new
+# configuration.
+#
+# gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
+#
+# e.g, the "Enable" key in the "[debug]" section would be "debug/Enable".
+#
+# You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
+# re-read the new configuration settings. You can also restart GDM by sending
+# a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes
+# any user session started by GDM to exit immediately while USR1 behaves like
+# gdm-safe-restart and will wait until all users log out before restarting GDM.
+#
+# For full reference documentation see the gnome help browser under
+# GNOME|System category. You can also find the docs in HTML form on
+# http://www.gnome.org/projects/gdm/
+#
+# NOTE: Lines that begin with "#" are considered comments.
+#
+# Have fun!
+
+[daemon]
+
+[security]
+
+[xdmcp]
+
+[gui]
+
+[greeter]
+
+[chooser]
+
+[debug]
+
+# Note that to disable servers defined in the GDM System Defaults
+# configuration file (such as 0=Standard, you must put a line in this file
+# that says 0=inactive, as described in the Configuration section of the GDM
+# documentation.
+#
+[servers]
+
+# Also note, that if you redefine a [server-foo] section, then GDM will
+# use the definition in this file, not the GDM System Defaults configuration
+# file. It is currently not possible to disable a [server-foo] section
+# defined in the GDM System Defaults configuration file.
+#
diff --git a/packages/gnome/gdm_2.24.1.bb b/packages/gnome/gdm_2.24.1.bb
index 24e36f5a11..cdca2f87ae 100644
--- a/packages/gnome/gdm_2.24.1.bb
+++ b/packages/gnome/gdm_2.24.1.bb
@@ -3,18 +3,56 @@ LICENSE = "GPL"
DEPENDS = "libpam gnome-doc-utils gtk+ libglade libgnomecanvas librsvg libxml2 libart-lgpl"
-inherit gnome
+PR = "r1"
-SRC_URI += "file://%gconf-tree.xml"
+inherit gnome update-rc.d
+
+SRC_URI += "file://%gconf-tree.xml \
+ file://gdm.conf \
+ file://gdm \
+ "
do_install_prepend() {
mkdir -p ${D}/var/lib/gdm/.gconf.mandatory
cp ${WORKDIR}/%gconf-tree.xml ${D}/var/lib/gdm/.gconf.mandatory/
+ install -d ${D}/${sysconfdir}/gdm
+ install -m 0644 ${WORKDIR}/gdm.conf ${D}/${sysconfdir}/gdm/
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/gdm ${D}/${sysconfdir}/init.d/
}
FILES_${PN} += "${datadir}/icon* \
${datadir}/xsession*"
+CONFFILES_${PN} += "${sysconfdir}/gdm/gdm.conf ${sysconfdir}/init.d/gdm"
+
+INITSCRIPT_NAME = "gdm"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+
+pkg_postinst_${PN} () {
+ # can't do this offline
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+ grep "^gdm:" /etc/group > /dev/null || addgroup gdm
+ grep "^gdm:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/gdm gdm --ingroup gdm -g gdm
+
+if [ -d /var/lib/gdm ]; then
+ chown -R gdm:gdm /var/lib/gdm
+ chmod 0750 /var/lib/gdm
+fi
+
+# Register up as default dm
+mkdir -p ${sysconfdir}/X11/
+echo "${bindir}/gdm" > ${sysconfdir}/X11/default-display-manager
+
+}
+
+pkg_postrm_${PN} () {
+ deluser gdm || true
+ delgroup gdm || true
+ sed -i /gdm/d ${sysconfdir}/X11/default-display-manager || true
+}