summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-01-17 14:56:29 +0000
committerRoy Marples <uberlord@gentoo.org>2007-01-17 14:56:29 +0000
commitc695be471997d8dc82faa0cfece305c0fc9d70e0 (patch)
tree38327d3dd133061e43d683618dacc50b22147159 /x11-apps
parentremove stray bigloo-lib digest (diff)
downloadgentoo-2-c695be471997d8dc82faa0cfece305c0fc9d70e0.tar.gz
gentoo-2-c695be471997d8dc82faa0cfece305c0fc9d70e0.tar.bz2
gentoo-2-c695be471997d8dc82faa0cfece305c0fc9d70e0.zip
Add BSD support to the init script. GDM works very well, KDM doesn't work at
all. KDM users will need to add KDM to /etc/ttys on FreeBSD still. baselayout-1.13 users will also need this init script. (Portage version: 2.1.2)
Diffstat (limited to 'x11-apps')
-rw-r--r--x11-apps/xinit/ChangeLog12
-rw-r--r--x11-apps/xinit/files/digest-xinit-1.0.3-r13
-rwxr-xr-xx11-apps/xinit/files/xdm.initd183
-rw-r--r--x11-apps/xinit/xinit-1.0.3-r1.ebuild55
4 files changed, 251 insertions, 2 deletions
diff --git a/x11-apps/xinit/ChangeLog b/x11-apps/xinit/ChangeLog
index e96b2cefe08c..b218de523c24 100644
--- a/x11-apps/xinit/ChangeLog
+++ b/x11-apps/xinit/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for x11-apps/xinit
-# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.73 2006/11/22 20:08:45 dberkholz Exp $
+# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.74 2007/01/17 14:56:29 uberlord Exp $
+
+*xinit-1.0.3-r1 (17 Jan 2007)
+
+ 17 Jan 2007; Roy Marples <uberlord@gentoo.org> +files/xdm.initd,
+ +xinit-1.0.3-r1.ebuild:
+ Add BSD support to the init script. GDM works very well, KDM doesn't work at
+ all. KDM users will need to add KDM to /etc/ttys on FreeBSD still.
+ baselayout-1.13 users will also need this init script.
22 Nov 2006; Donnie Berkholz <dberkholz@gentoo.org>; files/xdm.start:
Added the comment, forgot the actual change.
diff --git a/x11-apps/xinit/files/digest-xinit-1.0.3-r1 b/x11-apps/xinit/files/digest-xinit-1.0.3-r1
new file mode 100644
index 000000000000..c80598bf332d
--- /dev/null
+++ b/x11-apps/xinit/files/digest-xinit-1.0.3-r1
@@ -0,0 +1,3 @@
+MD5 f04a903cc0e18b3c338f58eb90f6caf8 xinit-1.0.3.tar.bz2 97629
+RMD160 e0299e1cb07d12400b9513752dccde1dc0d9cb78 xinit-1.0.3.tar.bz2 97629
+SHA256 c77a58cba815eb1dde2242a819e80d7d84d753678837ac24d385e3ec65d33186 xinit-1.0.3.tar.bz2 97629
diff --git a/x11-apps/xinit/files/xdm.initd b/x11-apps/xinit/files/xdm.initd
new file mode 100755
index 000000000000..16c0c39e654c
--- /dev/null
+++ b/x11-apps/xinit/files/xdm.initd
@@ -0,0 +1,183 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/xdm.initd,v 1.1 2007/01/17 14:56:29 uberlord Exp $
+
+# This is here to serve as a note to myself, and future developers.
+#
+# Any Display manager (gdm,kdm,xdm) has the following problem: if
+# it is started before any getty, and no vt is specified, it will
+# usually run on vt2. When the getty on vt2 then starts, and the
+# DM is already started, the getty will take control of the keyboard,
+# leaving us with a "dead" keyboard.
+#
+# Resolution: add the following line to /etc/inittab
+#
+# x:a:once:/etc/X11/startDM.sh
+#
+# and have /etc/X11/startDM.sh start the DM in daemon mode if
+# a lock is present (with the info of what DM should be started),
+# else just fall through.
+#
+# How this basically works, is the "a" runlevel is a additional
+# runlevel that you can use to fork processes with init, but the
+# runlevel never gets changed to this runlevel. Along with the "a"
+# runlevel, the "once" key word means that startDM.sh will only be
+# run when we specify it to run, thus eliminating respawning
+# startDM.sh when "xdm" is not added to the default runlevel, as was
+# done previously.
+#
+# This script then just calls "telinit a", and init will run
+# /etc/X11/startDM.sh after the current runlevel completes (this
+# script should only be added to the actual runlevel the user is
+# using).
+#
+# Martin Schlemmer
+# aka Azarah
+# 04 March 2002
+
+
+# Start X Font Server before X
+depend() {
+ need localmount
+
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ # (#139824) Start after ypbind and autofs for network authentication
+ # (#145219) Could use lirc mouse as input device
+ # (#70689 comment #92) Start after consolefont to avoid display corruption
+ after bootmisc readahead-list ypbind autofs openvpn gpm netmount lircd consolefont
+ before alsasound
+
+ # Start before X
+ use acpid hald xfs
+}
+
+setup_dm() {
+ source /etc/profile.env
+ export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
+
+ local MY_XDM="$(echo ${DISPLAYMANAGER} | tr '[:upper:]' '[:lower:]')"
+ case "${MY_XDM}" in
+ kdm|kde|kde2|kde3)
+ EXE="$(which kdm)"
+ ;;
+ entrance*)
+ EXE="$(which entranced)"
+ ;;
+ gdm|gnome)
+ EXE=/usr/bin/gdm
+ ;;
+ wdm)
+ EXE=/usr/bin/wdm
+ ;;
+ *)
+ EXE=
+ # Fix #65586, where MY_XDM is empty so EXE=somedir
+ [ -x "/usr/bin/${MY_XDM}" -a -f "/usr/bin/${MY_XDM}" ] \
+ && EXE="/usr/bin/${MY_XDM}"
+ [ -z "${EXE}" ] && EXE="/usr/bin/xdm"
+ ;;
+ esac
+
+ test ! -x "${EXE}" && EXE=/usr/bin/xdm
+}
+
+cmdline_opt() {
+ if [[ "$#" -ne 1 || ! -e /proc/cmdline ]]; then
+ return 1
+ fi
+
+ for opt in $(</proc/cmdline); do
+ case ${opt} in
+ ${1}) eval ${1}="true" ;;
+ esac
+ done
+}
+
+nox() {
+ # Don't start X if we were passed 'nox' at boot (#83680)
+ cmdline_opt nox
+
+ if [[ "$?" -ne 0 ]]; then
+ return 1
+ fi
+
+ if [[ -n "${nox}" ]]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+start() {
+ setup_dm
+
+ if nox; then
+ einfo "Skipping ${EXE}, received 'nox'"
+ else
+ ebegin "Setting up ${EXE##*/}"
+ #save the prefered DM
+ save_options "service" "${EXE}"
+
+ # Start as soon as possible if XSTATICVT is set
+ # or if we don't have telinit (as on BSD)
+ if [ "${XSTATICVT}" = "yes" ] || [ ! -x /sbin/telinit ] ; then
+ /etc/X11/startDM.sh
+ else
+ #tell init to run /etc/X11/startDM.sh after current
+ #runlevel is finished (should *not* be in the "boot"
+ # runlevel).
+ /sbin/telinit a &>/dev/null
+ fi
+ eend 0
+ fi
+
+}
+
+stop() {
+ local retval=0
+ local curvt=
+ if [ -t 0 ]
+ then
+ if [ -n $(type -p fgconsole) ]
+ then
+ curvt="$(fgconsole 2>/dev/null)"
+ else
+ curvt="$(tty)"
+ if [ "${curvt}" == /dev/ttyv[0-9]* ]
+ then
+ curvt="${curvt#/dev/ttyv*}"
+ else
+ curvt=
+ fi
+ fi
+ fi
+ local myexe="$(get_options "service")"
+ local myservice="${myexe##*/}"
+
+ ebegin "Stopping ${myservice}"
+
+ if start-stop-daemon --quiet --test --stop --exec "${myexe}" >/dev/null
+ then
+ start-stop-daemon --quiet --stop --exec "${myexe}" --retry TERM/5/TERM/5
+ retval=$?
+ fi
+
+ #switch back to original vt
+ if [ -n "${curvt}" ]
+ then
+ if [ -n $(type -p chvt) ]
+ then
+ chvt "${curvt}" &>/dev/null
+ else
+ vidcontrol -s "${curvt}"
+ fi
+ fi
+ eend ${retval} "Error stopping ${myservice}"
+
+ return ${retval}
+}
+
+
+# vim:ts=4
diff --git a/x11-apps/xinit/xinit-1.0.3-r1.ebuild b/x11-apps/xinit/xinit-1.0.3-r1.ebuild
new file mode 100644
index 000000000000..45dfc534c120
--- /dev/null
+++ b/x11-apps/xinit/xinit-1.0.3-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/xinit-1.0.3-r1.ebuild,v 1.1 2007/01/17 14:56:29 uberlord Exp $
+
+# Must be before x-modular eclass is inherited
+# This is enabled due to modified Makefile.am from the patches
+SNAPSHOT="yes"
+
+inherit x-modular pam
+
+DESCRIPTION="X Window System initializer"
+
+LICENSE="${LICENSE} GPL-2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="minimal"
+
+RDEPEND="x11-apps/xauth
+ x11-libs/libX11
+ !minimal? ( x11-wm/twm
+ x11-apps/xclock
+ x11-apps/xrdb
+ x11-apps/xsm )"
+DEPEND="${RDEPEND}"
+PDEPEND="x11-terms/xterm"
+
+PATCHES="${FILESDIR}/nolisten-tcp-and-black-background.patch
+ ${FILESDIR}/gentoo-startx-customization-0.99.4.patch"
+
+src_unpack() {
+ x-modular_unpack_source
+ x-modular_patch_source
+
+ sed -i -e "s:^XINITDIR.*:XINITDIR = \$(sysconfdir)/X11/xinit:g" ${S}/Makefile.am
+
+ x-modular_reconf_source
+}
+
+src_install() {
+ x-modular_src_install
+ exeinto /etc/X11
+ doexe ${FILESDIR}/chooser.sh ${FILESDIR}/startDM.sh
+ exeinto /etc/X11/Sessions
+ doexe ${FILESDIR}/Xsession
+ exeinto /etc/X11/xinit
+ doexe ${FILESDIR}/xinitrc
+ newinitd ${FILESDIR}/xdm.initd xdm
+ newconfd ${FILESDIR}/xdm.confd xdm
+ newpamd ${FILESDIR}/xserver.pamd xserver
+
+ # Remove the XSTATICVT option as it's pointless on FreeBSD
+ # at this time.
+ if use x86-fbsd ; then
+ sed -i -e '1, /^$/ d' "${D}"/etc/conf.d/xdm || die
+ fi
+}