This book is available for $37.95 which includes


2 CD-ROM "Official" Debian GNU/Linux 1.3.1

Custom Debian CD-ROM with special features

30 days of E-mail Technical Support

This document in a 236 Page printed form


Call 888-770-4330 (Toll Free in the U.S.) or 707-773-4916

Help Support Continuing Linux Development!


The Debian Linux User's Guide

Dale Scheetz

Linux Press


Linux Press * P.O. Box 220 * Penngrove, California 94951 * U.S.A.

For information on software, translations, or book distributors in both the U.S.A. and outside the U.S.A., please write to Linux Press at the above address.

The Debian Linux User's Guide

Copyright c 1997 by Dale Scheetz

All rights to the publication and distribution of this book in printed form are held by Dale Scheetz, with exclusive license of those rights granted to Linux Press. Any production for resale of this document in hard copy form is strictly forbidden outside this exclusive license to Linux Press.

Distribution of the print version of this book must be arranged through Linux Press.

Although distribution of printed copies of this book are restricted, electronic copies of this book may be distributed freely via any electronic media. Proper use of the electronic form of this book permits the end user to make hard copy printouts for personal use only.

ISBN 0-9659575-0-0

Trademark Acknowledgements All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Linux Press cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.

Apple and Macintosh are registered trademarks of Apple Computer, Inc. CP/M is a registered trademark of Caldera, Inc. IBM is a registered trademark of International Business Machines, Inc. MS is a trademark of Microsoft Corporation. Windows is a trademark of Microsoft Corporation.

Information has been obtained by Linux Press from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Linux Press does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information.

Printed in Canada


dedicated

to

Linux users everywhere


Table of Contents

1 Introduction

2 Installation

3 dpkg The Package Management Tool

4 Dselect

5 X11 Installation

6 Networking with Debian

7 Compiling the Kernel

Appendix 1:

Appendix 2:

Appendix 3:

Appendix 4:

Appendix 5:

Appendix 6:

Appendix 7:

Appendix 8:

Appendix 9:

Index


Acknowledgments

The author wishes to thank everyone who made a contribution to the creation of this book.

Primary among them is Linux Press. Without their support and encouragement the author would not have had the opportunity to walk this particular path.

My family provided support in many ways as well. My daughter Crystal supervised herself at every opportunity during her last month of home school to give me more time to focus, while her mother Fox provided productive comments and a good "sounding board" for various ideas. Without both of their emotional support this book would never have been completed.

Thanks also go to Bernie Hamilton Lee for his editing of the initial manuscript.

Certainly many valuable people will be missing from this list, but most of them will be included with thanks to all those responsible for the Debian Distribution. Special thanks go to all those developers who took the time to educate the author about Debian and its distribution. Without these fine folks there would be no distribution to write about.


Page 1 - Linux Press http://www.linuxpress.com

1

Introduction

1.1 History

In late 1993, a college student and computer enthusiast named Ian Murdock was using SLS, an early distribution of Linux. He liked Linux but found himself disappointed that SLS had many problems and that, even worse, new releases of it failed to fix many of them. Convinced that this was mostly due to an over loaded, overworked maintainer, he decided to adapt the model used in the development of Linux itself and use it to create a new distribution with a decidedly different philosophy. He called the new d istribution "Debian Linux", and it was to be developed by a distributed group of volunteers. This group was completely open and anyone was welcome to get involved.

Ian posted his intentions to the Usenet in August of 1993 and immediately found outside interest in his idea, including that of the Free Software Foundation, the creators of much of the core software of all Linux-based systems. Ian credits this early interest as being pivotal to the acceptance of Debian into the free software world.


Page 2 - Linux Press http://www.linuxpress.com

Through the fall and winter of 1993, development of Debian proceeded through several internal releases, culminating in the public release of Debian 0.91 in January of 1994. Debian 0.91 gave the world its first glimpse of the Debian philosophy in action. By this time, a dozen or so people were involved in development, though Ian was still largely packaging and integrating the releases himself.

After the first public release of Debian, attention was turned toward developing the package system called dpkg. A rudimentary dpkg existed in Debian 0.91, but at that time was mostly used for manipulating packages once they were installed, rather than as a general packaging utility. By the summer of 1994, early versions of dpkg were becoming usable, and other people besides Ian began to join in the packaging and integration process by following guidelines that explained how to construc t packages that were modular and integrated into the system without causing problems.

By the fall of 1994, an overloaded Ian Murdock, now coordinating the efforts of dozens of people in addition to his own development work, transferred responsibility of the package system to Ian Jackson, who proceeded to make many invaluable enhancements to it and shaped it into the system it is today.

After months of hard work and organization, the Debian Project finally made its first distributed release in March of 1995, Debian 0.93 Release 5. Debian 0.92 had never been released, and Release 1 through Release 4 of Debian 0.93 had been development releases made throughout the fall and winter of 1994.

By this time, the Debian Project, as it had come to be called, had grown to include over sixty people. In the summer of 1995, Ian Murdock transferred responsibility of the base system, the core set of Debian packages, to Bruce Perens, giving him time to devote to the management of the growing Project. Work continued throughout the summer and fall, and a final a.out release, Debian 0.93 Release 6, was made in November of 1995 before attention turned to converting the system to the ELF binary format.


Page 3 - Linux Press http://www.linuxpress.com

Ian Murdock left the Debian Project in March of 1996 to devote more time to his family and to finishing school; Bruce Perens assumed the leadership role, guiding the Project through the its first ELF release, Debian 1.1, in June 1996.

With the release of 1.1 the project began to snowball and by the time of the release of Debian 1.2 in December 1996 it had grown to nearly two-hundred volunteers. This massive growth created management problems for the group.

As a result of the discussions that ensued, several subgroups were formed within the development group. These smaller teams took on specific issues and by the release of 1.3 there were teams in place to deal with documentation, publicity, quality assurance, testing, and most important, the Deity team. Most of these teams took on the long term tasks that could not be dealt with during one release, while QA and Testing have specific tasks related to releases. The Deity team has taken on the task of improving dselect. The problems with dselect have been the most visible for the distribution and have dragged on for so long specifically because release cycles are too short to adequately address these problems. There are great hopes for the success of this development project.

From its inception as an idea in the mind of Ian Murdock, this project has grown to produce a professional, high quality distribution. Given its current size and quality, Debian can be expected to continue to produce an up-to-date distribution of the highest quality.


Page 4 - Linux Press http://www.linuxpress.com


Page 5 - Linux Press http://www.linuxpress.com

1.2 The Debian Development Team

From its humble beginnings, with a mere hand full of developers, the Debian Development Team has grown to over 180 active developers and enough additional help from regular contributors to bring the total list of participants to over 200 people. Most of these people have never met; almost all of the communication between developers takes place via e-mail and the various mailing lists that the project supports.

All contributions to the project are completely voluntary, including the many fine people, businesses and institutions that contribute hardware to operate those lists and disk space to store the Archives. What little actual cash is necessary, has, in the past, been paid out of pocket by the person taking care of the issue. There is now a mechanism for the project to collect for such cash necessities. This volunteer organization, by its very nature, does not lend itself to the hierarchical structures usually found in development organizations. Control from a central location is ineffective, at best, and counter productive in many cases. The reason this process works without those controls stems from the modular package scheme that was developed so early in the project. This allows an individual developer to take responsibility for a "known" piece of the distribution.

The combination of mailing lists and bug reporting system provides the only checks and balances needed to adequately control each individual developer. If developers have any questions about the proper way to deal with package responsibilities, the mailing list provides the access to other developers who will gladly assist with suggestions and comments. If developers generate packages which are poorly formed, the bug tracking system allows anyone who notices the problem to bring it


Page 6 - Linux Press http://www.linuxpress.com

to their attention. With the recent rapid growth of the development group, this system became inadequate for dealing with the problems brought on by that rapid growth. This need has created multiple small teams within the larger structure, whose specific task has some narrowly focused agenda. Some of the current agendas include: Publicity; Documentation; Dselect redesign (Deity); Quality Assurance; and Testing.

These subgroups operate on the same general principles as the larger group, usually with their own mailing list and a team leader. These teams have a far better chance of coming to closure on the issues that they deal with, than the larger group was ever able to accomplish. Within this loose structure, the driving forces come from the universal desire of all participants to create an exceptional product of the highest possible quality. This helps to quell personal agendas and keep folks focused on the gener al goals. It is this development model, borrowed from the Kernel Development Team and modified to suit the needs of this team that has allowed Debian to become the powerful distribution that it is today.


Page 7 - Linux Press http://www.linuxpress.com


Page 8 - Linux Press http://www.linuxpress.com


Page 9 - Linux Press http://www.linuxpress.com

1.3 What Makes Debian Different?

As described above, the major difference between the Debian distribution and the other Linux distributions that are currently available is its open, volunteer, development model. This is not, however the only difference between Debian and others.

The second, most important, difference is Debian's strict adherence to the "Free Software" ideal. It is quite impressive, when you think about it, that this distribution is composed of freely redistributable software, complete with source code. Now, most other distributions also supply source code and these same programs, but they are also willing to put packages into their distributions that can not be redistributed under certain conditions, without any concern for the legal problems that they deliver to t heir end users. Users of the Debian distribution can be assured that what they find in that distribution will have no constraints on the free distribution of that software, leaving them free to build "value added" systems from this Distribution without fear that they will find themselves in court for misuse of someone else's intellectual property.

Debian provides areas within the archives for packages that do not meet these rigid standards, but are desired by the Debian community. Because of its free software status, the Debian packaging system can be used to package software that does not meet its own standards for free distribution.

Packages that are not freely distributable are found in the "non-free" section of the distribution. An additional category, called "contrib" is for those packages that would otherwise be free, except that they depend on some other package that is


Page 10 - Linux Press http://www.linuxpress.com

"non-free". In this way, Debian provides a wide variety of software outside the distribution, in a way that protects its users from the legal ramifications of the non-free nature of that software.

There are substantial technical issues that separate Debian from the other distributions available today. Debian is dedicated to a strict interpretation of the Linux File System Standards, soon to be known as simply the File System Standards. It is this strict adherence to these technical guidelines that helps make Debian such a dependably useful system. Foreign packages brought to a Debian system are typically easier to integrate into the system than with other Linux distributions.

As important as this standard is, the real technical superiority provided by Debian is its unique packaging system. This system allows for incremental upgrades of individual packages without the constant danger of ending up with a broken system. The modularity of the packaging system keeps each potential disaster localized within the narrow confines of the offending package. There are still plenty of ways to break the system, but the packaging system goes a long way toward protecting the system from such fa ilures. Most of this protection comes from the dependency checking that is provided by this packaging system. Packages can declare their dependency on other packages and even declare that dependency to encompass a particular version of that other package. The installation software enforces these dependencies in a way that allows the dependencies to be satisfied, yielding a functional package at the end of the installation. The major package management tool, dselect, is, by its nature, a complex tool for a c omplex job. For detailed instructions see the Dselect section (page 115).

Even with Debian's high quality, the complexity of Linux systems provides many ways to confuse the unwary user. Although Debian attempts to create an installation default that will fit the most general needs of the user, there are many areas where knowledge and skill are required to get the most value from this operating system. Debian provides for these needs with mailing lists. The debian-user mailing list is an open subscription list. To subscribe one simply sends an e-mail message to debian-user-REQUEST @lists.debian.org with the subject and


Page 11 - Linux Press http://www.linuxpress.com

message body containing the single word subscribe. This will bring you into contact with other users, potentially having had your problem in the past, who can help reduce your confusion. The strength of this list is that developers lurk on the list as well as users, so there is the possibility of getting expert advice from someone who understands your problem.

In addition, the debian-devel mailing list is also open to public subscription, although its goals are far more technical in nature, much useful information can be gleaned from lurking on this list. As with the user list, a simple e-mail to debian-devel-REQUEST@lists.debian.org with the subscribe statement in the subject and message body will result in mail from this list being sent to your e- mail address. The volume of these lists is quite high at times, which tends to scare folks new to the Internet, but the quality of response is also quite high. This is in stark contrast to other distributions, many of which don't even supply any e-mail address for questions. Those which do manage user mailing lists tend to be more closed and less helpful to the average user. Much of the difference comes from Debian's open development model, which welcomes the synergy created by multiple points of view. The helpful nature of these lists is way above average for this type of mechanism and most users find it a happy place to be while learning the ins and outs of the Debian system.

It is these differences that have made Debian a competitive system with all the current leaders in the Linux community. The fact that this is being done with literally "no money" and without corporate sponsorship makes Debian's ability to compare favorably against these other products a very remarkable achievement.


Page 12- Linux Press http://www.linuxpress.com


Page 13 - Linux Press http://www.linuxpress.com

1.4 How This Book Was Written

Several months before the release of Debian GNU/Linux version 1.3 the author and the publisher could find no Debian specific books available. They decided that this would be a valuable commodity for the Linux community and set about producing this book. From the very start it was determined that the electronic version, distributed in HTML format, could be distributed freely and used privately in any fashion. The print publication rights are held by the author, exclusively licensed to the publisher for w ide distribution.

The text of this book was primarily constructed from the author's extensive experience as a Debian developer. This experience includes maintaining a variety of packages as well as participating on both the development and users mailing lists. However, without the many contributors to all the Fine documentation that is available for Linux systems, however scattered and difficult it may be, the details of this book would not have been possible.

Special thanks and gratitude go to Ian Murdock for his contribution to the accuracy of the section on the early history of Debian and for his moral support. Many thanks also go to all of the other Debian developers who contributed to this author's understanding of the Debian system.

While all of the above is true, it was the author's work as testing coordinator that provided an understanding of the minor quirks of the installation and package management system. This experience provided many of the details that are contained in the following text.


Page 14 - Linux Press http://www.linuxpress.com

This book was written primarily to address the 1.3 version of Debian. It is also expected to grow and change side by side with the distribution. There will be changes and modifications to the content to keep the book in sync with Debian as it grows and changes.

To aid in improving the content of this book, Linux Press provides an e-mail address at books@linuxpress.com. Both complaints and compliments (the author and Linux Press like those too) can be sent to the aforementioned e-mail address. In particular, if you indicate areas where the book is incorrect or where it can be improved, let us know. Reader input is eagerly accepted and will be the prime motivator of future modifications to this book.

For those interested in purchasing the printed book and/or the Custom CD-ROM, e-mail can be sent to sales@linuxpress.com. Orders can also be placed at http://www.linuxpress.com. Linux Press can be contacted by mail or phone at:


Linux Press
P.O. Box 220
Penngrove, CA 94951

Phone: (707) 773-4916
Fax: (707) 765-1431
Web: http://www.linuxpress.com
E-mail: sales@linuxpress.com


Page 15 - Linux Press http://www.linuxpress.com


Page 16 - Linux Press http://www.linuxpress.com


Page 17- Linux Press http://www.linuxpress.com

2

Installation

2.1 Introduction

There are several ways to begin the installation of Debian. This section will describe three methods. They range from several floppies to hard disk and CD-ROM as the medium used to boot the installation software.

o A small hand full of floppy disks.
o A CD-ROM and 2 floppy disks.
o A CD-ROM (or DOS ftp download) and a DOS bootable partition.

As with any new purchase, there is a desire to start using the product NOW! What follows is a Quick Start section to accommodate that urge. However, we caution that this isn't necessarily the best approach and may result in the loss of existing data on your computer.


Page 18 - Linux Press http://www.linuxpress.com


Page 19 - Linux Press http://www.linuxpress.com

2.2 Quick Start

If the target machine can boot a CD then you will be able to begin the installation by putting the CD in the drive and re-booting the machine. If you don't have that luxury, boot the machine in DOS, either from a "DOS rescue" floppy or from the hard disk. As a last resort you may need to build a boot disk and a drivers disk on another DOS machine to get the installation started. These methods are covered in detail later. What follows next is a simplified, step by step, procedure that will result in the installation of a Standard Debian GNU/Linux system.

o If the machine will not boot the CD, boot DOS and change to the CD drive. Use START.BAT to begin the installation process on the Custom CD, or \boot\boot.bat on the Official CD, to begin booting up the installation kernel.

o Set color or monochrome at the opening screen, read the intro, and proceed to the Main Menu. Choose next to configure your keyboard.

o Partition and/or install a swap partition and, at minimum, a root partition. These will be created and mounted at your direction by the installation software. Repeat subsets of this step to create whatever other partitions are necessary for the installation.

o Install the Operating System Kernel and Modules from the CD, the hard disk, or floppies, depending on which procedure is being followed.


Page 20 - Linux Press http://www.linuxpress.com

o After the Modules have been copied into the target partition they can be installed for use during the remainder of the installation.

o Configuring the Network is provided next, so that the base system can be obtained from a remote site if the machine has an Ethernet card installed. This can be a many step configuration process, or, for CD installs to a stand alone machine simply a matter of choosing the machine's name.

o Installing the Base System can now be done from a variety of sources. From the CD (either Custom or Official) in the "Default Location", or from the Hard Disk, declaring the correct path to the base1_3.tgz file.

o Configuring the Base System is simply a matter of choosing the appropriate time zone information. The rest of the information necessary for proper Base System configuration has already been collected.

o Now the system is made bootable. Even if some other boot method is to be used in the final system, follow that step with "Make Boot Floppy". Make a boot floppy so you can be certain of booting your new system.

o Reboot the system

o Give root a password, a user account with its own password and the rest of the installation is begun when the install script runs dselect.

o It is pretty easy to get a standard system using dselect. More complex package management is possible with dselect, but usually not by the novice adventurer. This piece of software should be your first serious candidate for study once the system installation is complete.


Page 21 - Linux Press http://www.linuxpress.com

o From the dselect main menu choose the Access option. Here you can choose from the CD-ROM, the Hard Disk, an ftp site, and nfs mount, or, heaven forbid, floppies. Tell dselect where to find the Packages files and it's back to the main menu.

o First time in, either for a new install or for an upgrade from a new archive, always choose Update from the menu next. This will update the available file from the Packages files in the archive.

o Skip Select, as the standard set of packages have already been pre-selected for you, and go straight to Install. This process is fairly long and will ask some questions near the end of the installation period. When this completes with no errors it is time to quit dselect.

o At this point a Standard installation has been achieved. Although you may find packages that are not installed but are desirable and available in this release. To install them, restart dselect (as root) and go back to the Select screens. Now begin to learn about the heart of dselect. Pay close attention to the help screens and don't follow your instincts.

o Now the real fun begins!


Page 22 - Linux Press http://www.linuxpress.com


Page 23 - Linux Press http://www.linuxpress.com

2.3 Floppy Installation

If the target machine has no operating system installed and, for one reason or another, you don't want to install DOS on this machine, the floppy installation method is the one to use. This will require 8 high quality floppy disks (9 if your machine has less than 6 megabytes of memory).

The boot floppy, known as the rescue disk, boots up a Linux system and runs the installation program described later.

The Rescue Disk boots up the Linux kernel and provides a file system capable of installing the base system. The disk image is contained in either resc1440.bin or resc1200.bin depending on the size floppy being used. It is formatted for DOS, which makes it easy to exchange a custom kernel for the one provided.

The Installation Program is the first to run after the kernel has booted. This is a shell script, that uses elements of the Dialog package, to present the interface for installation interactions. This interface enables the installation of the base system as well as a boot floppy if necessary.

The second diskette, known as the drivers disk, provides device driver modules needed for mounting a CD-ROM as well as for establishing an Internet connection early in the installation process.


Page 24 - Linux Press http://www.linuxpress.com

The Drivers Disk contains various device drivers not compiled into the kernel. The image for the disk is found in the files drv1440.bin or drv1200.bin depending on which size floppy is used. The modules contained on the floppy are installed, both in the existing file system and the target file system, as early in the installation as possible, providing access to devices useful in completing the installation.

Modules. UNIX operating systems deal with access to devices by using device drivers. Linux has several features that allow these drivers to be built separately from the kernel and loaded when needed. These drivers are called modules. Modules provide many useful capabilities not available to "built in" drivers. Primarily they give the system flexibility in managing system drivers without need for recompiling the kernel.

The Base System contains all of the programs required for booting a Linux system on the target machine. It also has all the needed programs for continuing the installation of a system, tailored to specific needs and desires.

The Base System takes 5 floppy disks and can be found in the file, base1_3.tgz, as well. This provides a Linux system which can be used to install the rest of the Debian system.

One more floppy should be set aside and marked "Boot Disk". This floppy disk will be used to create a disk that will boot the newly installed system.

If you are installing on a machine with less than 6 megabytes of memory, as long as there is at least 4 megabytes of memory, an additional floppy known as the lmemroot disk will be needed to accomplish the installation. If you have less than 4 megabytes of memory or less than a 386 Intel processor, tie a rope around it and take it fishing. It will make a passable anchor, but it will not run Linux. A 386 with 4 megabytes of memory can be coaxed into running Linux, but it is sort of like trying to swim laps in a mud puddle. On the other hand, a 486 with 8 megabytes of memory makes a reasonable work station. It will even run X-Window though 16 megabytes will improve performance immensely.


Page 25 - Linux Press http://www.linuxpress.com

The lmemroot disk. This floppy is only necessary if the target system has less than 6 megabytes of memory. If the system has less than 4 megabytes this floppy will not solve the problem. It contains the image found in the file lmemroot.bin, that contains a root file system, trimmed down from the one normally used. Already unpacked for mounting as the root file system, this saves enough memory for a successful installation on these machines.

If this machine-without-an-operating-system has a CD-ROM that is recognized by the kernel, chances are very good that you will be able to get by with only the boot/rescue disk and the drivers disk.

In some instances this bare machine may need to have DOS installed, or even Windows, as well as Debian GNU/Linux. In this case the DOS/Windows OS should be installed first. See the appendix sections on DOS Installation and Multiple OS Installation for more details.

DOS Installation. Most Intel class machines come with some kind of DOS installed. Machines that don't may require the use of a DOS rescue disk. This floppy must boot DOS and contain the utility programs fdisk and format. Once the hard disk has been partitioned and formatted, the DOS installation disks will perform their job successfully.

Multiple OS Installation. There are several ways that more than one Operating System can reside on the same machine. DOS and Windows can easily reside on the same machine with Linux and each can be booted at the choice of the operator. Windows 95 is a little bit trickier since it enforces its own boot record. Attempts to install LILO may fail with Windows 95 because of this behavior but loadlin can be used instead.

If this is the case, or the machine already has DOS installed, the entire installation can be performed without the use of a single floppy.


Page 26 - Linux Press http://www.linuxpress.com

If you use the "Custom CD" provided with the print version of this book, installation starts with the following three steps.

1. Place the "Custom CD" in the CD-ROM drive.

2. Change drive to the CD-ROM.

3. Enter START and answer the prompts appropriately

2.3.1 Making Boot Floppies

Everything needed to produce a set of installation floppies can be found in the release Debian Archive in the subdirectory "disks-i386/". The files that will be transferred to a floppy are known as "image" files. (Note: the word used here is transferred, not copied. This is not a file copy procedure.) These image files contain within them an image of a file system taken from a device. In this case the device is a floppy disk.

A Debian Archive contains the packages distributed by the Debian Project. Each release resides in its own subdirectory tree. Release 1.3 started life as bo, referred to publicly as unstable. Passing through frozen, bo eventually became release as 1.3 and given the public link stable. Rex, formerly 1.2.18 and stable, passed over the horizon into history. Bo will do the same when hamm matures into stable.

Image Files/File Systems: Image Files are complete file systems that masquerade as a single file. File systems are composed of directories and files. The loop device allows such file systems to be mounted as though they were actual physical devices. Image files thus provide "device oriented file systems" in a modular fashion.


Page 27 - Linux Press http://www.linuxpress.com

Creating a set of installation floppies is a process of transferring the images contained in these files to the floppy disks that will be used to perform the installation. The files containing these floppy disk images are as follows:

The following can be written to either a 3 1/2" or 5 1/4" floppy

lmemroot.bin

Low memory root file system

base-1.bin

First image of base system

base-2.bin

Second image of base system

base-3.bin

Third image of base system.

base-4.bin

Fourth image of base system

base-5.bin

Last image of base system



The method used to transfer these images from their file to the floppy will depend on what is available. Many folks install Linux using a DOS machine as the starting point, so this platform will be discussed first. The second section will describe doing the same thing from a Linux platform, for those lucky enough to already be working on a Linux machine.

2.3.2 Creating Floppies With DOS

Whether the disks used are 5 1/4" that hold 1.2 megabytes of data, or 3 1/2" disks that hold 1.44 megabytes of data. (I am always intrigued by the fact that smaller physical size means higher precision, yielding more overall storage capacity in this particular instance.) Mark the floppies: boot/rescue, drivers, base-1, base-2, base-3, base-4, base-5, boot-disk, and possibly one marked lmemroot (only needed for low memory installation) should be prepared from high quali ty, formatted disks. It is important that, for those files that contain either 1200 or 1440 in their file names, the correct file is used with its particular floppy. So 1200 files go on 5 1/4" floppies while 1440 files will only fit on 3 1/2" disks.


Page 28 - Linux Press http://www.linuxpress.com

DOS systems typically don't provide programs for transferring these image files to floppy disk. The copy command certainly will not provide the desired results. The earliest installations of Linux solved this deficit with a program called rawrite.exe. The current version, rawrite2.exe, is used today by Debian and the rest of the Linux community to provide this capability. This program is provided in the disks-i386/ directory in any Debian Archive. It can therefore be found on the "O fficial Debian CD" or the "Custom CD", both provided with the print version of this book. This DOS executable is used to create the rescue floppy, the drivers floppy, the 5 base floppies, and, if necessary, a low memory root floppy from lmemroot.bin.

Be sure to put labels on these floppies so you can tell them apart. You should end up with at most eight floppies labeled: rescue, drivers, base-1, base-2, base-3, base-4, base-5, and lmemroot. A ninth formatted disk labeled boot should be set aside for the end of the base installation phase.


Page 29 - Linux Press http://www.linuxpress.com

