From owner-freebsd-x11@FreeBSD.ORG Tue Nov 16 13:08:27 2004 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2EBD16A4CE; Tue, 16 Nov 2004 13:08:27 +0000 (GMT) Received: from smtp1.jazztel.es (smtp1.jazztel.es [62.14.3.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB84543D3F; Tue, 16 Nov 2004 13:08:26 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from antivirus by smtp1.jazztel.es with antivirus id 1CU34c-0005BH-00 Tue, 16 Nov 2004 14:08:42 +0100 Received: from [212.106.252.3] (helo=rguez.homeunix.net) by smtp1.jazztel.es with esmtp id 1CU34c-0005Ap-00 Tue, 16 Nov 2004 14:08:42 +0100 Received: from redesjm.local (orion.redesjm.local [192.168.254.16]) by rguez.homeunix.net (8.13.1/8.13.1) with ESMTP id iAGD8O7f004076; Tue, 16 Nov 2004 14:08:24 +0100 (CET) (envelope-from freebsd@redesjm.local) Received: (from freebsd@localhost) by redesjm.local (8.13.1/8.13.1/Submit) id iAGD8Pjf017276; Tue, 16 Nov 2004 14:08:25 +0100 (CET) (envelope-from freebsd) Date: Tue, 16 Nov 2004 14:08:25 +0100 (CET) Message-Id: <200411161308.iAGD8Pjf017276@redesjm.local> To: FreeBSD-gnats-submit@freebsd.org From: Jose M Rodriguez X-send-pr-version: 3.113 X-GNATS-Notify: X-AntiVirus: checked by AntiVir Milter (version: 1.1; AVE: 6.28.0.12; VDF: 6.28.0.59; host: antares.redesjm.local) X-Virus-Scanned: by antivirus cc: x11@freebsd.org Subject: [PATCH] add xdm rc script to xorg-clients X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jose M Rodriguez List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2004 13:08:28 -0000 >Submitter-Id: current-users >Originator: Jose M Rodriguez >Organization: Redes JM >Confidential: no >Synopsis: [PATCH] add xdm rc script to xorg-clients >Severity: non-critical >Priority: low >Category: ports >Class: change-request >Release: FreeBSD 5.3-STABLE i386 >Environment: System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Tue Nov 16 13:26:33 CET 2004 root@orion.redesjm.local:/usr/obj/usr/src/sys/ORION i386 >Description: The standard FreeBSD way to launch xdm is from init via /etc/ttys This patch adds an aditional rcNG script under ${PREFIX}/etc/rc.d capable of launch gdm/kdm/xdm/Xorg Also, use vt9 as the default vt in FreeBSD. this is needed to cope with race problems between init gettys and xdm problem >How-To-Repeat: >Fix: This patch add the desired functionality. Additional work may be need to not define DEFAULTVT in archs where this can hurt. Posible candidates: arm, powerpc, sparch64 --- patch-xorg-clients begins here --- diff -Nru /usr/ports/x11/xorg-clients/Makefile x11/xorg-clients/Makefile --- /usr/ports/x11/xorg-clients/Makefile Fri Nov 5 03:46:04 2004 +++ x11/xorg-clients/Makefile Tue Nov 16 10:31:10 2004 @@ -7,7 +7,7 @@ PORTNAME= xorg-clients PORTVERSION= 6.7.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= x11 MASTER_SITES= http://freedesktop.org/~xorg/X11R6.7.0/src/ \ ${MASTER_SITE_XORG} @@ -22,6 +22,7 @@ RUN_DEPENDS= xterm-static:${PORTSDIR}/x11/xterm LIB_DEPENDS= png.5:${PORTSDIR}/graphics/png \ Xft.2:${PORTSDIR}/x11-fonts/libXft +USE_RC_SUBR= yes CONFLICTS= XFree86-clients-* @@ -41,14 +42,25 @@ @${ECHO_MSG} "setuid. If you want to do this, hit Ctrl-C now and use \"make WITH_SETUID_LUIT=yes\"" .endif +pre-install: +# create an rcNG xdm.sh + @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \ + -e 's|%%X11BASE%%|${X11BASE}|g' \ + -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \ + ${FILESDIR}/xdm.sh > ${WRKDIR}/xdm.sh + post-install: +# install an xdm.sh etc/rc.d script + @${INSTALL_SCRIPT} ${WRKDIR}/xdm.sh ${PREFIX}/etc/rc.d + @${LN} -sf ${X11BASE}/bin/resize-static ${X11BASE}/bin/resize @${LN} -sf ${X11BASE}/bin/xterm-static ${X11BASE}/bin/xterm @${LN} -sf ${X11BASE}/bin/uxterm-static ${X11BASE}/bin/uxterm @${LN} -sf ${X11BASE}/lib/X11/app-defaults/UXTerm-static ${X11BASE}/lib/X11/app-defaults/UXTerm @${LN} -sf ${X11BASE}/lib/X11/app-defaults/XTerm-static ${X11BASE}/lib/X11/app-defaults/XTerm @${LN} -sf ${X11BASE}/lib/X11/app-defaults/XTerm-color-static ${X11BASE}/lib/X11/app-defaults/XTerm-color - + .if defined(WITH_SETUID_LUIT) ${CHOWN} root:wheel ${PREFIX}/bin/luit ${CHMOD} 04711 ${PREFIX}/bin/luit diff -Nru /usr/ports/x11/xorg-clients/files/xdm.sh x11/xorg-clients/files/xdm.sh --- /usr/ports/x11/xorg-clients/files/xdm.sh Thu Jan 1 01:00:00 1970 +++ x11/xorg-clients/files/xdm.sh Tue Nov 16 10:49:09 2004 @@ -0,0 +1,71 @@ +#!/bin/sh +# +# $Id$ +# + +# PROVIDE: xdm +# REQUIRE: DAEMON LOGIN syscons moused +# KEYWORD: nojail shutdown + +# rcNG launch script for xdm +# +# Notes: +# this scripts implements an alternate method to launch xdm +# +# To activate this, you must define xdm_enable="YES" in rc.conf +# in /etc/rc.conf[.local] +# +# This script can: +# - launch gdm using xdm_program="%%X11BASE%%/bin/gdm" +# - launch kdm using xdm_program="%%LOCALBASE%%/bin/kdm" +# - launch Xorg XDMCP client using xdm_program="%%X11BASE%%/bin/Xorg" +# +# You may use /etc/rc.conf.d/xdm to use more advanced launch control +# like a start_precmd script + +# Basic config +name="xdm" +xdm_enable="NO" +xdm_program="%%PREFIX%%/bin/xdm" + +. %%RC_SUBR%% + +rcvar=`set_rcvar` + +# get the config from /etc/rc.conf[.local] && /etc/rc.conf.d/xdm +load_rc_config $name + +command="${xdm_program:-%%PREFIX%%/bin/xdm}" + +# a good ENV for a X11 App, we are in our subshell +HOME="/root" +PATH="/sbin:/bin:/usr/sbin:/usr/bin:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin:%%X11BASE%%/bin" +export PATH HOME + +case `basename ${command}` in + xdm) + # xdm standard display manager + : ${required_files:=%%PREFIX%%/lib/X11/xdm/xdm-config} + : ${pidfile:=/var/run/xdm.pid} + : ${extra_commands:="reload"} + ;; + gdm) + # gnome gdm display manager + : ${required_files:=${command%/bin/gdm}/etc/gdm/gdm.conf} + : ${pidfile:=/var/run/gdm.pid} + : ${procname:=${command}-binary} + ;; + kdm) + # KDE kdm display manager + : ${required_files:=${command%/bin/kdm}/share/config/kdm/kdmrc} + : ${pidfile:=/var/run/kdm.pid} + # don't use start_precmd(). We have local genkdmconf.sh now + ;; + Xorg) + # xdm login via Xorg broadcast XDMCP + : ${required_files:=/etc/X11/xorg.conf} + : ${xdm_flags:=-broadcast &} + ;; +esac + +run_rc_command "$1" diff -Nru /usr/ports/x11/xorg-clients/pkg-plist x11/xorg-clients/pkg-plist --- /usr/ports/x11/xorg-clients/pkg-plist Thu Nov 4 17:43:13 2004 +++ x11/xorg-clients/pkg-plist Tue Nov 16 10:40:31 2004 @@ -104,6 +104,7 @@ bin/xwd bin/xwininfo bin/xwud +etc/rc.d/xdm.sh include/X11/PM/PM.h include/X11/PM/PMproto.h include/X11/bitmaps/Dashes --- x11/xorg-clients/files/patch-xdm.orig Tue Nov 16 13:21:51 2004 +++ x11/xorg-clients/files/patch-xdm Tue Nov 16 13:22:07 2004 @@ -1,5 +1,5 @@ ---- programs/xdm/config/Imakefile.orig Fri Apr 2 13:47:35 2004 -+++ programs/xdm/config/Imakefile Sun May 30 11:55:14 2004 +--- programs/xdm/config/Imakefile.orig Fri Apr 2 23:47:35 2004 ++++ programs/xdm/config/Imakefile Tue Nov 16 13:18:29 2004 @@ -5,7 +5,7 @@ XCOMM $XFree86: xc/programs/xdm/config/Imakefile,v 1.14 2003/12/30 22:09:14 herrb Exp $ @@ -9,7 +9,18 @@ all:: Xservers.ws xdm-config Xservers Xresources -@@ -46,6 +46,7 @@ +@@ -17,6 +17,10 @@ + DEFAULTVT=vt7 + #endif + ++#if defined(FreeBSDArchitecture) ++DEFAULTVT=vt9 ++#endif ++ + #ifndef XdmPixmap + # define XdmPixmap XVendorStdFilePrefix.xpm + # define XdmbwPixmap XVendorStdFilePrefix-bw.xpm +@@ -46,6 +50,7 @@ LinkFile(Xservers,Xservers.$(SERVERSTYPE)) @@ -17,7 +28,7 @@ #if InstallXdmConfig InstallNonExecFile(xdm-config,$(XDMDIR)) InstallNonExecFile(Xresources,$(XDMDIR)) -@@ -66,6 +67,7 @@ +@@ -66,6 +71,7 @@ InstallNamedProgNoClobber(TakeConsole,TakeConsole,$(XDMDIR)) InstallNamedProgNoClobber(Xsetup_0,Xsetup_0,$(XDMDIR)) InstallNamedProgNoClobber(Xwilling,Xwilling,$(XDMDIR)) --- patch-xorg-clients ends here ---