Xfree Local Multi User Howto
Xfree Local Multi User Howto
Svetoslav Slavtchev
<svetoslav (at) users.sourcefourge.net>
Aug 2004
Revision History
Revision 1.4 2004−08−14 Revised by: SS
add some info on the new IsolateDevice XFree/X.org, drop some stalled comments about ruby−2.6 (a lot
more must be removed − linux−2.6 is table now)
Revision 1.3 2003−11−11 Revised by: SS
Ruby−2.6 is working :) , sync to new BRuby, add config file paths for Gentoo
Revision 1.2 2003−09−17 Revised by: SS
Lots, lots of stuff. the most major things: XFree−PrefBusID v3, input.rc (and exp. service ruby_init), add
"Known Limitations"
Revision 1.1 2003−07−14 Revised by: SS
sync input agent with examples, a bit more about ruby, less Fix−Me's, additions to video compatibility
Revision 1.0 2003−05−13 Revised by: TP
Initial release, reviewed by LDP.
This HOWTO explains one of the ways to get a working, multiple, local X user−capable PC system for up to
16 users. It is based on using a modified Linux kernel with support for multiple independent users . The
second way is not covered here, but on the web page of it's author, the pioneer Miguel Freitas.
XFree Local Multi−User HOWTO
Table of Contents
Chapter 1. Introduction......................................................................................................................................1
1.1. About Backstreet Ruby/ Ruby..........................................................................................................1
1.2. About this document.........................................................................................................................2
1.3. Related Documentation.....................................................................................................................2
1.4. New versions of this document.........................................................................................................3
1.5. Copyright and License......................................................................................................................3
1.6. Disclaimer.........................................................................................................................................3
1.7. Credits/Contributors..........................................................................................................................4
1.8. Feedback/Bug Reporting..................................................................................................................4
i
XFree Local Multi−User HOWTO
Table of Contents
Chapter 6. Configuring display managers
6.2.1. Changes, Part 1......................................................................................................................42
6.2.2. Changes, Part 2......................................................................................................................42
ii
XFree Local Multi−User HOWTO
Table of Contents
Appendix C. Scripts..........................................................................................................................................81
C.1. hotplug: input.agent........................................................................................................................81
C.2. hotplug: input.rc.............................................................................................................................83
C.3. hotplug & XFree supporting event devices: input.agent................................................................86
C.4. Wrapper for starting X using Nvidia libGL.so...............................................................................86
C.5. For installing Nvidia drivers for parallel use with DRI.................................................................86
iii
Chapter 1. Introduction
1.1. About Backstreet Ruby/ Ruby
Backstreet Ruby is a kernel patch for the Linux kernel. It is a back port to Linux−2.4 of the Ruby kernel tree,
which is developed by the Linux Console Project. The aim of the Linux Console developers is to enhance and
reorganize the input, the console and the framebuffer subsystems in the Linux kernel, so they can work
independent from each other and to allow multi−desktop operation. All this is done in the Ruby kernel tree
which is based on the development Linux−2.5 kernel. The new Input subsystem and the new Framebuffer
layer are already integrated in Linux−2.5 kernel, but as the main developer of the Linux Console Project,
James Simmons, is too busy with completing the rewrite of the framebuffer layer in Linux−2.5, the
multi−desktop operation will not be integrated in the next stable Linux kernel (Linux−2.6).
So Backstreet Ruby brings to the current stable Linux kernel (Linux−2.4) the enhanced input subsystem and
the ability to use multiple graphic cards and multiple keyboards independently, in order to make multiple local
XFree users on a single PC system possible.
You can have multiple independent graphic cards and multiple independent mice, but in order for multiple
users to interact with the system, they do need independent keyboards as well. Multiple independent
keyboards is the feature that Linux−2.4 (and in the future Linux−2.6) lacks, and this is what Backstreet Ruby
adds to the stable Linux kernel Linux−2.4.
The entire work on back porting Ruby to Linux−2.4 is done by Aivils Stoss. <Aivils.Stoss (at)
unibanka.lv>
Aivils got recently his hands on Ruby, and now Ruby is fully functional[1] too, so if you prefer the Linux−2.6
kernel you might use Ruby instead of Linux−2.4 + Backstreet Ruby.
Visit his web site for more information on the patch itself, on the current status, how to build a kernel using
his patch or how to build modified XFree86 server.
http://people.debian.org/~andreas/aivils/
2. in Germany:
http://www.schuldei.org/aivils/
3. in the United Kingdom:
http://karlovo.demon.co.uk/~svetlio/aivils/
Chapter 1. Introduction 1
XFree Local Multi−User HOWTO
I will use :
Every mention of Backstreet Ruby should be replaceable by Ruby/ Ruby−2.6 unless else mentioned.
Note
Currently it is not possible to set up systems for multiple console users.
1. Modify the kernel to ignore input from USB keyboards and add the handling of USB keyboards to a
modified Xserver. This solution was developed by Miguel Freitas. Visit his page on the topic at
http://cambuca.ldhs.cetuc.puc−rio.br/multiuser/, for instructions on how to set up such a system.
2. Use the Backstreet Ruby kernel which supports independent keyboards.
I'll concentrate on configuring a system for multiple local XFree users using the Backstreet Ruby kernel, but
there are parts which can be used also on a system using the solution from Miguel Freitas.
Note
This document is not intended to be a replacement of the existing documentation on the Backstreet Ruby
home page (http://startx.times.lv), but rather, this is a HOWTO, explaining the way to a working X
multi−user PC system. If you encounter any problems you'll probably need to consult the more detailed
information there.
The document is based on the file system layout of the Mandrake−Linux distribution, but I tried to make
it distribution−independent by including information about the differences to other mainstream
distributions like Debian, Red Hat and SuSE Linux.
http://linuxconsole.sourceforge.net
• The Backstreet Ruby home page
http://startx.times.lv/
• XFree with support for the new input layer by Zephaniah Hull
(seems the patches are obsolated, and were removed from the site)
http://people.debian.org/~warp/evdev/
Chapter 1. Introduction 2
XFree Local Multi−User HOWTO
http://cambuca.ldhs.cetuc.puc−rio.br/multiuser/
• Russian multi−terminal project Gorinich
http://www.ctc.msiu.ru/zg/main.html
• Step by step instructions by Jean−Daniel Pauget
http://disjunkt.com/dualhead/
• Multi−seat XFree solution under Linux with framebuffers, by Frode Trydal
http://www.itsopen.net/projects/x−hack/
http://tldp.org/HOWTO/XFree−Local−multi−user−HOWTO/
http://karlovo.demon.co.uk/~svetlio/ruby−contrib/how−to/XFree_local_multi−user−HOWTO/
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front−Cover Texts, and with no Back−Cover Texts. A copy of the license is
available at http://www.gnu.org/copyleft/fdl.html.
1.6. Disclaimer
No liability for the contents of this document can be accepted. Use the concepts, examples and information at
your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with
caution, and although this is highly unlikely, the author(s) do not take any responsibility.
All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term
in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of
particular products or brands should not be seen as endorsements.
Chapter 1. Introduction 3
XFree Local Multi−User HOWTO
1.7. Credits/Contributors
In this document, I have the pleasure of acknowledging:
for working so hard on Linux console project, for developing the new framebuffer, VT/console
subsystem
• Vojtech Pavlik<vojtech (at) suse.cz>
for rewriting the input subsystem and working hard on the Linux console project
• Aivils Stoss <Aivils.Stoss (at) unibanka.lv>
for back porting Ruby to linux−2.4 and providing his back port and experiences to the world
• Andreas Schuldei <andreas (at) schuldei.org>
In case you experiance troubles in configuring the system, feel free to contact me or the linuxcosnole mailing
list.
Please send as much details as possible, the most important information would be (from a running Backstreet
Ruby kernel):
Chapter 1. Introduction 4
Chapter 2. Before we begin
2.1. Known Limitations
XFree does not support DRI acceleration on multiple graphic cards. The only way to get multiple accelerated
X sessions is to use Nvidia's closed source driver and GL library or a single card using DRI and multiple cards
using Nvidia's closed source drivers. XFree extensions not dependent on DRI should work.
Most of the multiheaded graphic cards can be used only for a single user/display. In order to start independent
X servers the heads have to be explicitly addressable (which can not be done with most of the cards). It should
be possible to use cards with explicitly addressable heads for independent displays, but this has not yet been
tested.
In the following cases it might be possible to use a single multiheaded card for multiple independent displays :
• The card(s) have different PCI Bus ID's for the different heads
Have in mind that the XFree frame buffer driver does not support acceleration and most of the XFree
extensions.
Using/configuring independent devices for the independent screens/users is pretty hard or not explored.
Exceptions are the input devices, graphic cards and sound thanks artsd. Some examples of such unexplored
areas:
• External storage device (USB/Firewire hard disks, CD/DVD drives, ZIP/Floppy drives, memory
sticks, ....
• USB/Firewire printers, scanners, cameras ...
In case you succeed in configuring such devices for independent usage by multiple users, please share with us
how you did it.
Note
This doesn't mean that the devices won't work, but that every user will have access to all devices.
Currently under Backstreet Ruby/ Ruby you can have a maximum of 16 Virtual Terminals (8 for Backstreet
Ruby released before 7 Oct 2003). This means that without hotplug configured if you are using USB
keyboards with fancy keys you are limited to maximum of 8 independent users ( for older versions Backstreet
Ruby − 4 users). So do use hotplug if you are going to setup a system for more then 4 users ( even systems
with 2 attached USB keyboards benefit from using hotplug).
If you are using hotplug the maximal number of independent users is 16 for Backstreet Ruby / Ruby−2.6 and
8 for older versions Backstreet Ruby.
The easiest way would be to use the same kind of monitors & video cards, you could then configure only the
first card/monitor pair, make copies of this configuration file for the number of video cards you have, and then
only adjust the BusID "PCI:x:xx:x" field in the configuration file. You can do this with the help of lspci,
XFree86 −scanpci −verbose , or other similar distribution−specific tools.
You could use a similar approach if you have only monitors or video cards of the same type.
Most modern distributions also have advanced tools for easier configuration of Xinerama. You can use these
tools to set up the system for Xinerama and then use this configuration file for generating the configuration
files for the different X servers. You can use an example configuration file, replacing video card and monitor
section, by the corresponding sections from the Xinerama XFConfig−4 file.
This will allow you to easily switch between a multi−user environment and a Xinerama multi−monitor
environment.
What is Xinerama and how does the system configured using this HOWTO differ from a system using the
Xinerama extensions in XFree?
The Xinerama extensions were introduced to the XFree86 system in version 4.0. Xinerama is an extension to
XFree86 Release 6 Version 4.0 (X4.0) which allows applications and window managers to use the two (or
more) physical displays as one large virtual display. In case Xinerama is not used, applications can only reside
on one of the displays and can not be moved between the two. Window managers had to be specially written
to support the two displays. With Xinerama, window managers and applications don't have to be specially
written to support the larger "Virtual Desktop" Xinerama creates.
Just the opposite, the primary goal of a system configured according to this HOWTO is to offer multiple
independent displays for several users on a single PC system.
Binary packages for Debian Sid are also available thanks to Andreas Schuldei at
http://www.schuldei.org/debian/bruby, or as apt repository "deb http://www.schuldei.org/debian/bruby ./ ".
If you are going to use Ruby−2.6, please do install Linux−2.6 without the Ruby−2.6 patch first and
configure your system for it, in order to avoid tracking "Ruby−2.6 Bugs" which are actually due to a not
properly configured system because of the Linux−2.4 −> Linux−2.6 changes. A good starting point is
probably http://www.codemonkey.org.uk/docs/post−halloween−2.6.txt" .
The easiest way would be to pull an already prepared binary kernel; there are packages for some distributions
(currently only Mandrake and Debian) or a source package, and rebuild it on your system.
If for some reason you cannot use them or have problems using them you can also build your own kernel with
the Backstreet Ruby/ Ruby−2.6 patch. For more information how to do this visit the Backstreet Ruby page on
building and installing the kernel: http://startx.times.lv (or some of the mirrors) −> Documentation −> Quick
Kernel.
(If you are new to Linux, reading "The Linux Kernel HOWTO",
http://tldp.org/HOWTO/Kernel−HOWTO.html, could be very helpful.)
Note
• If you are going to use USB input devices, it's recommended to use the hid driver instead of
usbkbd/ usbmouse.
• Upon loading the hid driver, you might get the following error message:
[root@svetljo RPM]# modprobe hid
modprobe: Can't locate module keybdev which is needed for hid
[root@svetljo RPM]#
The reason is that in some version of the module−utils package this dependency is hardcoded,
but overrideable, so you should override it by adding "above hid usbcore" to your
/etc/modules.conf
3. I would suggest you also include at least one keyboard (built in − not as a module). You can also use
modules, but I find it safer to be able to use a keyboard instead of trying to find a PC with ssh (or
something similar) to load the required modules.
4. If you are new to Linux, do not try to patch an already patched kernel (heavily patched kernels like
the ones that ship with most distributions). Use a kernel from www.kernel.org, and take a look at the
Linux Kernel HOWTO.
Note
In Backstreet Ruby (the patch for a 2.4 Linux kernel) does not support frame buffer devices , and for that
reason is disabled.
In Ruby (the patch for 2.6 Linux kernel) if you want to disable/ change to modules support for PS2 input
devices, you have to first activate/enable "General setup −−> Remove kernel features (for embedded
systems)"
Note
Most current distributions should already provide the necessary device files, so try booting Backstreet
Ruby without creating the device files and in case you don't miss input devices omit this section. Any
distribution that came with XFree−4.3.0 and linux−2.4.20 should provide these device files.
If you use devfs, all required devices will be created automatically by devfs.
Mandrake is an example of one distribution that uses devfs. Debian does not use devfs by default, but the
kernel supports devfs; in order to activate devfs you have to add "devfs=mount" to the "append" line of your
boot loader and install devfsd (the devfs demon). Distributions that do not use devfs are Red Hat and SuSE.
You can check whether devfs is used by issuing the following commands:
If you get an empty string this means that devfs is not used; if you get something like the following output,
devfs is activated:
you will have a single VGA text console on the primary graphic card.
Ruby for Linux−2.6 supports framebuffer devices and single framebuffer console (which takes over the VGA
console), but support for multiple VT's through framebuffer consoles is not yet ready.
To keep VGA console properly working it is important first to be started the XFree instance which will drive
the graphic card which is used for VGA console(the graphic card defined as primary in BIOS).
When a keyboard device is found, it is bound to a free VT (given that there are free VT's). The first keyboard
found will be bound to VT0 (tty1−tty16), the second to VT1 (tty17), the third to VT2 (tty18).
Note
Older versions of the bruby patch (released before Oct 7 2003) use :
The order of detecting the keyboards depends on the configuration of your kernel :
• If you are using kernel with integrated USB input the USB keyboard devices will be registered first,
then the AT/PS2 keyboards will follow when the modules are loaded
• If you are using kernel with integrated PS2 input the AT/PS2 keyboard devices will be registered first,
then the USB keyboards will follow when the modules are loaded
• If you are using kernel with integrated PS2 & USB input the AT/PS2 keyboard devices will be
registered first, then the USB keyboards will follow
Most USB keyboards represent themselves as more than one keyboard; it is common that the multimedia keys
or the number−pad identify themselves as a different keyboard device. So if you are running a kernel with
integrated USB input and have one USB keyboard with multimedia keys and one PS2 keyboard, the USB
keyboard will be bound to VT0(real keyboard) and VT1(multimedia keys), the PS2 keyboard will be bound to
VT2 (in case you have enough DUMB consoles).
There are several ways to work around these issues. Here I'll explain the easiest way to follow. It's definitely
not the best one, but the shortest explanation, and I just want to make it clear to you that the problem is not
that big. The better solutions will follow later in their own section.
All you need to do is to start the Backstreet Ruby/ Ruby kernel with dumbcon=n , where n is the sum of your
AT/PS2 keyboards plus the sum of your USB keyboards multiplied by 2 (I suppose this is the maximum
number of interfaces a USB keyboard registers), so all keyboards will be bound to a VT. Now you should find
out which VT's the real keyboards are bound to (the keyboards excluding the multimedia keys) and start X
using the appropriate tty ranges. Thanks to the proc interface integrated in Backstreet Ruby, you can easily
find the assignment of keyboards to VT's. Each VT creates a file /proc/bus/console/[n]/keyboard
(n is the number of the VT, for VT0 n will be 00, for VT1 − 01, ... , for VT11 − 11); reading this file will give
you the assigned keyboard.
tells us that:
Now we can start X on the VT's with real keyboards, in this case VT0 and VT2.
Of course in this simple example with only 2 keyboards (one USB and one PS2) the problem could be easily
avoided by using a kernel with primary PS2 input support. The PS2 keyboard would be found first and bound
to VT0, the USB keyboard would follow and it's real keyboard interface would be bound to VT1, so there is
no need for additional dumb consoles (for the multimedia interfaces of USB keyboards).
"Why should a modified X server be used?" − The reason is that XFree is designed to serve a single user and
this design requires a single X server to drive all available graphic cards. So when an unmodified X server
starts, it disables access to graphic cards for other X servers. Hence we have to modify XFree to make it
possible more then one X server to run at the same time.
• "The experimental way": you can use the "hackvideo"(ignoring pci_disable XFree commands) feature
of the Backstreet Ruby kernel. This will allow you to use the XFree server that came with your
distribution (no need for installing modified XFree server).
Q: "Why experimental?"
A: Well, you have to find out whether it works with your combination of graphic cards. There are
some combination that works flawlessly, but the majority of tested combinations have problems with
this setup.
• "The surer way": you have to install XFree server modified with the Prefered Bus ID patch.
Q: "Why surer?"
A: Because it works with all "supported graphic cards", solves a lot of stability problems and makes it
possible to use VGA console on the primary graphic card.
If you decide first to try without installing a modified X server, follow these steps:
1. To enable this feature you have to add this to your XFree configuration file:
Section "ServerFlags"
...
Option "PciOsConfig" "1"
...
EndSection
2. and to inform the kernel to filter unnecessary PCI commands:
[root@mc contrib]#echo "1"> /proc/bus/pci/hackvideo
3. If you want this to be done automatically on every boot you have to add :
if [ −x /proc/bus/pci/hackvideo ];then
/bin/echo "1"> /proc/bus/pci/hackvideo
fi
to your init scripts, preferably somewhere at the end of /etc/rc.d/rc.sysinit (so the command is
executed before X is started)
Note
This functionality exists in the Backstreet Ruby kernel since 15. May 2003 and in Ruby−2.6 since 29.
Sep 2003 , but will never be added to the official linux kernel as it is a small hack to spare you installing
modified X server.
♦ Install an already built, but not packaged, modified X server and create the necessary
symbolic links. You can get such binaries from the Backstreet Ruby home page, at
http://startx.times.lv.
♦ Help us (as well other people using your distribution) in building an rpm or binary for your
distribution (we lack systems installed with all available distributions, so we are not able to
build packages for every distribution).
♦ To patch and rebuild XFree from source using the instructions on the Backstreet Ruby page.
Go to the Documentation section, at http://startx.times.lv (or some of the mirrors) −>
Documentation −> Quick XFree.
2. Find the BusID of your graphic cards
Note
For AGP cards, something similar to "1:0:0"
♦ In most cases you will find the BusID already set in the device section of the XFree
configuration file.
With lspci look for "VGA compatible controller" or other similar tools that came with your
distribution.
♦ Use the XFree config file option "SingleCard" , requires as argument a boolean
value(true/false), added in patch version 3
For use in multi−user environment set to true, for standard XFree behavior(single X server
allowed) to false or comment out/ delete the line.
This functionality is inlcuded the xorg−x11 packages for Mandrake and in Debian Sid
XFree86 packages.
♦ Use the XFree config file option "PrefBusID" , requires as argument a valid BusID, added in
patch version 2
For use in multi−user environment include the option with a valid BusID, for standard XFree
behavior(single X server allowed) comment out or delete.
This functionality is inlcuded the xorg−x11 packages for Mandrake and in Debian Sid
XFree86 packages, but the option name is changed to "IsolateDevice"
♦ Use the XFree command line option −prefbusid x:x:x , requires as argument a valid BusID,
initial release of the patch
For use in multi−user environment pass the option with a valid BusID to XFree at start−up,
for standard XFree behavior(single X server allowed) don't specify the option.
This functionality is inlcuded the xorg−x11 packages for Mandrake and in Debian Sid
XFree86 packages, but the option name is changed to −isolateDevice x:x:x
Note
Note
The BusID have to be specified in the "Device" Section of the XFree
configuration file.
Section "Device"
Identifier "nv"
VendorName ""
BoardName ""
Driver "nvidia"
# Clock lines
Section "ServerLayout"
Identifier "X0"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "IsolateDevice" "1:0:0"
EndSection
Section "ServerLayout"
Identifier "X1"
Screen 0 "Screen1" 0 0
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "IsolateDevice" "0:13:0"
EndSection
♦ using the "−prefbusid" option at XFree start−up (requires as argument a valid BusID)
or for Debian Sid's XFree86 and Mandrake's xorg−x11 use "−isolateDevice" instead
Caution
For the older(version 1) Preferred Bus ID XFree Server only this choice is valid.
..............................
# Definition of the standard X server.
[server−Standard]
name=Standard server
command=/usr/X11R6/bin/X0 :0 −layout first−Xserver −deferglyphs 16 −ac −prefbusid 1:
flexible=true
[server−Second]
name=Second server
command=/usr/X11R6/bin/X1 :1 −layout second−Xserver −deferglyphs 16 −prefbusid 0:13:
flexible=true
..............................
and for xdm/kdm
:0 local /bin/nice −n −10 /usr/X11R6/bin/X0 :0 −deferglyphs 16 −prefbusid 1:0:0 vt7
:1 local /bin/nice −n −10 /usr/X11R6/bin/X1 :1 −xf86config /etc/X11/XF86Config−4.TNT
You need to create as many symbolic links to the modified X server binary (or to the original X server in case
you do not need a modified one), as the number of your video cards/X sessions.
I assume that you will have to use a modified X server, but in case you do not need it, use the following
commands to create the links to your original X server:
cd /usr/X11R6/bin/
ln −s XFree[modified] X0
ln −s XFree[modified] X1
ln −s XFree[modified] X2
In case you use the provided rpm packages, you'll only need this if you want more than 4 parallel running X
servers/X sessions, as the rpm creates 4 symbolic links to the X server binary.
multiple X servers on each of the consoles, using the keyboard associated with the corresponding console for
input. Hence you get multiple independent X servers with independent keyboards, which in turn make it
possible for one single PC to be used by several local X users simultaneously.
To start X on a given console (using a given independent keyboard) you pass it the argument vt[N], where N
is a number from a given tty range.
If you have 3 video cards, 3 keyboards, and you have started the Backstreet Ruby kernel with dumbcon=2,
you can start 3 independent X servers for 3 simultaneous users with the following commands:
Note
Caution
Have in mind that for the older Preferred Bus ID XFree Server (version 1) you have to specify the
desired graphic card with parameter "−prefbusid x:x:x" where x:x:x is the Bus ID of the desired graphic
card. Just append "−prefbusid x:x:x" with the correct Bus ID of the card you want to start right before
the last argument vt[x]. If you omit this option the modified X server will act as a not modified/ standard
XFree server and you wont be able to run multiple XFree instances at the same time.
For the 1st X server you can skip the −xf86config /etc/X11/XF86Config−4[for your 1st
video card] argument. In this case, the default configuration file, /etc/X11/XF86Config−4, will be
used.
Note
This means that you have to use different vt parameter for the additional X servers.
You can also setup your display manager to start the independent X servers, once everything is properly
configured. But don't rush to setup your display manager before the configuration is finished, because this
could give you serious problems. When you are ready with the required configurations, you'll reach the
section on configuring the display manager.
You shouldn't use /dev/input/mice because it merges the input from all mouse devices.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/psaux"
Option "ZAxisMapping" "4 5"
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0"
Option "ZAxisMapping" "4 5"
EndSection
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1"
Option "ZAxisMapping" "4 5"
EndSection
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
and so on ...
• As far I know only one graphic card in a system can use DRI.
• The Nvidia closed source driver does not support DRI.
In case one of this reasons applies to your system, you do not need different XFree configuration files for the
different displays.
You can configure your system for Xinerama using the tools provided with your distribution and reading The
Xinerama−HOWTO, so when the system is used by a single user, he/she could switch to Xinerama desktop
and use all available displays for a bigger desktop.
Once configured for Xinerama, only small additions are needed to achieve multiple independent desktops. All
you have to do is to add new layouts which use single screen definition and have independent input devices
(well, this is actually needed only for the mouse devices, as the keyboard is managed through the vt[n]
option).
Section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 2"
Screen "Screen 1" RightOf "Screen 2"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
To achieve multiple independent desktops you only have to add layout definitions for a single screen :
Section "ServerLayout"
Identifier "first−Xserver"
Screen "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Section "ServerLayout"
Identifier "second−Xserver"
Screen "Screen 2"
InputDevice "Mouse2" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Section "ServerLayout"
Identifier "Xinerama"
Screen "Screen 2"
Screen "Screen 1" RightOf "Screen 2"
InputDevice "Mouse1" "CorePointer"
Section "ServerLayout"
Identifier "first−Xserver"
Screen "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Section "ServerLayout"
Identifier "second−Xserver"
Screen "Screen 2"
InputDevice "Mouse2" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Now you can start a single X server with option −layout Xinerama and enjoy the Xinerama desktop, or
You can start 2 independent X servers using −layout first−Xserver for the first, and −layout
second−Xserver for the second.
Since you will use a single XFree configuration file for all X servers,
# **********************************************************************
# Pointer section
# **********************************************************************
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1"
Option "ZAxisMapping" "4 5"
EndSection
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1. With the open source driver it's almost impossible to bring up a secondary card, so we should use the
closed source driver.
2. Why the Nvidia card? Currently these are the only available, affordable PCI video cards with some
acceleration.
3. I tried to use DRI on 2 parallel X servers, but it didn't work. I posted emails to XFree, DRI and lkml
list, but I only got a single answer with no valuable information on my problem. I tried to run DRI on
a Matrox G550 DH AGP & SiS63xx PCI, but when enabled for both cards, I got AGP errors. When
enabled only for one of the cards, I got DRI up and running. Please, someone confirm or prove me
wrong!
I'll explain several ways to get configuration working for both Nvidia GLX and XFree86 DRI. There are
probably a lot of other possibilities, and maybe these are not the simplest, but they are the ones I know to
work.
1. Nvidia should use a different module path for xf86: the glx extension module from Nvidia is
incompatible with the one from XFree86.
2. Nvidia should use a different XF86Config file: because DRI should be disabled for Nvidia and
enabled for others.
If you find a simpler way, please email it me and I'll include it.
Caution
This can not be used as−is on SuSE Linux. In order to make it easy for the user to switch between Mesa,
XFree and Nvidia GL libraries, SuSE uses a very complicated setup for the GL libraries. To use this
setup you have to switch your configuration to XFree86's GL libraries.
4.7.1. Example 1
This is the configuration that I use on my system (ATI AIW Radeon 7500 AGP and Nvidia TNT2 M64 PCI)
XFree configuration files:
mkdir /usr/X11R6/libNV
2. Create links to the original /usr/X11R6/lib:
cd /usr/X11R6/libNV
cd /usr/lib
ln −s ../X11R6/libNV/libGLcore.so.1 ./
Note: the Nvidia libGL.so is installed /usr/X11R6/libNV, so it's invisible to the system unless
you tell the system about the existence of /usr/X11R6/libNV. For this setup, you must not do
this, as it will break the standard X server start−up. But you can use the XFree GL libraries with the
Nvidia graphic card and Nvidia closed source drivers, with a non−Nvidia graphic card, using XFree's
DRI, which the GL library from Nvidia cannot do.
5. Add a line in the XFree configuration file for the Nvidia card to point the X server to the right
location of the library and module path:
Section "Files"
..........
ModulePath "/usr/X11R6/libNV/modules"
..........
EndSection
Now everything should be fine and you should be able to use DRI and Nvidia GLX at the same time. You will
have a bit smaller performance in comparison to a setup which uses Nvidia's libGL & libGLcore, but the
difference is not that big on my PC.
4.7.2. Example 2
This example will give you the full performance of both the Nvidia card(s), and the non−Nvidia card, since
XFree's libGL is used for the non Nvidia card, and Nvidia's libGL is used for Nvidia cards. But this will
require one more X server to be precise; a simple wrapper to add the path to the Nvidia libraries, and symbolic
links to it for additional Nvidia cards.
It is almost the same as the previous scenario, with the difference that the X servers for the Nvidia cards
should start with an environment where Nvidia's libGL is known, while the X servers for non Nvidia cards
shouldn't know anything about the Nvidia libGL. This requires a wrapper to be used for starting the X servers
driving Nvidia cards.
Install the Nvidia libraries and kernel driver like in the previous example. You may skip step 4. as
libGLcore.so.1 is installed in /usr/X11R6/libNV, and we'll inform the X servers driving Nvidia
cards about the proper path to the Nvidia libraries.
#!/bin/bash
export LD_LIBRARY_PATH=/usr/X11R6/libNV
exec /usr/X11R6/bin/X0 $*
Copy these lines into your favourite editor and save the file as XNV. Make it executable:
chmod +x XNV
Copy the file to /usr/X11R6/bin and make symbolic links to it for additional Nvidia cards (for additional
cards just add more links):
cp XNV /usr/X11R6/bin
cd /usr/X11R6/bin
ln −s XNV Xnv0
ln −s XNV Xnv1
ln −s XNV Xnv2
Appendix−>Scripts):
Manually:
cd $OPENWINHOME
find lib −name "libGL.*" −o −name "libGLcore*" −o −name "libglx.*" | xargs tar rpfv lib
If you feel comfortable under Linux, please review and test the experimental service ruby_init. The service,
the configuration file and the README can be found in Appendix D. Any kind of feedback is highly
appreciated. (Please, please drop a line with comments. :−) )
Note
If you are configuring a system with two displays( 2 keyboards, 2 mice) you probably can skip to
Chapter 6 "Configuring display managers", but if you want to use a single system for more users you
will find really useful information in this chapter.
To find the PHYS ID's (the addresses) or the name(quite oft it differs from the one labeled on the device) of
your input devices you have to read the file /proc/bus/input/devices.
Note
• /proc/bus/input/devices will provide the needed information for all devices except
USB multimedia/office keyboards.
• For such USB multimedia/office keyboards you will have to gather additional information, for
example with the help of lsusb.
• Under Ruby−2.6 for usb devices it will look like "usb−0000:00:10.x" not "usb−00:10.x"
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
........
So my USB keyboard has two interfaces (see bInterfaceNumber); the first one is the real keyboard
(bInterfaceProtocol 1 Keyboard), the second (bInterfaceProtocol 0 None) − the additional keys. Hence the real
.....
N: Name="Logitech USB Keyboard"
P: Phys=usb−00:10.1−1.1/input0
H: Handlers=kbd
.....
The input.rc script will run the input.agent with appropriate arguments for drivers that are built in the kernel or
are loaded before hotplug is available.
5.2.1. input.agent
The input agent uses 3 configuration files:
• /etc/hotplug/kbd.conf
• /etc/hotplug/mouse.conf
• /etc/hotplug/event.conf
Note
The explanations here are using Backstreet Ruby ( usb devices have PHYS_ID "usb−00:xx.x−..."), if
you are running Ruby−2.6 for usb devices you should have PHYS_ID "usb−0000:00:xx.x−...." , but you
should be able to use the same configuration files both under Backstreet Ruby and Ruby−2.6 by
specifying "usb−0*:xx.x−..." .
If I wanted to use the PS2 keyboard for the primary Display and for the VGA console, I would have:
#
# keyboard configuration
#
# vt_name device_physicaly_location
VT0 isa0060/serio0/input0
VT1 usb−00:10.1−1.1/input0
Or, if I want to use the USB keyboard for the primary Display and for the VGA console:
VT0 usb−00:10.1−1.1/input0
VT1 isa0060/serio0/input0
you could also use "*.*" instead of the pci function of the USB controller:
#
# keyboard configuration
#
# vt_name device_physicaly_location
VT0 usb−*.*−1.1/input0
VT1 isa0060/serio0/input0
#
# mouse device configuration
#
# sym_link device_physicaly_location
mouse0br usb−00:10.1−1.2/input0
mouse1br usb−*.*−2.7.*/input0
mouse2br isa0060/serio1/*
......
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0"
Option "ZAxisMapping" "4 5"
......
to :
......
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0br"
Option "ZAxisMapping" "4 5"
......
......
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1"
Option "ZAxisMapping" "4 5"
to :
......
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1br"
Option "ZAxisMapping" "4 5"
......
and so on.
#
# input event device config file
#
# symbolic_link device_physicaly_location
event0br isa0060/serio0/*
event1br isa0060/serio1/input0
event2br usb−*.*−3/input0
and configure the applications which use them to use the symbolic links instead of the real devices
5.2.2. input.rc
If you are using input drivers built into the kernel please ensure that the input.rc script is started/executed
at system start. In case the script is not executed you will find that hotplug could not configure these input
devices.
Note
This area requires user feedback. Currently I have information only about Mandrake, where hotplug is
not run as service.
If your distribution does not run hotplug as service you will have to modify your init scripts to run
input.rc for you before XFree is started.
• if you have input devices with different names, to use them with the same Xserver/screen wherever
you plug or re−plug them.
• if you have input devices with the same names, to use them with the same Xserver/screen according
to the USB port where you plug or re−plug them.
• the ability to use wild cards such as "*" and "?".
Caution
Currently hot−plugging doesn't seems to work properly. I have reports that it works when using the "Dev
Name" option, but my primary purpose was to get it working with "Dev Phys" and this does not
currently seem to work. "Why "Dev Phys"?" − because if one wants to setup a single system for 4,5 or
more users it would be easier to get 4,5 or more pieces of the same keyboard/ mouse then to find the
same number keyboards or mice but from different manufacturer or with different names, and i find
configuring XFree for such number users is simpler when "Dev Phys" is used.
Warning
This section is somewhat abandoned and is not tested under Ruby−2.6 as it didn't work reliably for me.
For this to work you will have to use XFree with the patches for event interface support, developed by
Zephaniah Hull. You can find them at the following url: http://people.debian.org/~warp/evdev/.
For hot−plugging you will also need the /etc/hotplug/input.agent , which you can find under the
above address and in Appendix Scripts
The configuration section for a mouse should look something like this:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Name" "A4Tech USB Optical Mouse"
The configuration section for a keyboard should look something like this:
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Name" "SILITEK USB Keyboard"
Option "Dev Phys" "usb−*/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
For Dev Name and Dev Phys, the wildcats "?" and "*" work, you MUST have at least one of the two, if you
have both then the device must match on both, a non−existent entry is the same as one consisting of "*".
As USB devices are connecting in a tree form, you can really easy specify the way keyboard and mice devices
are bound to a specified X display. You have to use one USB hub with number of ports equal(or bigger) to the
number of the X displays, to this hub are connected smaller (2−4 port) hubs (or keyboards with integrated
hub). To the first port of the smaller (integrated) hub are connected the keyboards, to the second the mice (in
case there are free ports you can connect usb−audio devices to them :) ). This results in the following layout of
the usb−id's in case the primary USB hub is the first USB device :
Note
In the following explanations and examples I use for first device on the secondary(integrated) hub
keyboard device because my keyboard is internally connected to the 1st port of the integrated hub. I
assume this will apply for most of the keyboards with integrated hub, but in case the one you own uses
different port you will have to make small adjustments.
Based on this we can bind all devices connected to a specified USB port to a given X server.
Note
Here the PCI function of the USB controller is masked by *.* so it should work both under Backstreet
Ruby and Ruby−2.6 . If you use more then one USB controller you'll have to use different mask ( for
example "usb−0*:xx.x−...") or specify the full PHYS_ID's : .
We'll use the "vt[n]" parameter when starting X and the following configuration file for the
keyboards(/etc/hotplug/kbd.conf ):
#
# keyboard configuration
#
# vt_name device_physicaly_location
VT0 usb−*.*−1.1.1/input0
VT1 usb−*.*−1.2.1/input0
VT2 usb−*.*−1.3.1/input0
VT3 usb−*.*−1.4.1/input0
For mouse devices the configuration file (/etc/hotplug/mouse.conf) will look like this:
#
# mouse device configuration
#
# sym_link device_physicaly_location
mouse0br usb−*.*−1.1.2/input0
mouse1br usb−*.*−1.2.2/input0
mouse2br usb−*.*−1.3.2/input0
mouse3br usb−*.*−1.4.2/input0
and we have to adjust the XFree configuration files, so XFree uses the symbolic links instead of the actual
devices. If you already configured independent mice you have only to append "br" to each of the mouse
devices.
......
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0br"
Option "ZAxisMapping" "4 5"
EndSection
......
......
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1br"
Option "ZAxisMapping" "4 5"
EndSection
......
and so on.
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0br"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1br"
Option "ZAxisMapping" "4 5"
EndSection
......
Note
The examples below are for multiple XFree configuration files, if you use a single XFree configuration
file you have to adjust the identifiers.
The configuration for the input devices for the 1st display would look something like this:
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−1.1.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−1.2.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−1.2.2/input0"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−1.3.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−1.3.2/input0"
Option "ZAxisMapping" "4 5"
EndSection
and so on.
You could also use the "?", so wherever you plug the primary hub, all displays will still have the desired
configuration.
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb−*−?.1.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Beside the graphical differences, xdm/kdm and gdm handle the X servers differently. Gdm will start the X
servers in the order specified in it's configuration file (and stop them in the reverse order). Xdm/kdm will start
and stop all the X servers at the same time(in case there are no opened X sessions). Also, restarting the gdm
daemon means end for all X sessions, but if you restart xdm/kdm when you are under X, your session won't
be closed.
• Using gdm could help you to retain the VGA console and prevents lock−ups with some graphic cards
(check the compatibility list).
• Using xdm/kdm allows you to switch it's configuration retaining your opened X session(of course the
changes shouldn't affect the X server you are using).
Note
Have in mind that for the older Preferred Bus ID XFree Server (version 1) you have to specify the
desired graphic card with parameter "−prefbusid x:x:x" where x:x:x is the Bus ID of the desired
graphic card. Just append "−prefbusid x:x:x" with the correct Bus ID of the card you want to start
right before the last argument vt[x].
Note
• SuSE uses:
♦ /etc/X11/XF86Config
♦ /etc/X11/xdm/Xservers for xdm
♦ /etc/opt/kde3/share/config/kdm/Xservers for kdm
you can make a backup copy of /etc/opt/.../kdm/Xservers and make a symbolic link
from /etc/X11/xdm/Xservers to /etc/opt/../kdm/Xservers, in order to use the
same configuration file for xdm and kdm.
• Debian uses:
♦ /etc/X11/XF86Config
For every additional X server you should add a single line. You can copy the existing line, change the X
server binary and display number, and append −xf86config [your configuration file]. My original
xdm/Xservers:
#####################################################################
######################################################################
######################################################################
#######################################################################
#######################################################################
Note
Under older versions of Backstreet Ruby (released before 7. Oct 2003) each console is represented by 8 tty's, so yo
use:
.....
:0 local /bin/nice −n −10 /usr/X11R6/bin/X0 :0 −deferglyphs 16 vt7
:1 local /bin/nice −n −10 /usr/X11R6/bin/X1 :1 −xf86config /etc/X11/XF86Config−4.TNT2 vt9
.....
................
:0 local /bin/nice −n −10 /usr/X11R6/bin/X0 :0 −layout first−Xserver −deferglyphs 16 vt7
:1 local /bin/nice −n −10 /usr/X11R6/bin/X1 :1 −layout second−Xserver vt9
................
Note
• SuSE uses:
♦ /etc/X11/XF86Config
♦ /etc/opt/gnome2/gdm/gdm.conf for gdm2
• Debian uses:
♦ /etc/X11/XF86Config
Modifications:
Here, you'll have only 0=Standard. For each additional X server you should add a definition, like here, for
1=Second.
[server−Second]
name=Second server
command=/usr/X11R6/bin/X1 :1 −deferglyphs 16 −xf86config /etc/X11/XF86Config−4.[your card] vt17
flexible=true
..............................
And here, the exact definition of the command line for starting the X server, very similar to the definitions in
/etc/X11/xdm/Xservers (the definition of [server−Second] is the additional one).
..............................
# Definition of the standard X server.
[server−Standard]
[server−Second]
name=Second server
command=/usr/X11R6/bin/X1 :1 −layout second−Xserver −deferglyphs 16 vt17
flexible=true
..............................
Note
Under older versions of Backstreet Ruby (released before 7. Oct 2003) each console is represented by 8 tty's, so yo
should use:
..............................
name=Standard server
command=/usr/X11R6/bin/X0 :0 −deferglyphs 16 −ac vt7
..............................
name=Second server
command=/usr/X11R6/bin/X1 :1 −deferglyphs 16 −xf86config /etc/X11/XF86Config−4.[your card] vt
..............................
..............................
name=Standard server
command=/usr/X11R6/bin/X0 :0 −layout first−Xserver −deferglyphs 16 −ac vt7
......
name=Second server
command=/usr/X11R6/bin/X1 :1 −layout second−Xserver −deferglyphs 16 vt9
..............................
Add these lines to your Window Manager start−up script (of course, with the proper arguments for your
setup):
artsshell −q terminate
#!/bin/sh
# License: GPL
Chapter 7. Tweaking it 44
XFree Local Multi−User HOWTO
artsd −F 10 −S 4096 −D /dev/dsp −s 5 −m artsmessage −l 3 −f &
;;
1)
artsd −F 10 −S 4096 −D /dev/dsp1 −s 5 −m artsmessage −l 3 −f &
;;
2)
artsd −F 10 −S 4096 −a alsa −D hw:2,0 −s 5 −m artsmessage −l 3 −f &
;;
esac
/usr/X11R6/bin/enlightenment
artsshell −q terminate
1. Daemon will use the first OSS sound device for the 1st X server.
2. Daemon will use the second OSS sound device for the 2nd X server.
3. Daemon will use the Alsa sound device for the 3rd X server (requires feedback).
1. Modify the line containing the background image, to adjust the path to your image for the 2nd X
server:
....
if [ −r /usr/share/mdk/backgrounds/default.png −a −x /usr/bin/qiv ]; then
/usr/bin/qiv −z /usr/share/mdk/backgrounds/default.png
else
/usr/X11R6/bin/xsetroot −solid "#21449C"
fi
....
Modified:
....
if [ −r /usr/share/mdk/backgrounds/flower.jpg −a −x /usr/bin/qiv ]; then
/usr/bin/qiv −z /usr/share/mdk/backgrounds/flower.jpg
else
/usr/X11R6/bin/xsetroot −solid "#21449C"
fi
....
....
#if [ −r /usr/share/mdk/backgrounds/flower.jpg −a −x /usr/bin/qiv ]; then
# /usr/bin/qiv −z /usr/share/mdk/backgrounds/flower.jpg
#else
/usr/X11R6/bin/xsetroot −solid "[your color]"
Chapter 7. Tweaking it 45
XFree Local Multi−User HOWTO
#fi
....
2. Comment out the lines which may affect the primary X server, from:
....
if [ −x /etc/X11/xinit.d/numlock ]; then
/etc/X11/xinit.d/numlock &
fi
....
to
....
#if [ −x /etc/X11/xinit.d/numlock ]; then
# /etc/X11/xinit.d/numlock &
#fi
....
Modified:
......
! The following three resources set up display :0 as the console.
DisplayManager._1.setup: /etc/X11/xdm/Xsetup_1
DisplayManager._0.setup: /etc/X11/xdm/Xsetup_0
DisplayManager._0.startup: /etc/X11/xdm/GiveConsole
DisplayManager._0.reset: /etc/X11/xdm/TakeConsole
DisplayManager._0.startAttempts: 1
!
......
......
[X−:0−Core]
Authorize=true
AutoLogin1st=true
AutoLoginEnable=false
Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_0
Chapter 7. Tweaking it 46
XFree Local Multi−User HOWTO
Startup=/etc/X11/xdm/GiveConsole
[X−:1−Core]
Authorize=true
......
to
......
[X−:0−Core]
Authorize=true
AutoLogin1st=true
AutoLoginEnable=false
Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_0
Startup=/etc/X11/xdm/GiveConsole
[X−:1−Core]
Authorize=true
#AutoLogin1st=true
#AutoLoginEnable=false
#Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_1
#Startup=/etc/X11/xdm/GiveConsole
#[X−:1−Core]
#Authorize=true
......
From:
.....
# Greeter for local (non−xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmgreeter
.....
to
.....
# Greeter for local (non−xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmlogin
.....
Chapter 7. Tweaking it 47
XFree Local Multi−User HOWTO
Modified:
/etc/X11/gdm/Init/:0
#!/bin/sh
exit 0
/etc/X11/gdm/Init/:1
#!/bin/sh
if [ −x /etc/X11/xinit/fixkeyboard ]; then
/etc/X11/xinit/fixkeyboard
fi
exit 0
4. Repeat the procedure for each additional X server, using file(s) /etc/X11/gdm/Init/:[n],
where n is the number of the display.
5. Check here for additional customising options: Gnome Display Manager Reference Manual.
Chapter 7. Tweaking it 48
XFree Local Multi−User HOWTO
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
# (pixel) a kind of profile for XF86Config
# if no XFree=XXX given on kernel command−line, restore XF86Config.standard
for i in XF86Config XF86Config−4; do
if [ −L "/etc/X11/$i" ]; then
XFree=`sed −n 's/.*XFree=\(\w*\).*/\1/p' /proc/cmdline`
[ −n "$XFree" ] || XFree=standard
[ −r "/etc/X11/$i.$XFree" ] && ln −sf "$i.$XFree" "/etc/X11/$i"
fi
done
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Move your XF86Config−4 file (the one for standard kernel) to XF86Config−4.standard, create a
symbolic link from it to XF86Config−4, and move the XF86Config−4 file (the one for Backstreet Ruby)
to XF86Config−4.bruby. For Ruby/Backstreet Ruby kernels, add to the append line in
/etc/lilo.conf, or on boot prompt "XFree=bruby", leave the standard kernel as is.
Results:
Booting with "XFree=standard" or without "XFree=" (boot prompt or lilo.conf) will result in linking
XF86Config−4.standard to XF86Config−4; booting with "XFree=bruby" will link
XF86Config−4.bruby to XF86Config−4, so in both scenarios XFree can be started with the proper
configuration file for the first X server.
Under a standard kernel you cannot use several independent X servers, so you should use the other XFree
configuration files only under Ruby/Backstreet Ruby − there is no need for different configuration files under
standard & bruby kernels.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
#
#the same like XF86Config but for gdm.conf & Xservers
#
for i in xdm/Xservers gdm/gdm.conf; do
if [ −L "/etc/X11/$i" ]; then
DumbCon=`sed −n 's/.*dumbcon=\([0−9]*\).*/\1/p' /proc/cmdline`
[ −n "$DumbCon" ] || DumbCon=0
[ −r "/etc/X11/$i.$DumbCon" ] && ln −sf "/etc/X11/$i.$DumbCon" "/etc/X11/$i"
fi
done
echo "Setting up display managers for `expr $DumbCon + 1` Xservers"
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Chapter 7. Tweaking it 49
XFree Local Multi−User HOWTO
• "i.0" is used for a single X server, when dumbcon=n is not specified, or dumbcon=0.
• "i.1" is used by the display manager when dumbcon=1 is specified.
• "i.2" is used by the display manager when dumbcon=2 is specified.
• "i.3" is used by the display manager when dumbcon=3 is specified.
...and so on.
Therefore:
• "i.0" should contain the definition only of your original standard X server.
• "i.1" should contain the definitions for 2 X servers.
• "i.2" should contain the definitions for 3 X servers.
• ...and so on.
If you boot without dumbcon=n or with dumbcon=0 (for example a standard kernel), your display manager
will start a single X server with the corresponding XF86Config file.
If you start with dumbcon=1 the display manager will automatically start 2 X servers.
If you start with dumbcon=2, when booting is finished you'll get 3 login prompts on your 3 displays.
Keep in mind that each X server should have it's own configuration file, and it should be specified in the
display manager configuration file properly. Take a look at the configuration files before restarting with an
activated display manager and this addition to your init scripts.
This can also be used if you have a single XFree configuration file (see Section 4.6, "For graphic cards
without DRI"). In this case you will have to specify the correct layout instead of the correct XFree
configuration file.
Once it is more tested and bug−free, you could, for example, use it under Backstreet Ruby to switch between
2, 3 or more X servers and a single X server using Xinerama. So when your PC isn't used by more then one
user, you could use the other monitors under Xinerama. Or one more funny example: you're simulating net
gaming with a number of friends on your bruby Linux PC, you have invested a bit more in an additional
graphic card which is already configured, but you don't have enough money right now to buy one more
monitor and keyboard/mouse pair. One friend of yours comes and says, "Hey guys, that's cool. Can I join?"
What would you answer? Using the GUI could result in the following answer from your side: "No problem,
just bring your monitor,keyboard and mouse."
Chapter 7. Tweaking it 50
XFree Local Multi−User HOWTO
If you are feeling like a hacker and want to try out this BUGGY GUI/CLI, check the current status at
http://karlovo.demon.co.uk/~svetlio/ruby−contrib/bruby−python/. But remember, it's not very tested, and if
not configured properly it can cause you serious troubles. Please wait until it is more stable if you are not that
familiar with Linux. If you feel comfortable enough under Linux, and think of yourself as a hacker, please
help in testing it and making it better, bug−free and easy to configure.
Chapter 7. Tweaking it 51
Chapter 8. Known problems
8.1. Hardware problems
While not exactly problems, some graphic cards do not work well, or even at all in multi−user environments.
If you are building such a system from the beginning, check the Video Compatibility list before buying video
hardware.
Sometimes secondary graphic card(s) (for now reported only by Nvidia owners) will refuse to start, even if
they have worked flowlessly for months. One of the following sollutions should fix the problem:
• Running /usr/X11R6/bin/X −probeonly on the secondary card(s) before initializing/ starting XFree
on the primary graphic card.
Some examples:
or:
Recommended: disable.
2. RedHat 8.0/9 − /bin/sysfont:
Recommended: disable. If you have to install new hardware and want to use this service, boot with
standard kernel and start it manually.
;;
stop)
gprintf "Disabling numlocks on ttys: "
− for tty in /dev/tty[0−8]; do
+ for tty in /dev/tty[0−7]; do
setleds −D −num < $tty
done
echo_success
I still seem to have some kind of problem, because on the console I always get:
9.3. Debian
There are no known problems.
9.4. SuSE
1. In /etc/init.d/kbd, add this line in the very beginning of the file:
KBD_TTY="tty0 tty2 tty3 tty4 tty5 tty6 tty7"
After modifications:
#! /bin/sh
# Copyright (c) 1995−2001 SuSE GmbH Nuernberg, Germany.
#
# Author: Burchard Steinbild <[email protected]>
# Werner Fink <[email protected]>
#
# /etc/init.d/kbd
#
# and symbolic its link
#
# /sbin/rckbd
#
### BEGIN INIT INFO
# Provides: kbd
# Required−Start: $remote_fs
# Required−Stop:
# X−SuSE−Should−Start: fbset serial
# X−SuSE−Should−Stop:
# Default−Start: 1 2 3 5 S
# Default−Stop:
# Description: Keyboard settings (don't disable!)
### END INIT INFO
. /etc/rc.status
. /etc/sysconfig/console
. /etc/sysconfig/keyboard
KBDBASE="/usr/share/kbd"
Recommended: disable. If you have to install new hardware and want to use this service, boot with
standard kernel and start it manually.
Difficulty understanding the HOWTO? Some parts are not clear? Drop a line to the above address.
In case you experience troubles in configuring the system, feel free to contact me or the linuxconsole mailing
list.
Please send as many details as possible, the most important information would be (from a running Backstreet
Ruby kernel):
You got it running? Congratulations! Drop a line, give some details on your configuration and attach your
XFree configuration files.
Nvidia cards
This can be acomplished by manually starting X or using gdm as desktop manager. You'll have to
abstain from using xdm or kdm, as they start the X servers at the same time.
• AGP sever restart leads to system crashes. In gdm.conf, set AlwaysRestartServer=false.
• The XFree−4.3−prefbusid patch/binary fixes most of the problems. In case the X servers are started in
the right order there are no lock ups.
B.1. XFree86
B.1.1. 1st XFree server configuration file
# File generated by XFdrake.
# **********************************************************************
# Refer to the XF86Config(4/5) man page for details about the format of
# this file.
# **********************************************************************
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
EndSection
# **********************************************************************
# Server flags section.
# **********************************************************************
Section "ServerFlags"
EndSection
# **********************************************************************
# Input devices
# **********************************************************************
# **********************************************************************
# Keyboard section
# **********************************************************************
Section "InputDevice"
Identifier "Keyboard1"
Driver "Keyboard"
Option "AutoRepeat" "250 30"
EndSection
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
# Option "Device" "/dev/psaux"
Option "Device" "/dev/input/mouse1"
Option "ZAxisMapping" "4 5"
EndSection
Section "Module"
SubSection "extmod"
#Option "omit xfree86−dga"
Load "type1"
Load "freetype"
EndSection
Section "DRI"
Mode 0666
EndSection
# **********************************************************************
# Monitor section
# **********************************************************************
Section "Monitor"
Identifier "Generic|Monitor that can do 1600x1200 at 70 Hz"
VendorName "Unknown"
ModelName "Unknown"
EndSection
Section "Monitor"
Identifier "monitor2"
VendorName "Unknown"
ModelName "Unknown"
Section "Monitor"
Identifier "monitor3"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 31.5−60.0
VertRefresh 56.0−75.0
EndSection
# **********************************************************************
# Graphics device section
# **********************************************************************
Section "Device"
Identifier "Generic VGA"
Driver "vga"
EndSection
Section "Device"
Identifier "g550_1"
VendorName ""
BoardName ""
Driver "mga"
# Clock lines
Section "Device"
Identifier "g550_2"
VendorName ""
BoardName ""
Driver "mga"
# Clock lines
# **********************************************************************
# Screen sections
# **********************************************************************
Section "Screen"
Identifier "screen1"
Device "g550_1"
Monitor "monitor2"
DefaultColorDepth 16
Subsection "Display"
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "layout1"
Screen "screen1"
Option "SingleCard" "true"
# **********************************************************************
# Refer to the XF86Config(4/5) man page for details about the format of
# this file.
# **********************************************************************
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
EndSection
# **********************************************************************
# Server flags section.
# **********************************************************************
Section "ServerFlags"
EndSection
# **********************************************************************
# Input devices
# **********************************************************************
# **********************************************************************
# Keyboard section
# **********************************************************************
Section "InputDevice"
Identifier "Keyboard1"
Driver "Keyboard"
Option "AutoRepeat" "250 30"
EndSection
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "PS/2"
# Option "ChordMiddle"
EndSection
Section "Module"
SubSection "extmod"
#Option "omit xfree86−dga"
EndSubSection
Load "type1"
Load "freetype"
EndSection
#Section "DRI"
# Mode 0666
#EndSection
# **********************************************************************
# Monitor section
# **********************************************************************
Section "Monitor"
Identifier "Generic|Monitor that can do 1600x1200 at 70 Hz"
VendorName "Unknown"
ModelName "Unknown"
EndSection
Section "Monitor"
Identifier "monitor2"
VendorName "Unknown"
ModelName "Unknown"
# HorizSync 30−98
# VertRefresh 50−160
HorizSync 30−50
VertRefresh 50−120
EndSection
# **********************************************************************
# Graphics device section
# **********************************************************************
Section "Device"
Identifier "Generic VGA"
Driver "vga"
EndSection
Section "Device"
Identifier "nv"
VendorName ""
BoardName ""
Driver "nvidia"
# Clock lines
# **********************************************************************
# Screen sections
# **********************************************************************
Section "Screen"
Identifier "screen1"
Device "nv"
Monitor "monitor2"
DefaultColorDepth 24
Subsection "Display"
Depth 8
Modes "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 32
Modes "1280x1024" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "layout1"
Screen "screen1"
Option "SingleCard" "true"
EndSection
/etc/X11/xdm/Xservers.1
/etc/X11/xdm/Xservers.2
B.2.2. gdm
/etc/X11/gdm/gdm.conf.0
[daemon]
# Automatic login, if true the first local screen will automatically logged
# in as user as set with AutomaticLogin key.
AutomaticLoginEnable=false
AutomaticLogin=
# Timed login, useful for kiosks. Log in a certain user after a certain
# amount of time
TimedLoginEnable=false
TimedLogin=
TimedLoginDelay=30
# A comma separated list of users that will be logged in without having
# to authenticate on local screens (not over xdmcp). Note that 'root'
# is ignored and will always have to authenticate.
LocalNoPasswordUsers=
# If you are having trouble with using a single server for a long time and
# want gdm to kill/restart the server, turn this on
AlwaysRestartServer=false
# The gdm configuration program that is run from the login screen, you should
# probably leave this alone
Configurator=/usr/sbin/gdmsetup −−disable−sound −−disable−crash−dialog
GnomeDefaultSession=/usr/share/gnome/default.session
# The chooser program. Must output the chosen host on stdout, probably you
# should leave this alone
Chooser=/usr/bin/gdmchooser
# Default path to set. The profile scripts will likely override this
DefaultPath=/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin
# Default path for root. The profile scripts will likely override this
RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin
DisplayInitDir=/etc/X11/gdm/Init
# Greeter for local (non−xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmgreeter
[security]
# If any distributions ship with this one off, they should be shot
# this is only local, so it's only for say kiosk use, when you
# want to minimize possibility of breakin
AllowRoot=true
# If you want to be paranoid, turn this one off
AllowRemoteRoot=true
# This will allow remote timed login
AllowRemoteAutoLogin=false
# 0 is the most anal, 1 allows group write permissions, 2 allows all write permissions
RelaxPermissions=0
RetryDelay=3
# XDMCP is the protocol that allows remote login. If you want to log into
# gdm remotely (I'd never turn this on on open network, use ssh for such
# remote usage that). You can then run X with −query <thishost> to log in,
# or −indirect <thishost> to run a chooser. Look for the 'Terminal' server
# type at the bottom of this config file.
[xdmcp]
# Distributions: Ship with this off. It is never a safe thing to leave
# out on the net. Alternatively you can set up /etc/hosts.allow and
# /etc/hosts.deny to only allow say local access.
Enable=false
# Honour indirect queries, we run a chooser for these, and then redirect
# the user to the chosen host. Otherwise we just log the user in locally.
HonorIndirect=true
# Maximum pending requests
MaxPending=4
MaxPendingIndirect=4
# Maximum open XDMCP sessions at any point in time
MaxSessions=16
# Maximum wait times
MaxWait=15
MaxWaitIndirect=15
# How many times can a person log in from a single host. Usually better to
# keep at 1 to fend off DoS attacks by running many logins from a single
# host
DisplaysPerHost=1
# The port. 177 is the standard port so better keep it that way
Port=177
# Willing script, none is shipped and by default we'll send
# hostname system id. But if you supply something here, the
# output of this script will be sent as status of this host so that
# the chooser can display it. You could for example send load,
# or mail details for some user, or some such.
Willing=/etc/X11/gdm/Xwilling
[gui]
# The 'theme'. By default we're using the default gtk theme
# Of course assuming that gtk got installed in the same prefix,
# if not change this.
GtkRC=/usr/share/themes/Default/gtk/gtkrc
# Maximum size of an icon, larger icons are scaled down
MaxIconWidth=128
MaxIconHeight=128
[greeter]
# Greeter has a nice title bar that the user can move
TitleBar=true
# Configuration is available from the system menu of the greeter
ConfigAvailable=true
# Face browser is enabled. This only works currently for the
# standard greeter as it is not yet enabled in the graphical greeter.
Browser=true
# The default picture in the browser
DefaultFace=/usr/share/mdk/faces/default.png
# These are things excluded from the face browser, not from logging in
[debug]
# This will enable debugging into the syslog, usually not neccessary
# and it creates a LOT of spew of random stuff to the syslog. However it
# can be useful in determining when something is going very wrong.
Enable=false
[servers]
# These are the standard servers. You can add as many you want here
# and they will always be started. Each line must start with a unique
# number and that will be the display number of that server. Usually just
# the 0 server is used.
0=Standard
#1=Standard
# Note the VTAllocation and FirstVT keys on Linux. Don't add any vt<number>
# arguments if VTAllocation is on, and set FirstVT to be the first vt
# available that your gettys don't grab (gettys are usually dumb and grab
# even a vt that has already been taken). Using 7 will work pretty much for
# all Linux distributions. VTAllocation is not currently implemented on
# anything but Linux since I don't own any non−Linux systems. Feel free to
# send patches. X servers will just not get any extra arguments then.
#
#Note: If you want to run an X terminal you could add an X server such as this
#0=Terminal −query serverhostname
# or for a chooser (optionally serverhostname could be localhost)
#0=Terminal −indirect serverhostname
flexible=true
# To use this server type you should add −query host or −indirect host
# to the command line
[server−Terminal]
name=Terminal server
# Add −terminate to make things behave more nicely
command=/usr/X11R6/bin/X −terminate
# Make this not appear in the flexible servers (we need extra params
# anyway, and terminate would be bad for xdmcp)
/etc/X11/gdm/gdm.conf.1
[daemon]
# Automatic login, if true the first local screen will automatically logged
# in as user as set with AutomaticLogin key.
AutomaticLoginEnable=false
AutomaticLogin=
# Timed login, useful for kiosks. Log in a certain user after a certain
# amount of time
TimedLoginEnable=false
TimedLogin=
TimedLoginDelay=30
# A comma separated list of users that will be logged in without having
# to authenticate on local screens (not over xdmcp). Note that 'root'
# is ignored and will always have to authenticate.
LocalNoPasswordUsers=
# If you are having trouble with using a single server for a long time and
# want gdm to kill/restart the server, turn this on
AlwaysRestartServer=false
# The gdm configuration program that is run from the login screen, you should
# probably leave this alone
Configurator=/usr/sbin/gdmsetup −−disable−sound −−disable−crash−dialog
GnomeDefaultSession=/usr/share/gnome/default.session
# The chooser program. Must output the chosen host on stdout, probably you
# should leave this alone
Chooser=/usr/bin/gdmchooser
# Default path to set. The profile scripts will likely override this
DefaultPath=/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin
# Default path for root. The profile scripts will likely override this
RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin
DisplayInitDir=/etc/X11/gdm/Init
# Greeter for local (non−xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmgreeter
# Greeter for xdmcp logins, usually you want a less graphically intensive
# greeter here so it's better to leave this with gdmlogin
RemoteGreeter=/usr/bin/gdmlogin
# User and group that gdm should run as. Probably should be gdm and gdm and
# you should create these user and group. Anyone found running this as
# someone too privilaged will get a kick in the ass. This should have
# access to only the gdm directories and files.
[security]
# If any distributions ship with this one off, they should be shot
# this is only local, so it's only for say kiosk use, when you
# want to minimize possibility of breakin
AllowRoot=true
# If you want to be paranoid, turn this one off
AllowRemoteRoot=true
# This will allow remote timed login
AllowRemoteAutoLogin=false
# 0 is the most anal, 1 allows group write permissions, 2 allows all write permissions
RelaxPermissions=0
RetryDelay=3
# Maximum size of a file we wish to read. This makes it hard for a user to DoS us
# by using a large file.
UserMaxFile=65536
# Maximum size of the session file. This is larger because it matters less as we
# never keep it all in memory. Just has an upper limit so that we don't go into too
# long of a loop
SessionMaxFile=524388
# XDMCP is the protocol that allows remote login. If you want to log into
# gdm remotely (I'd never turn this on on open network, use ssh for such
# remote usage that). You can then run X with −query <thishost> to log in,
# or −indirect <thishost> to run a chooser. Look for the 'Terminal' server
# type at the bottom of this config file.
[xdmcp]
# Distributions: Ship with this off. It is never a safe thing to leave
# out on the net. Alternatively you can set up /etc/hosts.allow and
# /etc/hosts.deny to only allow say local access.
Enable=false
# Honour indirect queries, we run a chooser for these, and then redirect
# the user to the chosen host. Otherwise we just log the user in locally.
HonorIndirect=true
# Maximum pending requests
MaxPending=4
MaxPendingIndirect=4
# Maximum open XDMCP sessions at any point in time
MaxSessions=16
# Maximum wait times
MaxWait=15
MaxWaitIndirect=15
# How many times can a person log in from a single host. Usually better to
# keep at 1 to fend off DoS attacks by running many logins from a single
# host
DisplaysPerHost=1
# The port. 177 is the standard port so better keep it that way
Port=177
# Willing script, none is shipped and by default we'll send
# hostname system id. But if you supply something here, the
# output of this script will be sent as status of this host so that
# the chooser can display it. You could for example send load,
# or mail details for some user, or some such.
Willing=/etc/X11/gdm/Xwilling
[gui]
# The 'theme'. By default we're using the default gtk theme
# Of course assuming that gtk got installed in the same prefix,
# if not change this.
GtkRC=/usr/share/themes/Default/gtk/gtkrc
# Maximum size of an icon, larger icons are scaled down
MaxIconWidth=128
MaxIconHeight=128
[greeter]
# Greeter has a nice title bar that the user can move
TitleBar=true
# Configuration is available from the system menu of the greeter
ConfigAvailable=true
# Face browser is enabled. This only works currently for the
# standard greeter as it is not yet enabled in the graphical greeter.
Browser=true
# The default picture in the browser
DefaultFace=/usr/share/mdk/faces/default.png
# These are things excluded from the face browser, not from logging in
Exclude=bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,gdm,postgres,pvm,rpm
# As an alternative to the above this is the minimum uid to show
MinimalUID=500
# If user or user.png exists in this dir it will be used as his picture
GlobalFaceDir=/usr/share/faces/
# Icon we use
Icon=/usr/share/pixmaps/gdm.png
[debug]
# This will enable debugging into the syslog, usually not neccessary
# and it creates a LOT of spew of random stuff to the syslog. However it
# can be useful in determining when something is going very wrong.
Enable=false
[servers]
# These are the standard servers. You can add as many you want here
# and they will always be started. Each line must start with a unique
# number and that will be the display number of that server. Usually just
# the 0 server is used.
0=Standard
1=2nd
# Note the VTAllocation and FirstVT keys on Linux. Don't add any vt<number>
# arguments if VTAllocation is on, and set FirstVT to be the first vt
# available that your gettys don't grab (gettys are usually dumb and grab
# even a vt that has already been taken). Using 7 will work pretty much for
# all Linux distributions. VTAllocation is not currently implemented on
# anything but Linux since I don't own any non−Linux systems. Feel free to
# send patches. X servers will just not get any extra arguments then.
#
#Note: If you want to run an X terminal you could add an X server such as this
#0=Terminal −query serverhostname
# or for a chooser (optionally serverhostname could be localhost)
#0=Terminal −indirect serverhostname
# To use this server type you should add −query host or −indirect host
# to the command line
[server−Terminal]
name=Terminal server
# Add −terminate to make things behave more nicely
command=/usr/X11R6/bin/X −terminate
# Make this not appear in the flexible servers (we need extra params
# anyway, and terminate would be bad for xdmcp)
flexible=false
#
# keyboard configuretion
#
# vt_name device_physicaly_location
VT0 usb−00:10.1−1.1/input0
VT1 isa0060/serio0/input0
#VT2 usb−*.*−1/input0
#
# input event device config file
#
# symbolic_link device_physicaly_location
#event0br isa0060/serio0/*
#event0br isa0060/serio1/input0
#event3br usb−*.*−1.3/*
#!/bin/sh
# Please place this file /etc/hotplug
#
# input−specific hotplug policy agent.
#
# Kernel Input params are:
#
# ACTION=add
# PHYS=pysical location of device
# NAME=Name of the device
#
# HISTORY:
# 15−JUN−2003 removed paste
# 07−MAY−2003 remake by Aivils Stoss
# /proc manipulation added
# parse kbd.conf event.conf mouse.conf.
# create necessary symbolic links
# 28−SEP−2002 Initial version from Andreas Schuldei
# andreas (at) schuldei.org
#
cd /etc/hotplug
. hotplug.functions
DEBUG=yes export DEBUG
KBD_CONFIG="./kbd.conf"
EVENT_CONFIG="./event.conf"
MOUSE_CONFIG="./mouse.conf"
setup_kbd ()
{
while read VT_NUM PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$VT_NUM" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
VT=`echo "$VT_NUM" | sed 's/VT//' | awk '{printf "%02d", $0}'`
if [ −d /proc/bus/console/$VT ]; then
echo "$PHYS" > "/proc/bus/console/$VT/keyboard"
debug_mesg "Input device $NAME on $PHYS mapping as secondary to VT$VT"
return;
else
debug_mesg "Trying to configure keyboard for VT$VT , but not enough VT's availabl
fi
fi
done
debug_mesg "Found no fitting VT"
}
setup_event ()
{
while read SYM_LINK PHYS_PATTERN NAME_PATTERN
do
Appendix C. Scripts 81
XFree Local Multi−User HOWTO
if [ `echo "$SYM_LINK" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
case $ACTION in
add)
cd /dev/input
rm −f $SYM_LINK
ln −s $DEV_EVENT $SYM_LINK
debug_mesg "Input event device $NAME on $PHYS linked to $SYM_LINK"
;;
remove)
rm −f /dev/input/$SYM_LINK
debug_mesg "Input event device link $SYM_LINK removed"
;;
esac
return;
fi
done
debug_mesg "Found no fitting event device"
}
setup_mouse ()
{
while read SYM_LINK PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$SYM_LINK" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
case $ACTION in
add)
cd /dev/input
rm −f $SYM_LINK
ln −s $DEV_MOUSE $SYM_LINK
debug_mesg "Input mouse device $NAME on $PHYS linked to $SYM_LINK"
;;
remove)
rm −f /dev/input/$SYM_LINK
debug_mesg "Input mouse device link $SYM_LINK removed"
;;
esac
return;
fi
done
debug_mesg "Found no fitting mouse device"
}
Appendix C. Scripts 82
XFree Local Multi−User HOWTO
DEV_EVENT=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /event/) print $n}'`
DEV_MOUSE=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /mouse/) print $n}'`
DEV_KBD=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /kbd/) print $n}'`
#
# What to do with this input device event?
#
case "$ACTION" in
add)
if [ −n "$DEV_KBD" ]; then
setup_kbd < $KBD_CONFIG
fi
if [ −n "$DEV_EVENT" ]; then
setup_event < $EVENT_CONFIG
fi
if [ −n "$DEV_MOUSE" ]; then
setup_mouse < $MOUSE_CONFIG
fi
;;
remove)
#setup_event < $EVENT_CONFIG
#setup_mouse < $MOUSE_CONFIG
;;
*)
debug_mesg "Input '$ACTION' event not supported"
return 1
;;
esac
#!/bin/bash
#
# input.rc This loads handlers for those input devices
# that have drivers compiled in kernel
# Currently stopping is not supported
#
# Best invoked via /etc/init.d/hotplug or equivalent, with
# writable /tmp, /usr mounted, and syslogging active.
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PROCDIR=/proc/bus/input
Appendix C. Scripts 83
XFree Local Multi−User HOWTO
if [ −f /etc/hotplug/hotplug.functions ]; then
. /etc/hotplug/hotplug.functions
fi
input_reset_state () {
PRODUCT=
NAME=
PHYS=
EV=
KEY=
REL=
ABS=
MSC=
LED=
SND=
FF=
#
# "COLD PLUG" ... load input handlers for compile−in input drivers loaded
# before the OS could really handle hotplug, perhaps because /sbin or
# $HOTPLUG_DIR wasn't available or /tmp wasn't writable. When/if the
# /sbin/hotplug program is invoked then, hotplug event notifications
# get dropped. To make up for such "cold boot" errors, we synthesize
# all the hotplug events we expect to have seen already. They can be
# out of order, and some might be duplicates.
#
input_boot_events ()
{
if [ ! −r $PROCDIR/devices ]; then
echo $"** can't synthesize input events − $PROCDIR/devices missing"
return
fi
ACTION=add
export ACTION
export PRODUCT NAME PHYS EV KEY REL ABS MSC LED SND FF
input_reset_state
declare line
#
# the following reads from /proc/bus/input/devices. It is inherently
# racy (esp. as this file may be changed by input.agent invocation)
# but so far input devices do not appear in sysfs
#
while read line; do
case "$line" in
I:* ) # product ID
eval "${line#I: }"
PRODUCT=$Bus/$Vendor/$Product/$Version
;;
N:* ) # name
eval "${line#N: }"
NAME="$Name"
;;
P:* ) # Physical
eval "${line#P: }"
PHYS=$Phys
Appendix C. Scripts 84
XFree Local Multi−User HOWTO
;;
B:* ) # Controls supported
line="${line#B: }"
eval "${line%%=*}=\"${line#*=}\""
;;
"" ) # End of block
debug_mesg "Invoking input.agent"
debug_mesg "PRODUCT=$PRODUCT"
debug_mesg "NAME=$NAME"
debug_mesg "PHYS=$PHYS"
debug_mesg "EV=$EV"
debug_mesg "KEY=$KEY"
debug_mesg "REL=$REL"
debug_mesg "ABS=$ABS"
debug_mesg "MSC=$MSC"
debug_mesg "LED=$LED"
debug_mesg "SND=$SND"
debug_mesg "FF=$FF"
/etc/hotplug/input.agent < /dev/null
input_reset_state
;;
esac
done < $PROCDIR/devices
}
echo ''
;;
restart)
# always invoke by absolute path, else PATH=$PATH:
$0 stop && $0 start
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
Appendix C. Scripts 85
XFree Local Multi−User HOWTO
exit 1
esac
#!/bin/bash
cd /etc/hotplug
. hotplug.functions
#DEBUG=yes export DEBUG
export ARG_SEP='\002'
export VAL_SEP='\003'
export LD_LIBRARY_PATH=/usr/X11R6/libNV
exec /usr/X11R6/bin/X0 $*
C.5. For installing Nvidia drivers for parallel use with DRI
#!/bin/bash
########################################################
### /usr/sbin/ruby_NVinstaller ###
### for usage call it with −h or −−help parameter ###
########################################################
if [[ −z $OPENWINHOME ]];then
Appendix C. Scripts 86
XFree Local Multi−User HOWTO
echo
echo "OPENWINHOME not defined!!!"
echo "Please set the environment variable OPENWINHOME"
echo "pointing to your XFree prefix eg. /usr/X11R6"
echo "for bash shell :"
echo "export OPENWINHOME=/usr/X11R6"
exit 1
fi
cd $OPENWINHOME
echo
echo "backup file for XFree's GL libraries "
echo "is $OPENWINHOME/libGL−backup.tar"
if [ −x libGL−backup.tar ]; then
echo "old backup exist, deleting" && rm libGL−backup.tar
fi
echo
find lib −name "libGL.*" −o −name "libGLcore*" \
−o −name "libglx.*" | xargs tar rpf libGL−backup.tar \
&& echo "backup finished"
echo
echo "now running Nvidia installer"
echo "`which $1` −−no−opengl−headers −−xfree86−prefix=/usr/X11R6NV −−opengl−prefix=/usr/X11R6NV"
echo
`which $1` −−no−opengl−headers −−xfree86−prefix=/usr/X11R6NV −−opengl−prefix=/usr/X11R6NV
RETVAL=$?
if [ $RETVAL −eq 0 ]; then
echo
echo "Nvidia installer finished,"
echo "now coping files to /usr/X11R6/libNV/"
echo
cd /usr/X11R6NV/lib && tar c * | tar xvC /usr/X11R6/libNV/
echo
echo "restoring backuped GL libraries"
echo
cd $OPENWINHOME
tar xvfp libGL−backup.tar && ldconfig && echo "GL libraries restored" && rm libGL−backup.tar
fi
echo
echo "script finished"
Appendix C. Scripts 87
Appendix D. Experimental Backstreet Ruby
configuration Script/ Service
D.1. README.ruby_init explains how to configure and use
the service.
well,
have to be written :−)
start the service and check if everything is done as requested and configured
/etc/init.d/ruby_init start
"chkconfig −−list ruby_init" will tell you in which runlevels the service is active
HACK_VIDEO_ENABLE=no
If set to "yes", turns on at boot the hackvideo feature of the Backstreet Ruby kernel.
In case XFree PrefBusID is used set to "no"
HOTPLUG_RC_input=yes
If set to "yes", runs /etc/hotplug/input.rc to configure input devices which were activated
by the kernel before hotplug was available (drivers statically linked in the kernel).
Generaly needed by all systems unless you have all input drivers configured as loadable modules
and load the drivers after hotplug is accessible to the kernel.
AUTO_DM=no
AUTO_XFree=no
LOAD_MODULES=yes
if set to "yes" loads certain input device drivers in case a ruby kernel is running.
#
# input modules configuration
#
# module arguments
The list of modules which should be loaded in case ruby kernel is running and
LOAD_MODULES is set to "yes".
In the example file are listed all important input drivers (keyboards & mice).
If you have some of them compiled in the kernel, you may disable the loading
of the corresponding drivers by commenting them out.
the ext−status argument can give you detailed information about the current
configuration, and valuable information in case you are in trouble.
# /etc/sysconfig/ruby.conf
# This file contains defaults for bruby_init
#
# HACK_VIDEO_ENABLE controls wether the ruby kernel shoukd
# ignore certain XFree commands.
#
# Set to yes in case you are not running the XFree−PrefBusID
# but XFree from your distribution
#
HACK_VIDEO_ENABLE=yes
HOTPLUG_RC_input=yes
#
# AUTO_DM controls wether the display manager configuration files
# is adjusted upon the boot argument dumbcon=[number]
#
# AUTO_XFree controls wether the XFree configuration file is
# adjusted upon XFree=[string] argument.
# For Mandrake users this always activated in /etc/rc.d/rc.sysinit
# and can not be disabled.
#
AUTO_DM=no
AUTO_XFree=no
LOAD_MODULES=yes
#
# input modules configuration
#
# module arguments
#
# keyboard devices configuration
#
# vt_name device_physicaly_location
VT0 isa0060/serio0/input0
VT1 usb−00:10.1−1.1/input0
#VT0 isa0060/serio0/input0
#VT2 usb−*.*−1/input0
#
# multimedia keys configuration
#
# vt_name device_physicaly_location
#VT1 usb−00:10.1−1.1/input1
#VT2 usb−*.*−1/input0
#
# mouse devices configuration
#
# sym_link device_physicaly_location
mouse0br isa0060/serio1/input0
mouse1br usb−00:10.1−1.2/input0
#mouse2br usb−00:10.1−2.7.*/input0
#mouse1br usb−00:10.1−2.2/input0
#
# event devices configuration
#
# sym_link device_physicaly_location
#event0br isa0060/serio1/input0
#event1br usb−00:10.1−1.1/input0
#event2br usb−00:10.1−1.1/input1
#event3br usb−00:10.1−1.2/input0
#
# end input device configuration
#
#!/bin/sh
#
# ruby_init This scripts configures cold−pluging for bruby, \
# loads additional input modules, manages the XFree \
# and display manager configuration files
#
# chkconfig: 2345 02 98
# description: Configures the Bruby input subsystem and manages \
# XFree and display manager configuration files.
# config: /etc/sysconfig/ruby.conf
#
# TODO
# * handle commented out "PciOsConfig"
# *? status/ ext−status
# − show config
# − check wether curr. configuration matches setup ?
# − make it work when hotplug files not installed ?
# ( currently it will just just inform that they are not installed
# and exit )
#
# $Id: XFree−Local−multi−user−HOWTO.xml,v 1.12 2003/11/11 14:52:42 gferg Exp $
# − don't exit silently if hackvideo or modules loading is deactivated,
# run the script to the end
# $Id: XFree−Local−multi−user−HOWTO.xml,v 1.12 2003/11/11 14:52:42 gferg Exp $
# − show keyboard status per VT ,use sed instead of head(head is in /usr)
# − *? status/ ext−status
# − (mice & evdev links)?
# $Id: XFree−Local−multi−user−HOWTO.xml,v 1.12 2003/11/11 14:52:42 gferg Exp $
# − include hackvideo handling (long time wondering what was missing)
# $Id: XFree−Local−multi−user−HOWTO.xml,v 1.12 2003/11/11 14:52:42 gferg Exp $
# − got it actually running
# − use >& /dev/null to load variables from the config file
# (what a mess)
# $Id: XFree−Local−multi−user−HOWTO.xml,v 1.12 2003/11/11 14:52:42 gferg Exp $
# − initial release
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# source defaults
if [ −f /etc/sysconfig/ruby.conf ]; then
#WTF, how to get rid of the ".... >& /dev/null"
. /etc/sysconfig/ruby.conf >& /dev/null
RUBY_CONF="/etc/sysconfig/ruby.conf"
else
action "ruby_init: Configuration file missing" /bin/false
exit 1
fi
function get_ext_status() {
run_input_rc status
run_hackvideo status
# prefbus_used ?
# print dumb_con=?
get_kbds #and curr. active VTs
get_links mouse
get_links event
}
function run_start_restart() {
load_modules
run_hackvideo start
run_input_rc start
run_auto_dm
run_auto_xfree
}
function run_input_rc () {
for RC in /etc/hotplug/input.rc
do
eval "doit=\"\$HOTPLUG_RC_input\""
if [ "$doit" != yes −a "$1" != status ]; then
continue
fi
$RC $1
if [ "$1" != status ]; then
action "bruby: configuring cold−pluged devices." $RC $1
fi
done
}
function run_hackvideo () {
eval "doit=\"\$HACK_VIDEO_ENABLE\""
if [ "$doit" != yes ]; then
if [ "$1" = status ]; then
echo "XFree hackvideo not configured."
fi
return ;
fi
if [ −f /proc/bus/pci/hackvideo ]; then
if [ −f /etc/X11/XF86Config−4 ]; then
xf_file="/etc/X11/XF86Config−4"
elif [ −f /etc/X11/XF86Config ]; then
xf_file="/etc/X11/XF86Config"
else
action "bruby: XFree configuration file not found" /bin/false
exit 1
fi
#fi
eval "xf_hackvideo=`sed −n '/^#/d;s/^.*"PciOsConfig"[ ]//p' $xf_file | sed −e '
if [ "$xf_hackvideo" = "1" ]; then
case "$1" in
fi
else
action "bruby: XFree hackvideo configured," /bin/false
action "bruby: but kernel hackvideo support missing." /bin/false
fi
function load_modules () {
eval "doit=\"\$LOAD_MODULES\""
if [ "$doit" != yes −a "$1" != status ]; then
return ;
fi
action "bruby: loading additional modules." /bin/true
cat $RUBY_CONF | sed −n "/input modules /,/config/p" | while read module args
do
case "$module" in
\#*|"") continue ;;
esac
initlog −s "Loading module: $module"
modprobe $module $args >/dev/null 2>&1
done
}
function run_auto_xfree () {
eval "doit=\"\$AUTO_XFree\""
if [ "$doit" != yes −a "$1" != status ]; then
return ;
fi
# (pixel) a kind of profile for XF86Config
# if no XFree=XXX given on kernel command−line, restore XF86Config.standard
for i in XF86Config XF86Config−4; do
if [ −L "/etc/X11/$i" ]; then
XFree=`sed −n 's/.*XFree=\(\w*\).*/\1/p' /proc/cmdline`
[ −n "$XFree" ] || XFree=standard
[ −r "/etc/X11/$i.$XFree" ] && ln −sf "$i.$XFree" "/etc/X11/$i"
fi
done
function run_auto_dm () {
eval "doit=\"\$AUTO_DM\""
if [ "$doit" != yes −a "$1" != status ]; then
return ;
fi
#
#the same like XF86Config but for gdm.conf & Xservers
#
for i in xdm/Xservers gdm/gdm.conf; do
if [ −L "/etc/X11/$i" ]; then
DumbCon=`sed −n 's/.*dumbcon=\([0−9]*\).*/\1/p' /proc/cmdline`
[ −n "$DumbCon" ] || DumbCon=0
[ −r "/etc/X11/$i.$DumbCon" ] && ln −sf "/etc/X11/$i.$DumbCon" "/etc/X11/$i"
fi
done
action "bruby: configuring display manager." /bin/true
echo "Setting up display managers for `expr $DumbCon + 1` Xservers"
}
function get_kbds() {
j=0
for i in /proc/bus/console/*
do
echo
j=`expr $j + 1`
phys=`cat $i/keyboard`
if [ "$phys" = "" ];then
echo " VT−`basename $i` : keyboard not attached"
else
echo " VT−`basename $i` using :"
# grep −n2 "$phys" /proc/bus/input/devices | sed −e '{/^B: /s;^B:.*;;};{s;^.*: ;
grep −B2 −A1 "$phys" /proc/bus/input/devices | sed 's;^.*: ;;'
fi
done
echo
echo "Total of $j VT's avialable."
}
function get_links() {
echo
for i in /dev/input/$1*br
do
real=`ls −l $i 2>/dev/null | sed "{s;^.*/dev/input/;;};{s; −>;;}" | cut −
if [ "$real" != "" ]; then
echo "$i"
sed −e '/Name/,/Handl/s/.*: //;{/^B: /s;^B:.*;;};' /proc/bus/input/de
else
exit 0
fi
done
}
case "$1" in
start|restart)
run_start_restart
*)
gprintf "Usage: %s {start|stop|restart|status|ext−status|force_reload}\n"
exit 3
;;
esac
#!/bin/sh
# Please place this file /etc/hotplug
#
# input−specific hotplug policy agent.
#
# Kernel Input params are:
#
# ACTION=add
# PHYS=pysical location of device
# NAME=Name of the device
#
# HISTORY:
# 15−Sep−2003 modified to use single configuration file
# /etc/sysconfig/ruby.conf by me :−)
# (Svetoslav Slavtchev)
# added handling for multimedia keys
# but doesn't work as expected :(
# 15−JUN−2003 removed paste
RUBY_CONF="/etc/sysconfig/ruby.conf"
setup_kbd ()
{
while read VT_NUM PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$VT_NUM" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
VT=`echo "$VT_NUM" | sed 's/VT//' | awk '{printf "%02d", $0}'`
if [ −d /proc/bus/console/$VT ]; then
echo "$PHYS" > "/proc/bus/console/$VT/keyboard"
debug_mesg "Input device $NAME on $PHYS mapping as secondary to VT$VT"
return;
else
debug_mesg "Trying to configure keyboard for VT$VT , but not enough VT's availabl
fi
fi
done
debug_mesg "Found no fitting VT"
}
setup_mm_keys ()
{
while read VT_NUM PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$VT_NUM" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
VT=`echo "$VT_NUM" | sed 's/VT//' | awk '{printf "%02d", $0}'`
if [ −d /proc/bus/console/$VT ]; then
echo "+$PHYS" > "/proc/bus/console/$VT/keyboard"
debug_mesg "Input device $NAME on $PHYS mapping as secondary to VT$VT"
return;
else
debug_mesg "Trying to configure keyboard for VT$VT , but not enough VT's availabl
fi
fi
done
debug_mesg "Found no fitting VT"
}
setup_event ()
{
while read SYM_LINK PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$SYM_LINK" | grep "^#"` ]; then
continue;
setup_mouse ()
{
while read SYM_LINK PHYS_PATTERN NAME_PATTERN
do
if [ `echo "$SYM_LINK" | grep "^#"` ]; then
continue;
fi
if [ `echo "$PHYS" | grep $PHYS_PATTERN 2>/dev/null` ]; then
case $ACTION in
add)
cd /dev/input
rm −f $SYM_LINK
ln −s $DEV_MOUSE $SYM_LINK
debug_mesg "Input mouse device $NAME on $PHYS linked to $SYM_LINK"
;;
remove)
rm −f /dev/input/$SYM_LINK
debug_mesg "Input mouse device link $SYM_LINK removed"
;;
esac
return;
fi
done
debug_mesg "Found no fitting mouse device"
}
setup_input ()
{
if [ −n "$DEV_KBD" ]; then
sed −n "/keyboard devices/,/config/p" $RUBY_CONF | setup_kbd
sed −n "/multimedia keys/,/config/p" $RUBY_CONF | setup_mm_keys
fi
if [ −n "$DEV_EVENT" ]; then
sed −n "/event devices/,/config/p" $RUBY_CONF | setup_event
fi
if [ −n "$DEV_MOUSE" ]; then
sed −n "/mouse devices/,/config/p" $RUBY_CONF | setup_mouse
fi
}
DEV_EVENT=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /event/) print $n}'`
DEV_MOUSE=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /mouse/) print $n}'`
DEV_KBD=`echo $DEV_HANDLERS | \
awk −F" " '{for(n=1;$n;n=n+1) if($n ~ /kbd/) print $n}'`
#
# What to do with this input device event?
#
case "$ACTION" in
add)
setup_input
;;
remove)
#setup_input
;;
*)
debug_mesg "Input '$ACTION' event not supported"
return 1
;;
esac
Notes
[1] All the features in Backstreet Ruby are included ( "/proc " interface & hot−plugging, video hack, ...),
support for Framebuffer devices, support for single Framebuffer console which takes over the VGA
console (support for multiple independent Framebuffer consoles is not yet implemented)