2.3.3 Using RAWRITE2.EXE

As a result of rawrite2's place in history it is totally unaware of many of the latest DOS advances and knows absolutely nothing about Windows or Windows 95. Because of this there are several issues that should be kept in mind when using rawrite2.

1. Though not always necessary, it is advised to put rawrite2.exe in the same directory as the image files that are to be transferred to the floppy. If you have a CD containing the Debian archive, the program is provided in the disks-i386/ subdirectory. This will only require changing to that directory on the CD and the transfers can be made directly from the CD to the floppies without the intermediate step of copying to the hard disk.

2. Let rawrite2 prompt you for the file name and the drive letter. Various instructions give command line options, but these produce less than the expected results when used on some machines. The process of creating a floppy disk from an image file will look like:

rawrite2.exe
RaWrite 2.0 - Write disk file to raw floppy diskette

Enter disk image source file name: [resc1440.bin]
Enter target disk drive: [a]
Please insert a formatted disk into drive A: and press -ENTER- :
Number of sectors per track for this disk is 18
Writing image to drive A:. Press ^C to abort.
Track: XX Head: Y
Done.

Where those items enclosed in [ ] are the entered responses to the prompts by the program. XX will range from 1 to 79 during the course of the transfer, while Y alternates between 1 and 0.


Page 30 - Linux Press http://www.linuxpress.com

3. Exit Windows completely before trying to use rawrite. In Windows 95 you may need to build a DOS Boot Disk (boot floppy) in order to make this work. Alternatively, if, while booting, when the first beep is heard from the computer, press the F8 key. Select the option COMMAND, which will allow running without the Windows 95 GUI being loaded. You will be presented with a DOS prompt from which rawrite can be used.

A DOS Boot Disk must be bootable, contain the utilities fdisk and format, and have config.sys and autoexec.bat and any drivers necessary for making a CD-ROM work, if available. Some operating system are delivered on CD, including Debian, of course. A DOS rescue disk provides tools to prepare the hard disk for installation of the operating system.

4. If you still have problems and the disks produced fail to work properly, try turning off caching and see if that helps.

5. The most common problems are caused by bad floppies, so always use the best floppies you can find, preferably new ones, and verify them if you can.

The "Custom CD" contains a batch program called START.BAT that will completely automate this process under "normal" circumstances.


Page 31 - Linux Press http://www.linuxpress.com

2.3.4 Creating Floppies from Unix/Linux

The program to use in a Unix environment (Linux is just such an environment) is dd. This program will transfer the image file to the floppy in much the same way that rawrite2 did. The command line will look similar to:

dd if=resc1440.bin of=/dev/fd0 bs=1k count=1440

Note that if you are making 1.2 megabytes floppies the last value should be 1200 instead and look like:

dd if=resc1200.bin of=/dev/fd0 bs=1k count=1200

The if= parameter is the input file. The of= parameter is the output device. Note that this will become /dev/fd1 if you are writing to the second floppy (i.e. B: drive in DOS). The bs= parameter is the block size on the floppy and the count= declares how many blocks may be copied. If there are fewer blocks than the disk will hold, dd will do the right thing. In fact, in the case of these files, dd will perform as desired even if the bs= and count= parameters are not included on the command line. It is, however, a good idea to get into the habit of including these options with this command as they will be necessary under other circumstances.


Page 32 - Linux Press http://www.linuxpress.com


Page 33 - Linux Press http://www.linuxpress.com

2.4 Installation From Floppy

You will need the boot/rescue disk, drivers disk, and the 5 floppies that hold the base system, built in the previous section. A formatted floppy will be needed to create a floppy to boot from when the installation is complete. Even if the intent is to use LILO or some other method of booting the new system. It is still highly advisable to build a boot floppy, just in case there is a system problem.

If you have a DOS partition to work from, the method described in Zero Floppy Installation in the next section is likely to be more applicable. It will still be valuable to read over this section, just to get a feel for the components of the installation.


Page 34 - Linux Press http://www.linuxpress.com

Step 1
Begin by booting the system with the boot/rescue disk. When the boot up is successful, the initial choice menu of the install script will be presented that looks something like:

Debian GNU/Linux Installation

Select Color or Monochrome 
of your monitor displays color, please select Color here. Select Continue when 
you are satisfied with the display.                       
  
        Next       Continue with the installation.
        Color      Select color display.
        Monochrome Select black-and-white display.


          OK            Cancel

If there is a color monitor on the machine it is highly recommended that the "Color" item be chosen from this menu. Color screens have better contrast which makes them easier to read. Of course, if there is only a monochrome monitor available the color choice will be unhelpful and the Monochrome display (the default) should be selected.


Page 35 - Linux Press http://www.linuxpress.com

Once the display type has been selected, accepting the "Next" option on the menu will display the following screen.

Release Notes
Software in the Public Interest
presents
*** Debian GNU/Linux 1.3 ***

This is the Debian Rescue floppy. Keep it once you have installed your system, 
as you can boot from it to repair the system on your hard disk if that ever 
becomes necessary.

Release note: This floppy was built on June 20, 1997 by sr1

Please be sure to visit the Debian WWW site: http://www.debian.org/

Debian's developers are more than 180 volunteers from all around the world, 
collaborating via the Internet. We have formed the nonprofit organization 
"Software in the Public Interest" to sponsor this development. We'd like to 
thank the many businesses, universities, and individuals who contributed the 
free software upon which Debian is based.  The Free Software Foundation should 
also be recognized for the many programs they have contributed and for their 
pioneering role in developing the free software concept and the GNU project.

                                    EXIT

Press enter here to move on to the main menu.


Page 36 - Linux Press http://www.linuxpress.com

Every time the script returns to the main menu the installation program will inspect the current state of the machine to determine which step in the installation is supposed to be performed next. It will then present several possible options for the next step in the installation at the top of the menu. The most likely choice is offered first with the highlight bar placed for its selection.

Step 2
This first time entry into the main menu, the installation program will determine that the installation has just begun, and the highlight bar will rest on Configure the keyboard. The menu will look like:

                    Debian GNU/Linux Installation Main Menu
Your keyboard has not yet been configured.                      
Please select "Next" from the menu to configure the keyboard.    
 
	Next	   Configure the Keyboard                            
	Alternate  Partition a Hard Disk                                                                           		

	A	   Configure the Keyboard                            
	B	   Partition a Hard Disk                             
	C	   Initialize and Activate a Swap Partition          
	D	   Activate a Previously-Initialized Swap Partition  
	E	   Do Without a Swap Partition                      
	F	   Initialize a Linux Partition                     
	G	   Mount a Previously-Initialized Partition          
	H	   Un-Mount a Partition                             
	I	   Install Operating System Kernel and Modules       
	J	   Install the Base System                           
	L	   Configure Device Driver Modules                   
	M	   Configure the Base System                         
	N	   Configure the Network                             


                OK            Cancel


Page 37 - Linux Press http://www.linuxpress.com

Note that, although the listing visible on the screen stops at item N for lack of space on the screen, the down arrow key can be used to move the highlight bar from the top of the menu down to the bottom. This will reveal the last five items on the menu:

O Make Linux Bootable Directly From Hard Disk
P Make a Boot Floppy
Q Reboot The System
R View the Partition Table
S Execute a Shell

Use the up arrow to move back to the top of the screen and press enter. This presents a screen for choosing the keyboard template that fits the machine.

Debian GNU/Linux System Installation
                                     Select Keyboard
Please select a Keyboard. If you don't find the exact
right choice below, please choose something close.
You'll be able to configure more keyboard choices by running
kebdconfig once you have installed the base system.                                       
   
	us	                U.S. English (Qwerty)     
	dvorak	                Dvorak                    
	de-latin1-nodeadkeys	Germany                  
	es	                Spain                      
	fi	                Finland                   
	fr-latin1	        France                    
	it	                Italy                      
	no	                Norway                     
	pl	                Poland                     
	ru	                Russia                     
	se-latin1	        Sweden                     
	uk	                United Kingdom            
   

                OK            Cancel                  


Page 38 - Linux Press http://www.linuxpress.com

Note: All of the options that are available are visible on the screen. There are many more keyboard choices available once the system is installed. However, in order to fight the constant space constraints of the boot disk, the number provided here is only those considered absolutely necessary. After the system has been installed, log in as root and execute kbdconfig. This will present the full list of keyboard maps, so that a more appropriate selection can be made.

Step 3
Once the keyboard is configured, the installation software looks over the system again. If partitions don't already exist on the installed drives, then the menu will look something like the following:

Debian GNU/Linux System Installation
Debian GNU/Linux Installation Main Menu

Unknown Help text found here

	Next       Partition a Hard Disk                             
	Alternate  Go Without a Swap Partition                       

	A	   Configure the Keyboard                            
	B	   Partition a Hard Disk                             
	C	   Initialize and Activate a Swap Partition          
	D	   Activate a Previously-Initialized Swap Partition  
	E	   Do Without a Swap Partition                       
	F	   Initialize a Linux Partition                      
	G	   Mount a Previously-Initialized Partition          
	H	   Un-Mount a Partition                              
	I	   Install Operating System Kernel and Modules       
	J 	   Install the Base System                           
	L	   Configure Device Driver Modules                   
	M	   Configure the Base System                         
	N	   Configure the Network                             

 
           OK            Cancel


Page 39 - Linux Press http://www.linuxpress.com

Note: Even if you are going to do without a swap partition (not highly recommended) you will need a root partition on which to install your system. If partitions have already been built, the menu will look like the one in the next step and you can proceed to step 4 now.

The opportunity to select which physical drive will be partitioned is presented when the option to Partition a Hard Disk is chosen. Cfdisk is used to partition the specified drive.

Use this tool to create at least one Linux partition and, unless circumstances get in the way, a swap partition. With a 24 Megabytes swap partition, and 8 Megabytes RAM, a 486 will compile a kernel without running out of virtual memory. However, when compiling very large packages, 24 megabytes is nowhere near enough, even on a Pentium, with 16 megabytes of memory. However, with 16 meg, a 48 megabytes swap partition becomes quite adequate. From this it can be seen that deciding on the size of the swap partit ion isn't really a simple formula. Depending on the tasks the system is expected to perform, the formula will be different for each configuration. The principle involved can be explained.

There is "real" memory or RAM (Random Access Memory) that is used for system memory and sometimes external cache, and there is virtual memory on disk on the swap partition. This virtual memory is primarily used to hold "pages" of real memory when they are not in use. The kernel parcels out pages of memory to processes that need them. These pages age when not in use and, when memory gets in short supply, the kernel "swaps" the oldest out to disk. If these swapped pages are needed by the process that created them, the kernel swaps them back into memory. Processes that create a lot of data can, at some level, consume all available memory. This means that no matter how much physical memory the machine has, some process will consume all of it. Swap space allows for the expansion of that limit. A knowledge of the memory needs of the system is required before the "correct" value for swap space can be computed.

Several simple rules:

You can't have too much swap space. Although excessive swap space may amount to wasted resources, it will not cause the system to exhibit thrashing or


Page 40 - Linux Press http://www.linuxpress.com

otherwise cause operational problems. It simply will not get used unless memory usage escalates.

Thrashing - When the operating system spends most of its time paging real memory in and out of the swap space it is said to be "thrashing" and no useful work gets done. This can happen for a variety of reasons. On another operating system, larger than "optimum" swap space would quickly drive the system into thrashing. Deciding the amount of RAM that will be swapped out based on the size of swap space causes "all" pages to be swapped out immediately after they are used and the machine spends all its t ime moving pages in and out of memory and never gets anything done (Well, at least it seems like it) This is pretty clearly "thrashing through stupidity". The more reasoned approach is to base swapping activity on the age of the unused page and the amount of free memory. As the amount of free memory decreases, pages get swapped at an earlier age. This can still be made to thrash if placed under enough load. With many processes allocating and using many buffers, memory can fill up faster than it can be swapp ed out. The end result is either machine lock-up because of exhausted memory (ever seen "can't get a free page" error?) or it goes into thrashing mode when the swap age gets to zero. Whew!

More real memory does not necessarily mean more swap space. The need for swap is much more dictated by the demands of the processes that consume memory. Thus a swap ratio of 3 to 1 which works fine compiling kernels, as in the 24 megabytes swap to 8 megabytes RAM in the above example, fails when given a larger task. But the same ratio on a 16 megabytes machine gives 48 megabytes of swap space. This will be adequate for a large task but may still fail under a heavier load.

Although large disk drives are dirt cheap, there is not always any dirt available, and you are forced to compromise. Often after parceling out the disk, the left over partition space is not adequate to the swap needs. You are better off to take the space from the root partition and live in cramped disk space, than to fall short of swap space. A work station with 16 megabytes of memory will be able to do most any relatively complex work, including compilation of a math intensive package, without running out of virtual memory, with only a 48 Megabyte swap partition. More memory in this environment means less swap. Less memory means more swap.

Now that decisions about swap size are as clear as mud, lets see if Linux partition


Page 41 - Linux Press http://www.linuxpress.com

sizes are any easier to determine. The base system takes slightly less than 20 Megabytes of disk space, while the "standard" installation consumes somewhat more than 200 Megabytes of disk space. A "complete" installation may exceed 400 Megabytes, but doesn't need to go on one partition. Here is where the first decision must be made. Is the whole installation going to go on one partition? Well, if there is one physical drive large enough, what reason would there be to create more than one large partition ? (leaving room for a swap partition, of course) There are, of course, several. Consider two of the most likely.

First, control of the user's consumption of disk space. If /home is contained on the root partition the user disk consumption can consume all but 5% of the available disk space choking off all disk use except by the root account. This 5% is set aside for root privilege specifically so this event would not kill system activity. Root can then come in and remove the offending files and return the machine to usefulness. Placing /home on another partition allows that partition to contain only the s pace you wish to give to user activity, rather than the complete root partition. This means that even when users have exhausted their disk space the rest of the system has plenty to continue servicing other processes needs. The system continues happily along, oblivious of the plight of the poor user. This is, of course, very useful when the same platform is supporting both user activity and serving web pages as well and having users plug up the web server is highly undesirable. There are also other solution s to this problem, such as the quota package, found in the admin section but, this is a complete hardware solution requiring no additional software or configuration-management.

Second, control over the contents of /usr. Many systems do this by making /usr read-only. The simplest way to accomplish this is to put /usr on its own partition and mount it read-only. When the system administrator wants to add something to /usr the partition gets remounted read-write, the changes get made and, the partition gets remounted read-only. This partition could just as easily be on a CD-ROM which would guarantee the read-only nature of the file system. Of course any changes t o /usr would require remastering a CD.

All of this mounting information is kept in the file /etc/fstab, which the installation software will modify correctly for each of the partitions created. The install program


Page 42 - Linux Press http://www.linuxpress.com

will expect that the first partition is to be used for the root (/) file system. This can be modified if there already is a root partition. As you add additional partitions a suggested mount point will be presented. This too can be modified. After each partition is created it is mounted on the declared mount point. Once you have created all the partitions they are thus all mounted and ready to accept the installation of software.

When "Partition a Hard Disk" is selected, the following dialogue box is presented:

Debian GNU/Linux System Installation

Select Disk Drive
Select the drive to partition. SCSI drives are listed in disk ID number order. 
Only drives that were connected and operating when the system was started will 
show up in this display. CD-ROM drives may be miss-identified as writable disk 
drives by this menu.        
 
	/dev/hda	First drive on primary controller (not SCSI).     
	/dev/hdb	Second drive on primary controller (not SCSI).    
 
 
                    OK            Cancel

Note that this machine has two physical drives installed.


Page 43 - Linux Press http://www.linuxpress.com

In this example let us choose the second drive, /dev/hdb. If this drive has not been partitioned yet, the screen presented will look something like:

                           cfdisk 0.8i
                              
                      Disk Drive: /dev/hdb                         
      Heads: 16   Sectors per Track: 63   Cylinders: 2100          
                                                                           
    Name    Flags   Part Type       FS Type         Size (MB) 
 --------------------------------------------------------------

           Pri/Log Free Space      1033.61 








                                                                          
 [  Help  ]  [  New   ]  [ Print  ]  [  Quit   ]  [ Units  ]  [ Write  ]                                                             

                                                                           
                       Print help screen                              

Debian Linux uses cfdisk which is a smaller, more trimmed down, partition editor than fdisk, and provides all the functionality necessary for partitioning a new device from scratch. Everything in the installation system has been chosen for its small size and cfdisk is no exception.


Page 44 - Linux Press http://www.linuxpress.com

With no partitions created the obvious choice is

[ New ]

which will give the options:

[Primary] [Logical] [Cancel ]

Only 4 Primary partitions can be created on any one physical drive. Usually this is sufficient. When it isn't, Logical partitions are used to extend the number. Logical partitions, sometimes known as "extended" partitions live inside a Primary partition. To add logical partitions will thus require the removal of one of the 4 possible primary partitions. With only 3 Primary partitions whatever space that is left on the drive can be divided up into as many logical partitions as needed. The limit on logical pa rtitions is only constrained by the space on the disk.

Whether you are constructing a Primary, or a Logical partition, the total space left on the device will be offered for the new partition. Simply type in a new value to override the displayed size. Pressing enter to accept the value typed will present the options:

[Beginning] [ End ] [ Cancel ]

The new partition may be placed at either the beginning of the free space, or at the end of it, or its creation can be canceled all together, by choosing the appropriate option.


Page 45 - Linux Press http://www.linuxpress.com

A few suggestions:

o Create the root partition first, and make it a Primary partition.

o Create the swap partition second. It too must be a Primary partition.

o Create whatever additional partitions are desired. These can be either Primary or Logical.

Whenever cfdisk creates a partition, it assumes that it will be a Linux partition and creates it so. When creating a swap partition the FS (file system) type is not correct. It should be a Linux Swap FS type. When the highlight bar rests on a partition the options section of the screen looks like:

[Bootable] [ Delete ] [ Help ] [Maximize][Print ]
[ Quit ] [ Type ] [ Units ][Write ]

While the up/down arrow keys move from one partition information line to the next, the left/right arrow keys move the highlight bar from one option to the next/previous one. In addition the first letter of the option will activate it as well, so pressing the "t" key will allow the FS type to be changed. This will display a list of all the allowed FS types. Typing the number of that FS type will change the partition to the new type when enter is pressed. The correct FS type for a swap partition is number 82, Linux Swap.

In addition, the first partition should be marked bootable if it is to be the boot partition. This is not necessary for additional drives that get added to the system.


Page 46 - Linux Press http://www.linuxpress.com

In the current example, with a root partition, a swap partition, and a partition to mount as /home the screen would look like the following when these partitions are completed.

                         cfdisk 0.8i
                              
                    Disk Drive: /dev/hdb                         
      Heads: 16   Sectors per Track: 63   Cylinders: 2100          
                                                                           
    Name    Flags   Part Type       FS Type         Size (MB) 
 --------------------------------------------------------------

 /dev/hdb1	boot	Primary	Linux	655.11 
 /dev/hdb2		Primary	Linux Swap	78.26 
 /dev/hdb3		Primary	Linux	300.24 
                                                                           
                                                                            

                                                                           

 [Bootable]      [ Delete  ]     [  Help   ]     [Maximize]      [  Print  ]             
 [    Quit    ]  [  Type   ]     [  Units  ]     [   Write    ]                         
                                                                           
	Toggle bootable flag of the current partition              

When the partitioning is complete there is still the need to Write the partition information to the disk. Pressing "w" at this screen will begin that process. The program will ask if you are sure you wish to write the new partition information. While most programs accept a simple "y" to indicate agreement, this particular tool demands that the word "yes" be typed in full. This is a potentially dangerous operation. The program is about to wipe out all data currently on this device when it constructs the new partition table. It wants to make very sure that this is the desired result.


Page 47 - Linux Press http://www.linuxpress.com

Step 4
If the drive was pre-partitioned, or if Step 3 was performed, the installation software will now suggest setting up a swap partition. The menu will look something like:

Debian GNU/Linux System Installation
Debian GNU/Linux Installation Main Menu
There are "Linux native" and "Linux swap" partitions
present on your system. The next step would be to initialize
and activate a swap partition to provide virtual memory to your
system. If you have not finished partitioning your disks or wish to 
change the partitions, please select "Previous" from the menu 
to partition them. if you are satisfied with your partitions,
please select "Next" from the menu to initialize and activate
your swap partition, or "Alternate" to activate a
previously-initialized swap partition. If you absolutely insist one
doing without a swap partition, select "Alternate1".

        Next            Initialize and Activate a Swap Partition          
	Alternate 	Activate a Previously-Initialized Swap Partition  
	Alternate1	Do Without a Swap Partition                       
	Previous	Partition a Hard Disk                             
  	
	A	Configure the Keyboard                            
	B	Partition a Hard Disk                             
	C	Initialize and Activate a Swap Partition          
 

           OK            Cancel


Page 48 - Linux Press http://www.linuxpress.com

As we built a swap partition in the last section the Next choice is the correct one to follow. In the above case this will present the following dialogue box:

Debian GNU/Linux System Installation

                         Select Swap Partition
    Please select the partition to initialize as a swap device. 
  
       	                      /dev/hdb3
                      
  
           OK            Cancel

Notice that only the partition that was marked "Linux Swap" is presented as an option for a swap device.

Pressing OK here will present an information box asking if the partition should be checked for bad blocks. Answer yes here and the next question is "Are you sure you want to do this?". Answer yes here and the swap partition begins to be initialized. When the initialization is complete the swap partition in mounted and the program returns to the main menu, after checking out the system to see how far the installation has progressed.


Page 49 - Linux Press http://www.linuxpress.com

Step 5
Upon returning from setting up the swap partition the menu will look like:

Debian GNU/Linux Installation Main Menu
There are "Linux Native" partitions present on your system but
none are mounted. You must mount a root filesystem, and you may mount
other file systems, before installing the system. If you have just created
the partitions, you must initialize them before you can mount them. Please
Select "Next" to initialize and mount a Linux partition, or
"Alternate" to mount a previously-initialized partition.
 
        Next      Initialize a Linux Partition                      
        Alternate Mount a Previously-Initialized Partition          
                                                                
        A         Configure the Keyboard                            
        B         Partition a Hard Disk                             
        C         Initialize and Activate a Swap Partition          
        D         Activate a Previously-Initialized Swap Partition  
        E         Do Without a Swap Partition                       
        F         Initialize a Linux Partition                      
        G         Mount a Previously-Initialized Partition          
        H         Un-Mount a Partition                              
        I         Install Operating System Kernel and Modules 


           OK            Cancel


Page 50 - Linux Press http://www.linuxpress.com

If the Linux partitions have not already been initialized then Next is the correct choice at this menu. When selected the following dialogue box will provide the available partitions for initialization:

Debian GNU/Linux System Installation
Select Partition
Please select the partition to initialize as a 
Linux ext2 filesystem..

	/dev/hda1
	/dev/hda3
	/dev/hdb1
	/dev/hdb2
	/dev/hdb3


           OK            Cancel

After choosing a partition to initialize the option of checking for bad blocks is offered. Even though it will extend the time it takes to initialize the partition, this is time well invested. On the 655 block partition created for hdb1, in the example being used here, the total time to initialize the partition was 10 minutes and 30 seconds. The time taken to check for bad blocks was 10 minutes and 5 seconds. Even at this cost in time, checking for bad blocks is highly recommended.


Page 51 - Linux Press http://www.linuxpress.com

When the initialization is complete an inquiry box will ask if this partition should be mounted as the root file system ("/"). The first time through this step should be to create just such a root file system, so the answer should be yes. Additional partitions will be mounted on mount points within this root partition.

Step 6
After the first initialization step is complete, the main menu will be redrawn like:

Debian GNU/Linux Installation Main Menu
You've mounted you root filesystem. You may initialize and mount
additional file systems, or you may go on to install the
operating system kernel and the modules.

        Next       Install Operating System Kernel and Modules       
        Alternate  Initialize a Linux Partition                      
        Alternate1 Mount a Previously-Initialized Partition          
                                                               
        A          Configure the Keyboard                            
        B          Partition a Hard Disk                             
        C          Initialize and Activate a Swap Partition          
        D          Activate a Previously-Initialized Swap Partition  
        E          Do Without a Swap Partition                       
        F          Initialize a Linux Partition                      
        G          Mount a Previously-Initialized Partition          
        H          Un-Mount a Partition                              
        I          Install Operating System Kernel and Modules  


           OK            Cancel     

If there are still additional partitions to initialize and mount choose the Alternate selection as many times as is necessary to complete the partition initialization process on all desired partitions. (see the previous step)


Page 52 - Linux Press http://www.linuxpress.com

Once all of the desired partitions have been initialized and mounted it is time to choose Next, and install the operating system kernel and any modules that will be needed. Since the machine was booted from the boot/rescue disk, there is every likelihood that it is still in the drive. If it has been removed, find it as it will be needed shortly. First the installation medium must be chosen from the following dialogue box:

Debian GNU/Linux System Installation

Select Installation Medium 
Please select the medium you will use to install 
the system                                       
   
	/dev/fd0	First floppy drive              
	/dev/fd1	Second floppy drive             
        cdrom           CD-ROM drive                    
	harddisk	filesystem on the hard disk     
        mounted         already mounted filesystem      
   
   
           OK            Cancel              

At this point, unless it operates as a SCSI or ATAPI device, the cdrom can't work at this moment because the kernel doesn't have a driver for the CD-ROM drive yet. This is the same dialogue box that will be used later in the install when the option will work. That's why it is displayed at this time. Under the current


Page 53 - Linux Press http://www.linuxpress.com

installation conditions we must rely on the floppy disk since there are no "pre-existing" file systems that could contain the image files needed for a Zero Floppy Installation (see page 75). Remember that this discussion is focused on a bare machine. Your mileage may vary.

