Fractoon's dedicated build - part 3

From Gentoo Linux Wiki

Jump to: navigation, search




Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article


This article is so "complete" that gentoo-wiki started complaining about it's size.

I've split it into three pages:


Contents

[edit] Xorg-X11

Note: This article is partly outdated.

[edit] Introduction

Of all the steps along the way, I found this the most difficult to do, not because it is difficult, but because there is so much history and conflicting advice available about what you should and shouldn't do. As a newbie, filtering through all the noise was tough as there really are many "outdated" practices around installing and configuring X. I suppose this proves how long X has been around as there really are many many ways to get a working X-server.

I'm not saying what I have is the best, what I am saying is that I chose the simplest options I could find and my fonts and whatnots look great. Maybe a tad small for my liking at times, but they are all very readible.

Here is my very simple X11 install and configuration. I hope it helps others ;-)

[edit] Install Xorg-X11 (release 6.8.1) software

Warning: This section is outdated. Xfree isn't in portage any longer.

I had a bit of a nightmare with compiling xorg-x11, so here are the specifics of how I finally managed to install it. Mostly with help from the gentoo forums!

Code: Install xorg-x11
emerge xorg-x11
emerging fontconfig-2.2.3
emerging ttmkfdir-3.0.9-r2 ... failed!

From the forums I then tried

Code: Special workaround?
CXX=i686-pc-linux-gnu-g++ emerge ttmkfdir ... failed!

Next I tried

Code: Install libtool
emerge libtool
emerging libtool-1.5.2-r7 ... worked

Trying ttmkfdir again

Code: Install ttmkfdir
emerge ttmkfdir
emerging ttmkfdir-3.0.9-r2 ... worked

Now ready to try xorg-x11 again

Code: Install xorg-x11
emerge xorg-x11
emerging opengl-update-1.8.1-r1
emerging xorg-x11-6.8.0-r3
emerging rpm2tarqq-9.0-r2
emerging utempter-0.5.5.5
emerging xterm-196.r1

It worked. Woo Hoo!!!

Update environment

Code: Update all the new env. variables
env-update && source /etc/profile

'Disable' xfree

Code: Ensure xfree remains uninstalled
echo x11-base/xfree >> /etc/portage/package.mask

And lastly the most important of the whole lot

Code: The most useful command of the lot
man 5 xorg.conf

[edit] Create/tune the xorg.conf file

The Dell Inspiron 9100 truly has an amazing 'monitor', check out these stats.

LTN154U1 aka "SEC W3866 154U1"
 SIZE                       15.4"
 RESOLUTION                 WUXGA
 NUMBER OF PIXELS           1,920 x 1,200
 ACTIVE AREA(mm²)           331.2 x 207.0
 PIXEL PITCH(mm)            0.173
 NUMBER OF COLORS           262K
 CONTRAST RATIO             300:1
 BRIGHTNESS(cd/m²)          175
 RESPONSE TIME(ms at 25C)   25

Create the xorg.conf file

Code: Auto-create xorg.conf?
Xorg -configure
Didn't work for me unfortunately. Had a problem finding the mouse,
but did create the xorg.conf.new template with all the other settings

Edit the 'incorrect' xorg.conf.new file

Code: Edit xorg.conf.new
nano /root/xorg.conf.new

Here is the listing of 'key' changes I added. I'm only listing the changes so that the size of this section is smaller

File: ~/xorg.conf.new
# set some time-outs
Section "ServerLayout"
 Option	"BlankTime"	"10"
 Option	"StandbyTime"	"20"
 Option	"SuspendTime"	"30"
 Option	"OffTime"	"40"

# the order of the FontPath entries are significant. I'm giving
# preferance to the core, truetype and type 1 fonts over all else
Section "Files"
 FontPath	"/usr/share/fonts/corefonts/"
 FontPath	"/usr/share/fonts/TTF/"
 FontPath	"/usr/share/fonts/Type1/"
 FontPath	"/usr/share/fonts/75dpi/"
 FontPath	"/usr/share/fonts/100dpi/"
 FontPath	"/usr/share/fonts/75dpi/:unscaled"
 FontPath	"/usr/share/fonts/100dpi/:unscaled"
 FontPath	"/usr/share/fonts/misc"

# using a 'british' keyboard layout
Section "InputDevice"
 Identifier	"Keyboard0"
 Option	"XkbModel" 	"pc105"
 Option	"XkbLayout" 	"gb"

# think /dev/input/mice is a udev related thing, but that is
# is where the mice live. Not sure about the Emulate3Buttons
# thing as the 'mice' do not have 3 buttons... following the
# herd on this one I'm afraid
Section "InputDevice"
 Identifier	"Keyboard0"
 Option	"Protocol" 		"ExplorerPS/2"
 Option	"Device" 		"/dev/input/mice"
 Option	"ZAxisMapping" 		"4 5"
 Option	"Emulate3Buttons" 	"yes"

