From e87932293a76ccc0c1a5d00fb6aad060e416d2e1 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 17 Jan 2007 14:56:29 +0000 Subject: [PATCH] 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. Package-Manager: portage-2.1.2 --- x11-apps/xinit/ChangeLog | 12 +- x11-apps/xinit/Manifest | 19 ++- x11-apps/xinit/files/digest-xinit-1.0.3-r1 | 3 + x11-apps/xinit/files/xdm.initd | 183 +++++++++++++++++++++ x11-apps/xinit/xinit-1.0.3-r1.ebuild | 55 +++++++ 5 files changed, 266 insertions(+), 6 deletions(-) create mode 100644 x11-apps/xinit/files/digest-xinit-1.0.3-r1 create mode 100755 x11-apps/xinit/files/xdm.initd create mode 100644 x11-apps/xinit/xinit-1.0.3-r1.ebuild 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 +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 ; files/xdm.start: Added the comment, forgot the actual change. diff --git a/x11-apps/xinit/Manifest b/x11-apps/xinit/Manifest index 31048e1374e9..174823766c55 100644 --- a/x11-apps/xinit/Manifest +++ b/x11-apps/xinit/Manifest @@ -22,6 +22,10 @@ AUX xdm.confd 668 RMD160 336b367da62beb39bcf4ce60efc07c7c00dc7133 SHA1 57e33bae4 MD5 1ef321642c38bfb020e92723722319fb files/xdm.confd 668 RMD160 336b367da62beb39bcf4ce60efc07c7c00dc7133 files/xdm.confd 668 SHA256 d8b6828dae11bd2e632c9000b087d59c66192e1e21183124e7bf90ddee09f128 files/xdm.confd 668 +AUX xdm.initd 4356 RMD160 5ed53483871015b65fa1c5e362d5491b0c95a061 SHA1 69a84dc4bd6ce9b0c42ccef4f099d0491ca085d7 SHA256 1472bbdeb14c82036b42ffddf4cba06e7db58f98de9da9c7af90b189bb2f24e8 +MD5 ae3c0e37f5c0e88a855d787bda10bcc7 files/xdm.initd 4356 +RMD160 5ed53483871015b65fa1c5e362d5491b0c95a061 files/xdm.initd 4356 +SHA256 1472bbdeb14c82036b42ffddf4cba06e7db58f98de9da9c7af90b189bb2f24e8 files/xdm.initd 4356 AUX xdm.start 3974 RMD160 67f3b69fc9c006146999271935e1ae06d093130a SHA1 12763e84e31632c0421159e8feca2f9855966b7b SHA256 151b697f62e335850118a5d7d113d83fb37f2a75407985cd1e433de93eb55ded MD5 5dd1b14c1942c59025be5fa7d470f281 files/xdm.start 3974 RMD160 67f3b69fc9c006146999271935e1ae06d093130a files/xdm.start 3974 @@ -44,14 +48,18 @@ EBUILD xinit-1.0.2-r6.ebuild 1354 RMD160 093c2d1dbc5b83c6ed0361c3e7a900f9a0194d6 MD5 75e5b767a10863d3c241020c199272c6 xinit-1.0.2-r6.ebuild 1354 RMD160 093c2d1dbc5b83c6ed0361c3e7a900f9a0194d6f xinit-1.0.2-r6.ebuild 1354 SHA256 0eab789fd344cd41051c72ba7ee1483994be028d9285a269d749cda9c37a3e79 xinit-1.0.2-r6.ebuild 1354 +EBUILD xinit-1.0.3-r1.ebuild 1493 RMD160 67ff3cd22c6a87c7313658fac1fdffbd30d2c161 SHA1 3e4b3da5984bda3c2c4788cb6e9232ba4ee24b2d SHA256 3257e30863c3ab0dd920fe3df4fdf044dee4c6cfd46794f286024d72b8ea266f +MD5 c40503cf7ecfd1dad648e85bbf6929c8 xinit-1.0.3-r1.ebuild 1493 +RMD160 67ff3cd22c6a87c7313658fac1fdffbd30d2c161 xinit-1.0.3-r1.ebuild 1493 +SHA256 3257e30863c3ab0dd920fe3df4fdf044dee4c6cfd46794f286024d72b8ea266f xinit-1.0.3-r1.ebuild 1493 EBUILD xinit-1.0.3.ebuild 1336 RMD160 054bb3644da3f4720e360c0d09b1c7be982947c4 SHA1 3bd6bb98e4d809e4a2d00dc8f0ab673db03cc987 SHA256 0bb57c9c2b9ae0f775c4eb55b3c187a12314f76c14f25901dfc805368e090244 MD5 2bee4f9f0da107e71869d6011f152f40 xinit-1.0.3.ebuild 1336 RMD160 054bb3644da3f4720e360c0d09b1c7be982947c4 xinit-1.0.3.ebuild 1336 SHA256 0bb57c9c2b9ae0f775c4eb55b3c187a12314f76c14f25901dfc805368e090244 xinit-1.0.3.ebuild 1336 -MISC ChangeLog 11817 RMD160 6b5f96e9a4a3ce8e79549e776a933aaaee42d3e8 SHA1 6d928b1c9c9eacf112a2e75dc3ee9a4fad24b9d2 SHA256 a31c403cceceb1f4b3a27203beccb83ce1a3aa151307199b73a1dc051c301e86 -MD5 1f87d4a6c81c384ffc7561cdb2638173 ChangeLog 11817 -RMD160 6b5f96e9a4a3ce8e79549e776a933aaaee42d3e8 ChangeLog 11817 -SHA256 a31c403cceceb1f4b3a27203beccb83ce1a3aa151307199b73a1dc051c301e86 ChangeLog 11817 +MISC ChangeLog 12146 RMD160 e4ea9cea90817d96289b244bb551a0ffca656dcf SHA1 83d1989f0aff9df78d5823b9a5f440a9e93034c8 SHA256 a8b710084143aac94c24cfd43b8f761b21fcb19bb50c7539a3a026a6df65b7f3 +MD5 02e1462655e1d0836d063867cdd3b926 ChangeLog 12146 +RMD160 e4ea9cea90817d96289b244bb551a0ffca656dcf ChangeLog 12146 +SHA256 a8b710084143aac94c24cfd43b8f761b21fcb19bb50c7539a3a026a6df65b7f3 ChangeLog 12146 MISC metadata.xml 156 RMD160 c1274bdccf57603d580de0075ba07a35b7509560 SHA1 6f78f604e3d079d39189b40aaaa1ddb06182ad91 SHA256 5101ab0d4cc8c7125eea733c44e86962769bd77acaf53b69223b9cadcdd29055 MD5 a37bab73e2f24b213932c30997d3d360 metadata.xml 156 RMD160 c1274bdccf57603d580de0075ba07a35b7509560 metadata.xml 156 @@ -62,3 +70,6 @@ SHA256 a8f4441513332ff52b02d667e403ebb39418f3eb6df177c51899f70b21c59cd1 files/di MD5 273fc0942d2b4ea4d51a2447ba6b1c77 files/digest-xinit-1.0.3 235 RMD160 427f07a6108e50a618c487041421ba91e25f146f files/digest-xinit-1.0.3 235 SHA256 a37b78e123e42af15479c362d492e682e687a13cb9c1f038ec3e395f12612242 files/digest-xinit-1.0.3 235 +MD5 273fc0942d2b4ea4d51a2447ba6b1c77 files/digest-xinit-1.0.3-r1 235 +RMD160 427f07a6108e50a618c487041421ba91e25f146f files/digest-xinit-1.0.3-r1 235 +SHA256 a37b78e123e42af15479c362d492e682e687a13cb9c1f038ec3e395f12612242 files/digest-xinit-1.0.3-r1 235 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 $(/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 +} -- 2.26.2