Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ruby (AKA Backstreet Ruby) kernel patch and system setup how
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
jguarini
n00b
n00b


Joined: 28 Dec 2005
Posts: 10

PostPosted: Thu Dec 29, 2005 8:27 am    Post subject: Ruby (AKA Backstreet Ruby) kernel patch and system setup how Reply with quote

How to build and run a dual head/dual leg system using ruby patch and 2.6.13-ck kernel set


* this is my first tutorial so please be nice


All this information is pretty much found at http://www.ltn.lv/~aivils/


NOTE1: PLEASE read through this completely!
If you have any questions please ask them before starting, it will help you have a better experience in the long run.

NOTE2: This is NOT a kernel tutorial, so if you don't know how to compile your kernel you may want to read up on that first

Purpose:

For whatever reason, someone may want to have multiple keyboards/mice/monitors attached to one box.
I did it for: the fun of doing it, the learning experience and to save a little cash; others may do it so they don't have to build out a whole new system or they just may have additional hardware laying around.



Concept:

From what I understand, the concept is to have multiple keyboards/mice/monitors plugged into one system.
And with a patched kernel multiple users can login and use the system simultaneously. For X number of users there will need to be X number of keyboards/mice/monitors (and soundcards if you so choose to do so)


Setting up the system:

These are the steps I used in order to get a multi-headed/multi-legged (as I have seen it called) system.

NOTE: I will be using a system set up for two users running the 2.6.13 kernel patched with ck patchset for the example setup. More keyboards, mice and monitors have been said to work (and soundcards as well), but I will leave that up to others who want to run more than two users.

The system I am running has the following specs:

one (1) ps2 keyboard
one (1) ps2 mouse
one (1) usb mouse
one (1) usb keyboard
one (1) pci graphics card / Nvidia gforce
one (1) agp graphics card / Nvidia gforce
two (2) monitors


1. setup hardware

* plug-in the keyboards, mice and monitors

pretty basic, I am sure you can figure this part out :-)



2. patch the kernel

* get kernel sources

what I do (as root) is:

Code:

         cd /usr/portage/sys-kernel/ck-sources/

         emerge -f ck-sources-2.6.13_p8.ebuild



get the A0 patchset from here http://www.ltn.lv/~aivils/files/ruby-2.6.13-A0.diff.bz2


* patch with A0, ck and gentoo patchsets

next unpack and patch the sources:

Code:

                                    cd /usr/src/
                                    rm linux
         tar xjvf /usr/portage/distfiles/linux-2.6.13.tar.bz2
                                    ln -s linux-2.6.13 linux
         mkdir patches
         cd patches
         wget http://www.ltn.lv/~aivils/files/ruby-2.6.13-A0.diff.bz2
         bunzip2 ruby-2.6.13-A0.diff.bz2
         tar xjvf /usr/portage/distfiles/genpatches-2.6.13-6.base.tar.bz2
         cp /usr/portage/distfiles/patch-2.6.13-ck8.bz2  .
         bunzip2 patch-2.6.13-ck8.bz2



so you should now have:

* the kernel source unpacked
* ck patchset unpacked
* gentoo's genpatchset unpacked
* ruby's patchset unpacked


A note from the ck-2.6.13 ebuild:

Quote:
# Note: 2.6.x.y updates in genpatches begin with 10 but are included in -ck


now it is time to patch the kernel


* remove duplicates patches as noted above

Code:

            rm 2.6.13/10*
            rm 2.6.13/0000_README




* now cd into source directory

Code:
         
            cd linux-2.6.13



* now patch with ruby patchset

Code:
            
             patch -p1 < ../ruby-2.6.13-A0.diff



* patches should apply cleanly and without errors

* now apply ck-patchset

Code:

            patch -p1 < ../patch-2.6.13-ck8




* patches should apply cleanly with the exception of patching the Makefile (which is to be expected)

Quote:
patching file Makefile
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej

this is due to the fact that ruby changed the EXTRAVERSION to be =-ruby-A0

what I do is edit the Makefile to indicate that it is a ruby and ck patched kernel