# had some mental 'issues' with LCD panels not having HorizSync specs,
# or VertRefresh specs, but used the /var/log/Xorg.0.log to find these
# values ... setting them seems to speed up start-up of X as the scanning
# time are shorter. I havent' measured this, it is subjective
Section "Monitor"
 Identifier	"Monitor0"
 VendorName	"SEC"
 ModelName	"LTN154U1"
 HorizSync	70 - 110
 VertRefresh	60-90
 Option	"dpms"

# This is the most confusing thing to set. There doesn't appear to be
# much difference between using ati and radeon as the driver apart for
# the radeon appears to cut out some detection time? Setting the driver
# to ati then loads radeon as a sub section?
Section "Device"
 Driver	"radeon"
 Option	"DPMS"
 Option	"AGPMode"	"4"
 Option	"MonitorLayout"	"LDVS,NONE"
 # Possible optimisations to try at some stage
 # tried "AGPMode" "8", but it failed spectacularly
 #Option	"AGPFastWrite"	"True"
 #Option	"EnablePageFlip""True"

Section "Screen"
 DefaultDepth	24
 SubSection "Display"
   Depth	24
   Modes	"1920x1200"
 EndSubSection

# No point in uncommenting this section as DRI doesn't appear to be supported
#Section "DRI"
#	Group        0
#	Mode         0666
#EndSection

Test the new config file

Code: Test
X -config /root/xorg.conf.new
Should see a 'horrible' looking server with no background and a x cursor,
i.e. it is working.

