LPI Linux LPIC1
Total Page:16
File Type:pdf, Size:1020Kb
LPI Linux LPIC1 Module 6 Module Contents • 1 Evans Ikua Lead Editor Kenya [email protected] • 2 Chris Brown Content Author UK [email protected] • 3 Mark Clarke Content Author RSA [email protected] • 4 Brian Ssennoga Content Author Uganda [email protected] • 5 Trust Zifa Material co-editor Zimbabwe [email protected] • 6 John Matogo Material co-editor Kenya john [email protected] • 7 Ken Mutua Material co-editor Kenya [email protected] • 8 Bernard Owuor Material co-editor Kenya [email protected] • 9 Sisay Adugna Material co-editor Ethiopia [email protected] • 10 Balthas Seibold Senior Project • Manager - GIZ • Germany [email protected] • 11 Petra Hagemann Project Manager - GIZ Germany [email protected] • 12 George Nyambuya Africa Coordinator - • ict@innovation • RSA [email protected] • 13 David Paulus Intern - GIZ Germany [email protected] Module Contents User Interfaces and Desktops • Install and configure X11 • Set up a display manager • Accessibility Module Contents Configuring X11R6 Two of the configuration utilities provided with the Xfree86 software (which is a raw Xwindow system) are the XF86Setup and xf86config scripts. Other vendors have specific utilities such as: • Xconfigurator, • redhat-config-xfree86 (RedHat) • XFdrake (Mandrake) • sax (Suse) Once the server has been configured one can change the horizontal and vertical settings for the monitor with xvidtune. Module Contents Configuring X11R6 Basic X configuration specifies features such as the mouse used, the keyboard layout, the screen resolution, the video refresh rate, the display colour depth, and the video card you’re using. Some of these options require telling X about what hardware you have installed, whereas others enable you to adjust settings on your hardware. In any event, before you proceed with actual confi guration you should know something about the X servers that are available for Linux, because your selection will determine what additional tools are available and what fi les you may need to adjust manually. GUI and text-mode confi guration utilities can help you confi gure X; but sometimes you must delve into the confi guration fi les, so knowing their format is important. This requires that you know what the major option groups do so you can adjust them. Module Contents X Server Options for Linux Although X is by far the dominant GUI for Linux, several implementations of X are available: XFree86 The dominant X server in Linux until 2004 was XFree86 (http://www.xfree86.org). This open source server supports a wide array of video cards and input devices, and most Linux software was originally designed with XFree86 in mind. As I write, the most recent version is 4.8.0. Signifi cant changes occurred between 3.3.6 and the 4.x series, and some older utilities work only with the 3.3.6 and earlier versions of XFree86. Although a tiny number of elderly systems must run XFree86 3.3.6 or earlier for driver support reasons, most systems today run XFree86 4.x or X.org-X11; the latter is more common on distributions released since 2004. Module Contents X Server Options for Linux X.org-X11 In 2004, most Linux distributions shifted from XFree86 to X.org-X11 because of licensing changes to XFree86. X.org-X11 6.7.0 was based on XFree86 4.3.99, but it’s developed independently up to the current version, 7.7. Because X.org-X11 is based on XFree86, the two are virtually identical in most important respects. One significant difference is the name of the configuration file; another is the default location for fonts. Subsequent sections of this chapter point out these differences. You can learn more at http://www.x.org/wiki/. Module Contents Methods of Configuring X Configuring X has traditionally been a difficult process because the X configuration file includes many arcane options. The task is made simpler if you can use a configuration utility, and most Linux distributions now run such a utility as part of the installation process. If the configuration utility doesn’t do everything you want it to do, though, you may need to delve into the X configuration fi le to set options manually, so knowing something about its format will help a lot. You must also know how to go about restarting X in order to test your changes. Module Contents X Configuration Utilities Several configuration tools for XFree86 4.x and X.org- X11 are available: The X Server itself includes the capacity to query the hardware and produce a configuration fi le. To do this, type XFree86 -configure (for XFree86) or Xorg -configure (for X.org-X11) as root when no X server is running. The result should be a fi le called /root/XF86Config.new (for XFree86) or /root/xorg.conf.new (for X.org- X11). This fi le may not produce optimal results, but it’s at least a starting point for manual modifications. Module Contents The X Configuration File Format The X configuration fi le’s name and location vary with the version of X being run: X.org-X11 This server’s configuration fi le is called xorg.conf, and it’s usually stored in /etc/X11, although /etc and several other locations are also acceptable to the server. XFree86 4.x The XFree86 4.x configuration fi le is called XF86Config-4 or XF86Config, which is found in /etc/X11 or sometimes in /etc. This fi le’s format is the same as for the X.org-X11 confi guration fi le. Module Contents Configuring X11R6 All the mentioned configuration utilities will create and edit the XF86Config / Xorg configuration file. This file is read at start up by the X Server and determines its behavior. This file is typically found in the /etc/X11 directory, and this is its’ full path: /etc/X11/XF86Config. Typically there are 11 configuration sections in the configuration file: Module Contents Configuring X11R6 • ServerFlags • Module • InputDevice • Device • VideoAdapter • Monitor • Modes • Screen • ServerLayout • DRI • Vendor Module Contents Configuring X11R6 Section “InputDevice” Identifier “Keyboard0” Driver “kbd” Option “XkbModel” “pc105” Option “XkbLayout” “us” Option “AutoRepeat” “500 200” EndSection This section tells X about the keyboard—its model, layout, and so on. Details for the sections you’re most likely to need to adjust are described shortly, in “X Configuration Options.” Module Contents Configuring X11R6 - Loading Modules The Module section controls the loading of X server modules—drivers for specific features or hardware. A typical example looks like this: Section “Module” Load “dbe” Load “extmod” Load “fbdevhw” Load “glx” Load “record” Load “freetype” Load “type1” Load “dri” EndSection Module Contents Configuring X11R6 - Loading Modules Each module is named (dbe, extmod, and so on) and is loaded by name using the Load option. For the most part, if an X configuration works, you shouldn’t try to adjust the Module section, even if you want to tweak the X configuration. Sometimes, though, you’ll need to add lines to or remove lines from this section. This is particularly likely to be necessary if you’re activating 3D acceleration support or some sort of exotic feature. In such cases, you should consult the documentation for the feature you want to activate. Module Contents Configuring X11R6 - Setting the Keyboard The keyboard is one of two common input devices confi gured via an InputDevice section: Section “InputDevice” Identifier “Keyboard0” Driver “kbd” Option “XkbModel” “pc105” Option “XkbLayout” “us” Option “AutoRepeat” “500 200” EndSection The Identifier line provides a label that’s used by another section (ServerLayout, described in “Putting It All Together”). The string given on this line is arbitrary, but for a keyboard, a descriptive name such as this example’s Keyboard0 will help you understand the fi le. Module Contents Configuring X11R6 - Setting the Keyboard The Driver line tells X what driver to use to access the keyboard. This should be kbd, Keyboard, or evdev, depending on your X server. The kbd and Keyboard drivers are, as you might expect, keyboard-specific drivers. The evdev driver, by contrast, is a generic input device driver that works with many types of input devices. Unless your keyboard isn’t working at all, you shouldn’t adjust this line. The Option lines set various options that adjust keyboard features, such as the model, the layout, and the repeat rate. Module Contents Configuring X11R6 - Setting the Mouse A second InputDevice section controls how X treats the mouse: Section “InputDevice” Identifier “Mouse0” Driver “mouse” Option “Protocol” “IMPS/2” Option “Device” “/dev/input/mice” Option “Emulate3Buttons” “no” Option “ZAxisMapping” “4 5” EndSection Module Contents Configuring X11R6 - Setting the Mouse As with the keyboard, the Identifier line is used in the ServerLayout section to tell X which input device to use. The Driver line identifi es the driver to use: mouse. (Many modern systems use evdev for the mouse.) The Option lines set mouse control options. The most important of these are Device and Protocol. Module Contents Configuring X11R6 - Setting the Mouse The Device line tells X what Linux device fi le to read to access the mouse. In this example, it’s /dev/input/mice, but other possibilities include /dev/mouse (a pointer to the real mouse device, whatever its name), /dev/psaux (for the PS/2 mouse port), /dev/usb/usbmouse (an old identifi er for USB mice), /dev/ttyS0 (the fi rst RS-232 serial port mouse), and /dev/ttyS1 (the second RS-232 serial port mouse). The Protocol option tells X what signals to expect from the mouse for various movements and button presses. The Auto protocol causes X to try to guess the mouse’s protocol, which usually works correctly.