Normally the first floppy will be the correct choice for this operation. If there is need to use the second one instead, that choice is also available. Once a drive is chosen, instructions will ask that the Rescue Floppy be placed in that drive. Insert the disk and press enter. The message "Installing from the rescue floppy ..." will hang on the top of the screen until the copy is completed. Next the Drivers Floppy will be requested. Replace the boot/rescue floppy with the drivers floppy and press enter. A similar "Installing from the drivers floppy ..." message lasts for the period of the transfer, after which, if there have been no failures of the floppy disk medium during this step in the installation, the main menu presents one, single, option:

Next Configure Device Driver Modules

As this has been the first opportunity for a disk failure since the kernel was booted off of the boot/rescue disk, such a failure during this step will almost certainly require the reconstruction of the offending floppy disk. In addition, although the installation software recovers, several steps may need to be repeated to get back to this configuration step. All of the partition work and file system creation will survive, but the swap partition will probably need to be "activated" again. Barring severe har dware problems, like broken floppy drives and other tricks "Murphy" uses to turn perfectly good things into useless junk, a repaired floppy will allow this step to complete successfully.

(On second thought, entropy turns working machines to junk. Murphy is that invisible elf sitting on my shoulder laughing at me for what I have forgotten to say. Take care that he isn't sitting on your shoulder during this installation.)


Page 54 - Linux Press http://www.linuxpress.com

Step 7
Configuring device drivers can be a crucial step in a floppy installation. If the hardware includes either a modem useful for connecting to an Internet Service Provider, or a CD-ROM drive supported by the current kernel, here is where their drivers are to be configured. If the connection is through an Ethernet card, very likely the driver is already built into the installation kernel. Some are not and will be found in the net section of the configuration menu. Upon successful installation of th ese drivers the source of the base system need no longer be the five floppy disks constructed earlier. If these options are not open, or not to be taken for some reason, this step need not be performed. Any of the included modules can be set up later by either editing the appropriate files or running modconf (as root, of course). (See Modules section)

Even if you do configure all of the necessary modules at this time, it may become desirable to edit /etc/modules and activate the "auto" line by removing the leading "#" character. This will allow modules to be loaded as needed and earlier in the boot up process than kerneld is normally running. Modules explicitly declared after the auto will be loaded at boot-up and never unloaded by kerneld until shutdown. This is useful in maintaining startup configuration on some drivers, most notably a serial dr iver with nonstandard interrupts.


Page 55 - Linux Press http://www.linuxpress.com

When this configuration option is chosen, the program modconf will display the following screen:

Select Category
 Modules are loadable device drivers. Please go through the menus 
 for each category and look for devices, network protocols, file systems,   
 etc. that you would like to have supported by your system. You should     
 not install modules for devices that aren't installed in your system,     
 as they will sometimes cause the system to pause for a long time while    
 it is searching for the device. Also, drivers for devices that you        
 don't have use memory that you could put to better use.                   
                                                                           
  Please select the category of modules.                                    
 
  Exit    	Finished with modules. Return to previous menu.               

  block  	Disks and disk-like devices.                                   
  cdrom  	Device drivers for CD-ROM drivers.                             
  fs     	Drivers that allow many different file systems to be accessed.  
  ipv4   	Internet Protocol drivers.                                    
  misc   	Drivers that don't fit in the other categories.                
  net    	Drivers for network interface cards and network protocols.    
  scsi   	Drivers for SCSI controller cards and classes of SCSI devices. 


                  OK            Cancel                           

Work through the menu selecting and installing those modules that will be useful to the new system, as well as those that may aid in the installation process. Once all necessary modules have been added to the system, choose Exit and return to the main menu.


Page 56 - Linux Press http://www.linuxpress.com

Step 8
It is now time to "Configure the Network". This option is presented at this time to provide the possibility of installing the Base System over an Ethernet card or even a dial up connection. Even if the base system is to be installed from floppy disk, it is probably a good idea to go through this section anyway, as it creates files that will be of use later if networking is desired. Whether you are going to use networking or not, at least answer the first question posed by this option. Selecting this option presents the following dialogue box:

Debian GNU/Linux System Installation


	                Please enter your Host name  
  Every Debian system has a name - even if it is not on a network. 
  This name is called its hostname. You should now specify a 
  hostname for your new system.                                
                                                                         
   If your system is going to be on a network, you should talk to the     
   administrator of the network before you choose a hostname. If not,     
   you may choose any name you like.                                      
                                                                          
   The hostname must not contain dots, and you must not append the domain      	   
   name here.                                                             
                                                                        
   If you can't think of a hostname for your new system, you may press    
    to use the default hostname of debian.                         
   
      debian_                                                              
   
  
                             OK     Cancel                         

Whether or not the machine is going to be on a network, a name should be entered here. Simply pressing the carriage return will assign the hostname debian. If you


Page 57 - Linux Press http://www.linuxpress.com

want a more distinctive name for your system, replace the string displayed with one of your own choosing. It could even be your own name! The author's machine is named dwarf. The only requirement of a name is that it not contain the "." (dot) character. (Along with the fact that it probably can't be a bazillion characters long...shorter is better here.)

Since the name can be changed by editing /etc/hostname, there is no need to expend much effort at this point in the installation. Whatever is chosen with the press of the enter key, the following question is then asked:

Debian GNU/Linux System Installation

Use a Network?
Is your system connected to a network? 
           
If you decide to use a network you must ask your  
network administrator for an IP address and the   
network parameters !                               
          
          Yes      No                  

Even if the machine will never be configured on a network, or even if the information asked for in this section is not known, the answer here should still be "Yes"!


Page 58 - Linux Press http://www.linuxpress.com

There are three files that are created during this process that will be of interest later. The first of these files, the /etc/hosts file, provides functionality even on machines not connected to the net. Multi-user servers will use the dummy network driver and the address found in the first line of /etc/hosts (127.0.0.1 localhost) which provides the routing when a user executes ftp localhost.

After selecting the following selection screen will be displayed:

Debian GNU/Linux System Installation

                Please enter your Domain name 
As with individual systems, every network has a name.  
This name is called the domain name. Please enter your 
Domain Name.                                           
       
_      
      
       
                    OK            Cancel                

If the machine is being connected to an Internet provider using PPP and a fixed IP address, this will usually be the providers domain name. If the machine is part of a LAN via Ethernet, the domain name will be that of the server, most likely. Discuss


Page 59 - Linux Press http://www.linuxpress.com

this issue with the LAN administrator to get it right, but at the moment any place holder value will do. Together with the IP address requested later, this domain name and the host name will be used to make a second entry in /etc/hosts that looks like:

IP address host name.domain name host name

In addition to the /etc/hosts file, this information, and what has yet to be entered this step, will be used to construct the files /etc/resolv.conf and /etc/init.d/networks. See the section on Networking (page 143) for details on these files and other information needed for this section. After entry of a domain name, the host name and domain name are combined to create the "full name" of the system (debian.domainname.com). A simple request box will ask if the name presented is correct. If the answer is no, then an opportunity will be presented to do the last two dialogues over.

If the answer is yes, then a new entry box will be presented requesting the IP address of this system. The value presented is 192.168.1.1, and while this is very unlikely to be the correct IP address for this machine, it is an example of what an IP address looks like. It can be used as a place holder until the correct value can be determined, or it can be overwritten with the correct value.


Page 60 - Linux Press http://www.linuxpress.com

In either case the enter key will move on to the question of the net mask, which is used if this machine will have a sub-net. The value presented (255.255.255.0) is most likely to be the appropriate value, but your network administrator would be able to tell you if it was not. Entering a value for net mask displays the following screen:

Debian GNU/Linux System Installation
Choose Broadcast Address
What is your IP broadcast address?                                  
Unless your network has very specific needs choose the first option 
     
	192.168.1.255	Last bits set to one                    
	192.168.1.0	Last bits set to zero                    
	another 	choose another broadcast address        
    
   
                     OK     Cancel                       


Page 61 - Linux Press http://www.linuxpress.com

As with the other information requests, enter the value if known, otherwise this can wait until after the installation. Selecting will present the next question:

Debian GNU/Linux System Installation

 Is there a Gateway?
A gateway system is one that connects your network to    
other networks such as your company wide-area net or the 
Internet. Is there a gateway system on your network?     

               Yes              No  


Page 62 - Linux Press http://www.linuxpress.com

Again, you may answer here with no ill consequences, only to be asked for your "IP gateway address". The default of 192.168.1.1 may be accepted or the correct value entered, if it is known, which will deliver the following to the screen:

Debian GNU/Linux System Installation
Locate DNS Server 
	Where is the DNS (Domain Name Service) server              
 
	1	System hostname will be its own DNS server.
	2	Another system will be the DNS server for system   
	3	There will be no DNS server.                             
   
   
                         OK     Cancel                       


Page 63 - Linux Press http://www.linuxpress.com

The values determined here will be used to make DNS entries in /etc/resolv.conf. If option 2 is chosen the actual IP addresses will be requested. Option 1 uses the IP address supplied earlier in this step and, of course, option 3 doesn't need an IP address.

The final screen:

Debian GNU/Linux System Installation
       Please Confirm
	IP Address:	        192.168.1.1    
	Netmask:	        255.255.255.0  
	Network Address:	192.168.1.0    
	Broadcast Address:	192..168.1.0    
	Gateway Address:	192.168.1.1    
	Nameserver Addresses:	127.0.0.1      
                                              
	Correct?

                   Yes      No   


Page 64 - Linux Press http://www.linuxpress.com

is presented with all the values entered during this step in the installation. If there are any incorrect values presented here, they can be corrected by choosing , otherwise selecting will move the installation along to the next final network configuration screen:

Debian GNU/Linux System Installation
                                Choose network interface
  Choose the type of your primary network interface.                        
  If you have more than one network interface, choose the one 
  that you will need for installing Debian (via NFS or FTP)                               

                 eth0    	Ethernet or Fast Ethernet                    
                 tr0     	Token Ring                                    
                 ppp     	PPP                                           
                 slip    	SLIP                                          
                 plip    	PLIP                                         
                 pcmcia  	PCMCIA Ethernet or Token Ring                 


                          OK     Cancel                           

Make the choice from this list based on the later needs of the installation and the type of interface available. If you have configured the modules correctly and have an Ethernet card (or token ring) you will be able to establish a connection right away. If you want to use PPP, SLIP or PLIP you will need to do some additional setup to establish a net connection. See the section on PPP for more details.


Page 65 - Linux Press http://www.linuxpress.com

Step 9
Upon returning to the main menu the "Next" option will be, Install The Base System. If none of the other installation options are available, and floppies are the only recourse, here is where those floppies that were marked base-1 through base-5, selecting "Next" will present the previously seen selection screen:

Debian GNU/Linux System Installation
Select Installation Medium
Please select the medium you will use to install 
the system                                       
   
	/dev/fd0	First floppy drive              
	/dev/fd1	Second floppy drive             
        cdrom           CD-ROM drive                    
	harddisk	filesystem on the hard disk     
        mounted         already mounted filesystem      
        nfs             NFS (network filesystem)        
  

               OK            Cancel

Notice there is an additional entry available now. Once the network has been configured, the Ethernet connection can be used for NFS installation. The Base System can be installed this way or from another medium. Reminder: See section 2.5 if this is a CD-ROM install.


Page 66 - Linux Press http://www.linuxpress.com

If none of the others are appropriate, selecting the correct floppy drive will produce the prompt: "Please insert disk 1 and press ENTER.". You will be prompted for each succeeding disk and provided a progress report as it copies the contents of the disk onto the new partition, until all five disks have been copied. If any of the disks fail (an occurrence that does happen sometimes), the installation program will restart, and may loose such things as the swap partition, and sometimes, even the root part ition will be unmounted. Follow the steps that are indicated in next to get back to "Install the Base System". Of course, you will need to rebuild the offending diskette. One way or the other, when the base disks have been copied and unpacked successfully the installation program will return to the main menu and the next step.


Page 67 - Linux Press http://www.linuxpress.com

Step 10
Time zone configuration is the principle task in this step. Choosing the Next option of "Configure the Base System" will display:

Timezone setup... (Current directory: /target/usr/lib/zoneinfo)           
                                                                           
Please select the appropriate location in the world in which you          
live.  A name followed by a slash (/) indicates that this option  
leads to further options, such as specific sections of a country.         
                                                                            
You may enter ".." to go up a level.                                      
                                                                           
----------------------------------------------------------------
right/     Africa/   Atlantic/  Indian/    Antarctica/ Asia/     
Australia/ Pacific/  Europe/    WET        CDT         MET       
EET        America/  Etc/       Factory    SystemV/    Arctic/   
EST5EDT    CST6CDT   MST7MDT    PST8PDT    EST         MST
HST        US/       Brazil/    Canada/    Chile/      Cuba      
Egypt      Eire      GB         GMT        GMT+0       GMT-0     
GMT0       Greenwich HongKong   Iceland    Iran        Israel    
Jamaica    Japan     Kwajalein  Libya      Mexico/     Navajo     
NZ         NZ-CHAT   PRC        Poland     Portugal    ROC       
ROK        Singapore Turkey     UCT        UTC         Universal 
W-SU       Zulu      localtime@ posixrules iso3166.tab Zone.tab  
-----------------------------------------------------------------
                                                                           
 Which?                                                                    

The object is to choose the time zone that represents your version of local time. There are several ways to get to the same, or seemingly same, time zone setup. The results will not always be as expected.

For example: If you are in the Eastern time zone in the United States, you would be tempted to choose the US section and the Eastern time zone within that section. Things will work fine until a daylight savings time change, at which point


Page 68 - Linux Press http://www.linuxpress.com

the clock will report the time incorrectly. In fact, the correct choice is available on the outer menu as EST5EDT. All of the US time zones are represented in the above list. You might also have been tempted to choose America, but all you will find there is a list of cities in north, central and south America. The simple rule of thumb is: Look over the outer menu very carefully. If you don't find what you need there, then look at the lower level choices.

Whatever you choose at this time can be changed later by running tzconfig.

The last question asked in this step is, "Is your system clock set to GMT (y/n) [y]?". Unix system clocks are generally set to Greenwich Mean Time, also known as Universal Time, and use time zone files to display the local time. If this machine is to be set up in this fashion then the answer is yes. Most MS-DOS machines set their clocks to "local time" for convenience. If you wish to maintain this compatibility with a DOS system then the proper answer is "no".

Step 11
After configuring the time zone, the main menu will now suggest "Make Linux Bootable Directly From Hard Disk", with the alternatives: "Make a Boot Floppy" and "Reboot the System". Even if you choose to accept the first option, you should make a boot floppy as well. This gives an alternative method of booting the machine in a crisis. If the LILO configuration does not work as expected, there is still a reliable way to boot up the new system. The floppy can thus be used until the L ILO configuration can be fixed.

Unless you wish to boot multiple operating systems and use loadlin, or another boot loader, then you should choose this option. It will install LILO as the boot manager and make the system bootable. There are many things that may still make the system unbootable with LILO. For instance, if the system is installed on a second hard disk device, where the first device is bootable, LILO will not be properly installed and the system will continue to boot the first drive. Re-configuring LILO on the first drive wi ll fix the problem, but this is not always possible. If the first drive boots Windows 95, then LILO can not be placed on the boot sector for that drive, '95 does not allow such behavior. Loadlin is the solution for this particular problem.


Page 69 - Linux Press http://www.linuxpress.com

After making Linux bootable the menu may still present the same options that it did before, but now the correct choice is "Make a Boot Floppy". You will need to insert a blank floppy into the drive. The drive will be formatted and a kernel installed and made bootable. On successful completion this will have produced a floppy that can be used to reboot the system.

Step 12
After building a boot floppy the only thing left to do for a base install is "Reboot The System". The new system can be booted from the hard disk (assuming that LILO installed correctly) or using the new boot floppy. The DOS partition, if there is one, can be rebooted now and a loadlin installation can be set up if that is the desired boot path. No matter which method will be used, the final step in the base installation is "Reboot The System"!

The base system installation is now complete and the rest of the system can be installed from various sources using a selection of methods.

The first time the new system boots up a request for a "root" password will be displayed, after which the creation of a user account and password will be demanded. There is no choice in this matter. A password for root and a user account are required before the next step.

Once this has been done the script will startup dselect to continue the installation. If you are going to use ppp to connect to the net for the rest of the installation, you will wish to switch to a different Virtual Console and set up the net link first before continuing. For more information on how to continue the installation using dselect see the section on Dselect (page 115).


Page 70 - Linux Press http://www.linuxpress.com

2.5 Two Floppies and a CD

If the target machine has a CD-ROM device mounted on a SCSI interface supported by the kernel, you will only need the boot/rescue floppy to boot a "bare machine". This means that with the Custom CD supplied with the print version of this book, and one floppy containing the image found in the file resc1440.bin, Debian can be installed on a machine with no existing operating system.

If the CD-ROM device is not connected to the machine through a SCSI connection the second, drivers disk, will be required before data can be obtained from the CD-ROM.

Starting with the boot/rescue floppy and the drivers floppy, the installation


Page 71 - Linux Press http://www.linuxpress.com

proceeds just like a normal floppy installation until it comes time to "Install the Base System". (Step 9) Instead of choosing a floppy drive from the installation medium selection screen, choose the cdrom option. Choosing this option will present the following dialogue box:

Debian GNU/Linux System Installation
Select CD interface type 
Choose the type of your CD interface                  

	/dev/scd0	SCSI                                                  
	/dev/hda	ATAPI (IDE), first drive on the primary controller    
	/dev/hdb	ATAPI (IDE), second drive on the primary controller   
	/dev/hdc	ATAPI (IDE), first drive on the secondary controller  
	/dev/hdd	ATAPI (IDE), second drive on the secondary controller
	/dev/hde	ATAPI (IDE), first drive on the third controller      
	/dev/hdf 	ATAPI (IDE), second drive on the third controller     
	proprietary	proprietary CD-ROM interface                          


                     OK            Cancel

It should be fairly obvious which of the above choices is correct. If the CD-ROM device is neither a SCSI device, nor an ATAPI drive, it must be one of the proprietary drives. If this is the case, the driver for it was installed during the configure device drivers step of the installation. For instance, if the device is a Sound Blaster Pro with a Creative Labs CD-ROM, the proper module to configure was the sbpcd driver. When this driver was installed earlier, the installation software


Page 72 - Linux Press http://www.linuxpress.com

made a link to it from /dev/cdrom. When the "proprietary" option is chosen this device is used to mount the CD-ROM.

Once the CD-ROM is mounted, the following selections appear on the screen:

Debian GNU/Linux System Installation

                          Select Base Archive file 
Please select the directory containing a file base1_3.tgz                   
that you will use to install the Base System.                              
Unless you really know what you need choose the default.                    

          default       The default stable Archive                                    
          list          Choose from a list of all Base Archive Files                  
          manually      Enter the directory containing the 
          Base Archive  File manually 

                                                                             

                             OK          Cancel

With the Custom CD any of the options will produce the desired result. The list option is not recommended because of the use of find and the length of time it takes to come up with something obscure. Either the default or the manually options will produce the desired result with the Custom CD. If manually is chosen, accept the path of the mount point with no additions, and the base system will install. The Official CD will work with no assistance only in the default option. If


Page 73 - Linux Press http://www.linuxpress.com

you should choose manually by mistake, the path to add to /instmnt/(the mount point) is, stable/disks-i386/current. This is where the base1_3.tgz file will be found in any "complete" archives of the Debian distribution.

The installation program, when pointed at the base1_3.tgz file, will install it. This will have the same result as the 5 floppies but with far less work on both human and machine.

The remainder of the base installation proceeds as described in the Floppy Installation section (page 67, Step 10). The rest of the installation may now proceed.


Page 74 - Linux Press http://www.linuxpress.com


Page 75 - Linux Press http://www.linuxpress.com

2.6 Zero Floppy Installation

2.6.1 What you will need

The "Official CD" and the "Custom CD" each have the required files for this installation method. They are found in stable/disk-i386/current on these CDs. For that matter, these files are also available at most ftp sites that archive Debian. Information on FTP sites and CD vendors can be found at the Debian Web site: http://www.debian.org. Other useful information is available there as well. Of course, the print version of this book, provides a Custom CD that contains these archive. Once you decide where to get them, you will need the following:

linux

The kernel image used on the boot disk

root.bin

The root file system from the boot disk

base1_x.tgz

Base file system found on 4 base disks

drv1440.bin

Image file containing kernel modules

resc1440.bin

Rescue disk used to obtain the kernel image



One other file, not found in the standard disk set, must be acquired for this method to work. This file is the program, loadlin.exe and is usually found in the tools directory of a Debian archive. You will also find this program at most Internet sites, such as sunsite.unc.edu. For best results, get version 1.6 or better. All of these files are located in the upper directory level of the Custom CD delivered with the print version of this book.

In order to do an installation without floppies, a bootable DOS partition with at least 10 Megabytes of disk space will be required.


Page 76 - Linux Press http://www.linuxpress.com

Using the Custom CD, simply place the CD in the CD-ROM drive, change to the drive (if the drive is D:, simply type D: ) and, assuming the DOS drive is C:, enter START and select the Zero Floppy Install Option. Several files will be transferred to the DOS drive and then the kernel starts- up the installation software . It is as simple as that.

2.6.2 Getting Started

Without the help from the Custom CD it becomes necessary to put the required files on the root directory of the DOS partition the hard way, using the copy command. After the files have been copied enter "cd \". Then enter the following line:

loadlin linux root=/dev/ram initrd=root.bin

During the boot process, the kernel spews message after message describing the current step in the boot process. Many of these messages scroll off the screen before they can be read. This is not a cause for concern, unless the kernel fails to finish the boot process. If this happens, the message left hanging on the screen (assuming that the system doesn't blank the screen in its terror) is of some importance when seeking assistance with the problem. Those messages sent to the console during this period can typically be recalled with a utility called dmesg. You will not find this utility on the rescue disk because of the severe space constraints imposed by the boot floppy, but it will be available on the system once it has been installed. After this usual, long list of boot messages, the first screen of the installation script is displayed.

2.6.3 Installation

Much of the installation process is the same here as it was in the Floppy Installation section (page 23). Steps 1 thru 5 are the same no matter how the installation is initiated. Before beginning these steps, the required files should be at the top level directory of the DOS partition, whether the Custom CD method placed them there or whether it was done "by hand".


Page 77 - Linux Press http://www.linuxpress.com

Files of future interest are; resc1440.bin, drv1440.bin, and base1_3.tgz. These files will be used in place of the floppies to install the kernel, the drivers, and the base system.

Execute the Install Operating System Kernel and Modules option from the main menu, as in step 6 of the floppy install. Now, however, choose the harddisk option.

Note that if the cdrom is connected to the system through a SCSI interface, that interface has been "built in" to the kernel and the CD-ROM device will be accessible at this time. This makes the CD-ROM equivalent to a hard disk for this discussion. If a CD-ROM will be used, it should be understood that statements about the hard disk apply to the CD-ROM as well, even though only the hard disk will be mentioned from this point on.

If the DOS partition, containing the required files, has already been mounted, choose the "mounted" option instead. The choices here are much the same as those found within the "harddisk" option.

Selecting the "harddisk" option presents a list of unmounted partitions. Choose the DOS partition that contains the necessary files, and it will be mounted. The "Select Base Archive file" dialogue box appears next. It offers two options:

list - Choose from a list of all Base Archive Files ;
manually - Enter the directory containing the Base Archive File manually.

For best results choose "manually". The request for the "Base Archive directory" will display the "mount point" of the DOS partition. This provides an opportunity to add any additional path information that will locate the desired files.

If these directions have been followed so far, the required files are no further away than the mount point, and no additional information is required. Simply press enter to "show the way" to the requisite files. Note that, up until now, this process could be canceled at any step.


Page 78 - Linux Press http://www.linuxpress.com

Once this "path" is accepted with , the process will progress to completion. The installation program will now proceed to install the kernel and the modules from the image files found on the DOS partition.

Configure Device Driver Modules just as described in the installing from floppies section. Once you have all the drivers necessary for your hardware, continue with step 8, "Configure the Network" which is followed by "Install the Base System".

Now, instead of feeding floppies, one by one, into the machine to install the base system, the correct choice is, again, harddisk, as the installation medium. Proceed along the same path as with the kernel and drivers and the base1_3.tgz file transferred to the DOS partition will be installed on the new root file system.

The remaining steps, 10 thru 12, configure the base system, make Linux bootable from the hard disk, make a boot floppy and reboot the system. You now have the base system installed and can proceed with the dselect installation of the rest of your new system. You also have enough software on your dos partition to boot Linux. If your Debian system is on /dev/hda2, then you can boot your new system with:

loadlin linux root=/dev/hda2

When the system boots for the first time, you must give a password for root and declare a user account as well. After this, the installation program brings up dselect.

Note: Although this procedure is described using loadlin and a DOS partition in place of a floppy drive, it is quite clear that LILO could just as easily be used from an existing, non- Debian, Linux system. So, installation of a Debian system from another Linux machine could be done without floppies as well.


Page 79 - Linux Press http://www.linuxpress.com

2.7 Forcing Hardware Detection

Debian is moving to a fully modular kernel in the installation phase. This means that the installer gets to choose which drivers to install and which to leave out. This creates far fewer hardware collisions, when compared to the previous method of having all the device drivers built into the kernel. Even so, for one reason or another, your hardware may not be configured the way the driver software expects it to be. Just exactly what your hardware and driver may need to see will require a little research on your part.

For instance, if you have a Sound Blaster driving a Creative labs CD drive you are probably going to use the sbpcd driver. The information provided in the kernel source is found in Documentation/cdrom/sbpcd and includes the following:

"...the setup may be done during boot time
(via the "kernel command line" or "LILO option"):
sbpcd=0x320,LaserMate
or
sbpcd=0x230,SoundBlaster
or
..."

Once you have a full system installed you will find a complete list of boot prompt parameters in /usr/doc/HOWTO/BootPrompt-HOWTO.gz. For the most up-to-date list of parameters for a given device driver, look at the source code for that driver. Within the first 100 lines there will be a set of comments detailing the various parameters that can be passed to this particular device driver. So, if you are


Page 80 - Linux Press http://www.linuxpress.com

looking for information on the Adaptec 1542 SCSI driver, you would look in Linux/drivers/scsi for the file aha1542.c and read the comments you find there. Unless you have an alternated Linux system where these files can be found, none of this is accessible from a "base system".

The parameters get passed to the kernel by the boot loader, which will often be LILO or LOADLIN.EXE. These loaders pass the information provided on the command line to the kernel for its use.

2.7.1 LILO

LILO is the most commonly used boot loader in the Linux community. LILO can boot various operating systems including, DOS, OS/2, Linux, FreeBSD, etc. For passing boot arguments to the Kernel, LILO uses the append= command.

2.7.2 Loadlin

Loadlin is the other commonly used boot loader. As it is a DOS program, its primary use is in booting up Linux from a DOS partition. One very good reason for booting in this fashion is to deal with cards that need to be configured by the DOS driver before they can be used by Linux. Since no reset occurs in this situation, the card stays configured when Linux boots, thus keeping its settings intact. Loadlin will pass various parameters on to the kernel, such as root=/dev/hdb1.

2.7.3 rdev

Several boot parameters are actually stored in the kernel itself. The program rdev is used to set these parameters. They include: root device, swap device, RAM disk size, video mode, and the readonly/readwrite flag for the root device. For details of its use type rdev -h, or look at the man page.


Page 81 - Linux Press http://www.linuxpress.com

2.7.4 Argument Format

Most boot arguments follow the format:

keyword[=value1][,value2]...[,value11]

Note: The limit of 11 arguments is an actual limit. If you need to pass more than 11 arguments to a given keyword, you can reuse the keyword with the next 11 arguments and they will all be given to the kernel. Each keyword group is separated by a space on the command line, allowing multiple keywords to be used.

2.7.5 Usage

The first thing that the kernel does with the arguments that it receives is to search the arguments for the special keywords: root=, ro, rw, and debug.

Next the list of setup functions registered with the kernel are checked to see if the keyword is found.

For instance the aha1542 keyword would cause a search for aha1542_set-up(). When found by the kernel the setup routine is passed the parameters listed after the keyword and, hopefully, the device will configure correctly.

Any keyword of the form keyword=argument that is not found in the setup functions list is considered an environment variable and will result in the setting of that variable by the kernel.

Any arguments that remain are passed to process one, which is usually the init program. The most common of these is "single" which tells init to go into single user mode. The man page for init will inform you of just what arguments it will accept (See Appendix 7 for keywords).


Page 82 - Linux Press http://www.linuxpress.com


Page 83 - Linux Press http://www.linuxpress.com

2.9 Installation Via FTP

2.9.1 General

No matter which of the following FTP methods you use, you will first have to locate an FTP site to use. The primary FTP site for Debian is ftp.debian.org. If this site is overloaded it will provide you with a list of alternatives you can use. Once you have decided which FTP site to use you are ready to begin.


Page 84 - Linux Press http://www.linuxpress.com

2.9.2 Straight FTP

If you have enough disk space the most straight forward FTP method is to download all of stable/binary-i386 and stable/disks-i386 (non-intel architectures are available, but are in beta at the moment). If you are downloading onto a DOS partition (using Windows FTP) you will want to use the stable/msdos-i386 directories instead of stable/binary-i386 so that the file names will not get mangled. It doesn't damage the package to have the name mangled, but it does make it fail to match the P ackages file which will cause problems later on.

If you don't have a DOS machine to do the download with, but can get a valid disk set on floppies, you can access the net once you have installed the base system. The base system comes with ppp and ftp as well as telnet, so you should be able to "get on the net" with just the base system installed. PPP setup; Once you are at this stage, the various options are all available. If you have Ethernet connection to the net, you will not even need to set up ppp.


Page 85 - Linux Press http://www.linuxpress.com

Once you have the base system installed and the archive downloaded, you can either use dselect to do an installation of the complete system (or choose some subset that you like), install packages one at a time using dpkg -i, or try out dftp. Although you will need to download and install this first, as it doesn't come with the base system.

2.9.3 Installation using dftp

Dftp is a perl program for keeping Debian systems up-to-date with an FTP site, or an NFS mount, and it also works on a CD, so you could use it on a local archive as well. To use this program for initial installation you will first need to download it into your new base system. You will also need the full perl package (what is provided on the base disks is a stripped down version of perl). Install these two packages with:

dpkg -i /path-to-packagefile/package-version.deb

and read the man page on dftp.

Once dftp logs onto the FTP site it will compare the files available on the site with those already installed and create a list of "available" packages, in category order, to make selection easier. Dftp will then present you with the list and let you choose which package you wish to install. It will then go out to the FTP site (or wherever you have set it to) and fetch the files you requested, if necessary. After acquiring the files, dftp checks them for correctness and installs them. < /H4>

2.9.4 Dselect FTP method

Dselect also has an FTP installation method. Setting the access method to FTP will set dselect to install via this method and the rest of the installation proceeds as you would with any other dselect method. See the section on dselect for more specific information on this installation method.


Page 85 - Linux Press http://www.linuxpress.com

2.9.5 Installation via NFS

Starting with release 1.3, Debian provides for NFS installation. If you have an Ethernet connection to a net with the Debian archive on an NFS mountable device, you can do the whole installation with only the rescue disk and the driver disk. If you don't have an Ethernet connection, but do have a PPP connection to the net, you can still do the major part of the installation via NFS after installation of the base system.

2.9.6 Ethernet connected install

If the machine you intend to install Debian on has an Ethernet connection to a network containing an NFS mountable device with an archive of the distribution, you will need a rescue disk and a driver disk to perform the installation. After you boot the disk and enter the installation program it will be suggested that you configure the keyboard, then create, initialize and mount a swap device, then create, initialize and mount the root partition.

You will next, install the kernel from your rescue disk (choosing the floppy device as the installation medium) and then install and configure the modules you need to access the devices in your machine. This will, of course include the particular networking card your machine uses for Ethernet access. Don't forget to include drivers for any scsi cards your system may use to get to drives, and if you have any peculiar CD setup this is the place to configure it.

The next option is to install the base system. When choosing a device you may choose NSF here, as you are all set to use it. Once the nfs mount is established the base will be extracted from base1_3.tgz and installed on the root partition. Once this installation is complete and the configuration step is finished you can either make a boot floppy or make your system LILO bootable. At this point, when you boot the system, you will be asked to give root a password and create a user account and password, follow ed by running dselect. There is an nsf mount option in the Access Method section of the menu and, once the mount is successfully established, you can go through the rest of the installation via this method.


Page 86 - Linux Press http://www.linuxpress.com

PPP connected installation

Without an Ethernet connection to the net there will be no NFS capabilities until the base system has been installed, so you will need a full set of installation floppies unless you have a bootable DOS partition and can do the Zero Floppy Installation.

Once the base system has been installed you will need to do some setup to get ppp started. See the section on PPP setup (page 149) for more details. Once the ppp connection has been established, either the NFS volume is mounted, or the installation/upgrade is performed using dselect, choosing the NFS access method. If the NFS volume is already mounted when dselect is run, then the "mounted" access method will work just fine.

2.9.8 Installation from an MS-DOS Partition

If you have an MS-DOS partition with about 500 Megabytes of space available you will be able to install the complete system from this partition. You will need some method of downloading the archive from the Internet. Windows 3.1 with Trumpet Winsock and an FTP client (both trumpet and the FTP client are available on the Internet, and many ISPs provide them to new users as tools for getting hooked up).


Page 87 - Linux Press http://www.linuxpress.com

********************* WARNING WARNING WARNING *********************

When downloading files from the archive using an MS-DOS file system as the storage media, ALWAYS download from the msdos-i386 directory tree. This will keep the file names in the Packages file consistent with the file names found in the directory and dselect will be much happier. Note: It is not important what the file name ends up as far as dpkg is concerned, since this tool looks into the file to see the package name and other information. When using dselect, however, the file names in the Packages file m ust match those in the archives, so use the msdos-i386 tree and get your Packages file from that same tree, you will have more success.

********************************* END WARNING ***********************************

So, Step one is: Download the msdos-i386 tree completely, paying special attention to getting a Packages file that is up-to-date (This is not always possible, and is the first available point of failure. Having an up-to-date Packages file is essential for a correct dselect installation)

Step two: Download the disks-i386 tree "beside" it. Note that, the file names in this directory have been very carefully held within the 8.3 constraints of the DOS file system.

Step three: Read the section on "Zero Floppy Installation" and copy the required files from the disks-i386 directory, into the root directory and install the base system just as described in the Zero Floppy Installation section (page 75).


Page 88 - Linux Press http://www.linuxpress.com

Step four: Once a base system has been installed that can reboot the new system, the normal root password and user account get created followed by dselect. Choose the harddisk access method in dselect and give the device name for your DOS partition, typically /dev/hda1. When prompted for the path to the archive, reply "none". Then when prompted where the binary packages can be found give the path /... where ... is the directory, on the DOS partition, where you chose to place the binary arc hive. This archive is divided into a series of subdirectories, starting with admin, base, comm, etc... and each containing .deb files that will be used to install the binary packages.

After setting up the access method the next option is to update the list of available packages. This option should be selected at least once whenever a new access method is started, and will bring the list of available packages up to date with the Packages file on the "current" archive.

At this point, what happens next depends on what kind of installation is being performed. If you want only the "standard" packages (and higher priority as well) then the select phase can be skipped. Dselect defaults to installing the standard system. If you want more than this, then enter the select menu option and find the packages you wish to add, selecting them for installation at your choice. See the section on Dselect (page 115) for more details of its operation.


Page 89 - Linux Press http://www.linuxpress.com

2.9.9 Boot Managers supporting Multiple Operating Systems

LILO is the default "boot manager" for most Linux systems. Debian is no different in this, although there is no requirement that LILO be used. There are any number of "good" boot managers on the market. If you are using one of these and wish to continue doing so, read the documentation that came with your boot manager very carefully. This section will cover the use of LILO and LOADLIN.EXE and will give a brief description of SYSLINUX.

LILO

This boot loader is delivered with Debian as the default and is a very versatile program. Many of the problems experienced with this loader are related to improper configuration, so read all the documentation carefully.

LOADLIN.EXE

This boot loader requires a dos partition as the normal boot path for the machine. That is, without the execution of loadlin the system would normally boot up in dos. Loadlin will reside on this partition even though the Linux root partition might be another device but certainly may be another partition.

The only two files that will reside on the dos partition are loadlin.exe and a file containing the kernel image (normally vmlinuz, but can be named anything). In order to get a choice between dos and linux the best method uses the menu capability of config.sys to provide optional operating system execution.


Page 90 - Linux Press http://www.linuxpress.com

In the following examples the section called is the section of the file that would exist if only dos were to be installed and will vary from machine to machine. It is just what is on the DOS machine before you begin installation of Linux, so simply insert that into the following and it will work. The assumption is that the kernel image and loadlin.exe have been placed in /linux as their subdirectory.

config.sys:
[Menu]
menuitem=Linux, Linux 2.0.29
menuitem=DOS, DOS/Windows
[DOS]

[Linux]

autoexec.bat:

cd \linux
goto %config%

:DOS
cd \


goto End

:Linux
loadlinux vmlinuz root=/dev/hda2
goto End
:End

These two files will provide you with the means to boot either your DOS partition or your Linux partition. A menu is presented at boot, providing the two choices: Linux 2.0.29 and DOS/Windows.


Page 91 - Linux Press http://www.linuxpress.com

SYSLINUX

This boot loader is primarily used by Debian to build boot floppies and is not intended for any more complex use. See /usr/doc/syslinux for further information on this boot loader.dpkg


Page 92 - Linux Press http://www.linuxpress.com


Page 93 - Linux Press http://www.linuxpress.com

3

dpkg The Package Management Tool

3.1 Introduction

Dpkg is the work horse of the Debian packaging system. When run with root privilege, it installs and removes groups of software files called packages. For developers it builds packages. For users, dpkg supplies information on specific packages, the contents of any particular package, or a list of the installed packages on the system. It does all of these package management tasks and more. It is used by dselect, another application discussed in Chapter 4, to perform the actual installation of packages. M any perl programs and scripts make calls to dpkg as part of their operation. A familiarity with dpkg provides solutions to many general packaging problems. When all other installation methods fail, dpkg is often capable of resolving the problem.

Dealing with the interdependence of packages is one of the major tasks of the Debian Package Management system. The dependency checking features of dpkg are well advanced when compared to other solutions available in the Linux community. What does this mean? It means that, if you use dpkg to attempt the installation of a package, and that package depends for its proper operation on


Page 94 - Linux Press http://www.linuxpress.com

another package that has not yet been installed, dpkg will complain and fail to install the new package. While this may, at first, seem to be a problem, it is actually the solution to a problem. It is far more unsatisfactory to be able to install a package that will not work after being installed. This dependency mechanism protects the system from such installations. As dpkg provides information on the package dependency that has not been satisfied, it is a straight forward task to install the dependent packages. Once the dependencies have been satisfied the package will install without problems, and run as expected afterwards. On some systems, one or more of these "dependent" packages might only be supplied by a "local" version of the software, unknown to the packaging system. There are ways to force dpkg to install the depending package even when it does not know that the dependency is satisfied. These options should be used with extreme care, and an understanding of the consequences. All of these inter dependency issues are dealt with by an interface to dpkg called dselect, described in Chapter 4.

The following discussion will cover all of the options that can be specified when using dpkg with the focus on how to use them. All of the information contained here is available in "sparse" form by dpkg -h |less. Each of those options will be described in as much detail as possible in this section.


Page 95 - Linux Press http://www.linuxpress.com

3.2 Running dpkg

Dpkg can be run at two levels. Many of the information features of dpkg are available to a simple user account. For tasks like removing and installing packages, root privilege is required. This root privilege may be obtained from tools like sudo or su if root login is undesirable. Scripts that use dpkg to install or remove packages must either be run with root privilege or have the facility to gain root access for the critical operations.

Sudo is provided as an alternative to logging is as root to obtain those privileges. Entries in the controlling file (/etc/sudoers) determine the commands that a given user can execute with root privilege. In this way, individuals or groups may be given access to areas of the system which are normally off limits.

What's with all this need for root access? Isn't it dangerous to use root for such a simple thing as package installation? Well, look at it from another point of view. Would you wish any user on your system to be able to install a potentially important package on your system? Those, hopefully few, people that are trusted to do the maintenance jobs that require root access are also those folks who should be trusted to install and remove packages.


Page 96 - Linux Press http://www.linuxpress.com


Page 97 - Linux Press http://www.linuxpress.com

3.3 Options Recognized by dpkg

3.3.1 Installation and Removal Options

-i | --install

This option is the standard way to install an individual package. The package file is the file name of the .deb file containing the package and must contain an adequate path to the file. So if you are currently in the directory /usr/debian and the archives are in /usr/debian/stable, you can either type:

dpkg -i ./stable/binary-i386/admin/cron_3.0pl1-38.deb

or:

dpkg -i /usr/debian/stable/binary-i386/admin/cron_3.0pl1-38.deb

with the same results. Either of the above lines will install the cron package on your system from the given location.

This is fine for installing packages one at a time, but an installation of all of the packages in a given directory tree is possible with the use of the -R option. This option causes dpkg to attempt installation of every .deb file that it finds while doing a recursive search of the declared directory tree. So, if you wanted to install the entire admin directory as given in the above example the command would look like:

dpkg -i -R /usr/debian/stable/binary-i386/admin


Page 98 - Linux Press http://www.linuxpress.com

Because of dependencies between packages this approach will not always (or even very often) be successful. It is very useful if you have a nonstandard archive that contain all the packages you wish to install and all of their dependent packages as well. Constructing such archives using ftp to download only those packages that you need, will create archives that dpkg can install as a group. If the packages are all found in the directory /usr/local/Debian/archive, then the command:

dpkg -i -R /usr/local/Debian/archive

will direct dpkg to install all the packages found there. Dpkg will install the packages in the order it finds them. This leaves open the possibility that dependencies will not be satisfied during the first pass. On large complex collections of packages this can potentially take several passes at the package files.

A more general solution is to break the installation phase into two steps. The first step unpacks the package file, while the second step configures the unpacked files. Just which files are unpacked, and where they are placed after unpacking, is determined by a collaboration between dpkg and the package.

--unpack package file

Sometimes, as when dependencies get in the way of installation, it is desirable to break the installation into two separate steps. The --unpack option performs the first step of the installation. Dpkg extracts files from the package and places them in their correct locations in the file system.

The configuration of the package, including the installation of configuration files known as conffiles, is postponed until a later time.

Like install, this option will accept the -R | --recursive option. This allows for unpacking all of the packages in the given directory tree. Following up on the


Page 99 - Linux Press http://www.linuxpress.com

example discussed for --install, a large collection of packages gets unpacked by a command like the following:

dpkg --unpack /usr/local/Debian/archive

After all the packages are unpacked, the installation can be completed by use of the --configure option.

--configure package name

This option is used in conjunction with the unpack option to complete the installation of a package. This option may involve scripts specific to the package that put the finishing touches on the package, or it may require that dpkg manage the installation of files known as conffiles.

Conffiles are files that have been declared by their package to require special handling during their installation. The passwd file, that holds the password information, is just such a file. Dpkg provides the opportunity to replace the current password file with a new one whenever the package is updated. In the case of passwd this is not desirable, while with other packages, such as mimetypes, it may be perfectly acceptable. If you do replace an old conffile with a new one, the old one is backed up with the added extension .dpkg-old. If you reject the new conf file a copy is provided with the extension .dpkg-dist. This allows for recovery from mistakes, but it also provides the material from which a composite conffile can be constructed. Thus, with the password example, if major changes happened to the structure of the password file, the new file is accepted and the old data edited into the new file. This produces a composite password file with the new changes combined with the old user information.


Page 100 - Linux Press http://www.linuxpress.com

This --configure option causes these remaining details of configuration to be completed for a given package. To configure all packages that are unpacked but not configured the -a | --pending option replaces the package name. To complete the installation of packages previously only unpacked, the command looks like:

dpkg --pending

and will complete the installation of any unpacked packages.

-r | --remove package name

This causes the package to be removed but leaves the conffiles installed. When a package will be removed, but later replaced, it is sometimes desirable to keep the conffile. An extreme example would be the passwd file. The password package could be successfully removed without damaging current system operations only if the passwd file remains intact after the package has been removed. This option provides that capability and allows for a packages removal and replacement without loss of the con ffile.

The -a | --pending option in place of a package name will cause dpkg to remove all packages marked for removal in the status file.

This "status" file looks much like a Packages file with the addition of a Status: field. Dselect, discussed in the next section, edits this file based on the choices selected via its interface. It is possible to edit the file /var/lib/dpkg/status, but it must be done carefully. As with all of the files in this "database" maintained by dpkg and dselect, disastrous results can come from improper changes. A reasonable amount of knowledge and understanding should be acquired before changes are attempted in these files.

Use the tools provided to manage the package system. Only the most dire of circumstances will warrant abandoning the tools in favor of modifying the files directly.


Page 101 - Linux Press http://www.linuxpress.com

--purge package name

Unlike remove, this option not only removes the package but also removes the conffiles associated with that package. In this way all traces of the package are eradicated from the system. This option also supports the -a | --pending option in place of the package name.

3.3.2 Available Packages File Management

Dpkg and dselect both use the available packages information found in the file /var/lib/dpkg/available. This file is constructed from the Packages file found in the binary, contrib, and non-free sections of these archives. There are several tools that dpkg provides, as options, for creating and managing this file.

--clear-avail

Dpkg will clear the available packages file of all information when given this option. There are times when the current file has been corrupted or otherwise broken in some fashion. This can happen for a number of reasons.

The most common reason is that it has gotten updated from a "broken" Packages file. In extreme cases, changes to the file format have resulted in files that would fail to work with the old version of dpkg. This requires that the new version be installed before the file can be fixed. Cleaning out the file allows the upgrade to go forward. Once completed the available file can again be updated with the new Packages format and the installation may progress unhindered. Executing the command:

dpkg --clear-avail

is a way to clean the slate and start over from scratch and will typically be followed by a --merge- avail command.


Page 102 - Linux Press http://www.linuxpress.com

-A | --avail package file

This will add the package information, found in the .deb file pointed to by package file, to the available file. So the command:

dpkg -A /usr/local/Debian/archive/joe_2.8-7.deb

Will add an entry to the available file if there is not an entry there already. If the package has an entry, the entry will be updated with the information about this version of the package.

--update-avail | --merge-avail Packages file

When the update-avail option is used, the old information about the packages in available is replaced by the package information contained in the Packages file. This file is found in the top of a binary distribution, so Packages files can be found in binary-i386/, contrib/, and non-free/. Issuing the command:

dpkg --update-avail /home/ftp/stable/binary-i386/Packages

will replace the old available file with the contents of the Packages file found in /home/ftp/stable/binary-i386. This option is intended for use when a new release archive is being used.

Merge-avail adds the Packages file from another binary tree to the list of available packages. The new information gets combined with the old list, adding information on new packages to the available file. The following commands:

dpkg --clear-avail
dpkg --merge-avail /home/ftp/stable/binary-i386/Packages
dpkg --merge-avail /home/ftp/contrib/Packages
dpkg --merge-avail /home/ftp/non-free/Packages

will create an available file that reflects all three of these areas of the distribution.


Page 103 - Linux Press http://www.linuxpress.com

3.3.3 Package System Information

-s | --status package name

This option delivers the status information contained in the entry for the package named from the status database. Much useful information about the package can be obtained from this display beside the installation status. Among them, the version of the package, its maintainer, and a brief description of the package. For instance, the command:

dpkg -s mc

will produce the output:

Package: mc
Status: install ok installed
Priority: optional
Section: utils
Maintainer: Fernando Alegre <alegre@mars.superlink.net
Version: 3.2.1-1
Depends: libc5, ncurses3.0, ncurses-base
Suggests: gpm
Conf files:
/etc/mc/mc.ext 6e672da6b5961ba9125e11824fcb2fef
/etc/mc/mc.ini d41d8cd98f00b204e9800998ecf8427e
/etc/mc/mc.lib fcdd319ffefa2a9cb4b7a5fa3ccad72d
/etc/mc/mc.menu 4be9e09f0728f993fc468b98db403be0

Description: Midnight Commander - A feature-rich full-screen file manager.
Midnight Commander is a feature-rich file manager. It has mouse support in a
Linux console and in an xterm. It started as a Norton Commander clone but now
it has new features on it's own.

It does not use libncurses, but it uses the terminfo database. Support for
XView and TCL/Tk is available, but it is still experimental. It is not
included in the current binary.


Page 104 - Linux Press http://www.linuxpress.com

--print-avail package name

Much the same information is provided by this option as by the status option.
While the status information is not presented here, the installed-size and
architecture and package size fields are given in this listing. Issuing the
command:

dpkg --print-avail mc

produces the following output:

Package: mc
Priority: optional
Section: utils
Installed-Size: 890
Maintainer: Fernando Alegre <alegre@debian.org
Architecture: i386
Version: 3.5.17-1
Depends: libc5 (= 5.4.0-0), libgpm1, ncurses-base
Suggests: gpm
Size: 371140
Description: Midnight Commander - A feature-rich full-screen file manager.
Midnight Commander is a feature- rich file manager. It has mouse support in a
Linux console and in an xterm. It started as a Norton Commander clone but now
it has new features on it's own. It does not use libncurses, but it uses the
terminfo database. Support for XView and TCL/Tk is available, but it is still
experimental. It is not included in the current binary.


Page 105 - Linux Press http://www.linuxpress.com

-L | --listfiles package name

All of the files that dpkg installed for are listed by this option. This does not, of course, include files created by installation scripts, as they are unknown to dpkg. Thus, the command:

dpkg -L mc

produces the following output:

/.
/usr
/usr/bin
/usr/bin/mcserv
/usr/bin/mc
/usr/lib
/usr/lib/mc
/usr/lib/mc/icons
/usr/lib/mc/bin
/usr/lib/mc/bin/create_vcs
/usr/lib/mc/bin/cons.saver
/usr/lib/mc/bin/mcfn_install
/usr/lib/mc/term
/usr/lib/mc/term/ansi.ti
/usr/lib/mc/term/linux.ti
/usr/lib/mc/term/vt100.ti
/usr/lib/mc/term/xterm.ti
/usr/lib/mc/term/xterm.tcap
/usr/lib/mc/term/xterm.ad


Page 106 - Linux Press http://www.linuxpress.com

/usr/lib/mc/term/README.xterm
/usr/lib/mc/extfs
/usr/lib/mc/extfs/zip
/usr/lib/mc/extfs/zoo
/usr/lib/mc/extfs/lslR
/usr/lib/mc/extfs/a
/usr/lib/mc/extfs/rpm
/usr/lib/mc/extfs/deb
/usr/lib/mc/extfs/ftplist
/usr/lib/mc/extfs/extfs.ini
/usr/lib/mc/extfs/README
/usr/lib/mc/mc.hint
/usr/lib/mc/mc.hlp
/usr/lib/mc/mc.tcl
/usr/man
/usr/man/man1
/usr/man/man1/mc.1
/usr/man/man8
/usr/man/man8/mcserv.8
/usr/doc
/usr/doc/copyright
/usr/doc/copyright/mc
/usr/doc/mc
/usr/doc/mc/README
/usr/doc/mc/FAQ
/usr/doc/mc/NEWS
/etc
/etc/mc
/etc/mc/mc.ext
/etc/mc/mc.menu
/etc/mc/mc.lib
/etc/mc/mc.ini
which lists every file installed by the mc package.


Page 107 - Linux Press http://www.linuxpress.com

-l | --list [package name pattern]

Packages matching package name pattern are listed by this option, along with their installed status, the version number and the short description. If no package name is supplied then the list is a complete list of the installed packages on the system. Following our example with mc the following command:

dpkg -l mc

will produce the following output:

Desired=Unknown/Install/Remove/Purge
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===============-================================
ii mc 3.2.1-1 Midnight Commander - A feature-rich full-scr


Page 108 - Linux Press http://www.linuxpress.com

-S | --search search file pattern

The package containing the file described by search file pattern is returned by this option. Both the package and the location of the file are displayed in the output. To deviate from our current example, with something a little more informative, the following command:

dpkg -S whereis

creates the output:

util-linux: /usr/bin/whereis
util-linux: /usr/man/man1/whereis.1.gz

providing the information that this program is available in the package called util-linux. Installing that package will provide this program.


Page 109 - Linux Press http://www.linuxpress.com

-C | --audit

All of the packages that are not completely or correctly configured are listed by this option. Most often the correct solution is to run dpkg --configure package to complete the installation. Executing the command:

dpkg -C

will create a listing something like:

The following packages have been unpacked but not yet configured. They must be
configured using dpkg --configure or the configure menu option in dselect for
them to work:

svgalib1-bin SVGA display utilities

ncftp A user-friendly and full-featured FTP client.

statserial statserial - displays serial port modem status lines

ftape QIC-117 (Floppy-tape) driver, in source code form.

j1 J is a dialect of APL freely available on a wide variety

tk40-dev The Tk toolkit for TCL and X11 - Development Package.

expect The expect/expectk programs and libraries.

tclX Extended Tcl (TclX).

acct The GNU accounting utilities.

The following packages are only half configured, probably due to
problems configuring them the first time. The configuration should be retried
using dpkg --configure package or the configure menu option in dselect:

xdevel XFree86 3.1.2 developer's toolkit

Of course the packages listed here will vary from system to system.


Page 110 - Linux Press http://www.linuxpress.com

3.3.4 Force Options

Force options are used to override the default behavior of dpkg. These options should be used with some forethought, due to the potentially dangerous nature of these commands. Each of these commands forces dpkg to perform in a way that is foreign to its normal behavior. This opens possibilities for damage to the system that are otherwise well contained.

The force options have two actions:

--force- which reduces errors on to warnings
--refuse- stops execution on encountering errors on

--no-force-thing == --refuse-thing

thus each of the options in this section can be preceded by either of the above prefixes.

downgrade

Install the selected package even when the current installed package is a newer version than the one to be installed. This option is enabled by default.

configure-any

Configure any other packages, as well as this one, that this package depends on, which is currently only unpacked and not yet configured.


Page 111 - Linux Press http://www.linuxpress.com

remove-reinstreq

Even if the package has been marked for required reinstallation this force option will allow its removal. It is understood that under some circumstances this will result in files being left behind without dpkg's knowledge.

remove-essential

Removal of essential packages is not recommended because these packages are required for the proper operation of the system and removing them may break the system. In some rare cases, like the name change of a package, or the replacement of functionality by privately built software, it becomes necessary to remove one of these packages. This force option will allow that removal to proceed.


Page 112 - Linux Press http://www.linuxpress.com

3.3.5 Miscellaneous Options

--print-architecture

Outputs the architecture of the machine for package building purposes.

--print-gnu-build-architecture

Prints the gnu format architecture of the machine.

--print-installation-architecture

Same as --print-architecture, but used by installation programs.

--license

Prints license and copyright information


Page 113 - Linux Press http://www.linuxpress.com

--version

Prints the version of dpkg

--help

Displays a list of the options that dpkg currently supports, with a brief description of the option and its function.


Page 114 - Linux Press http://www.linuxpress.com


Page 115 - Linux Press http://www.linuxpress.com

4

Dselect

4.1 Introduction

Dselect is, at the same time, a very powerful tool and a very difficult tool for the new user to make work. Some folks have problems with the interface because of it being unlike anything else on the planet. Many of the keys used are not the "standard" keys used elsewhere in other software to perform those functions. Others are surprised by some of the "unexpected" things that dselect will do for, and in some cases, to them. Yet, there are many satisfied dselect users, some who would compl ain loudly if dselect were to change in any way. This implies that the tool does what it was designed to do. The following discussion should be very helpful to a beginner trying to figure out how to make dselect work for them.

In general, the principle rule when using dselect is: Pay very close attention to all the messages that appear on the screen before you press any keys. Even if you have seen the screen dozens of times before, you are cautioned to think twice before you initiate any key strokes. Read the help information that is available every time you use the program, until you are completely familiar with the information contained there. Take notes when odd behavior is noticed.


Page 116 - Linux Press http://www.linuxpress.com

Dselect uses separate scripts to manage the access portion of its functionality. These scripts, called methods, deal with the task of mounting the device containing the archive. As such, they are referred to as, mountable methods. There is a package called dpkg-mountable that not only adds another mountable method to dselect but provides a log of all dpkg activity during the dselect session. This can be invaluable in determining just what went wrong with a particular installation attempt. This package can be found in hamm/main/binary-i386/admin/dpkg- mountable_0.4.deb in the Debian archives. This directory is found on the Custom CD provided with the print version of this book.


Page 117 - Linux Press http://www.linuxpress.com

4.2 Using Dselect

When dselect is executed, the first screen is the main menu which contains the following seven options:

0. [A]ccess

Choose the access method to use.

1. [U]pdate

Update list of available packages, if possible.

2. [S]elect

Request which packages you want on your system.


3. [I]nstall

Install and upgrade wanted packages.


4. [C]onfig

Configure any packages that are unconfigured.


5. [R]emove

Remove unwanted software.

6. [Q]uit

Quit dselect.


These selections can be chosen by either using ^P and ^N (^ indicates the control key is pressed with the letter) to move up and down the list (up and down arrows work as well) and pressing enter when the highlight bar is on the option you wish to choose, or by pressing the key for the character found in square brackets at the beginning of the option name.


Page 118 - Linux Press http://www.linuxpress.com

0. [A]ccess If no additional methods (like dpkg-mountable) have been installed then selecting [A]ccess will provide the six access methods: cdrom, nfs, harddisk, mounted, floppy, and ftp. Each of these "methods" needs slightly different information. The goal is to find the Packages file for the various pieces of the distribution.

The top half of the screen, topped with the red title bar, shows the menu items. The list can be traversed with the arrow keys and enter selects the item under the highlight bar.

The bottom half of the screen is bounded by blue highlight bars. The top bar names the access method currently highlighted. In between the bars is descriptive help information about the highlighted selection. The bottom bar indicates the percentage of text viewed, and the key that will change the current text position in the window.

This is a common pattern in dselect. The upper portion of the window is where the activities occur and the bottom half provides additional information to help make the choice.

cdrom:

What you need to know:

o Device driver name for CD-ROM if not yet mounted
o Is the CD-ROM image a "standard" distribution?
o Mount point if already mounted.

The cdrom method will find an already mounted CD-ROM or will ask for the device driver that will mount the correct drive. All such drivers are found in /dev and thus, the specification of an sbpcd driver would be /dev/sbpcd0 for the SoundBlaster Pro driver, /dev/scd0 for the first SCSI CD- ROM, and possibly /dev/hdb1 for an IDE ATAPI type drive.


Page 119 - Linux Press http://www.linuxpress.com

Once the drive is mounted the next problem is finding the distribution on the CD-ROM. A CD- ROM with a "standard" archive will have a directory link called "stable" in the outer directory of the CD-ROM. This link provides the path stable/binary-i386 and dselect knows how to find everything it needs from the main distribution. Under these circumstances "/" is the proper designation of the "top level" of the distribution. (dselect does not make it clear that the path specification it expects is relative to the mount point of the CD-ROM)

It is safe to assume that the archive is standard, since dselect will notice if it is not and ask again for the location of the top of the archive. See the Notes section (page 122) for details.

nfs:

During a fresh installation, when you first get introduced to dselect, there will only be an Internet connection available if the machine uses an Ethernet card and it is recognized by the installation kernel. Without this kind of configuration a PPP/SLIP connection, typically through a modem, must be established before proceeding with this step. Note: There are several other ways to make a connection to another machine, local area net or wide area net. Ethernet and PPP/SLIP are the most common. By wh atever method, once a connection to the desired host is available, this method can proceed.

What you need to know:

o URL to the NFS mount.
o Directory structure found on that mount.

When this option is chosen the first request is for the domain name of the NFS server. This can be a numeric IP address, or a fully qualified domain name, of the form something.someplace.net, which will be used to contact the server. The installation software will mount the NFS volume found at the declared IP address.


Page 120 - Linux Press http://www.linuxpress.com

Once mounted, the location of the "top level" of the distribution is required. Dselect is expecting the path to a directory called stable that contains stable/binary-i386. Some archives don't support this path structure. Under these circumstances it becomes necessary to specify each binary distribution individually, and the correct answer is "none". See the Notes section below for details (page 122).

harddisk

Use this access method only when the hard disk device containing the archive is not yet mounted.<BR.
What you need to know:

o Device name for the hard disk partition containing the archive.
o Path to the various archives.

Dselect will ask for the device name of the disk partition containing the archive. Once it has successfully mounted this partition it will request the path to the "top level" of the distribution. If you have a standard distribution this should be the path to the sub-tree, stable/binary-i386, otherwise the answer is "none". (See the Notes section on page 122.)


mounted

When the archive of the distribution is already mounted, this option only needs to know where the "top level" of the distribution is. This method does not care if the device containing the archive is a hard disk, a CD-ROM, or an NFS mount on another machine, so this method can be used to make a non-standard CD-ROM or NFS mount "look" like a standard distribution. This is done by constructing a subdirectory tree that will act as the "top level" of the distribution. Create a mount point (sub-directory) in the "top level" directory and mount the CD-ROM or NFS to that mount point. Then create symbolic links for "stable", "contrib" and if available "non-free". Make these links point to their respective places in the mounted archive. As an example: If the mount point is /mnt/dist/debian and the path on the


Page 121 - Linux Press http://www.linuxpress.com

4.2 Using Dselect

CD-ROM to binary-i386 is /bo/binary-i386, then the link would be made by the following commands:

cd /mnt/dist
ln -s debian/bo/stable

with similar constructions for the contrib and non-free sections.

Once the directory structures are in place then just give /mnt/dist as the "top level" of the distribution. If this seems too complicated then simply answer "none" to the first prompt and then give the explicit path to each of the parts of the distribution being installed. (See the Notes section on page 122 for details.)

floppy:

This is not a recommended installation method. Floppies are notorious for their failure rates. If there is a machine with an archive and Linux, and floppies are going to be made on that machine for one that only has floppy drives, it would be far more successful to bring the machines close enough together to install a null modem cable between them and establish a SLIP connection between the two machines and proceed with an FTP installation.

If this is impossible..., then the problem becomes one where you must have far too much idle time on your hands. CD-ROM drives are cheap. Buy one. If you wish to install the complete binary distribution, it rings in at just under 400 Megabytes. Even on 1.44 Megabytes floppies that's still around 280 floppies.

For a limited number of packages this method has a reasonable chance of success. The best approach for this is to place all of the .deb files for the packages to be installed into one directory and build a Packages file for them. See Building Packages Files for details.


Page 122 - Linux Press http://www.linuxpress.com

ftp:

What you need to know:

o The domain name for the FTP site that is to be used.
o The path structure of the archive on that site.

Selecting this method will result in a prompt for the domain name of the ftp site which is to be used for the installation. As with the other access methods, the path to the archive must be known, and supplied for the proper continuation of the installation.

Notes

Each of the above access methods will at some point ask for the location of the "top level" of the distribution. If the archive is in the "standard" form, pointing to this "top level" will be all that is necessary. Dselect will find a Packages file for the binary-i386 portion of the distribution as well as contrib, and non-free. The path to the local distribution will be asked for separately, as well as any of the above that were not found in the "top level".

If the distribution is in a non-standard layout, dselect will notice this and complain that what was identified was not, in fact, the "top level". In this case simply answer "none" and each section will be prompted for separately. Note: switching consoles VCs (see below) will allow an investigation of the distribution archive so that the path to binary-i386 can be found as well as contrib and non-free.

VCs: The Virtual Console is a method for sharing the console monitor with more than one login process. Debian configures six Virtual Consoles. The left ALT key pressed along with a function key (F1 thru F6) will place the corresponding session on the monitor. It's like having 6 separate terminals!


Page 123 - Linux Press http://www.linuxpress.com

In addition to the three "standard" distribution collections, dselect offers the option of giving the location of the "local-distribution". This local distribution is for use at the direction of the local system administrator. Packages that have been created as .deb package files that are not available from the Debian archives are candidates for placement in the local archive. Although alternate packages that do exist in the archive can go here, the Packages file for the local archive must be "me rged" by hand using dpkg --merge-avail before dselect will recognize them for installation. This is because dselect is unwilling to downgrade a package, so those packages must be the only ones in the available file for proper installation. If the intent is to operate in this fashion then the update of available will need to be done by hand and the "Updated Available file" option should not be executed.

1. [U]pdate

Choosing this option will update the available packages file from the Packages files available from the various distribution sections you identified in the "Access" section. If any custom construction of the available packages file has been done, then this option should not be executed.

2. [S]elect

This option delivers the main power of dselect as well as providing the greatest challenge. Here is where a thorough knowledge of the various keys used by dselect will provide major benefit.


Page 124 - Linux Press http://www.linuxpress.com

Novice use of [S]elect

For those installing Debian for the first time with no experience with dselect the choice of [S]elect should be considered an educational experience where no "real" actions will be taken. This should simply be considered to be a "look around" at what is available so a familiarity can be established with this complex and powerful section of dselect. No selections need be made here, since all "standard" packages are marked for installation at this time. This is a good starting point when configuring a new system.

On first entry to the [S]elect screen it should be noticed that the top of the screen is the normal selection area with the bottom area of the screen for information display.

Things to look at:

o Note the operation of the o key.
o Note the effect of the v key.
o Use the search key (/) to find a package in the list.
o Note the effect of the i and I keys here.
o Add a package to the install list.
o Dealing with depends screens.

On first entry into the select window a complex list of sections and packages is visible in the top section of the screen. The arrow keys will move the highlight bar up and down this list/menu. The order of the packages on this list can be changed using the "o" key. Press the key several times slowly and the display changes the order in which packages are displayed from the starting point, ordered by priority, to ordered by section, and finally to an alphabetical listing of all available packages.

Further examination of the display will reveal, on the left edge of the display a cryptic set of symbols like *_* or some other form of arcana. Pressing the v key


Page 125 - Linux Press http://www.linuxpress.com

will expand these symbols into their "English" meanings, each symbol described by one word on the display line. This results in the loss of the available and installed versions as well as the short description that was found on the line before pressing v. Press v again and return the display to the terse mode.

Next, let's see if we can find a particular package among this information rich list. Midnight Commander (mc) is a nice package to have, but is not included in the "standard" packages, so it will not be currently selected for installation. Use the / key and enter mc when asked what to search for. Like any string search the package found will not necessarily be the one you are looking for. There are several other packages that start with mc and, unless the list is ordered in simple alpha betic order, these other packages are as likely to be found first as the desired one. To search for the next possibility, simply press the back slash (\) and the next match will be found. Several repetitions of this action will eventually find the package in question.

Once the mc package has been found, the bottom section of the screen will display the "long" description for this package. Pressing the "i" key will provide several other informative screens. The first gives the installation status of the package. The next two give various control file displays which provide additional information about the priority, section, dependencies and package maintainer. Some of this information is helpful when tracing down various errors. The "I" key removes this section of the screen all together, providing more space on the screen for listing packages. Pressing it again consumes most of the screen in the information section leaving only a few lines for the selection list. Thus this key cycles the display between these three different configurations.

At this point the short tour is over and if only the "standard" installation is desired the return key will exit the selection phase and the install can be started.

For those with a more adventurous spirit, this discussion will continue with a description of how to select an additional package for installation. This can be returned to after the standard distribution is complete, or be dealt with by using dpkg "by hand".


Page 126 - Linux Press http://www.linuxpress.com

The plus key "+" is used to select a previously unselected package for installation. Note that the minus key "-" is the opposite of the plus key and designates the package for removal. This is not the same as "don't install" and should only be used when a package is really supposed to be removed. For packages that no action is desired for, such as "don't upgrade" the proper key is "H" which puts the package on Hold (no action to be taken with regard to this package).

With the highlight bar over the mc package file line in the display, press the "+" key. The "Dependency Conflict Resolution Help Screen" will pop up as a consequence of this action. This means that there is a dependency or a conflict that must be resolved before the chosen package can be installed. In this case it is a dependence on libgpm1 that must be satisfied. Pressing the space bar drops the help screen and shows the dependencies necessary for mc. Dselect is typically very smart about doi ng what is necessary to resolve the dependencies or conflicts. Only rarely will it set things up contrary to the wishes of the package administrator. The same keys that work in the main selection screen can be used here to force the desired actions by dselect. If dselect still doesn't agree, then the "Q" key will force acceptance of the configured actions.

In the case of Midnight Commander though, dselect makes the correct adjustments and adds libgpm1 to the list of packages for installation and a simple "enter" will exit the resolution screen. Press enter again to exit the selection screen, or, if you are feeling really brave, look for more packages you might like to install. Since dselect takes the time to work through the complete list of available packages when doing the install, reporting which packages are being skipped and which ar e already installed. It is a good idea to do package selection once, so as not to have to wade through the list over and over during the installation phase.

Several packages that are not found in the standard section, but might be valuable are: joe and vim. Other packages of interest depend on the specific needs of the system being configured and is left up to the person doing the installation to decide.


Page 127 - Linux Press http://www.linuxpress.com

3. [I]nstall

This option will use dpkg to install the packages chosen in the [S]elect section. Often one package or another will fail to install because its dependent packages have not yet been configured. This step should be run over again until all the packages have installed.

4. [C]onfig

Use this option to configure any packages that were not configured in the installation phase.

5. [R]emove

This option will remove any packages marked for removal or purge in the [S]elect phase.

6. [Q]uit

When you are finished with dselect this option will exit the program.

This section has covered the basics of package installation using dselect. If the help screens are read, every time dselect is used, a slowly growing understanding of the additional features of dselect will be the result. Try something new each time you use it and you will eventually move from being a novice user of dselect to having a well rounded knowledge of its many powerful features. Just remember to take it slow and be sure that you understand the consequences of your actions befo re you take them. With care and patience dselect can become one of the formidable weapons in your arsenal of Debian package management tools.


Page 128 - Linux Press http://www.linuxpress.com


Page 129 - Linux Press http://www.linuxpress.com

4.3 Upgrading with dselect

Once you have installed a system and have all the necessary packages installed, maintaining such a system with dselect is exceptionally easy. Dselect (actually dpkg) keeps a database detailing the state of the system. What packages are installed, their versions, and additional necessary information are contained in the directory /var/lib/dpkg/info while the status of installed packages are kept in /var/lib/dpkg/status. The file /var/lib/dpkg/available is updated by dse lect whenever a new archive is to be installed. This is not automatic, but happens when the [U]pdate item is chosen from the main dselect menu.

From the information in these areas, dselect can do an upgrade with little interaction. There are several preparatory tasks that should be done first, to insure dselect's success. There were several incremental upgrades to dpkg during the life of the 1.2 distribution. At one point upgrading may have "broken" the available file. The transition to actually using a new feature did not go as smoothly as expected. To get past this problem it will be necessary that the available file get remo ved. This is done by the command:

dpkg --clear-avail

After this command it will be possible to install the following using dpkg:

o The new version of ld.so
o The new version of libc5
o The new version of dpkg

These are critical packages and, although dselect can often "do the right thing"


Page 130 - Linux Press http://www.linuxpress.com

when upgrading an installed system, it is advisable to install these by hand. In any case it is almost always necessary to upgrade dpkg by hand. This package has the newest version of dselect as well as dpkg and often packages in the new release will need features that are only available in the newest version of dpkg.

Once this preliminary work has been done, dselect can be run in normal fashion to perform a complete system upgrade. If there are packages that should not be upgraded for one reason or another, they can be placed on hold in the [S]elect screens. To do this, search out the package using the "/" and press "H". This will put the package on hold and dselect will do nothing with respect to this package. Additional packages of interest can be added at this time as well, so the system can be enhanced by new packages that are of interest.

After configuring these details in [S]elect, the upgrade will proceed as expected.


Page 131 - Linux Press http://www.linuxpress.com


Page 132 - Linux Press http://www.linuxpress.com


Page 133 - Linux Press http://www.linuxpress.com

5

X11 Installation

5.1 Introduction

Once a "standard" system has been installed, there is sufficient infrastructure to support an X11 installation. There is a broad range of software that will only run in X-Window and many people prefer a graphic interface to a text one. X-Window provides a versatile environment in which to work and play.

It is strongly recommended that, with a fresh install, the "standard" packages be installed first, before the X installation is attempted. Trying to do both at once will result in some configuration difficulties caused by the "order of installation" being different under these circumstances. If the default (standard) installation is done first, followed by the X installation the X packages will configure properly. If they are attempted together, no configuration file can be created until after the installat ion. This will require editing the server line in /etc/Xservers both before the configuration (to indicate the vga16 server) and again after the config file has been created (to indicate the server that will actually be used).


Page 134 - Linux Press http://www.linuxpress.com

Also, if the disk set being used is dated 1997-06-06 or earlier, the base system is created without the device tty0. Xbase-configure depends on the existence of this device. If you have a CD-ROM with one of these disk sets, you will need to build the device. To do this, change to the /dev directory and execute the following:

./MAKEDEV tty0

after which you will be able to continue with the installation.

Specific knowledge of the graphics hardware on the target machine is needed before the installation of X-Window begins. There will be limited opportunity to find this information from the machine once the installation has begun. The make and model of the graphics card is the most important piece of information, but vertical and horizontal sweep rates for the monitor may also be necessary. The graphics card information and the monitor information can usually be obtained from the User Manual provided. Getting the card information right is half the battle. The sweep rates are usually found in a table at the end of the users manual. Because of the way that these items are chosen in the configuration software, any of the VGA or SVGA settings provided will work without doing damage. In order to get the most from your monitor it may be desirable to go beyond the configuration thus created. This is only dangerous if the values declared fall outside the capabilities of the monitor. Under extreme conditions an i ncorrect setting can do permanent damage to the monitor. Have all this information available before the installation is begun and you have a fair chance of success.

XFree86 has come a long way since its early release. While once one had to configure X "by hand", editing config files and hoping the parameters were correct, today this product almost configures itself. The package now provides a "generic" VGA server which provides, on most machines, a graphical interface to the configuration process. Here, you declare the default server (which has already been installed by this point), the graphics card and monitor information, as well as the other details of the c onfiguration. When successfully completed there will be a working X-Window system available for use.


Page 135 - Linux Press http://www.linuxpress.com

5.2 Using Dselect

If dselect has been used to install the system so far, then there will be no confusion in using it to install X-Window. Even if dselect hasn't been used before this would be a good way to become familiar with its operation and use. See Dselect (see page 115).

Required Packages:

xbase

Basic X programs

xserver-vga16

Configuration server

xserver- your choice

Operational server

xfntbase

Basic Font set

xfnt75

75dpi fonts


Recommended Packages:

Some Window Manager:

fvwm2

A window manager

xpm4.7

Pixmap runtime libraries

fvwm-common

Files common to fvwm2 and fvwm

xloadimage

A suggested graphics viewer

 


Page 136 - Linux Press http://www.linuxpress.com

Additional Fonts:

xfnt100

100dpi fonts

Xfntbig

Large fonts

Xfntcyr

Cyrillic fonts

xfntil2

ISO 8859-2 fonts

Xfntpex

Pex minimal font support

Xfntscl

Scalable fonts


Available Window Managers in Debian 1.3:

9wm

Plan 9 Window Manager

afterstep

NextStep look and feel WM

ctwm

Claud's Tab WM

fvwm

F Virtual WM

fvwm2

F2 VWM

fvwm95

F VWM with Win95 look and feel

gwm

Generic WM

olvwm

OpenLook VWM

wm2

Small unconfigurable WM


Enter the [S]elect window in dselect and search out xbase. When this package is selected, the Conflict/Dependency screen will pop up, showing the other required packages. Choose the appropriate server from the list provided. The other requirements have already been selected by dselect. Once the dependency screen is exited there are enough packages selected to install and operate an X server, but without a window manager of some kind the system will not be very useful. It is highly recommended that a window manager be chosen at this time as well. The fvwm2 window manager is versatile and very configurable. It is one of the more popular window managers available. As can be seen from the list of "Available Window Managers" there are several other choices. If fvwm2 doesn't suit the particular needs of the installation, then one of these will probably be a better choice.


Page 137 - Linux Press http://www.linuxpress.com

The author prefers the olvwm window manager, primarily because of the way that it deals with "focus". Focus is what makes a window active and allows text to be entered in that window. Most X-Window managers have the focus follow the mouse pointer. This means that if you are typing in a window, and the pointer slides out of the window, the keys you type will stop appearing in the desired window. Olvwm, on the other hand, requires a click of the mouse pointer inside a window to set th e focus in that window. Moving the pointer out of the window does not move the focus. The author finds this a much easier way to work a window system. The choice is, of course, totally up to you. There are several very nice window managers to choose from, so, try several and you will certainly find one that suits your needs.

The window managers available on your system will be recorded in /etc/X11/window-managers. The first available entry in the list will be the one executed when xdm runs. This file is ignored if the user starting the session has a .xsession file in their home directory. The window manager referenced in .xsession will be the one used.

Although the default font choice will get things started, many X programs will require additional font support. Depending on the amount of disk space available it is recommended that as many font sets as possible be installed. This will reduce problems with other packages in the future, as some of these packages don't require "desired" font sets to be installed before the package can be installed and will give peculiar results if the desired fonts are not available.

Once all the desired packages have been "selected" proceed with the installation phase. One of the more aggravating features of dselect is its desire to traverse the complete list of packages while looking for things to install. This makes the installation phase somewhat long, even when only a few packages are being installed. Be prepared to wait for awhile until dselect gets to the "interesting" portion of the install. If you want to go off and do some laundry, don't worry about making dse lect wait for you. If it gets to the "good part" and has to wait millions of machine cycles before you get back, it's only fair.


Page 138 - Linux Press http://www.linuxpress.com

When the unpacking phase of the installation is complete, the configuration phase begins. This phase of the installation requires interactive responses. It is now that the hardware interface information that was previously collected will be used to set up the X-Window environment.

The first request pause will ask about the configuration file /etc/init.d/xdm. Unless this is an upgrade situation, the correct reply is "Y" and will install the package maintainer's current version of the config file. Even during an upgrade it may be advisable to replace the file.

The next question is, "Would you like xdm to be started at boot time?". Even when the eventual configuration is going to start xdm at boot, it is probably better to answer "n" here and wait until it is certain that the X-Window installation will succeed. Otherwise this could yield a system that will fail to work properly at boot time, possibly locking up the machine, making it useless. To enable xdm at bootup add the line start-xdm to /etc/X11/config. For more information on the X11 config file see /usr/doc/X11/debian.README.

After setting up the fonts that were selected, the question, "Do you want to make the VGA16 X server the default?". This server is designed to work on most machines and is intended for use by the configuration software. The correct response here is "y" even though this may not be the server you intend to use. After the configuration portion of the install the server selected for installation can be identified as the new default.

If no XFree86.config file exists, permission to create one will be requested. Unless some specific configuration file is available and desired over the one that would be created, the correct answer is "y". The vga16 server will run the configuration program.


Page 139 - Linux Press http://www.linuxpress.com

Options for configuring the mouse, the graphics card, and the monitor will appear. Here is where all that information about the graphics card and monitor will be used. Sometimes when the configuration screen comes up the mouse doesn't work. This is a configuration problem that can be fixed right here. The tab key moves the focus from button to button. The button "in focus" will have an additional fine black line around it. Normally the mouse option is in focus already, so the enter key brings up the mou se configuration dialogue. Here the sub window of interest is the device type list. Tab around the screen until the edit field is highlighted and type the correct device (usually /dev/ttyS0), or use the scroll bar to move up and down the list. Once the correct device is selected, tab to the "accept" button and press enter. You should now have mouse control to continue the configuration.

Once the configuration is complete and the remainder of the packages have been configured, xdm can be used to start the server for the new X-Window installation. Startx or xinit can also be used for this purpose, but xdm gives more access control and allows protection from a user shutting down the server (xdm will automatically start a new one).

There are several different ways to configure the X-Window environment, depending on what functionality is desired. The best place to learn more about XFree86 is from the HOWTO. Debian collects the HOWTOs and FAQs in the directory /usr/doc on an installed system. This is also the place to look for information on the packages that are installed on the system after the man page and info pages have been exhausted. Obviously none of this is available until after the sys tem has been installed. Although the HOWTOs are not generally available in a Debian Archive, the Custom CD contains them in the directory doc/HOWTO to provide help before the system has been installed. As these are formatted for UNIX systems the carriage return/linefeed characters are different and the text may be hard to read on a DOS machine. There is a program called cr in the tools directory of the Custom CD. This program will convert UNIX carriage returns to DO S returns (or vise versa) and can be used to "copy" any HOWTO file from the CD-ROM to the DOS disk for proper viewing. To convert a file from UNIX to DOS the command looks like:

cr + /path to HOWTO on cd/some-howto c:/some path/some-howto


Page 140 - Linux Press http://www.linuxpress.com

This will convert the some-howto file on the CD-ROM to a file of the same name on the DOS partition with proper carriage return characters.

For future reference, to convert a DOS format file to a UNIX format the command looks like:

cr - /path to dos file/dos-file /path to unix file/unix-file

There are two versions of this program. CR.EXE is the DOS version, while cr is the Linux version. The Linux version can also be found in the package, Seesat5.


Page 141 - Linux Press http://www.linuxpress.com


Page 142 - Linux Press http://www.linuxpress.com


Page 143 - Linux Press http://www.linuxpress.com

6

Networking with Debian

6.1 Introduction

Networking can range from two computers with a direct connection to each other to the many computers at General Motors linked with each other through a variety of methods. Connecting to other computers is wonderful, but even the set-up of a simple PPP connection to an Internet Service Provider can be frustrating. In one chapter, all of the aspects of networking with Debian can't be addressed. There are many books available about networking in addition to information on the Internet. The focus here will be to complete a workstation Ethernet and/or PPP dial-up connection.

Linux provides a variety of networking methods such as Ethernet, SLIP, PPP, Arcnet and AppleTalk. The set-up of these will be left as a challenging exercise to the reader. In either case there are a host of other sources for information on this subject. Once a standard Debian system has been installed, there is a complete set of FAQs and HOW-TOs in the directory, /usr/doc. A good starting point would be the NET-2-HOWTO.gz file found in /usr/doc/HOWTO. This document has a v ery good bibliography in the beginning, pointing to a wide variety of related HOW-TOs that are very useful in understanding the situation. These HOWTOs are also contained on the Custom CD in the directory, doc/HOWTO.


Page 144 - Linux Press http://www.linuxpress.com

Many of these documents are available in HTML format on the Internet. For instance the Ethernet-HOWTO is available at:

http://sunsite.unc.edu/mdw/HOWTO/Ethernet-HOWTO.html

or you can browse the index at:

http://sunsite.unc.edu/mdw/HOWTO/HOWTO-INDEX-3.html

The details that can be found there may be helpful in making use of the information that will be discussed in the following section.


Page 145 - Linux Press http://www.linuxpress.com

6.2 Network Installation

The Debian Installation software provides for the configuration of the network as early as possible in the process. This creates the potential for performing the remainder of the installation from a network mounted device.

The network installation process is concerned with the construction of three configuration files:

/etc/hosts
/etc/resolv.conf
/etc/init.d/network

It does so by collecting the following information:

Host Name
Domain Name
Full Name
IP address
Netmask
Network Address
Broadcast Address
Gateway Address
Nameserver Addresses

The Host Name is the name given to the machine, itself. The installation software provides the name debian as the default value. Any "reasonable" string of


Page 146 - Linux Press http://www.linuxpress.com

characters can be used as a host name, but normally this is intended to be readable and should thus be a legitimate name. On some local area networks these names are determined by the network administrator. In this case the name will need to be supplied by the administrator.

The Domain Name is typically the name of the network (i.e. linuxpress.com) that the machine is connected to. This will also be supplied by the network administrator. If the machine connects to the Internet through an Internet Service Provider (ISP) then the domain name is typically the domain of the provider.

The Full Name is constructed from the Host Name and the Domain Name. If the machine is named fred and the domain is somewhere.net then the full name becomes: fred.somewhere.net. This is the name that others will use when attempting to contact this machine with telnet or ftp or any other remote login client, so this represents the "complete address" of the machine in question. Typically a "name server" is used to convert this "full name" into an IP address for the site. Whe n a site is not accessible with its full name, but is accessible by its IP address, this indicates that the system being used has no DNS facilities available or the IP address hasn't been registered through the Internic. Declaration of these servers is done in /etc/resolv.conf and will be discussed in detail later in this section.

The IP Address that corresponds to the Full Name is a string made up out of the numbers between 0 and 255 and the dot (.) character. A typical IP address has the form: 192.64.1.1 and represents the "address" of the target machine. If your ISP can provide "static" IP addresses, you will be able to declare the address that they assign, at installation time. If your connection to the Internet uses dynamic IP addressing, supply the address 0.0.0.0 as a value to fill the entry.

The Netmask is a string of bits used to determine whether a given address is on the local subnet or outside of it. Debian installation assumes a class C network and provides the default value of 255.255.255.0. This value is used to compute several other addresses for the system. If the machine belongs to a broader (or more restricted) network the system administrator will know the correct value to provide for the netmask.


Page 147 - Linux Press http://www.linuxpress.com

The Network Address, the Broadcast Address, and the Gateway Address are all constructed from the machine IP Address and the Netmask. In our example above, the Netmask of 255.255.255.0 "masked" (logical AND) against the IP Address, 192.64.1.1, gives the Network Address of 192.64.1.0. To obtain the Broadcast Address, the Netmask is first inverted, to become 0.0.0.255 and a logical OR performed with the Net work Address, yielding a Broadcast Address of 192.64.1.255 for our example machine. The address of the machine on the local net that connects to the rest of the Internet is know as the Gateway Address. These machines are known as routers and typically are the first (but sometimes the last) address on the local net. This would imply that our example IP address, 192.64.1.1, is that of a router. In this case the machine is its own gateway which is fine depending on your set-up!< BR>
The last set of information involves Name Servers. When you can ping an IP Address but can't ping the equivalent Full Name then there is a name server missing or not configured. If the machine connects to the Internet via an ISP, then they will provide the name server and will be able to declare the correct address. If the machine is connected by Ethernet the local system administrator will provide that information. The Debian installation will accept up to 5 name servers for ent ry into /etc/resolv.conf to be used for name lookup.

The /etc/hosts file from our example above would look like:

127.0.0.1 localhost
192.64.1.1 fred.somewhere.net

While /etc/resolv.conf might look like:

domain somewhere.net
search somewhere.net
nameserver 192.64.1.1
nameserver 199.44.34.2


Page 148 - Linux Press http://www.linuxpress.com

and, if there is an Ethernet card in the machine /etc/init.d/network might look like:

#! /bin/sh
# Configure the loopback device
ifconfig lo 127.0.0.1
route -add 127.0.0.1

# Configure the Ethernet device
ifconfig eth0 192.64.1.1
route -add net 192.64.1.0
route -add net 0.0.0.0 gw 192.64.1.1

If you still have questions about the correct values for the various addresses and masks that will be requested during the installation ask the local network administrator or your Internet Service Provider, depending on which provides the Internet access for the machine.


Page 149 - Linux Press http://www.linuxpress.com

6.3 PPP Configuration

If the target machine gains its Internet access using PPP rather than Ethernet, there will be some configuration necessary before access to the Internet can be established. The Debian Base System, comes with the PPP daemon installed, but not configured. Once configured, a PPP connection can be used to complete the installation, when necessary.

What will be described here is a simple connection to a service provider with no special authentication. This is the most common connection method and should work in most cases. What You Need to Know:

From the Internet Service Provider:

The dialup phone number
The Login Name to use for the PPP connection
The account password
The IP address of the ISP's Name Server

The dialup number is not the same number you use to contact tech support or the front office of your ISP. This is the number that they will provide for connecting to their machine. The ISP will also provide you with a Login Name (possibly of your choosing) and a password to start with. This password should be changed to something else at the first opportunity.


Page 150 - Linux Press http://www.linuxpress.com

The Name Server address will also be provided by the ISP upon request. This address allows the system to convert domain names into IP addresses, so that you will only need to remember something like ftp.debian.org, instead of 130.207.7.21.

With this information in mind, let's look at what files are necessary to complete the configuration. The PPP daemon expects there to be a file in /etc/ppp called options. This file is provided in the Base System with fully commented explanations of all the entries provided. It will be a simple task to remove the comment mark (#) from those options that are required for proper installation. This file can be constructed from scratch as well, and should contain the following lines:

debug
/dev/ttySN (Where N is the number of the serial port of the modem)
38400
modem
crtscts
lock
connect /etc/ppp/ppp-connect
asyncmap 0
defaultroute

The "debug" line causes the PPP daemon to log diagnostic information to the logs. The connect line points to another file that must be constructed that will actually establish the phone connection for the PPP daemon. This connect script will use the chat program, provided in the PPP package, and will automate the dialing process for PPP. The simplest version of this file looks like:

#!/bin/sh
/usr/sbin/chat -v -t 60 -f /etc/ppp/ppp-chat

The -v option tells the chat program to be verbose in it's comments to the log file. The "-t 60" option provides a 60 second window for the connection to happen without causing chat to "time out" it's operation. The last option (-f) points the chat


Page 151 - Linux Press http://www.linuxpress.com

program to /etc/ppp/ppp-chat, which will contain all the information necessary to automate the dial up process for chat.

This file looks like:

ABORT "BUSY"
ABORT "NO CARRIER"
"" AT&F\r
OK AT&D2&C1\r
OK ATD555-5555\r
ogin: LoginName\r
sword: password\r

The first two lines tell chat under what conditions it should abort. The remaining lines are composed of "expect" "response" pairs. Line three starts with "", which means don't expect anything. The response string resets the modem to factory defaults. The expected reply from the modem is "OK" to which the response is, configure the modem to raise the Data Carrier Detect line when the call is connected and to hang up the connection when the Data Terminal Detect line goes low. This matches the "modem" option provided in /etc/ppp/options. The expected reply is again "OK" to be followed by dialing the number for the ISP's modem. Note: replace 555-5555 with the phone number provided by the ISP. Also, if you have call waiting add "#70," to the beginning of the phone number. This will disable call waiting for this connection. The next two lines only contain the last few characters of both the login: and the password: prompts. Sometimes the first character doesn't show up and this allows for the correct response in that case. The response to "ogin:" is to provide the Login Name that the ISP provided. The response to "sword:" should be the password that was provided (or the one you replaced it with) by the ISP as well.


Page 152 - Linux Press http://www.linuxpress.com

Now there are three files in /etc/ppp. The options file, the ppp-connect file, and the ppp-chat file. These files should all be owned by root and have the permissions set to 600. To set these ownerships and permission use the following two commands for each file:

chown root.root /etc/ppp/options
chmod 600 /etc/ppp/options


These changes should, of course, be made as root, or by using su or sudo to gain root privilege.

One more step remains before the PPP connection can be established and be useful. This step configures the Name Resolver for the system. The ISP will provide the IP address for a Name Server that you can use. To take advantage of this server, the file /etc/resolv.conf must be edited to contain the line:

nameserver nnn.nnn.nnn.nnn

Where nnn.nnn.nnn.nnn is the IP address provided by the ISP.

Once all of these files and changes are in place it becomes a simple matter to start the PPP daemon. As root, or with root privilege provided by su or sudo, enter the command line:

/usr/sbin/pppd

The daemon will then read all the lines in /etc/ppp/options and execute the cat script to make the connection. It then obtains the IP address from the host, creates the ppp0 device and configures it, creates the default route and then runs in background mode for the rest of the session.


Page 153 - Linux Press http://www.linuxpress.com

6.3.1 Verifying the Connection

The program ifconfig provides detailed information about the network configuration. Executing this command will produce output similar to the following:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0

ppp0 Link encap:Point-Point Protocol
inet addr:199.44.34.24 P-t-P:199.44.34.10 Mask:255.255.255.0
UP POINTOPOINT RUNNING MTU:1500 Metric:1
RX packets:16517 errors:0 dropped:0 overruns:0
TX packets:14782 errors:0 dropped:0 overruns:0

Because a PPP connection is a temporary condition, the machine has already been configured for a local loop back device (this was done during the network configuration phase of the installation) and it's condition is reported in the "lo" section. The section starting with ppp0 gives the details of the PPP connection. The inet address is the address of this machine, given to it by the ISP's host machine. The P-t-P address is the address of the host machine itself. The last two lines are of interest if the va lues for errors:, dropped:, or overruns: is something other than 0. This will indicate some kind of problem with the connection. Under these circumstances this is typically a noisy phone line or problems with either the machine's modem or the ISP's modem. Looking into the log will sometimes help to clarify the situation, but it often requires the cooperation of the ISP for proper resolution.

At this point an attempt can be made to ping the service provider and the name server provided. In the above ifconfig example the IP address of the host machine is the same as the name server. This will not always be the case. To ping the


Page 154 - Linux Press http://www.linuxpress.com

name server execute the following command:

ping 199.44.34.10

and something like the following output should be received:

PING 199.44.34.10 (199.44.34.10): 56 data bytes
64 bytes from 199.44.34.10: icmp_seq=0 ttl=255 time=1337.9 ms
64 bytes from 199.44.34.10: icmp_seq=1 ttl=255 time=1600.2 ms

The output can be terminated with Control-C. If you get any of the "64 bytes from...." messages, then the default route has been established correctly and access to the name server is available.

Another method of checking the default route is to use the route command as follows:

route -n

which produces output like:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
199.44.34.10 0.0.0.0 255.255.255.255 UH 0 0 1 ppp0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 199.44.34.10 0.0.0.0 UG 0 0 6 ppp0

Note the last line, beginning with 0.0.0.0. This line declares the default route to be 199.44.34.10 and indicates that all is well. If this line is missing then there is no default route and the name server will not be accessible. Check the options file and make sure that the "defaultroute" option is enabled.


Page 155 - Linux Press http://www.linuxpress.com

At this point the connection has been established successfully. It should now be possible to ping a site using it's domain name, such as:

ping sunsite.unc.edu

If this works, then all the other networking clients, like telnet and ftp, can provide access to the rest of the Internet. The PPP connection is established and usable.

6.3.2 Shutting Down the Connection

When it comes time to disconnect from the service provider, it is simply a matter of killing the pppd process. Do this as root, or with root privilege with the following command:

killall -HUP pppd

and the ppp daemon will hang up the phone line and exit.


Page 156 - Linux Press http://www.linuxpress.com


Page 157 - Linux Press http://www.linuxpress.com

7

Compiling the Kernel

7.1 Hardware

The current 2.0.x Linux Kernels will still run on 386 based Intel PCs, as well as all the subsequent CPUs of the 80x86 family from Intel. There are current, functioning ports of the kernel to Sparc and Alpha machines as well as the m68k port to the Atari and Amiga machines. With a proprietary micro-kernel there is even an m68k version for the Macintosh machines. A wide range of SCSI, IDE, and special CD-ROM drivers are available with the "stock" kernel. As the kernel is the heart of a Linux system, it i s also the fundamental infrastructure of any distribution. Debian is no different in this matter, and many times the flaws in the distribution can be traced back to flaws in the kernel being used.

Debian became a full ELF compliant system with the release of 1.1 and it has not changed the library infrastructure since then. There are a wide range of available kernels that will work. When the stock kernel does not work with the hardware configuration of the target machine, it becomes necessary to rebuild the kernel with a new configuration that better suits the hardware situation. When this can't be done with the current kernel, it is sometimes even useful to move to a newer, or older, version of the k ernel. A standard Debian system (all packages with priority of Standard and higher) will have all of the development tools needed to perform the construction and installation of a custom compiled kernel.


Page 158 - Linux Press http://www.linuxpress.com

The less memory the machine has, the more difficult it will be to compile a kernel. With as little as 8 Megabytes of memory, it is necessary to have at least a 20 Megabyte swap partition/file, but more memory will always improve this situation. Any error complaining about the exhaustion of virtual memory can be fixed by increasing the size of the swap-space.

swap-space All machines have a finite amount of Random Access Memory. Without a method for dealing with this limited memory the system would crash whenever available memory is exhausted. To resolve this issue, the kernel "swaps" memory to disk when not in use, to free memory for use by other processes. This requires a disk partition, or a file, that has been specially formatted to deal with memory swapping.


Page 159 - Linux Press http://www.linuxpress.com

7.2 Building the Kernel

The Debian system provides access to the kernel in several ways. There is a separate Kernel Image package that will allow you to install a "pre-configured" kernel image on the current system. There is also a Kernel Source package that will allow the custom configuration of a kernel and build a Kernel Image package as its output.

There are no pre-conditions in a Debian system that require you use these packages. The kernel for a Debian system can be built without these packages and will work just as well. A discussion of how to do this will be instructive to more than just the paranoid individual who needs direct control over such important matters as a kernel. The following section will first describe how to construct and install a kernel without using the Debian packages, followed by a description of the differences and advantages of using the Debianized versions. As there are trade-offs for either approach the choice of method will be dictated by local considerations.


Page 160 - Linux Press http://www.linuxpress.com

7.2.1 Non-Debian Kernel Construction

Sometime before the advent of the 2.0 kernel the old method of building the kernel was abandoned. What was removed was the requirement that the kernel source reside in a particular location in the file system. Every time you installed new kernel source it was necessary to remove and rebuild several links that pointed gcc and others to the proper header files and assembly routines needed to compile other programs as well as the kernel. At about the time that this practice ended, Debian began to distribut e Kernel Headers that were stable and always found at these "pre-defined" locations. Thus satisfying the general need to compile programs with kernel header information. Since the new kernel Make files are now aware of the location of the kernel source tree (by doing a pwd early in the make process) that tree can be located anywhere.

Debian follows the Standard on file system layout very closely, so you can be assured that anything that you install in /usr/local will remain undamaged by any actions of the Debian Package System. The following procedure will allow the installation of kernel source; the compilation of that kernel source into an image and modules; and the installation of that image and those modules in the current system. Because the very few packages that depend on a particular kernel must interrogate the sys tem to determine the running kernel, the registration with the packaging system of any given kernel is completely unnecessary.

o Create the directory /usr/local/source if not present.
o Create the directory /usr/local/source/kernel-
o Change directory to /usr/local/source
o Make a link between linux and kernel-.
o ln -s /usr/local/source/kernel linux
o Copy the linux-.tar.gz file into /usr/local/source.
o Untar the linux-.tar.gz file


Page 161 - Linux Press http://www.linuxpress.com

The steps above will create a kernel source tree in /usr/local/source. This can, of course be any other place in the file system that seems appropriate, and need not be /usr/local/source. This is only one of several safe places you could put this tree. Creating the target directory and the link to it from the linux directory allows for future kernel source trees to also install here. Setting up the link to the target before untarring the source files makes everything end up where it should , rather than having to rename directories after the fact. The need for all of this stems from the fact that the source tar.gz file unpacks itself into the local directory named "linux". This can also cause problems if there is already a full directory named linux. With the link, there is at least the chance of moving the link to a fresh directory before unpacking new kernel source over the old.

If there are no patches to be applied to the source you are ready to build a kernel. Begin by changing to the directory /usr/local/source/linux. What gets done next depends on the state of the source tree and the desires of the builder. If the desire is that the build process should start from the "pristine" source, sometimes referred to as "distribution clean" then the first step is to do make mrproper. From here the following steps are standard:

Configure the features of the kernel via:
make config
make menuconfig
or
make xconfig
then:
make dep ; make clean
make zImage
or
make bzImage
then:
make modules
make modules_install


Page 162 - Linux Press http://www.linuxpress.com

The major caution during the configure phase is: Make sure that devices needed by the kernel, before the root file system is mounted, are always built in and never made as modules. Any other features declared to be modularized in the configure menu can be built as modules. Once the configuration phase is complete, the rest of the steps should proceed with no errors. Use of make zImage will result in the kernel image being placed in arch/i386/boot/zImage. The normal place for this image is in /boot/vmlinuz version, where it can be accessed using the link from /vmlinuz. The kernel image must be moved to /boot "by hand" and the new link created in /vmlinuz. The system map file, System.map, found in /usr/local/source/linux should also be placed into /boot with the version number appended. Refreshing the link in /System.map to point to this new file will complete the setup.

If you use lilo for loading the kernel there are several steps necessary for safe installation of the new kernel.

1. First copy the old kernel to /boot/vmlinuz.old
2. Next copy the new kernel to /boot/vmlinuz
3. Modify the link /vmlinuz to point to the new kernel
4. Modify lilo.conf to provide another tag
5. Run LILO

Simply copying the new kernel over the old, will not result in the desired effect. Copying the old kernel to a separate location and copying the new kernel into the old slot also doesn't quite get the desired result, even though this is the correct first step.

Once the files have been moved, LILO still needs to be informed of the changes.


Page 163 - Linux Press http://www.linuxpress.com

When LILO is run, it reads its configuration information from the file /etc/lilo.conf, so, to inform LILO of the change in kernels it is necessary to edit/create this file. If the file starts out like:

# /etc/lilo.conf - - single Linux installation.

boot=/dev/hda1
root=/dev/hda1
compact
install=/boot/boot.b
map=/boot/map
vga=normal
delay=20
image=/vmlinuz
root=/dev/hda1
label=Linux
read-only

then you need only add the following section:

image=/vmlinuz.old
root=/dev/hda1
label=Old
read-only

next, run lilo and the new kernel will be installed with access to the old kernel as a fall back.

Debian kernels are built with all the SCSI low level drivers built in. This makes the uncompressed kernel greater than 1 Meg, requiring the use of bzImage instead of zImage. BzImages can sometimes cause problems for some hardware and for some loaders. Loadlin has been known to have problems with these kernel images in the past, although most of those difficulties have already been fixed.


Page 164 - Linux Press http://www.linuxpress.com

If loadlin is used as the boot loader, then none of the above actions will make the new kernel available. You must copy the zImage file to the file that is used on the DOS partition as the kernel image file. If you use loadlin to boot the file linux from your DOS partition, then you must copy the new kernel image into the file linux on the DOS partition. Also make sure that make modules_install has been run, and you are ready to reboot the new kernel.

If you boot from a floppy, then mount the floppy as a DOS disk, and copy the kernel image file from /arc/i386/boot/zImage to the file linux on the floppy. This is the kernel image file on the boot floppy and replacing it with the new kernel image will allow the system to boot under the new kernel.


Page 165 - Linux Press http://www.linuxpress.com

7.2.2 Debian Kernel Construction

The kernel for Debian comes pre-packaged as a kernel-image ver_ver_.deb file.

Installing this with dpkg or dselect will deliver a pre-compiled kernel of that version to the system. In many cases this is perfectly adequate and results in a new functional kernel with little effort. When this fails to be adequate to the needs of the system there is a kernel-source package to help resolve the problems.

Installing the kernel-source package with either dpkg or dselect will result in the kernel source being unpacked into /usr/src/linux via a linux symlink similar to that used in /usr/local/source to link the linux directory to the correct kernel-source-version. There is also the file .linux-versions placed in /usr/src. This file contains a list of all the kernel source and kernel header packages that have been installed on the system. The reason the version number is embedded into the package name is to allow more than one version of kernel source (or header or image) to reside on the system at the same time.

In addition to the kernel-source package the kernel-package package must also be installed. This package contains the scripts needed to build the kernel and make image, header, and source packages. Once this package is installed the following results can be obtained when make-kpkg is executed from the kernel-source directory:

make-kpkg build Will build a kernel.
make-kpkg binary Will make all the kernel packages.
make-kpkg kernel-image Will make only the kernel-image package
.

If the intent is to construct a "custom" kernel, rather than just rebuild the delivered one, then: make config (or one of its varieties) must be executed to reconfigure the kernel to the new requirements. Once this has been done, make-kpkg kernel-image will construct a kernel-image package that can be installed


Page 166 - Linux Press http://www.linuxpress.com

using dselect or dpkg. This image package is only an advantage if LILO (or some other boot manager) is used. If loadlin is being used to boot the kernel, then it will be necessary to move the kernel image file by hand to its proper location.

Although the benefits may seem limited, use of the packaging system can make life much easier. With the kernel this is not as necessary as it is with other packages, so the decision is left to the system administrator as to how this issue should be dealt with.


Page 167 - Linux Press http://www.linuxpress.com

7.3 Modules

Sometime before the 2.0.x kernels, modularized drivers were first introduced into the kernel. This was a pretty shaky interface at first, and some drivers worked very well while others didn't work at all. By the 2.0 kernel the use of modules was a well understood method. While there are still occasional problems associated with modular drivers, this feature of the Linux kernel have become one of the stable work horses of the present day operating system.

7.3.1 Advantages

o Smaller kernel image
o More versatility in installation environments
o Driver modification/testing without kernel reboot
o Reduction in memory usage.

Almost every driver can be built as a module. If the kernel was built with module support and kerneld enabled, then most modules will not need any special entries in the /etc/modules file. Kerneld will load them when they are needed and unload them when they are not being used. Some modules need to be loaded and initialized by the kernel before kerneld is started by init. There is a line in the provided /etc/modules file, after the comments, that has been commented out. This is the "auto" line. Removing the comment (# character) from the "auto" line, will tell the kernel to load those modules automatically, without the aid of kerneld.


Page 168 - Linux Press http://www.linuxpress.com

Some device drivers, like the low level drivers for specific SCSI cards, must be installed explicitly. When a CD is mounted, the system (and kerneld) know that the modules that support the SCSI device must be loaded. The kernel has no knowledge of what card the machine has installed. This information is provided to the kernel in the /etc/modules file. An Adaptec 1542 SCSI controller needs a line added to the modules file (anywhere after the "auto" line) that declares this driver. In this s imple case the /etc/modules file might look like:

# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.
#
auto

aha1542

This file will cause all the necessary modules to support the controller to be loaded by kerneld, while the aha1542 driver is loaded at boot time and left loaded until reboot.

The device driver that accesses the root file system must be built into the kernel or the system will be unable to boot. If the device driver is a module, the kernel has no driver to read the root file system, as this is where it expects to find the module for that driver. This Catch 22 is, for instance, why the Debian installation kernel has the MS-DOS FAT driver built into the kernel, rather than available in the modules installation section. Because the rescue disk is an MS-DOS format disk the kernel mus t have the FAT file system drivers already installed before it can read the root file system off of the floppy (minix is also built in because the root.bin image file is a minix file system).

Any devices the kernel will need before the root file system has been mounted, in order to get to the point of having a mounted root file system must be built into the


Page169 - Linux Press http://www.linuxpress.com

kernel. All other devices can be built as modules. The Debian installation kernel is built in this fashion, making it possible to fit the installation into complex hardware configurations where blanket support causes failures. With the recent growth in the size of the kernel image this configuration allows the kernel to stay below the size limitations of some boot loaders and still maintain the highest level of functionality.

Many of the configuration problems associated with device drivers involve finding the correct set of options to pass when installing the driver.

Without modules each test would require rebooting the system in order to get the newest test options to take effect. With the module utilities supplied with a Debian system, a module can be unloaded with the rmmod command. The module's options can be edited in /etc/conf.modules to reflect the new test values, and the module reinstalled with insmod, all without rebooting the system!

With the use of kerneld, modules can be loaded and unloaded as needed. When no access has been made to the VFAT file systems for awhile, kerneld will unload the module and free up the memory it used. If, by chance, there is the need to read that VFAT file system in the future, the request to the kernel will trigger the loading of the required module by kerneld. In this way the kernel only takes up as much memory as it actually needs to continue with operations while maintaining the capability of accessing a wide variety of devices and systems.

7.3.2 Disadvantages

o Broken or missing modules can cripple the system

o Provide opportunities for security violations

o Erratic operation of, and timing problems with, some devices

If a driver file in /lib/modules/version/device-type/*.o is either corrupted or removed, the system can find itself without critical resources. This can be fatal for critical processes and possibly result in a system crash. Recovery is not always


Page 170 - Linux Press http://www.linuxpress.com

obvious, but with a rescue disk the system can be rebooted and the state of /etc/modules investigated. It is not always obvious that the problem is with the modules. But, having a printed listing of the files in /etc/modules (along with their file sizes) is a good tool to have in the recovery file folder when you start looking for solutions to problems.

Modules also provide a potential security risk. Using the "exploit of the day", a system cracker need only gain root access long enough to copy "his" version of the system PPP module and provide an "undetectable" TCP channel into the target machine with full root access. Any number of other drivers could be subverted in this fashion. This makes security even more important with a modular kernel at the heart of the system. Obviously the security hole is actually in the "exploit of the day" and not in the mod ules as delivered. Protecting the system from attacks of this nature is no more difficult than protecting from the "exploit of the day". Debian and Linux have a continued focus on security. Security breeches are announced in the appropriate newsgroups. Patches and their locations are announced, as well.

Most important of the disadvantages of modular drivers and kerneld has to do with timing problems and unusual hardware configurations. With some devices, under certain load conditions, the time it takes kerneld to install and initialize the driver is long enough for the device to time out, resulting in a failed installation. So, if an FTP client calls for a network connection, and pppd isn't running, kerneld will kick off the appropriate processes and, depending on configuration, dial the number and establish the connection. In the mean time, however, the FTP client has timed out, waiting for the connection. The solution here is to try again with the FTP client. By this time the connection should be established and the connection will go through with no delay. This is not the best example, since the time delays are very large for a diald type ppp connection even when everything is compiled into the kernel. If, however, this system did not time out the FTP connection without kerneld and mo dules, it would be likely to do so under some level of system load because of the additional time needed to load the modules from disk.

The other point has to do with special hardware configuration. If there is a modem that uses a non-standard interrupt for the given slot location, the system will install


Page 171 - Linux Press http://www.linuxpress.com

the driver and configure it properly using setserial. However, if the driver isn't used for several minutes, it will be unloaded. When the driver is next needed, kerneld will load it, but knows nothing of the special configuration needs of the driver. This results in the driver trying to use the wrong interrupt for that device, and failing. The resulting symptom is that if the system establishes a PPP connection within the first several minutes of operation, the connection will be made in the sta ndard fashion and work as expected. If, however, the system is allowed to sit quietly for several minutes after reboot, the PPP connection will never get established. The chat program (if that is how the connection is established) will time out waiting for the first response from the modem because it isn't servicing the proper interrupt. This can be fixed temporarily by issuing another call to setserial with the proper interrupt value for the card. The better fix is to explicitly name the device driv er in /etc/modules. Adding serial to the list of modules in /etc/modules will cause the module to be loaded by init and configured with setserial. It will also have the beneficial side effect of causing kerneld to leave the module alone and never unload it. Thus, the configuration initially provided for this driver remains unaffected and the device continues to work properly.


Page 173 - Linux Press http://www.linuxpress.com

Appendix 1

Common UNIX Commands

Introduction

This section covers most of the useful commands available on any UNIX operating system. None of the commands are covered in great detail, but should give enough information to be a useful introduction for those not familiar with the various UNIX commands. For more details on these and other commands there are two standard commands for getting documentation on programs installed on the system. The man command and the info command are the two major methods of gaining this documentation. If information is desired for command foo either man foo or info foo will provide the available documentation. Not all packages provide info pages, while many GNU packages don't provide man pages. Depending on the program involved one or the other of these will be available. When the command is unknown but some idea of functionality is known, a key word search can be done of the man pages using the apropos command or man -k.


Page 174 - Linux Press http://www.linuxpress.com

Note: The term program and command have been used interchangeably in the previous discussion. This is because in UNIX, all executable commands are, in fact, programs that execute to perform their various tasks. Every program, and thus, every command, is documented in some fashion or another within the system. This documentation is not always easy to find, and sometimes is limited to a few lines of comments in the source code. In a Debian system each package places its copyright, changelogs , and any additional examples or documents into the directory /usr/doc/package name and is a good place to start after you have exhausted the man and info pages.


Page 175 - Linux Press http://www.linuxpress.com

chgrp

This command is used to change the group ownership of a file or files. The form of the command is: chgrp options group files. The group will be assigned to the files that are specified. As usual wild cards are permitted, allowing multiple files to be specified. Several useful options are:

-c describe only the files who's ownerships have actually changed.
-f don't print error messages on unchanged files.
-R recursively traverse the subdirectories changing group permission on the appropriate files.

Example:

chgrp -R dwarf /home/dwarf

Will change all of the files in all of the directories below /home/dwarf to belong to the group dwarf.

See also: chmod, chown


Page 176 - Linux Press http://www.linuxpress.com

chmod
When it is necessary to modify the permissions on a particular file or group of files this command is the one to use. It takes the form:

chmod options mode files

mode has the form: [ugoa...][[+-=][rwxXstugo...]...][,...]

u the user who owns the file
g users in the files group
o other users not in the group
a all users
+ causes permissions to be added to those already present for the file.
- remove the specified permissions from the file
= make those permissions specified as the only permissions defined for the file.
r read permission
w write permission
x executed permission
X execute only if the file is a directory or already has permission for some user.
s set user or group id on execution.
t save program text on swap device
u set the permission to those of the user who owns the file.
g set the permissions to those of the group.
o set the permissions to those other than the group.

options

-c give a verbose reporting of only the files changed.
-r recursively change permissions of directories and their contents.
-f do not print errors about files that were not changed.


Page 177 - Linux Press http://www.linuxpress.com

Example:

chmod g-w ./* Will remove the group write permissions from all the files in the current directory.

See also: chown, chgrp


Page 178 - Linux Press http://www.linuxpress.com

chown

To change the ownership of a file or group of files the chown command is used. This command has the form:

chown options [user][:.][group]

If only user is supplied, then the ownership of the file is changed to that user. If only a : or . follow the user then the ownership is changed to that user and the group is changed to the login group for that user. If user:group or user.group is provided not only the ownership of the file is changed to user, but the group owning the file is changed to group.

Files can be designated with wild cards so that a set of files can be changed at the same time.

Several useful options are detailed below. See the man page for complete details:

-c describe only those files that have been changed.
-f don't print error messages when files can't be changed.
-R recursively change files in subdirectories.
Example:

chown fred ./document.1

will change the ownership of document.1 to user fred.

See also: chmod, chgrp


Page 179 - Linux Press http://www.linuxpress.com

cp

This command is used to copy files from one location in the file system to another. The form of the command is "cp ". Wild cards are permitted in the parameter. If this parameter refers to more than one file, the must be a directory. There are a wide range of options for this command. Several are listed here.

-a This option is the same as the -dpR and attempts to retain the permissions and ownerships of the files being copied. This option is the best way to "replicate" a file system on another partition, or to move a subtree from one place to another without changing its permission structures.

-d Copy symlinks as symlinks rather than the file pointed to and preserve hard link relationships between files in the copies.

-p Preserve the owner, group, permissions, and timestamp found on the original when making the copies.

-R Recursively copy all subdirectories and their file contents. This will allow a complete limb of a file system to be replicated somewhere else in the file system.

Example:

cp -a /home /mnt

will copy all of the files and directories in /home into the directory /mnt and will maintain the permissions and ownerships of the files during the copy.


Page 180 - Linux Press http://www.linuxpress.com

df

This command displays file system information for each device mounted on the system. The information displayed includes the size of the partition, the amount used, and the amount available. The device name and mount point are also provided in this display.

Example:

df

Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/hdb3 649339 396690 219108 64% /
/dev/hda1 1054176 784352 269824 74% /mnt/DOS
/dev/hdb1 649307 542629 73139 88% /mnt/image/1
/dev/hdb7 331767 180711 133922 57% /mnt/image/2
/dev/hdb5 347375 258195 71240 78% /Debian
/dev/hdb6 347375 303564 25871 92% /home
/mnt/a/deb.iso 617388 617388 0 100% /mnt/loop1
/mnt/image/1/1.3.iso 540506 540506 0 100% /mnt/loop2

The order in which the file systems are listed, is the order that they were mounted. Except for the last two entries, the above were all mounted by fstab at boot time. The last two are loop mounted image files.


Page 181 - Linux Press http://www.linuxpress.com

du

The du command reports the disk usage for the specified directory. The value reported for each subdirectory and the total are given in blocks. Normally a block is 1K.

Example:

du /lib

1 /lib/modules/2.1/fs
1 /lib/modules/2.1/net
1 /lib/modules/2.1/scsi
1 /lib/modules/2.1/block
1 /lib/modules/2.1/cdrom
1 /lib/modules/2.1/ipv4
1 /lib/modules/2.1/misc
8 /lib/modules/2.1
77 /lib/modules/2.0.22/block
55 /lib/modules/2.0.22/net
133 /lib/modules/2.0.22/scsi
321 /lib/modules/2.0.22/fs
45 /lib/modules/2.0.22/misc
635 /lib/modules/2.0.22
80 /lib/modules/2.1.5/block
58 /lib/modules/2.1.5/net
139 /lib/modules/2.1.5/scsi
335 /lib/modules/2.1.5/fs
48 /lib/modules/2.1.5/misc
664 /lib/modules/2.1.5


Page 182 - Linux Press http://www.linuxpress.com

477 /lib/modules/2.0.30/net
974 /lib/modules/2.0.30/scsi
265 /lib/modules/2.0.30/fs
245 /lib/modules/2.0.30/cdrom
228 /lib/modules/2.0.30/misc
2195 /lib/modules/2.0.30
3503 /lib/modules
5730 /lib

This declares /lib to contain 5730, 1k blocks.


Page 183 - Linux Press http://www.linuxpress.com

ls

This command provides information about the contents and permissions of files within the file system. The bare command "ls" will list the files in the current directory. In addition to the many options that can be used with this command, the last element on the command line can be a file or directory specification. Wild cards are appropriate here, so "ls m*" will list all files in the current directory that begin with "m". There are many options that can be used with the ls command. A few of the more useful are:

-l display listing in the "long" format, giving file type, permissions, the number of hard links, owner and group name, byte size, and the time stamp, by default the modification time.

-a display all files including those that start with ".".

-R give a recursive listing of the contents of all subdirectories.

-- color-code files according to file type.

-S sort by file size

-r reverse the order of whatever sort has been chosen


Page 184 - Linux Press http://www.linuxpress.com

Example:

ls -l /dev/l*

brw-rw---- 1 root cdrom 24,0 Jan 17 09:45 /dev/lmscd
srw-rw-rw- 1 root root , 0 Jun 8 23:49 /dev/log
crw-rw-rw- 1 root sys 10,0 Jan 17 09:45 /dev/logibm
crw-rw-rw- 1 root sys 10,0 Jan 17 09:45 /dev/logimouse
brw-rw---- 1 root disk 7, 0 Sep 23 1996 /dev/loop0
brw-rw---- 1 root disk 7, 1 Sep 23 1996 /dev/loop1
brw-rw---- 1 root disk 7, 2 Sep 23 1996 /dev/loop2
brw-rw---- 1 root disk 7, 3 Sep 23 1996 /dev/loop3
brw-rw---- 1 root disk 7, 4 Sep 23 1996 /dev/loop4
brw-rw---- 1 root disk 7, 5 Sep 23 1996 /dev/loop5
brw-rw---- 1 root disk 7, 6 Sep 23 1996 /dev/loop6
brw-rw---- 1 root disk 7, 7 Sep 23 1996 /dev/loop7
crw-rw---- 1 root lp 6, 0 Jan 17 09:45 /dev/lp0
crw-rw---- 1 root lp 6, 1 Jan 17 09:45 /dev/lp1
crw-rw---- 1 root lp 6, 2 Jan 17 09:45 /dev/lp2
crw-rw---- 1 root lp 6, 3 Jan 17 09:45 /dev/lp3

lists all the files in /dev that begin with "l" and lists them in the long format.


Page 185 - Linux Press http://www.linuxpress.com

mkdir

This command is used to create subdirectories within the file system. The command expects at least a directory specification and has several options. The most useful of which is:

-m mode This option allows the specification of permissions on the directory being created

Example:

mkdir /mnt/DOS

will add the subdirectory DOS to the /mnt directory.

See also: rmdir


Page 186 - Linux Press http://www.linuxpress.com

mv

The move command (mv), like copy is of the form: mv options source dest. The source parameter can contain wild cards and when referring to more than one file the dest must be a directory. Several options include:

-b make backups of the files to be removed.
-i prompt before removing files.
-v print the name of the files being moved.


Example:

mv myfile myfile.old

will move the file myfile to the new filename myfile.old.


Page 187 - Linux Press http://www.linuxpress.com

rm

The remove command (rm) is used to delete files from the file system. After options this command expects a file name. Wild cards are permitted here, so the command can remove more than one file at a time. Several options for this command are:

-r recursively remove files from subdirectories.
-f never prompt for files to remove and ignore nonexistent files.
-i prompt for each file before removing it.

Example:

rm -r /home/fred/*

will remove all the files in all the directories of /home/fred.


Page 189 - Linux Press http://www.linuxpress.com

rmdir

This command is the reverse of the mkdir command. It causes the directory named to be removed. There is only one option for this command:

-p removes any parent directories that become empty by removing the specified directory.

Example:

rmdir /mnt/DOS

will remove the subdirectory DOS from the path /mnt.

See also: mkdir


Page 189 - Linux Press http://www.linuxpress.com


Page 190 - Linux Press http://www.linuxpress.com


Page 191 - Linux Press http://www.linuxpress.com

Appendix 2

Text Editors

Introduction

Linux systems provide many different kinds of editors. Debian is no different. From the tiny ae used in the base system, to the gigantic and powerful emacs, there are all the editors you might expect to find in any UNIX and then some. The following section will give a brief description of two editors found in Debian. Each description section will tell how to start the editor, how to save a file, and how to exit the editor. Some of the primary edit features will also be discussed.

For more detailed information see the man pages and other documentation provided with each of the editors.


Page 192 - Linux Press http://www.linuxpress.com

ae

Anthony's Editor (ae) is an exceptionally small program (23.9K) that provides basic edit capability for the base system. If you try to run vi in the base system, ae will start in vi mode for those more familiar with that editor. Whether started as vi or ae, the default condition for the editor is with the help screen visible. This is one of the features that makes this editor so easy to use. All of the possible commands available in the editor are displayed on the screen. F1 will toggle the help screen off and on to provide more screen area for editing. When called using ae as the command the standard commands are:

^R Read a file into the editor.
^W Write the contents of the editor to a file.
F2 Block select to cursor movement.
F3 Cut selected block.
F4 Paste a cut block.
F10 Exit the editor. Will only work if file has been saved.
SF10 The shifted F10 will exit the editor without saving first.

The default setting for ae is as a mode-less editor. This means that the editing progresses without need for special keys to define the edit mode. The behavior in vi mode can be a little different than normal vi because these features are dealt with via macros and thus are limited to what can be done in a macro. For instance, to write the file and quit the normal vi command is ":wq", while in the ae version these must be entered as two separate commands: ":w" followed by ":q". In any case this editor is the only one available in the base system, so until the system is upgraded to "standard" there may not be an editor that is completely familiar available. Ae is a good compromise between size and familiarity.


Page 193 - Linux Press http://www.linuxpress.com

joe

Joe's Own Editor (joe) is a WordStar clone with all the features found in that ancient piece of CP/M code. The control K sequences are the same as in the original, so anyone familiar with WordStar can just use joe without thinking about learning new commands. For those not familiar with this word processor the following will be a good start:

^k h Toggle the help screen on and off.
^k d Save the current edit session.
^k x Save the current edit session and exit.
^k z Suspend the editor for the shell.
^c Abort the current edit session. (don't save the file)

With the help screen you can find out how to select a block of text, move or copy the block. Word search and replace are also available along with a spell checker.

When a file is saved with joe it automatically moves the original file to original-file-name~. The ~ makes it easy to identify the backup edit session, but it only reflects the last edit session, so older contents will be lost.


Page 194 - Linux Press http://www.linuxpress.com


Page 195 - Linux Press http://www.linuxpress.com

Appendix 3

The Loop Device

The loop device is a device driver that allows an image file to be mounted as though it were a normal block device. The question that immediately jumps to mind is, "So, how do I use this beast?". As an example, lets look at mounting, and examining the contents of, the rescue floppy image file.

First the CD-ROM, or other device containing this image file needs to be mounted like:

mount -r -t iso9660 /dev/scd0 /cdrom

Note: The -r option declares the device to be read only. Also /dev/scd0 assumes the drive is the first SCSI device. If the machine uses a SoundBlaster Pro/Creative Labs combo for the cdrom this device would be /dev/sbpcd0 instead.

If this is an "Official CD" that was mounted (or the Custom CD from the book) the file of interest is found as:

/cdrom/stable/disks-i386/current/resc1440.bin


Page 196 - Linux Press http://www.linuxpress.com

So the mount command using the loop device will look like:

mount -t msdos -o loop /../../resc1440.bin /mnt

After which an ls of /mnt will show all the files that will appear on the floppy disk when this image file is transferred to it. This is a "live" file system. That is, it can be modified just like any other read/write file system mounted as a block device. The changes made to the file system while mounted become part of the image file and will be reflected on the floppy constructed from that image. Of course, in our example the file image resides on a read-only medium so changes aren't possibl e, but when the image file resides on a writable medium, like the hard disk, then those kinds of changes become possible.

OK. We can mount such file systems, but how are they constructed in the first place? This, of course requires a *nix environment. The tools are dd and losetup, and the process goes something like this:

First it is necessary to create an empty file of the desired size. This is done with dd and the zero device in a line like:

dd if=/dev/zero of=/../image.file bs=1k count=100000

This will create a file with 100 Megabytes of space. Note that the file size is equivalent to the partition size when creating partitions on a block device like the hard disk. This file will thus hold a file system that can reach 100 Megabytes in size before "device full" errors occur.

Before a file system can be created on this image file and it can be mounted, it needs to be made to look like a block device. This is done with the losetup program in the following fashion:

losetup /dev/loop0 /../image.file

There are 8 loop devices to choose from, so you may need to check to see if


Page 197 - Linux Press http://www.linuxpress.com

a particular device is already in use. losetup /dev/loopN, where N ranges between 0 and 7, will return the status of the Nth loop device if it is mounted and will return an error message if it is not.

Now that /dev/loop0 is a legitimate block device, mke2fs (or any of the other make file system utilities) can be used to create a file system on the looped image file with a command like:

mke2fs -c /dev/loop0 100000

The -c option checks the device for bad blocks and the value on the end specifies how many blocks are on the file system. These two options can be left off of the command line and results will be seen faster, but there is no guarantee that the resultant file system will be useful. Take the time to check for bad blocks. It is time you will not spend looking for the cause of problems later. Once the file system has been created and the loop device associated with file can be mounted by the following command l ine:

mount -t ext2 /dev/loop0 /mnt

When this is later unmounted make sure to release the device with the command losetup -d /dev/loop1. Another alternative is to release the loop device as soon as the file system creation is complete, and mount the file as in the previous example with a command like:

mount -t ext2 -o loop=/../image.file /mnt

In either case this produces a "file system" mounted on /mnt that has 100 Megabytes of storage space. Whatever this file system is intended to contain can now be copied, or untarred, or otherwise created on the new file system. This process can be used, on an alternate virtual console to construct and mount a file that the installation software will use to install a Debian system on. Thus you can create your own custom file system for Drop in Debian and build a root file


Page 198 - Linux Press http://www.linuxpress.com

system large enough for a full blown installation. It should be evident that loop devices are very useful critters. The installation software makes use of one to perform several sets in the Zero Floppy Installation by mounting image files from the DOS partition instead of requiring a floppy disk to mount. This is not only faster, but physically easier than the floppy installation method.


Page 199 - Linux Press http://www.linuxpress.com

Appendix 4

Multiple OS Installation

There are different ways that more than one Operating System can reside on the same machine. DOS and Windows can easily reside on the same machine with Linux and each can be booted at the choice of the operator. Windows 95 is a little bit trickier since it demands its own boot manager. Installing Windows 95 after installing Linux will result in LILO getting "bumped off" the system. Installing Linux AFTER Windows 95 will work. You will need to configure your Linux system to be able to boot Windows 95 wit h LILO however.

LILO can be used as long as there is a Linux partition on the first physical drive. With a modified boot record and LILO, the system can be made to boot either Linux or DOS/Windows 95. There are other boot loaders available for Intel machines. Most of these can be used to boot a variety of operating systems.


Page 200 - Linux Press http://www.linuxpress.com

The more versatile method of installation uses the DOS program loadlin.exe. This software can boot a kernel image from a DOS partition and mount any partition on the system as the root partition for that kernel. For automatic operation, the best method is to use the config.sys menu system in DOS to offer the choices of the different OS available on the machine. Then autoexec.bat can determine whether to go ahead and boot DOS or run loadlin and boot Linux. The following example should clarify this proces s:

config.sys:

[Menu]
menuitem=NewLinux, Linux 2.0.30
menuitem=OldLinux, Linux 2.0.27
menuitem=DOS
[DOS]
DEVICE=C:\DOS\SETVER.EXE
DEVICE=C:\DOS\HIMEM.SYS
DOS=HIGH
FILES=30
STACKS=9,256
[NewLinux]
[OldLinux]


Page 201 - Linux Press http://www.linuxpress.com

autoexec.bat:

cd \boot\linux
goto %config%

:DOS
cd \
C:\DOS\SMARTDRV.EXE
@ECHO OFF
PROMPT $p$g
PATH C:\WINDOWS;C:\DOS
SET TEMP=C:\DOS

goto End

:NewLinux
loadlinx vmlinuz2 root=/dev/hdb3

goto End

:OldLinux
loadlinx vmlinuz root=/dev/hdb3

goto End

:End

Note that this system allows the root file system to reside on other than the first device on the machine.

This process will work for Windows 95 as well as DOS/Windows and OS/2.


Page 202 - Linux Press http://www.linuxpress.com


Page 203 - Linux Press http://www.linuxpress.com

Appendix 5

Building Packages Files

Files with the extension .deb contain the packages managed by dpkg. For information on how these packages are built, the programmer.html/ and policy.html/ directories found on the Custom CD in the directory doc/dpkg. On a Debian system these files are found in the /usr/doc/dpkg.

What you need to build a Packages file:

1. Debian GNU Linux system with dpkg-dev installed.
2. A collection of .deb package files.
3. The override file for the distribution involved.

The Debian package dpkg-dev provides the script dpkg-scanpackages which is used to produce Packages files. With this tool an arbitrary collection of Debian binary packages can be converted into a "distribution". Normally the Debian distribution resides in the subdirectories of the directory binary-i386. Many times however, even with a "standard" archive of this distribution, the Packages file is not in sync with the archive, and a new Packages file will be required. The proper operation of dselect depends on an accurate and up-to-date packages file.

Another reason for building a Packages file relates to the construction of a "custom" installation. Collecting a specific subset of the Debian distribution for installation using dselect will require a Packages file for this subset. Once these


Page 204 - Linux Press http://www.linuxpress.com

packages are collected into a subtree a Packages file can be created.

Dpkg-scanpackages has two required parameters and sends its output to stdout. The first parameter is the path to the archives while the second points to the override file for the release being used. The 1.3 release is code named bo, while the previous release was rex and the next one is hamm (all characters from the movie "Toy Story"). These override files are found in the indices/ directory of any Debian mirror with the name override.bo or override .rex or override.hamm depending on which distribution the packages came from. The command line would look something like:

dpkg-scanpackage /mnt/bo/binary-i386 /mnt/indices/override.bo Packages

and will run for quite some time. Upon completion the script will print information about any differences found between packages and information found in the override file. This is typically caused by the fact that the maintainer changed and the override file does not reflect the new maintainer. These errors are never a problem to the correct operation of the Packages file, but are informative only. The final information provided by the script gives the total number of packages added to the Packag es file. A copy of this file along with a gzipped copy should be placed in the outer directory of the distribution tree. For the standard distribution the packages file goes into .../binary-i386. When a group of packages are collected into one directory that is the directory where the Packages and Packages.gz files should be placed as well. Once this has been accomplished the distribution is ready to be installed using dselect.


Page 205 - Linux Press http://www.linuxpress.com

Appendix 6

Linux as a Server

One of the many versatile features of Linux is its ability to act as a server in various network environments. Linux, and therefore Debian, provide features that allow it to act as a server for Windows and Windows 95 machines. It can also act as a server for an AppleTalk network, or even a Novell network.

SAMBA is the name of the software that provides the tools for serving Windows machines. A very comprehensive discussion of this tool can be found at:

http://lake.canberra.edu.au/pub/samba

There is also a HOWTO that can be found at

http://www.interweft.com.au/other/samba/smb_se.html

as well as a FAQ that can be found at:

http://sunse.jinr.dubna.su/local/samba/samba.faq.html

AppleTalk, the Macintosh network protocol, can be supported by the kernel if the proper appletalk.o module is provided, or compiled in. This network is also called netatalk and a HOWTO can be found at:

http://thehamptons.com/anders/netatalk


Page 206 - Linux Press http://www.linuxpress.com

Linux can also be run directly on a Mac with the product called MKLinux. Information on how to set up netatalk on MKLinux can be found at:

http://www.primate.wisc.edu/people/debois/mklinux/netatalk-setup.html

Linux can even act as a server on a Novell network. The kernel needs to have IPX support compiled in, or as a module. For more information see

http://electron.phys.dal.ealmini/HTTP+Netware

or

http://www.inet.co.th/cyberclub/karnedp/http-4.html

The IPX module is also discussed in the Modules HOWTO which can be found at

http://linuxwww.db.erau.edu/ldp/HOWTO/Module-HOWTO-s.html

or at most mirrors of the Linux Documentation Project.

All of the above sites were found using one of the many search engines that the Internet provides. If you point your browser at:

http://altavista.digital.com/cgi-bin/query?pg=aq

the first blank is for a list of keywords (with logical operators that define the way they are selected. The real power of this page is the second field for Result Ranking Criterion. Key words in this list are used to bring more likely hits to the top of the list. This is very useful when your keywords return 2,000 hits. There are many other search engines available on the net. Using the above site and the keyword "search engine" produces 500,000 hits, so choices for Result Ranking Criterion can be very use ful.


Page 207 - Linux Press http://www.linuxpress.com


Page 208 - Linux Press http://www.linuxpress.com


Page 209 - Linux Press http://www.linuxpress.com

Appendix 7

Arguments

The kernel accepts arguments of the following form:

no387=
This argument tells the kernel not to use the math co-processor, even when present. The kernel must, of course, be compiled with math emulation support for this to work.

root=
Tells the kernel which partition to use as the root device. This value can be entered as a text string, like /dev/hda4, or as the major/minor number for the device, which for hda4 is "0x304" for major 3 and minor 4. fsck has been run. This argument can be set with rdev.

debug=
Under normal circumstances the kernel logs only those messages of debug level 7 or below to the console. Using this argument will send all debug messages to the console. Klogd also has options that it will accept to modify what debug level will get logged. See the man page for details.

reserve=
Protects various i/o ports from being probed. It takes the form: reserve=iobase,extent[,iobase,extent]... and will keep one device driver from probing sensitive ports on another card. Since that card will eventually need to


Page 210 - Linux Press http://www.linuxpress.com

be initialized by its own driver, this command is usually used in conjunction with another. If the device foo is caused to lock up by a probe from another device, the argument list would look like:

reserve= 0x300,32 foo=0x300

This will keep all other device drivers from probing 0x300 while allowing the drive that uses that port to be properly initialized.

ramdisk=
This argument tells the kernel how big a ramdisk to create. To put a file system from a floppy into ramdisk would require an argument like: ramdisk=1440. Note that the units of size for this argument is kilobytes. This is one of the few parameters that can be set in the kernel using rdev.

mem=
Since the BIOS of most PCs can only report 64 Megabytes there are times when the kernel needs to be told that there is more memory than this. This argument should be used with great care, since, if you lie to the kernel and tell it that it has more address space than it actually has, the system will crash miserably as some time in the near future. Also make sure that your system does not use the highest memory for caching the bios code, as use of this memory by the kernel will ultimately crash the system as well. The value given after the equal sign should be the highest ram address available to the kernel, so a 96 Megabyte system would get an argument like "mem=0x6000000".

SCSI device arguments

General Notation

obasei
The first I/O port that the SCSI device occupies, normally between the values: 0x200 and 0x3ff


Page 211 - Linux Press http://www.linuxpress.com

irq
The hardware interrupt that the SCSI card in configured to use.

scsi-id
The host adapter's ID on the SCSI bus. Some adapters allow this value to be changed but most don't. Many adapters use ID of seven, however, the Seagate and Future Domain TMC-950 cards used ID of six.

parity
Specifying a 1 tells the card to expect the SCSI devices to report parity. Setting this to 0 has the opposite effect. As with the scsi-id not all adapters accept this argument.

SCSI argument list

max_scsi_luns
Some SCSI devices are poorly designed and will lock up when probed for LUNs (Logical Unit Numbers) other than zero. As the kernels now default to only probe LUN 0, this argument allows for the probing of other LUNs as well.

st=
This is used to configure SCSI tape devices and has the form: st=buf_size[,write_threshold[,max_bufs]]

buf_size:
The value is given in units of Kilobytes with the default value of 32 and a max value of 16384

write_threshold:
Is the size of the buffer that will commit a write to tape and defaults to 30 Kilobytes.


Page 212 - Linux Press http://www.linuxpress.com

max_bufs:
Normally defaults to 2 but the proper number depends on how many devices are present

aha152x=iobase[,irq[,scsi-id[,reconnect[,parity]]]]
These values are as described earlier and are order dependent, so to specify parity, the rest of the parameters must appear on the line. If the reconnect value is non-zero the device will be allowed to disconnect/reconnect.

aha1542=iobase[,busson,bussof[,dmaspeed]]
The iobase for this card is usually, 0x130, 0x134, 0x230, 0x234, 0x330, and 0x334. Some clone cards provide other addresses as well. Busson and bussof specify the time the card spends on and off the buss. Default values are 11us on and 4us off so that other cards get a chance at the ISA buss. Dmaspeed refers to the rate at which the DMA transfers proceed. The default value is 5 MB/s, although some cards allow setting up to 10 MB/s, but care should be taken to make sure that the machine is up to the task.

aic7xxx=extended,no_reset
A non-zero value for extended enables extended translation for large disks. A non-zero value for no_reset tells the card not to reset the card at boot up.

buslogic=
The only parameter that this argument accepts is the iobase. The expected values are: 0x130, 0x134, 0x230, 0x234, 0x330, and 0x334.

tmc8xx=mem_base,irq
The probe code for these Future Domain cards looks for a BIOS on the card. If one is not found, or the signature is not recognized, this card will go unrecognized. Specifying the mem_base address and the irq in this argument will force recognition of the card. The mem_base address specifies the memory mapped I/O region of the card and expects values: 0xc8000, 0xcc000, 0xce000, 0xdc000, 0xde000.


Page 213 - Linux Press http://www.linuxpress.com

pas16=iobase,irq
This card uses the NC5380 SCSI chip and usually expect the iobase to be 0x388. If the irq value is given as 255 then the card will operate without interrupts, at a reduced capability.

st0x=mem_base,irq
This probe code also expects to find a bios and will not find the card if there is no bios. This argument will force detection of the card. Mem_base is the memory mapped I/O region of the card and uses values: 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000.

t128=mem_base,irq
These cards also use the NC5380 SCSI chip and expect the following values for mem_base: 0xc8000, 0xcc000, 0xd8000, 0xdc000.

The following cards do not accept arguments:

Always IN2000 Adaptec aha1740 EATA-DMA
EATA-PIO Future Domain 16xx NCR5380 (generic)
NCR53c7xx to NCR53c8xx Qlogic
Ultrastor Western Digital wd7000

Hard Disk Arguments

The hard disk arguments are used to do special set-up on IDE devices. This includes a number of CD-ROM devices as well as the normal hard drives. Drive specific options have the form:

hda=, hdb=, hdc=, hdd=.


Page 214 - Linux Press http://www.linuxpress.com

Non drive specific options have the form: hd=. This option can be used to specify the next drive in the a, b, c, d order. Drive specific options can be used in place of non-specific ones with the expected result. In the following discussion the hd= will be used exclusively and can be replaced by any drive specific option that applies.

hd=cyls,heads,sects[,wpcom[,irq]]
This option is used to specify the physical geometry of the disk. Only the first three parameters are required. The wpcom (write pre-compensation) parameter is ignored by IDE devices. The irq value is the irq of the controller of the device and as such is not strictly a drive parameter.

hd=serialize
Many of the older kernels had a broken CMD-640 chip driver design which resulted in corrupted data when the second controller was operated at the same time as the first. This option forces the driver to do sequential accesses rather than simultaneous activity. You will only need to use this option if you have a drive installed on the second IDE controller.

hd=dtc2278
If you have a DTC2278D IDE interface this option causes the driver to attempt to enable the second controller and faster transfer options.

hd=noprobe
If the machine has an old IDE drive that suffers from being probed this option will keep that disaster from happening. For example, if the drive is hdb then the following will allow the drive to not be probed but also provide the drive information for proper identification of the drive: hdb=noprobe hdb=1166,7,17 will do the trick.

hd=nowerr
As some drives appear to have the WRERR_STAT bit permanently stuck. This option allows the drive to work anyway.


Page 215 - Linux Press http://www.linuxpress.com

hd=cdrom
If there is an ATAPI compatible CD-ROM installed on one of the IDE controllers and it is not recognized by the kernel, this option will allow the kernel to recognize the drive.

xd=type,irq,iobase,dma_chan
If the system has an old 8 bit xt card, the driver probes the card for a BIOS. If none is found, or the signature is not recognized, then the drive will not be recognized. This option will allow the recognition to occur. Type specifies the card manufacturer and has the values: 0=generic; 1=DTC; 2,3,4=Western Digital; 5,6,7=Seagate; 8=OMTI. Irq, iobase and dma_chan are all required parameters so don't leave any off.

Other CD-ROMS

This section contains options for CD-ROM devices that are neither SCSI or IDE/ATAPI devices.

aztcd=iobase[,magic_number]
The Aztech interface uses these options. If the magic number is set to 0x79 the driver will continue to try to function even when the firmware version is unknown. Any other magic number will be ignored by the driver.

cdu31a=iobase[,irq[,is_pas_card]]
This argument is used to configure the Pro Audio Spectrum cards as well as some Sony supplied interface cards. Passing an irq value of 0 tells the driver that the card does not support interrupts. If the card does support them you are encouraged to use the interrupt, as it will ease the CPU load. If the card is a Pro Audio Spectrum then the is_pas_card parameter should be "PAS".

sonycd535=iobase[,irq]
Used by the Sony CDU-535 interface card, the iobase passed as 0 to act as a placeholder when an irq needs to be specified.


Page 216 - Linux Press http://www.linuxpress.com

gscd=iobase
Used by the GoldStar interface

mcd=iobase[,irq[,wait_value]]
Used by Mitsumi Standard interface cards, the wait_value is for devices that are having trouble with timeouts, but should be used with care as some implementations of the driver don't support this option. Whether or not it is implemented depends on a compile time DEFINE.

mcdx=
For the Mitsumi XA/Multisession Interface experimental

optcd=iobase
The Optics Storage Interface uses this argument.

cm206=[iobase][,irq]
Used by the Philips CM206 interface, this driver expects irq values between 3 and 11 and iobase values between 0x300 and 0x370, so these can be supplied in any order, with either value missing. There is also the cm206=auto which tells the driver to auto probe for the information.

sjcd=iobase[,irq[,dma_channel]]
This argument is used by the Sanyo interface card.

sbpcd=iobase,type
Used by the Soundblaster Pro interface card, the value of type can be: 0 for LaserMate, 1 for SoundBlaster, 2 for SoundScape and 3 for Teac16bit. The iobase is the base for the CD interface and not the sound card.

Floppy Drive Arguments

All of the information in this section can be found in README.fd in linux/drivers/block. The following information is taken directly from this file.


Page 217 - Linux Press http://www.linuxpress.com

Several points of interest include:

Using floppy= arguments on the command line as well as in the LILO config file will result in the two arguments being concatenated.

The floppy= argument can be used with insmod, however the syntax is slightly different.

For insmod the floppy= is only entered once with the parameters following it in quotes as, "floppy="daring two_fdc"".

floppy=mask,allowed_drive_mask and floppy=all_drives Are obsolete and should be replaced by: floppy=drive,type,cmos

Which is mandatory when using more than 2 floppy drives, and sets the CMOS type for drive to type, where the CMOS types are:

0 - Use the value found in the physical CMOS
1 - 5 1/4 DD
2 - 5 1/4 HD
3 - 3 1/2 DD
4 - 3 1/2 HD
5 - 3 1/2 ED
6 - 3 1/2 ED
16 - unknown or not installed

Note: Type 5 is for use with AMI floppy drives. Under other circumstances this type was intended for use by floppy "tapes".


Page 218 - Linux Press http://www.linuxpress.com

floppy=asus_pci
Sets the bitmask to allow only devices 0 and 1. This is the default.

floppy=daring
Indicates a "well behaved" floppy controller, which allows the driver to provide more efficient and smoother operation and will speed up certain operations. However this may cause failures on some controllers.

floppy=one_fdc
Tells the driver that you have only one controller. This is the default.

floppy=[address,]two_fdc
Indicates to the driver that there are two floppy disk controllers and that the second controller resides at address. If address is not entered then 0x370 is assumed.

floppy=thinkpad
Informs the driver that this is a Thinkpad and will deal with the inverted disk change line used by these machines.

floppy=0,thinkpad
Tells the driver that this is not a Thinkpad.

floppy=omnibook
and
floppy=nodma
As the HP Omnibook has no workable DMA channel and other hardware deliver "Unable to allocate DMA memory" error, this argument tells the driver not to use DMA transfers with the drive. The machine must be at least a 486 to use nodma, and the FIFO threshold should be set to 10 or lower to limit the number of data transfer interrupts.


Page 219 - Linux Press http://www.linuxpress.com

floppy=dma
Allows the driver to use DMA and is the default.

floppy=nofifo
Used to disable the FIFO entirely. If the Ethernet card or other device declares "Bus master arbitration error" while using the floppy, you will need to use this argument to disable the FIFO.

floppy=fifo
Enables the FIFO and is the default.

floppy=threshold,fifo_depth
This argument is relevant in DMA mode and sets the FIFO threshold. A higher value allows the floppy driver to tolerate more interrupt latency, while generating more interrupts. A lower value should lower the interrupt latency and produces fewer interrupts.

This threshold can be tuned using the "floppycontrol --messages" and then looking for "Over/underrun - retrying" messages when accessing the floppy drive. If there are a huge amount of these messages then the threshold is set to low. Set the threshold value higher until you only see an occasional error message. Building the kernel with the floppy driver as a module will allow you to remove the driver and re-install it with a different threshold value without the need to reboot the machine. Remember to re-is sue the "floppycontrol --messages" command after each reload of the driver. Usually this "tuning" will not be necessary, as the default value of 0xa is a reasonable value in most cases.

floppy=unexpected_interrupts
This argument causes a warning message to be printed whenever an unexpected interrupt is received from the floppy. This is the default behavior.


Page 220 - Linux Press http://www.linuxpress.com

floppy=no_unexpected_interrupts
and
floppy=L40SX
This argument causes no message to be printed when an unexpected interrupt in received. The IBM L40SX laptops have an interaction between certain video modes and the floppy controller that result in unexpected interrupts. These interrupts only effect performance and can be safely ignored.

Fdutils and mtools provide additional run-time configuration capabilities for the floppy drive, including reading high capacity disks.

Other Device Drivers

Any drivers not falling into the above categories will be found here.

ether=irq,iobase[,param1[,param2....[,param8]]],name

For configuring Ethernet cards. The various cards have differing parameters, but they all require an irq and iobase address. The first, non-numeric value, is taken to be the name of the device. This argument is typically used to force the detection of a second Ethernet card, and, for that purpose, would look like: ether=0,0,eth1. Note that 0 is again used as a place holder for this argument.


Page 221 - Linux Press http://www.linuxpress.com

sound=device1[,device2.....[,device11]]
Provide a means to override the compiled in values. This is somewhat complex and should be avoided if possible. The deviceN parameters are of the form 0xTaaaId where the bytes are used as follows:

T device type: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16, 7=SB16-MPU401
aaa I/O address in hex
I Interrupt in hex
d DMA channel

Using a "sound=0" disables the sound card all together.

busmouse=irq
Used by the busmouse driver.


Page 222 - Linux Press http://www.linuxpress.com


Page 223 - Linux Press http://www.linuxpress.com

Appendix 8

Drop in Debian

Drop in Debian (DiD) is provided on the Custom CD, as a set of 5 files, copied to the DOS partition by the START.BAT script. These files provide a Debian installation suitable for compilation of a custom kernel without impacting the partition configuration of the target machine. Although the root-file-system image-file requires "contiguous" disk space, this can easily be provided by the DOS utility defrag. Running defrag with full optimization enabled will improve the operati on of the DOS programs on the system, as well as provide an adequate space for installation of DiD.

Once the files have been properly installed this Debian system can be booted up simply by typing did and enter, at the DOS prompt. This will cause loadlin to boot up the kernel and mount the file system. This system comes with the 2.0.30 kernel source installed in /usr/local/src/linux and all the gcc tools and support necessary for compiling that source. This system takes up just less than 75 megs of the 100 meg file system which leaves a little room for system expansion, but is primarily provided for the installation of an alternate kernel source tree. It is also possible to enlarge the system if there is sufficient disk space on the DOS partition, and obtain as complete a Debian installation as is desired, without creating a new partition on the disk.


Page 224 - Linux Press http://www.linuxpress.com

How it works

Drop in Debian uses a patch to the kernel that allows the root file system to be mounted with the loop device. This means that the root file system can be an ext2 file system file image. That is, it is a file system embedded inside a file. That file can now reside on a DOS file system and still perform as an ext2 file system by mounting it with the loop device. The file acts like a partition under these circumstances with full read/write capability within the limits of the files siz e.

Loadlin loads the kernel and provides the parameters to cause it to mount the root file system image from the file provided. The line from the Custom CD that causes this boot up looks like:

loadlin vmloop root=/dev/hda1 looproot=root.did

where vmloop is the kernel image file with the proper patches applied, /dev/hda1 is the DOS partition where the file system file exists, and root.did is the image file used for the root file system.

This Debian system can thus reside on a DOS machine with no more impact to answer for, other that the consumed disk space. When the system is no longer wanted on that particular machine, the 5 files can be deleted, wiping all trace of Debian from the system. While the Debian system resides on the DOS machine, no DOS application is capable of gleaning information from the Debian system, as the file contents make no sense without the proper file system access.


Page 225 - Linux Press http://www.linuxpress.com


Page 226 - Linux Press http://www.linuxpress.com


Page 227 - Linux Press http://www.linuxpress.com

Appendix 9

What is Free Software

The following definition of Free Software is copyright c 1997 "Software in the Public Interest" and is printed here with the author's permission. The project participants overwhelmingly voted to adopt this declaration on the 4th of July, 1997. What follows is the entire document.

DEBIAN'S "SOCIAL CONTRACT" WITH THE FREE SOFTWARE COMMUNITY

We are Software In The Public Interest, producers of the Debian GNU/Linux system. This is the "social contract" we offer to the free software community.

1. Debian Will Remain 100% Free Software

We promise to keep the Debian GNU/Linux Distribution entirely free software. As there are many definitions of free software, we include the guidelines we use to determine if software is "free" below. We will support our users who develop and run non-free software on Debian, but we will never make the system depend on an item of non-free software.


Page 228 - Linux Press http://www.linuxpress.com

2. We Will Give Back to the Free Software Community

When we write new components of the Debian system, we will license them as free software. We will make the best system we can, so that free software will be widely distributed and used. We will feed back bug-fixes, improvements, user requests, etc. to the "upstream" authors of software included in our system.

3. We Won't Hide Problems

We will keep our entire bug-report database open for public view at all times. Reports that users file on-line will immediately become visible to others.

4. Our Priorities are Our Users and Free Software

We will be guided by the needs of our users and the free-software community. We will place their interests first in our priorities. We will support the needs of our users for operation in many different kinds of computing environment. We won't object to commercial software that is intended to run on Debian systems, and we'll allow others to create value-added distributions containing both Debian and commercial software, without any fee from us. To support these goals, we will provide an integrated system of high-quality, 100% free software, with no legal restrictions that would prevent these kinds of use.

5. Programs That Don't Meet Our Free-Software Standards

We acknowledge that some of our users require the use of programs that don't conform to the Debian Free Software Guidelines. We have created "contrib" and "non-free" areas in our FTP archive for this software. The software in these directories is not part of the Debian system, although it has been configured for use with Debian. We encourage CD manufacturers to read the licenses of software packages in these directories and determine if they can distribute that software on their CDs. Thus, although non-free software isn't a part of Debian, we support its use, and we provide infrastructure (such as our bug-tracking system and mailing lists) for non-free software packages.


Page 229 - Linux Press http://www.linuxpress.com

THE DEBIAN FREE SOFTWARE GUIDELINES

1. Free Redistribution

The license of a Debian component may not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources. The license may not require a royalty or other fee for such sale.

2. Source Code

The program must include source code, and must allow distribution in source code as well as compiled form.

3. Derived Works

The license must allow modifications and derived works, and must allow them to be distributed under the same terms as the license of the original software.

4. Integrity of The Author's Source Code

The license may restrict source-code from being distributed in modified form _only_ if the license allows the distribution of "patch files" with the source code for the purpose of modifying the program at build time. The license must explicitly permit distribution of software built from modified source code. The license may require derived works to carry a different name or version number from the original software. (This is a compromise. The Debian group encourages all authors to not restrict any files, so urce or binary, from being modified.)

5. No Discrimination Against Persons or Groups

The license must not discriminate against any person or group of persons.


Page 230 - Linux Press http://www.linuxpress.com

6. No Discrimination Against Fields of Endeavor

The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.

7. Distribution of License

The rights attached to the program must apply to all to whom the program is redistributed without the need for execution of an additional license by those parties.

8. License Must Not Be Specific to Debian

The rights attached to the program must not depend on the program's being part of a Debian system. If the program is extracted from Debian and used or distributed without Debian but otherwise within the terms of the program's license, all parties to whom the program is redistributed should have the same rights as those that are granted in conjunction with the Debian system.

9. License Must Not Contaminate Other Software

The license must not place restrictions on other software that is distributed along with the licensed software. For example, the license must not insist that all other programs distributed on the same medium must be free software.

10. Example Licenses

The "GPL", "BSD", and "Artistic" licenses are examples of licenses that we consider "free".


Page 231 - Linux Press http://www.linuxpress.com

The concept of a Linux distribution stating its "social contract with the free software community" was suggested to me by Ean Schussler. I composed a draft, and then it was refined by the Debian developers in e-mail conference during most of June. They then voted to approve it as our publicly stated policy. We hope that other software projects, including other Linux distributions, will use this document as a model. We will gladly grant permission for any such use.

Respectfully Submitted

Bruce Perens
Debian Project Leader


Page 232 - Linux Press http://www.linuxpress.com

Index

Symbols

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Z

"Linux Press" © 1997 "Linux Press" All Rights Reserved.