Kill the session (or switch to terminal view via

Code: Kill 'horrible looking' session
ctrl+alt+backspace
Code: Switch to terminal view
ctrl+alt+Fx swithes to terminal x

Copy the working config file to X11 and start playing with X

Code: Play with X
cp /root/xorg.conf.new /etc/X11/xorg.conf

startX

Brings up a clock, a couple of x-terms and twn - not very exciting.

Verify 3D Rendering, if you must. Not supported on radeon mobility 9700 card!

Code: Check 3D rendering
startx
No need to load modules for your driver or agpgart, if you compiled
agpgart as a module. They will be loaded automatically.

glxinfo | grep rendering

direct rendering: Yes
 If it says "No," there is no 3D acceleration. Do not run glxgears.
 It completely locked my X server

glxgears

Test your frames per second (FPS) at the default size.

Still left to do.

Investigate the various modules and options that can be used/loaded via xorg.conf. Also check out 3D rendering as it would be nice to have. Don't think I need it for transparency or anything like that, but it does feel like I'm missing out, not being able to run glxgrears!

[edit] Configure X11 environment

Beautify fonts?

Plan on using freefonts & corefonts only

freefonts already installed
emerge corefonts

Check order of fonts to use in xorg.conf above, but summarised here:

corefonts, TTF, Type1, 75dpi, 100dpi (unscaled) and lastly misc

Set-up anti-aliasing by creating ~/.fonts.conf using (this file has been copied from http://tommy.impulsestorm.com/texts/view/131 and doesn't tie-up fully with 'corefonts', but will do for now).

File: ~/.fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <dir>~/.fonts</dir>

 <match target="font" >
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  </edit>
 </match>

 <match target="font" >
  <test compare="eq" name="family" qual="any" >
   <string>Arial</string>
   <string>Arial Black</string>
   <string>Comic Sans MS</string>
   <string>Courier New</string>
   <string>Georgia</string>
   <string>Tahoma</string>
   <string>Times New Roman</string>
   <string>Trebuchet MS</string>
   <string>Verdana</string>
   <string>Webdings</string>
  </test>

  <test compare="less" name="size" qual="any" >
   <double>16</double>
  </test>

  <edit mode="assign" name="antialias" >
   <bool>false</bool>
  </edit>
 </match>

 <match target="font" >
  <test compare="eq" name="family" qual="any" >
   <string>Arial</string>
   <string>Arial Black</string>
   <string>Comic Sans MS</string>
   <string>Courier New</string>
   <string>Georgia</string>
   <string>Tahoma</string>
   <string>Times New Roman</string>
   <string>Trebuchet MS</string>
   <string>Verdana</string>
   <string>Webdings</string>
  </test>

  <test compare="less" name="pixelsize" qual="any" >
   <double>18</double>
  </test>

  <edit mode="assign" name="antialias" >
   <bool>false</bool>
  </edit>
 </match>

</fontconfig>

Set-up Xserver to run at 96dpi - seems to be the MS imposed standard for web browsing ;-)

File: /etc/X11/xdm/Xservers
:0 local /usr/X11R6/bin/X -dpi 96

Set-up xdm environment

Plan is to have xdm act as graphical login manager and launch the 'default' Xclients you'd get if launched startx from command line. From here it would be easy work to exchange startx with startxfce4 for that Desktop Enviroment feeling

Code: Use xdm as display manager
nano /etc/rc.conf uncomment DISPLAYMANAGER="xdm"


Set-up the 'default' Xclients (apps, enviroment etc.)

File: ~/.Xclients
twm
xclock - geometry 50x50-1+1 &
exec xterm -geometry 80x66+0+0 -name login
  Setup 'required' client environment here. Do stuff like prepare
  environment and launching Window Manager (WM) or
  Desktop Environment (DE). We want to 'launch'/test X so only one entry

Make it executable, it is a script file after all

Code: Make exe
chmod u+x ~/.Xclients

"Ensure" that all roads lead to Rome (If that is what you want of course)

Code: Set-up links
ln -sfv ~/.Xclients ~./xsession
ln -sfv ~./Xclients ~/.xinitrc

(Note from Taniwha - thanks for this wonderfull writeup - really helped a lot. I took a slighlty different track at this point - I built Xorg 6.8.0 and downloaded the ATI binary driver from here and followed the instructions to compile it against (in my case the) 2.6.10 kernel (problem here ATI vs 2.6.10 - it complained about not being able to find 'pci_find_class', added '#define pci_find_class pci_get_class' to /usr/src/linux/include/linux/pci.h to get around it) then I ran fglrxconfig to get an xorg.conf which I merged with xorg.conf.example to get this - haven't thrashed on it much yet but glxgears gets 1650 odd fps)

Some general info on xdm

When xdm starts up in the default runlevel it launches Xlogin and waits for someone to attempt to login. If login authentication fails Xlogin terminates the xdm session, which re-spawns xdm in an ever repeating cycle.

Once login authenticated (.Xauthority) the start-up scripts set-out above are excuted and providing no scripting or connectivity issues it should launch ~./Xclients that in turn launches WM/DE

For a standalone workstation much can be done to streamline the X11 config, for example can 'enhance' security by disabling remote connection to the workstation. Disabling XDMCP should as well ... Obviously this could hurt you later if you really need to connect remotely ;-)

xdm 'functions' include

  • has a list of servers it manages
  • listens on XDMCP port for other servers that require management
  • for each 'managed' server it spawns itself and launches the Xlogin widget
  • After login it writes session key to .Xauthority file if the authorize resources is set for that display within the xdm-config file
    • local servers pass via a file with the -auth switch on the server command line
    • remote servers the information is passed via XDMCP.

The xdm 'database' is a list of flat files that are listed in /etc/X11/xdm/xdm-config. These files can be edited to set-up the requried environment.

  Name         Default         Usage
config         xdm-config      configuration
servers        XServers        displays to manage
resources      XResources      X resource database
session        Xsession        session management (Runs user session file!)
setup          XSetup          server setup
errorLogFile   xdm-errors      error log
pidFile        xdm-pid         process ID
authFile       ~/.Xauthority   authorization file

Interesting commands for terminating X

resetting xdm  kill -HUP 'cat <pidFile>'
halting xdm  kill -TERM 'cat <pidFile>'
resetting a server kill -HUP 'cat <server_pid>
halting a server kill -TERM 'cat <server_pid>

Still left to do

  • Change xdm 'skins' to change xlogin widget login box etc.
  • I'll happily provide a screenshot if someone is willing tell me how and provide a location to store the image.

For a small XDM facelift:

Code: Edit /etc/X11/xdm/Xresources
nano /etc/X11/xdm/Xresources
xlogin*greeting: Welcome to CLIENTHOST
xlogin*logoFileName: /etc/X11/xdm/pixmaps/[your-logo].xpm

CLIENTHOST get replaced by $hostname

[edit] xdm 'graphical' logon manager

Once happy all is working then

Code: Add xdm to default run level
rc-update add xdm default

For completion this is the chain of events leading to the xdm xlogin widget being displayed. It could be wrong, but it sure seems to work this way!

/etc/init.d/xdm executes
/usr/X11R6/bin/xdm ('proper' executable) & uses
/etc/X11/xdm/xdm-config to run (when 'successfully logged in)
/etc/X11/xdm/Xsession that defaults to
~/.xsession which is symbolic linked to
~/.Xclients which finally executes
  twm
  xclock - geometry 50x50-1+1 &
  exec xterm -geometry 80x66+0+0 -name login
or when using xfce4 "exec startxfce4"

Reboot machine and should now have a graphical logon prompt loading the X11 client as configured directly. Time to move onto prefered 'WM/DE' now. Check out "XFce4 - Installation and configuration (using xdm)" for the last piece of the puzzle, but I warn you it isn't very exciting.

[edit] XFce4

Code: Install XFce4
emerge xfce4

I'm using xdm as my graphical login manager (and I think as session manager as well) so the only thing needed to get XFce4 fired up is to edit ~/.Xclients and add startxfce4 to it.

File: ~/.Xclients
source /etc/profile
exec startxfce4

Please see Xorg-X11 - installation and configuration for details of how to enable the ~/.Xclients file to become part of the X11R6 set-up.

Most of the configurations are driven via the XFce4 taskbar (not sure this is the right name) and the various fonts can be selected from the Settings applet.

I'll add more info here when I've actually started using XFce4 in 'anger'

Regards

fractoon 12:25, 10 Dec 2004 (GMT)

[edit] Outstanding and To Do

Needless to say, perfection is seldomly attained and although I am relatively happy with my machine at this stage, it is still far from perfect. All the following topics are still to be investigated, explored and hopefully be resolved in time

Please feel free to drop me a line with suggestions! fractoon 17:09, 5 Dec 2004 (GMT)

'Security' related stuff I've avoided security in general as it seems too tough a beast to tame at the moment. I don't think you can ever have a completely secure system and I know mine is vulnerable, but having a working machine seems more important at this time. The following 'stuff' still needs doing

  • General user management (especially the PAM mallarkey)
  • I've installed xinetd, but haven't the foggiest what it is meant to do?
  • mount /tmp on tmpfs and put /home & /var on seperate, dedicated partitions
  • Have a look at SEC/swatch - intrusion detection?
  • syslog-ng.conf - split up output more & create log rotation/aging

General environment There are so many general environmental stuff still left to do it isn't even funny. You can tweak Linux till you die, but there are some key things I still need to do to have a fully functioning system.

  • What I call "init.d" configuration.
    • Ensure minimal services are loaded at start-up
    • tweak hdparm settings for the cdrom with cdrom0_args="-d -E40"
  • Beautify "my" install
    • grub skin
    • fbsplash 'theme'
    • console backgrounds etc
    • xdm (xlogin box & background)
    • xclients, specifically xfce4 (or whatever I end up with)
  • Switch to UTF-8, not sure what this involves, but know it includes locales, Keymapping etc. (also to X)
  • Network 'management' scripts
    • disable 'networking' by default
    • 'service' scripts for eth0
    • 'service' scripts for wlan0
    • routing info ('setting' hostnames, dnsdomainnames etc)
    • IPv6 stuff

Hardware/System related

  • Modularise kernel, especially thinking about online/offline & battery usage
  • Misc hardware still not "working": IrDA, USB, Sound, 'Printer'
  • UDEV rules & fstab (See reading list ...)
  • Upgrage to reiserfs 4

Emerge usage

  • "emerge -uDav world" vs. "emerge --update --deep --newuse world"
  • Investigate deltup - apparently reduces download requirements

Power Management

  • Tweak/optimise/investigate ACPI battery event handling
  • 'disable' swap space when running off battery

Build process

  • review the 'magic' bootstap command (t189250)

To-read list

Luxi Serif:style=Regular Bitstream Vera Sans Mono:style=Bold Arial:style=Regular Webdings:style=Regular Verdana:style=Bold Italic Trebuchet MS:style=Bold Italic Luxi Serif:style=Bold Fixed:style=Bold Trebuchet MS:style=Italic Bitstream Vera Sans:style=Oblique Comic Sans MS:style=Bold Luxi Mono:style=Bold Bitstream Vera Sans:style=Roman Luxi Sans:style=Bold Trebuchet MS:style=Regular Times New Roman:style=Bold Italic Arial Black:style=Regular Impact:style=Regular Times New Roman:style=Bold Verdana:style=Bold Luxi Sans:style=Regular Arial:style=Bold Italic Georgia:style=Bold Courier New:style=Regular Times New Roman:style=Italic Trebuchet MS:style=Bold Bitstream Vera Sans Mono:style=Oblique Luxi Mono:style=Regular Bitstream Vera Sans:style=Bold Courier New:style=Bold Italic Georgia:style=Italic Andale Mono:style=Regular Bitstream Vera Serif:style=Roman Georgia:style=Bold Italic Courier New:style=Bold Bitstream Vera Sans Mono:style=Bold Oblique Luxi Serif:style=Oblique Bitstream Vera Sans:style=Bold Oblique Courier New:style=Italic Luxi Serif:style=Bold Oblique Times New Roman:style=Regular Bitstream Vera Sans Mono:style=Roman Luxi Mono:style=Oblique Fixed:style=Italic Luxi Sans:style=Oblique Fixed:style=Regular Arial:style=Italic Comic Sans MS:style=Regular Luxi Sans:style=Bold Oblique Georgia:style=Regular Bitstream Vera Serif:style=Bold Luxi Mono:style=Bold Oblique Verdana:style=Regular Verdana:style=Italic Arial:style=Bold

Personal tools