Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 71 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
71
Dung lượng
620,95 KB
Nội dung
Configuring Other Servers P ART II 188 without runlevels (run man init to see whether your system uses an init), you should look into the /etc/rc and /etc/rc.d/rc.local files; you usually only have to remove comment signs at the beginning of a line that calls xdm. If no such line is present, you probably have a system that has no preconfigured xdm. In any event, xdm by default runs your .xinitrc file for you. Configuration of the Window Manager Window managers are a user- and site-specific issue. Several window managers are available for Linux. The configuration of one window manager is quite different from that of another. The window manager used in the configuration is usually explained in your .xinitrc file, so look there. The most commonly used window managers for Linux are ■ olwm or olvwm for the OPEN LOOK Window manager. (It is on the CD-ROM at the back of this book.) ■ mwm for the Motif window manager, possibly the most common commercial window manager. You have to buy it along with Motif. ■ twm. (It is part of the XFree86 distribution on the CD-ROM at the back of this book.) ■ fvwm95. (This seems to be the most popular freely available window manager and is on the CD-ROM at the back of this book.) I discuss mwm in greater detail in Chapter 26, “Motif Programming.” Compiling Programs That Use X Before compiling any programs for X, please read the GCC-HOWTO file. This file can be found in the pub/Linux/docs/HOWTO directories of sunsite or under /usr/doc. Many questions on com- piling programs with Linux are answered here. If you have the source code for a program that uses X11, it is usually shipped with an Imakefile instead of a Makefile. Imakefiles are files that create Makefiles for your system. Discussing Imakefiles is beyond the scope of this book; however, you will have to work with Imakefiles if you work at all with X sources. Just remember the shell script xmkmf, and you should be okay. TIP xmkmf is an abbreviation for X Make Makefile. X Window C HAPTER 10 189 10 X WINDOW CAUTION The xmkmf shell script actually runs the imake command with a set of arguments. The most common argument is the -DUseInstalled argument. If you examine xmkmf (look in /usr/ X11R6/bin/), you will see that the xmkmf script is a basic wrapper around a call to imake. It’s very tempting to use imake on a command line by itself. Do not do so. Run the imake command with the -DUseInstalled argument if you must run imake on the command line. Of course, before ever running xmkmf, you should read the documentation that usually comes with such packages. Run xmkmf in the directory that contains the Imakefile. If there is a hierarchy of directories with Imakefiles, you usually only have to run xmkmf in the root directory of that hierarchy. The xmkmf command builds the Makefiles in all directories in the hierarchy. Then you should run the make command with an argument to let make resolve its dependen- cies, using the following command: $ make depend TIP Don’t be afraid if include files, such as stddef.h, varargs.h, and so on, are not found. They are gcc proprietary header files, and therefore not in the standard include directories. After that, you can make the program by running make, and you can install your new utility (usually in /usr/X11R6/bin) by running this line: $ make install The installation of the man pages is accomplished by running $ make install.man Some Common Problems Some of the problems you might see when you work with XFree86 are outlined in the following: ■ No windows—all you get is a gray background and no windows. This is due to running without a window manager. Running X only starts the X server, not the window manager. You should use the startx script in usr/X11/R6/bin/startx. Configuring Other Servers P ART II 190 ■ Your Logitech serial mouse does not work. The keyword Logitech is reserved for older Logitech serial mice. Use the keyword MouseMan (or Microsoft) for newer mice. Logitech serial mice plugged into a PS/2 port require the keyword PS/2. ■ You get errors about not finding any font files. First check the XF86Config file to see whether the directories in the font path are named correctly and contain fonts. If they are correct, run mkfontdir in each of those directories to set them up for use with X. ■ After leaving X, your screen fonts are not restored. This is a known bug with some servers. There are utilities called runx or restoretext included with svgalib that can help you in most cases. You can get them from sunsite.unc.edu in the file /pub/ Linux/libs/graphics/svgalib-1.2.10.tar.gz . ■ You will have some problems on uncommon, extremely new, or extremely old cards. This is what you have to live with when you are dealing with freeware. ■ The server dies with the message Cannot find a free VT. XFree86 needs a free virtual terminal (VT) on which to run. So if you have put a getty process on every virtual console in your /etc/inittab, XFree86 is not able to start. The common practice is to leave / dev/tty8 (for kernel messages) and /dev/tty7 (for XFree86) free of a getty process. This is not an exhaustive list. Read the HOWTO documents in /usr/docs on the CD-ROM for more information about other video card problems that are too specific to list here. Compiling Sources for XFree86 You do not typically want to compile sources for XFree86 unless you really want to make changes to the sources because something is not working. You will need a lot of disk space and CPU time to do a complete build of the XFree86 system. Anything you need to know for compiling XFree86, you can find in the following files (in /usr/X11R6/lib/X11/doc): INSTALL, README, and README.Linux. Note that you should not compile XFree86 to get rid of hard-coded restrictions (on the maxi- mal pixel clock, for example) because without these restrictions, your hardware will probably break down. To build a server that includes only those drivers you need, you should use the LinkKit instead of compiling the complete system. This is a little easier than trying to build it from scratch. The LinkKit package is specific and complicated and is therefore beyond the scope of this chapter. Read /usr/X11R6/lib/Server/README for a description of how to use LinkKit. This file is not included in the standard XFree86 tar files but is part of the file that includes the LinkKit. You can find the LinkKit at www.xfree86.org. For adding drivers to the SVGA servers, you need the LinkKit only. The documentation on how to build servers can be found in the /usr/X11R6/lib/Server/ VGADriverDoc directory after installing the LinkKit package. X Window C HAPTER 10 191 10 X WINDOW Summary This chapter covers the topic of configuring the XFree86 system. After reading this chapter, you should have an idea of how to set up your XF86Config file to generate your X environment. Just remember to start with the basic configuration settings for VGA cards and then make en- hancements. Keep backups of your work and do not change the video settings unless you know what you are doing. If nothing works despite your best efforts, you have the recourse of know- ing where to look for answers in FAQs, newsgroups, and FTP sites on the Internet for HOWTO and other documents on Linux. Configuring Other Servers P ART II 192 Hardware Connectivity and Devices P ART III IN THIS PART ■ Filesystems, Disks, and Other Devices 195 ■ Printing with Linux 229 ■ TCP/IP Network Management 243 [...]... the same way, into four logical partitions Partitions that aren’t inside an extended partition are sometimes referred to as primary partitions Running fdisk -l shows that my first hard disk is divided up like this: Device Begin Start End Blocks ID System /dev/hda1 1 245 376 1 245 376 244 375 1060 122 944 660 24 345 240 83 82 83 Linux native Linux swap Linux native /dev/hda2 /dev/hda3 In this case, there... /dev/fd1 /mnt/floppy # ls -la /mnt/floppy total 14 drwxr-xr-x 3 root root 10 24 Aug 1 19 :49 drwxr-xr-x 7 root root 10 24 Jul 3 21 :47 drwxr-xr-x 2 root root 12288 Aug 1 19 :49 lost+found # umount /mnt/floppy 11 FILESYSTEMS, DISKS, AND OTHER DEVICES Filesystems are initially built by a program that opens the block device and writes some structural data to it so that, when the kernel tries to mount the filesystem,... and mount your CD-ROM drive using the Red Hat File System Manager, as explained previously, or by using the following mount command: # mount /dev/cdrom -t iso9660 /mnt/cdrom The directory /mnt/cdrom is a very common place to mount one’s CD-ROM drive under Red Hat Linux, because this is where the graphical package manager Glint expects to find the contents of the Red Hat installation CD-ROM, for example... loopback devices The patches were made against version 2.0.11 of the Linux kernel, but they work perfectly well with the kernel supplied with Red Hat Linux 4. 2 To summarize, encrypted filesystems can be useful for some kinds of data (for example, for storing digital signatures for important system binaries in such a way that they can’t be tampered with), but their usefulness to users other than root is limited... range of capabilities being offered by the terminal device driver, and hence explaining all the facilities offered could easily occupy an entire chapter This section just offers an overview of the facilities For more complete information on terminals and serial I/O, refer to the Linux Documentation Project’s excellent HOWTO documents These are provided on the Red Hat Linux 4. 2 CD-ROM and are also available... means that both the kernel and the program used to make the filesystem must agree on the correct filesystem structure 205 206 Hardware Connectivity and Devices PART III Here, you see the creation and mounting of an ext2 filesystem on a floppy The structure of the filesystem as specified by the program’s defaults are shown There is no volume label, and there are 40 96 bytes (4KB) per inode (360 × 4 = 144 0)... network filesystems that don’t depend on block devices Network filesystems are covered in Chapter 13, “TCP/IP Network Management.” There are more filesystems that are supported by Linux but not provided by the standard kernel (for example, NTFS) The mount Command To mount a block device into the filesystem, use the mount command You need to specify what device contains the filesystem, what type it is, and... which devices are to be mounted, what kinds of filesystems they contain, at what point in the filesystem the mount takes place, and any options governing how they are to be mounted The format of this file is described in fstab The Red Hat File System Manager An easy way of setting up filesystem entries in /etc/fstab is the configuration tool File System Manager in the Red Hat Control Panel (though you... /dev/fd1 Password: Init (up to 16 hex digits): # /sbin/mkfs -t ext2 -m0 /dev/loop0 mke2fs 1.10, 24- Apr-97 for EXT2 FS 0.5b, 95/08/09 Linux ext2 filesystem format Filesystem label= 360 inodes, 144 0 blocks 0 blocks (0.00) reserved for the super user First data block=1 Block size=10 24 (log=0) Fragment size=10 24 (log=0) 1 block group 8192 blocks per group, 8192 fragments per group 360 inodes per group Writing... so these options are used only in special circumstances: # mkfs -t ext2 /dev/fd1 mke2fs 1.10, 24- Apr-97 for EXT2 FS 0.5b, 95/08/09 Linux ext2 filesystem format Filesystem label= 360 inodes, 144 0 blocks 72 blocks (5.00) reserved for the super user First data block=1 Block size=10 24 (log=0) Fragment size=10 24 (log=0) 1 block group 8192 blocks per group, 8192 fragments per group 360 inodes per group Writing . 12 19 94 /dev/sda brw-rw 1 root disk 8, 1 Sep 12 19 94 /dev/sda1 brw-rw 1 root disk 8, 2 Sep 12 19 94 /dev/sda2 brw-rw 1 root disk 8, 3 Sep 12 19 94 /dev/sda3 brw-rw 1 root disk 8, 4 Sep 12 19 94 /dev/sda4 brw-rw. root disk 8, 13 Sep 12 19 94 /dev/sda13 brw-rw 1 root disk 8, 14 Sep 12 19 94 /dev/sda 14 brw-rw 1 root disk 8, 15 Sep 12 19 94 /dev/sda15 brw-rw 1 root disk 8, 16 Sep 12 19 94 /dev/sdb The obscure options. /mnt/floppy # ls -la /mnt/floppy total 14 drwxr-xr-x 3 root root 10 24 Aug 1 19 :49 . drwxr-xr-x 7 root root 10 24 Jul 3 21 :47 drwxr-xr-x 2 root root 12288 Aug 1 19 :49 lost+found # umount /mnt/floppy Hardware