Code:

            nano Makefile
            
            and change from EXTRAVERSION =-ruby-A0 to  EXTRAVERSION =-ruby-A0-ck




* now apply genpatches


Code:

            for i in ../2.6.13/* ; do patch -p1 < "$i" ; done



NOTE: patches should apply cleanly with some offset differences



* configure kernel

NOTE: I am assuming that you know how to compile your kernel and that you know what you need. As
this is not a how to on kernel configuration/compiling I am not going to go into every detail.
I am only going to indicate what needs to added/changes and when needed be specific.
Please add/change the other options as you need (like NIC and sound support etc.).


Code:

      make menuconfig



NOTE1: be sure to include the following in the kernel config
NOTE2: it is best to read through the kernel FAQ at http://www.ltn.lv/~aivils/ as there it maybe explained better


* basic configuration needed

Code:

         USB Support (needed for usb keybaord/mouse)
         
         Device Drivers -> Input device support -> Event interface
         
         Graphics support ->  <*> Support for frame buffer devices
             Console display driver support  ---> <*> Framebuffer Console support
            
         Mouse Support (needed for ps2 mouse)
         
         Keyboard support (needed for ps2 keyboard)
      
         and your usual changes :-)
         save and exit




NOTE: I have been unable to get the kernel to compile when i have

Kernel hacking ---> [*] Kernel debugging
[*] Magic SysRq key

if someone can figure out a fix for this it would be nice
so for now I just remove the [*] Magic SysRq key setting

* compile kernel

should be done as usual

eg. make && make modules modules_install

* cp kernel to /boot/

Code:

      mount /boot
      
      cp arch/<your arch>/boot/bzImage /boot/kernel-2.6.13-A0-ruby-ck




* add new kernel to grub.conf (I say grub because that is what I use)

some thing like the following should work:

Code:
      
         #For booting Gentoo kernel 2.6.13-A0-ruby-ck
         title Gentoo 2.6.13 dual head
         kernel /kernel-2.6.13-A0-ruby-ck root=/dev/hdb2 dumbcon=3 gentoo=nodevfs elevator=cfq




NOTE: the dumbcon is NOT optional, you need it



To keep portage from trying to upgrade my newly patched kernel sources I do the following:

Code:

                        echo "sys-kernel/gentoo-sources-2.6.13" >> /etc/make.profile/packages.provided
                        echo "=sys-kernel/ck-sources-2.6.13" >> /etc/portage/package.keywords




3. reboot into new kernel

as a precaution I would suggest not rebooting into graphical mode until you have all
the bugs worked out.

do the following:

Code:

      rc-update del xdm



now reboot and select the new ruby kernel

once you have booted into the new kernel the conf files can be changed according to the devices
found


4. modify the gdm.conf, xorg.conf and /etc/conf.d/localstart files

* gdm.conf

now I had to work a little on this in-order to get gdm to work correctly.
the documentation found at http://www.ltn.lv/~aivils/ also states that xdm and kdm
work as well. But I run gdm so that is what I will use for this example.


Here is my gdm.conf

Code:

[daemon]
AutomaticLoginEnable=false
AutomaticLogin=

TimedLoginEnable=false
TimedLogin=
TimedLoginDelay=30

Greeter=/usr/libexec/gdmgreeter

DefaultPath=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
RootPath=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin

AlwaysRestartServer=false

User=gdm
Group=gdm

LogDir=/var/log/gdm

PidFile=/var/run/gdm.pid

PostLoginScriptDir=/etc/X11/gdm/PostLogin/
PreSessionScriptDir=/etc/X11/gdm/PreSession/
PostSessionScriptDir=/etc/X11/gdm/PostSession/
DisplayInitDir=/etc/X11/gdm/Init

XKeepsCrashing=/etc/X11/gdm/XKeepsCrashing

ServAuthDir=/var/gdm

BaseXsession=/etc/X11/gdm/Xsession

DefaultSession=default.desktop

UserAuthDir=

UserAuthFBDir=/tmp
UserAuthFile=.Xauthority

StandardXServer=/usr/X11R6/bin/X

Xnest=/usr/X11R6/bin/Xnest -audit 0 -name Xnest

VTAllocation=false


ShowGnomeFailsafeSession=false
ShowXtermFailsafeSession=false

IncludeAll=false

[security]
AllowRemoteRoot=false
AllowRemoteAutoLogin=false
RelaxPermissions=0
DisallowTCP=true

[xdmcp]
Enable=false

[gui]
[greeter]
TitleBar=false
ConfigAvailable=false
Browser=false
MinimalUID=500
Logo=
ShowLastSession=false
GraphicalTheme=gentoo-cow
GraphicalThemeDir=/usr/share/gdm/themes/
SoundOnLogin=false
#SoundOnLoginFile=

[chooser]
HostImageDir=/usr/share/hosts/

Hosts=

Broadcast=true

Multicast=false

[debug]
Enable=false

[servers]
0=Standard0
1=Standard1

[server-Standard0]
name=Standard server 0
command=/usr/bin/X :0 -config xf.conf -layout Layout0  vt7
flexible=false

[server-Standard1]
name=Standard server 1
command=/usr/bin/X :1 -config xf.conf -layout Layout1 vt17
flexible=false

[server-Terminal]
name=Terminal server
command=/usr/X11R6/bin/X -audit 0 -terminate
flexible=false
handled=false

[server-Chooser]
name=Chooser server
command=/usr/X11R6/bin/X -audit 0
flexible=false
chooser=true




the important change is in the servers section
as you can see I specify the config and the layout
check dmesg and look for vc to verify that the new virtual terminals have been setup

you should see something similar to the following:

Code:
   
      $ dmesg | grep -i vc
      Console: Colour VGA+ 80x25 vc:1-16
      Console: mono dummy device 80x25 vc:17-17
      Console: mono dummy device 80x25 vc:18-18
      Console: mono dummy device 80x25 vc:19-19
      keyboard.c: [Logitech USB Receiver] vc:1-16
      keyboard.c: [Logitech USB Receiver] vc:17-17
      keyboard.c: [AT Translated Set 2 keyboard] vc:18-18
      keyboard: [AT Translated Set 2 keyboard] bound to [VGA+] vc:1-16
      keyboard: [Logitech USB Receiver] bound to [dummy device] vc:17-17



this will help verify that the vt settings in gdm.conf will actually work

if you have something like vc:1-18 and vc:19-21 then you would need to set vt7 and vt19 in gdm.conf
( I think you get the idea )


* also verify that the path in gdm.conf is correct for your location of X



* xorg.conf (well mine is called xf.conf)

and my xf.conf file (aka xorg.conf, you can call it whatever you want but be sure to use the
correct name in gdm.conf)

I have each "workstation" setup as 0 and 1 (you will see what I mean in moment)

workstation0 has the settings that correspond to Layout0
and
workstation1 has the settings that correspond to Layout1


so Layout0 uses mouse0, keyboard0 and screen0

and Layout1 uses mouse1, keyboard1 and screen1


please try to read through the conf file if this is not clear


a few things to point out and take notice of as they may be new to some of the readers:

* IsolateDevice
* SingleCard
* Serverlayout
* ServerFlags
* BusID


here is my xorg.conf (really called xf.conf on my system)

Code:

Section "ServerLayout"
   Identifier     "Layout0"
   Screen      0  "Screen0"  0 0
   InputDevice    "Mouse0" "CorePointer"
   InputDevice    "Keyboard0" "CoreKeyboard"
   Option          "IsolateDevice" "2:7:0"
   Option          "SingleCard"   "true"
EndSection

Section "ServerLayout"
   Identifier     "Layout1"
   Screen      1  "Screen1"  0 0
   InputDevice    "Mouse1" "CorePointer"
   InputDevice    "Keyboard1" "CoreKeyboard"
   Option          "IsolateDevice" "1:0:0"
   Option          "SingleCard"   "true"
EndSection

Section "ServerFlags"
   Option "PciOsConfig" "1"
EndSection

Section "Extensions"
#    Option "Composite" "Enable"
#   Option "RENDER" "Enable"
   Option "GL" "Enable"
EndSection

Section "Files"


   # For XFS, uncomment this and comment the others
   # FontPath   "unix/:-1"

    FontPath "/usr/X11R6/lib/X11/fonts/Type1"
    FontPath "/usr/share/fonts/Type1"
    FontPath "/usr/share/fonts/TTF"
    FontPath "/usr/share/fonts/misc"
    FontPath "/usr/share/fonts/corefonts"
   FontPath "/usr/share/fonts/artwiz/"
   FontPath "/usr/share/fonts/util"
   FontPath "/usr/share/fonts/75dpi"
   FontPath "/usr/share/fonts/encodings"
   FontPath "/usr/share/fonts/100dpi"
   FontPath "/usr/share/fonts/cyrillic"

   

EndSection

Section "Module"
   Load  "extmod"
   Load  "record"
   Load  "xtrap"
   Load  "dbe"
   Load  "glx"
   Load  "freetype"
   Load  "type1"
EndSection

Section "InputDevice"
   Identifier  "Keyboard0"
   Driver      "kbd"
   Option      "XkbRules" "xfree86"
   Option      "XkbModel" "pc104"
   Option       "XkbLayout" "us, ru"
EndSection

Section "InputDevice"
   Identifier  "Mouse0"
   Driver      "mouse"
   Option       "Protocol" "IMPS/2"
   Option       "Device" "/dev/input/mouse0"
   Option       "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
   Identifier   "Monitor0"
   VendorName   "Monitor Vendor"
   ModelName    "Monitor Model"
   HorizSync   30.0 - 96.0
   VertRefresh 50-160
EndSection

Section "Device"
   Identifier  "Card0"
   Driver      "nv"
   VendorName  "nVidia Corporation"
   BoardName   "GeForce 4 mx"
   BusID       "PCI:2:7:0"
EndSection

Section "Screen"
   Identifier "Screen0"
   Device     "Card0"
   Monitor    "Monitor0"
   DefaultDepth 24
   SubSection "Display"
      Viewport   0 0
      Depth     24
        Modes    "1600x1200" "1400x1050" "1280x1024"
   EndSubSection
EndSection

Section "InputDevice"
   Identifier  "Keyboard1"
   Driver      "kbd"
   Option      "XkbRules"   "xfree86"
   Option      "XkbModel" "pc104"
   Option       "XkbLayout"  "us,ru"
EndSection

Section "InputDevice"
   Identifier  "Mouse1"
   Driver      "mouse"
   Option       "Protocol" "IMPS/2"
   Option       "Device" "/dev/input/mouse1"
   Option       "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
   Identifier   "Monitor1"
   VendorName   "Monitor Vendor"
   ModelName    "Monitor Model"
   HorizSync   30.0 - 85.0
   VertRefresh 50-160
EndSection

Section "Device"
   Identifier  "Card1"
   Driver      "nv"
   VendorName  "nVidia Corporation"
   BoardName   "NV11DDR [GeForce2 MX 100 DDR/200 DDR]"
   BusID       "PCI:1:0:0"
EndSection

Section "Screen"
   Identifier "Screen1"
   Device     "Card1"
   Monitor    "Monitor1"
   DefaultDepth 24
   SubSection "Display"
      Viewport   0 0
      Depth     24
      Modes    "1280x1024"
   EndSubSection
EndSection




you can figure out which mouse to set for each setup by doing the following:

Code:

      cat /dev/input/mouse0



now move one of the mice around

if special characters (aka garbage) showup each time you move the mouse around, then you know
which mouse is mouse0


if nothing happens then move the other mouse
now (assuming you only have two mice attached) you should see special characters showup


once you have figured out which mouse you want to use for which workstation then change the
xorg.conf accordingly


now it is time to setup the graphics cards settings


now as root run:

Code:

         # lspci -v | grep "VGA compatible controller"



which should show something similar to the following:

Quote:

0000:01:00.0 VGA compatible controller: nVidia Corporation NV11DDR [GeForce2 MX 100 DDR/200 DDR] (rev b2) (prog-if 00 [VGA])
0000:02:07.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1) (prog-if 00 [VGA])



the first set of numbers (the ones in the format of ###:##:##.# is the BusID)
you will need to determine which video card you have attached to which workstation
then edit your xorg.conf file so that the correct layout has the desired videocard/monitor
associated to it


that should be all the changes needed for the xorg.conf

NOTE: please note that you DO need to edit the xorg.conf file to reflect your actual hardware setup and video drivers
I use the built in nv drivers because they work and I really don't have great video cards to start with (aka I am not a gamer)
I have used the nvidia drivers in the past and they have worked for me


*modify /etc/conf.d/localstart like so:

now we need to edit the localstart file so that the correct keyboard gets associated with
the correct workstation.


Code:

         echo "1" > /proc/bus/pci/hackvideo
      
         echo "isa0060/serio0/input0" > /proc/bus/console/00/keyboard
         echo "usb-0000:00:02.1-1/input0"  > /proc/bus/console/01/keyboard




to determine which device to use to echo to keyboard0 and keyboard1 run the following:

Code:

      cat /proc/bus/input/devices



which should give you something like the following:

Quote:

I: Bus=0003 Vendor=046d Product=c501 Version=0910
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:02.0-2/input0
H: Handlers=mouse0 event0
B: EV=7
B: KEY=1f0000 0 0 0 0
B: REL=103

I: Bus=0003 Vendor=046d Product=c505 Version=1711
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:02.1-1/input0
H: Handlers=kbd event1
B: EV=120003
B: KEY=1000000000007 ff800000000007ff febeffdfffefffff fffffffffffffffe
B: LED=1f

I: Bus=0003 Vendor=046d Product=c505 Version=1711
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:02.1-1/input1
H: Handlers=kbd mouse1 event2
B: EV=7
B: KEY=ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff 0 1
8d800d100 1e000000000000 0
B: REL=103

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
H: Handlers=kbd event3
B: EV=120013
B: KEY=402000000 3802078f840d001 f2ffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7


as you can see there is the AT keyboard (the ps2 keyboard)
located at Phys=isa0060/serio0/input0

and the usb keyboard located at P: Phys=usb-0000:00:02.1-1/input0

you can differentiate the usb keyboard from the usb mouse by the fact that the mouse
has the word mouse on the "Handlers" line and the keyboard does not



I found that echoing out the device to /proc/bus/console/00/keyboard and
/proc/bus/console/00/keyboard was easier to deal with than setting them
in xorg.conf


NOTE: if you are not going to reboot then you need to either restart local like so:

Code:

         /etc/init.d/local start
      
      or you can just simply do:
      
                        echo "isa0060/serio0/input0" > /proc/bus/console/00/keyboard
         echo "usb-0000:00:02.1-1/input0"  > /proc/bus/console/01/keyboard



with your actual settings


5. start the X server


now that you have everything configured/compiled and ready to go you can test the X server

NOTE: just a fair warning, I do not switch between the running instance of X and a vt
(by doing control-alt-F1 for example) basically because the console that shows up
is pretty much unreadable

you can disable vt switching in the xorg.conf IIRC


to test the X server I usually do the following:

Code:

     /etc/init.d/xdm start ; logout



now if you wait and watch you can see one monitor come on and then the other one

now you should test to see that you have the mice setup as expected and that the correct keyboard
types on the on the correct screen


if something is wrong in the xorg.conf file then the X server probably won't start and
will give you some indication why. Try to fix it and restart xdm


if all goes well then you can add xdm to the default run like so:

Code:

     rc-update add xdm default



I would then reboot and watch as your new multi-headed/legged system comes to life



6. Soundcards

My new setup has onbaord sound and a Sounblaster Live! PCI card

to get everything working was just a matter of installing the card, building the correct kernel module and setting up a .asound file in each users home directory. Now as an after thought this may not be the best to go about it but it works for me. If you are using arts daemon then you will be in luck see the very detailed PDF on http://www.ltn.lv/~aivils/ under the documents link.

But as a testamony dual sound cards does work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum