Linux Information, Linux Education, Linux Migration, Linux ISO Downloads


The (OLD) Debian GNU/Linux Cookbook
By Graham Williams

Last Modified 2003/09/06 12:11:28 Graham.Williams@csiro.au

DISCLAIMER: The information on this page is provided as-is. Use it at your own risk. But please let me know if there are errors or if you think it can be enhanced.

Visit the The GNU/Linux Cookbook, a user's guide to using GNU/Linux, and a replacement for this older information.

A PDF version of the FULL book is also available. Out-of-date information on Debian GNU/Linux on the Dell Latitude XPi P133ST is available in dlxpip133st.html

This cookbook provides an overview of installing Debian GNU/Linux on a number of machines, specifically the Dell Latitude CPi D300XT laptop, but also with information relating to installaitons on other hardware, including the Dell Latitude XPi P133ST and Dell Latitude XPi 90T laptops and an old 486/DX66 underperformer with no CDROM, no modem, no network card, but with 12MB RAM, a 1.44MB floppy and a 400MB hard disk.

If you've come by this way email me your experiences and recipes for inclusion.

Sample Hardware

This cookbook started life as a guide to installing Debian GNU/Linux on the Dell Latitude CPi D300XT laptop and will still serve that purpose. The hardware consisted of:

Identification: Dell Latitude CPi D300XT
CPU: Pentium II (Deschutes)
Graphics Chip: NeoMagic MagicGraph 128XD (NM2160) chipset
Memory: 128MB
Hard Disk: 6GB (internal MS-WindowsNT)
6GB (bay GNU/Linux /dev/hdc)
Floppy Disk: 3.5" (parallel port of the docking station)
CD-ROM: (docking station bay)
Sound: Crystal Semiconductor CS4237B
Advanced audio system with SRS® 3D sound
PCMCIA: 3COM 56K
Ethernet: 3COM Vortex 3C590/905-series (docking station)
Monitor: SyncMaster 17GLi (docking station)

The laptop has two 6GB internal Hard Drives (one internal for Microsoft Windows NT and one in the internal bay of the laptop for Debian GNU/Linux). The floppy drive normally housed in the internal bay is hooked up through the parallel port. A docking station delivers a CD-ROM, Ethernet, and external keyboard, mouse, and monitor to the laptop. Things work pretty much the same (except for missing devices of course) when it's free of the dock. I have woody (the current `unstable' Debian distribution) installed and use the Helix GNOME desktop environment.

A much older machine is the 486/DX66 on which I have a very basic installation of woody with Emacs, ssh, and lynx (no windows yet).

Identification: None
CPU: Intel 486/DX66
Graphics Chip:
Memory: 12MB
Hard Disk: 420MB

Floppy Disk: 3.5" 1.44M and 5.25" 1.2M
CD-ROM: Second hand, but not yet connect.
Sound: None
Network: None
Monitor: None

Installation

Distributions

For a real challenge one starts with the Linux kernel and builds a GNU/Linux system bit-by-bit. Usually though you start with one of the many excellent distributions. My favourite is Debian GNU/Linux, the ``Linux for the GNU Generation.'' I started with Slackware but migrated through Red Hat on to Debian. Red Hat is pretty good. But Debian is great. It conforms to the open and distributed development model, unlike Red Hat, and is the basis of commercial distributions like Amirix, Corel, Embedded Debian, Stormix, TimeSysand the VA Linux Systems, O'Reilly and SGI collaboration. It also powers web sites like Linux.com. The stable distribution is rock solid. The unstable distribution is where you will find the latest and the greatest -- it is a pretty solid distribution (and is particularly suited to those who live at the bleeding edge). Administering the system and maintaining up-to-date package installations is easy with Debian's apt and dpkg tools. A lot of effort has been devoted to ensuring the system works as a whole, rather than providing a lot of glitz.

Here are some specific reasons I use Debian:
It is difficult to upgrade a system from one RedHat release to another. Debian provides simple migration paths that are well trodden.
Debian's tools have the ability to do recursive upgrades of systems.
Debian deals with dependencies and will identify the required packages and install them and then install the package you want.
Debian has a utility to install RedHat packages if you are desperate!
Debian does not overwrite your config files nor does the packaging system touch /usr/local.
RedHat uses a binary database for it's package data while Debian (dpkg) uses text files. Debian is more robust (if a single file gets corrupted it's less of a problem) and it is possible to fix or modify things by hand using a normal text editor if needed. (Debian's apt uses a mixed approach: it uses the same text files as dpkg but uses a binary cache to also get the advantages of a binary database.

The Installation Process

Installation is a breeze if you follow the very clear instructions of the Debian Installation Guide.

Nine floppies (for Debian 2.1) began the installation for me. The raw floppy disk images were retrieved from ftp.debian.org. They are: resc1440.bin (Rescue Disk); drv1440.bin (Drivers); base14-1.bin up to base14-7.bin (Base Disks). These are dumped to floppy disks using the rawrite2 executable for Microsoft Windows (available from the same place):

C:\> rawrite2 -f resc1440.bin -d a:

Following the installation instructions left me with a basic installation of Linux:

Boot with the Rescue Disk. I had to force the recognition of the internal bay hard drive by supplying the following command line when you receive the boot prompt:

boot: linux hdc=13424,15,63
(the numbers were eventually figured out one time when the drive was auto-detected).

The dbootstrap application runs automatically and asks lots of configuration questions, with a summary of my answers below:

color
kbqwerty/us
diskspartition 6GBLinuxN P 6063 B T 83 Bhdc1
128MBSwapN P 125 T 82hdc2 W Q
swap/dev/hdc2scan
linux/dev/hdc1scan
rootmount/dev/hdc1
kernelfrom /dev/fd0Rescue DiskDrivers Disk
devicesmiscpsaux
netppp
networkhost = debian
connected = no
basefrom /dev/fd0Base Disks 1-7
configtimezoneAustralia ACTGMT no
(skip the "Make Linux boot directly from hard disk")
Make boot floppyCustom Boot
Reboot

Once the base is installed and the machine rebooted you are asked to enter a password for the root account and to create a user account. Do this.

PPP should then be made to point to your ISP using your PCMCIA modem card (or some other modem or network device). The Debian package tool called `dselect' will do the rest allowing you to choose packages and to install them. I did this using the `apt' method but you could also do this via a CD-ROM. Initially, dselect will install all of the other basic required packages, and then hand things over to you for your needs.

Dual Boot with MS-WindowsNT

You might like to begin with installing the lilo package. (But don't install it over the existing master boot record on drive /dev/hda unless you wish to wipe out NT -- the boot sector of the first hard disk where the BIOS boots from is called the master boot record or the MBR). For dual boot using the Microsoft Windows NT boot loader see the Linux with NT Loader mini HOWTO, but I detail the steps below. Lilo (/sbin/lilo) is run under Linux to install a boot sector (after editing /etc/lilo.conf) on /dev/hdc. You then copy the Linux boot sector to floppy disk, reboot to NT, and copy the Linux boot sector onto the NT hard disk. The NT boot loader is then told where to find the file (edit C:\boot.ini). It is all very clearly documented in the above mini HOWTO. On bootup you can then choose between GNU/Linux and Microsoft Windows NT.

# editor /etc/lilo.conf
root=/dev/hdc
boot=/dev/hdc
append="hdc=13424,15,63"
# /sbin/lilo
Warning: /dev/hdc1 is not on the first disk
Added Linux *
# dd if=/dev/hdc1 of=/root/bootsect.lnx bs=512 count=1
# mcopy /root/bootsect.lnx a:
# reboot (into NT)
C:\>copy a:\bootsect.lnx c:\bootsect.lnx
C:\>attrib -s -r c:\boot.ini
C:\>notepad c:\boot.ini
[boot loader]
timeout=30
default=C:\bootsect.lnx
[operating systems]
C:\bootsect.lnx="Debian GNU/Linux"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
C:\>attrib +s +r c:\boot.ini
C:\>reboot (into Linux)

Note the inclusion of the append line above in my lilo.conf. This ensures /dev/hdc is found. Otherwise, sometimes it is not.

After you install a new kernel under Linux (either from a kernel-image package on the Debian archive or else your own compiled kernel-image) you will need to rerun LILO. By default lilo.conf identifies the image to boot as "/vmlinuz". This is a symbolic link to, for example, /boot/vmlinuz-2.0.36.

Package Administration

Introduction

Debian distributions are based on over 4400 packages. Your task is to select those you wish to install! This is made easier with task packages which are virtual packages that depend on a collection of other packages. Selecting one of these task packages results in that collection of other packages being installed. An example is the task-tex package that will install the TeX and LaTeX packages and related utilities.

Individual packages are installed and updated using dselect (with a basic GUI), or dpkg (for manual installation of deb files), or apt-get (for automatic download and install, including installation of other required packages).

Using dselect is at first confusing but allows you to easily update and install new packages with an ease that leaves you confident that all difficulties have been carefully hidden through extensive dependency and consistency checking. If network connection is interrupted, the downloads will be resumed from where they got to. The dselect learning curve will pay dividends. My installation has always been left in a consistent and stable state after installing packages from the Debian archives on the Internet.

As you gain confidence and know what you are after, move on to apt-get if you prefer a command-line interface. This takes care of dependency checking automatically (unlike dpkg) and will retrieve the required packages from the Debian archives.

Each individual package can Suggest, Recommend, and Depend on other packages. A subtle difference between dselect and apt-get is that the latter ignores Suggest and Recommend dependencies whereas dselect will offer Suggested packages for the user's attention and will select Recommended packages automatically.

Releases and Versions

Debian has a carefully planned and controlled release program and has a variety of distributions available at any time. The distributions have code names (from the Toy Story movies), release names, and versions. This may sound complicated, but it is quite simple and effective, and I describe it through an example. The official version of Debian is referred to as the "stable" distribution which, as of April 2000, is code-named "slink" and is officially Debian 2.1. The "unstable" distribution is where new packages and updates to old packages appear and the current unstable distribution is code-named "woody". A new release is on the horizon. This release has until recently been called "unstable" but is now "frozen". Its code-name is "potato". It will be officially released sometime as Debian 2.2. The different names act as convenient synonyms with the code-names never changing but the stable/unstable/frozen links set as appropriate.

The fact that the links can change is a little problematical as people may suddenly find that their system wants to upgrade everything to a new version once the stable link changes to a new release. My suggestion is to choose the code-name and stay with that. So, as of May 2000, if you want to maintain a stable distribution, go with "slink". If you want to track the emerging new release, then go with "potato". If you want all packages and latest releases (but less well tested) go with "woody".

Version Code Name Frozen Released Distribution (April 2000)
2.0 hamm
2.1 slink 1998/11/03 1999/03/10 stable
2.2 potato 2000/01/16 2000/06/?? frozen
woody unstable

Installing Packages

There are over 75 Debian mirrors world-wide and over 4400 packages available for unstable. Check for a mirror near you by trying http://ftp.XX.debian.org/debian where you replace XX with your country code. If you don't find one then try some others or stay with the master Debian site or check for another mirror. If you do find a suitable mirror then edit /etc/apt/sources.list (as root user) and add in the appropriate Net address. My current sources.list points to the potato distribution:

deb http://ftp.au.debian.org/debian potato main contrib non-free
deb http://ftp.au.debian.org/debian-non-US potato/non-US main contrib non-free

Note that the format of the non-US entry has changed since slink.

Using dselect

Running dselect you will be lead through these simple steps:
Access the archives using the apt access method. You will be offered the chance to edit the sources.list file but I always answer N since it seems to wipe out my comments. I prefer to hand edit the file and to update my comments.
Update my machine's picture of the world. This reads the Packages files (which is the master list of packages available from the Debian archive) found at those sites listed in sources.list and updates the information for dselect on my machine.
Select any packages you want to install. This will also highlight any packages that dselect thinks you probably should install, including dependencies and security updates.
Install will then figure out what has to be done and tells you what it will need to download. You can tell it to go ahead or if you get cold feet you can pull out here and go back and change your selections. If you go ahead the packages are pulled from the Net and installed.
Config is mostly a null operation for me. It seems to just double check things.
Remove is also mostly a null operation. It also seems to just double check things.
Quit when I'm all done.

Simple. The Select stage can be a little confusing when you get conflicts so read the help screens carefully.

Once you've got things going with dselect you may find the convenience of the command line based apt-get useful.

Last Updated: 2000/06/13 09:35:02 Graham.Williams@cmis.csiro.au

Using apt-get

The apt-get utility provides a command line method for installing packages and (automatically) their dependencies, retrieving them from the Internet when required. The basic operation is:

# apt-get update (to update the list of available packages)
# apt-get install package-name

The file /etc/apt/sources.list is again used to specify the location of packages.
Upgrading all Packages

To upgrade all of your installed packages to the latest available for a particular distribution distribution, all you need to do is add the appropriate lines for that distribution to your /etc/apt/sources.list and then simply:

# apt-get update
# apt-get upgrade

Usually this will list the new packages to be installed and any old ones that will be removed, and inform you of the number of packages that will be upgraded. To also list the packages that will be upgraded use the -u option:

# apt-get -u upgrade

An alternative, and that which is often suggested, is to do a dist-upgrade rather than just an upgrade. The difference is that an upgrade will not remove packages nor will it install new packages (that might otherwise be required due to dependencies). A dist-upgrade will do an upgrade but also do the book-keeping (removing and installing other packages). As a consequence dist-upgrade may break things temporarily if it has to (e.g., uninstall a critical package in order to get dependencies working). So the common upgrade procedure is:

# apt-get update
# apt-get dist-upgrade

If your sources.list grabs the packages from the net these upgrades can take some time but are mostly automatic.

You can use the --download-only option of apt-get to download the files for an install without actually unpacking and setting up the packages. For example:

# apt-get update
# apt-get --download-only dist-upgrade

In this way you are able to leave the download unattended and when you are ready you can monitor the unpacking and setup.

If things go wrong somewhere the apt may be able to help. The --fix-broken will do its best:

apt-get --fix-broken dist-upgrade

but if things still don't work, you may need to use dpkg directly to remove and isntall packages.

Last Updated: 2000/05/20 22:50:25 Graham.Williams@cmis.csiro.au

Available Packages

Here are some other locations that may come in use for different purposes. Some may no longer be current so check them out first.

# Security updates from Debian
deb http://security.debian.org/ stable updates

# Gnome DEBs for slink from Debian
deb http://www.debian.org/~jim/debian-gtk-gnome.old/gnome-stage-slink slink main

# Alternative non-US distribution
deb http://non-us.debian.org/ potato/non-US main contrib non-free

# XFree (3.3.4) for slink
deb http://samosa.debian.org/~branden/ xfree86-334-slink/

# Updated Gnome packages (1.1.90)
deb http://marillat.free.fr/ unstable main

# Seahorse: the Gnome GUI for GnuPG
deb http://seahorse.sourceforge.net/ debian contrib/X11

# Helix GNOME: install task-helix-core and task-helix-gnome or dist-upgrade
deb ftp://spidermonkey.helixcode.com/pub/helix/distributions/Debian/ woody main

# Also mirrored in Australia by AARNET
deb ftp://mirror.aarnet.edu.au/pub/helixcode/distributions/Debian/ woody main
Package Administration

Put a package on hold


$ dpkg --set-selections hold diff

List all installed packages that have updated versions available


$ apt-get update
$ apt-cache dump | awk .....
Maintaining a Distribution Archive

The apt method within dselect and the apt-get command (which the apt mathod uses) place all downloaded files into /var/cache/apt/archive. You can then use the apt-move command to move the archived files into a local hierarchy that mirrors a standard disttribution hierarchy. Then you can point apt-get to this local archive by pointing to it from sources.list using the file:// format. You can also give the option --download-only to apt-get to download but not unpack nor install the package.
Synchronising Two Installations

The package system maintains a list of all packages installed (and de-installed). You can access this list, save it to a file, and use it to mark those same packages for installation (or deinstallation) on anther machine:

# dpkg --get-selections > dpkg-selections
# dpkg --set-selections < dpkg-selections
# apt-get dselect-upgrade
Package Information

The dpkg and apt-get commands are pretty useful and provide a lot of functionality. Here's some common things that you may want to do:

Search for the package that installed the file diff.info.gz


$ dpkg --search diff.info.gz[alternative is -S]

List all packages installed (one line per package)


$ dpkg --list[alternative is -l]
$ dpkg --get-selections

What is the (one-line) status of the diff package?


$ dpkg --list diff

List the information for any package with diff in its name


$ dpkg --list *diff*

List files associated with the package diff


$ dpkg --listfiles diff[alternative dpkg -L diff]

What packages mention diff?


$ apt-cache search diff

Display information about a package

$ apt-cache show diff[alternative is dpkg --print-avail]

What packages depend on diff?


$ apt-cache showpkg diff
$ apt-cache depends diff

Last Updated: 2000/05/24 16:36:07 Graham.Williams@cmis.csiro.au

X Windows

And now onto the desktop itself.

XFree86 Server

XFree86 3.3.2 is shipped with Debian 2.1. However, the NeoMagic Graphics chip is supported by XFree86 as a standard SVGA driver only from XFree86 3.3.3. All is not lost as Debian 2.1 has available a XFree 3.3.2 driver for the chipset called xserver-neomagic.

I first updated to XFree86 3.3.4 compiled for Debian 2.1. After upgrading to potato you will have XFree86 3.3.6. The packages from potato to install are:

# apt-get install task-x-window-system
# apt-get install xserver-svga

You will then need to run either xf86config (for a console-based interface) or XF86Setup (for a X Windows based interface) to create an appropriate /etc/X11/XF86Config file. If you are in luck, this will be straightforward. Often it is not (particularly for laptops). Below are some configs I have had success with:

XF86Config for the nm2160

I hand crafted a simple XF86Config file that worked to get 16 bpp at 1024x768 on the Neo Magic graphics chip nm2160:

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/freefont/"
FontPath "/usr/X11R6/lib/X11/fonts/sharefont/"
EndSection

Section "ServerFlags"
EndSection

Section "Keyboard"
Protocol "Standard"
AutoRepeat 500 5
LeftAlt Meta
RightAlt ModeShift
RightCtl Compose
ScrollLock ModeLock
XkbKeymap "xfree86(us)"
EndSection

Section "Pointer"
Protocol "PS/2"
Device "/dev/psaux"
Emulate3Buttons
Emulate3Timeout 50
EndSection

Section "Monitor"
Identifier "Dell SyncMaster 17GLi"
VendorName "Dell"
ModelName "SyncMaster 17GLi"
HorizSync 31.5 - 48.5
VertRefresh 55-65
Modeline "1024x768" 65 1024 1032 1176 1344 768 771 777 806 -hsync -vsync
EndSection

Section "Device"
Identifier "NeoMagic"
# Option "intern_disp"
Option "extern_disp"
EndSection

Section "Screen"
Driver "svga"
Device "NeoMagic"
Monitor "Dell SyncMaster 17GLi"
DefaultColorDepth 16
Subsection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection

This setup is used when the notebook is docked with display being to an external monitor. Both internal and external displays don't work together and so you need to manually edit the XF86Config file each time you change between the external and internal display (could be done with a script, but essentially you swap the "#" around, which is used to identify a comment line). It is reported that having both enabled can destroy the internal display. It certainly makes it go pretty ugly momentarily. According to the Linux on the Dell Latitude CPi A366XT page, you can't just switch between internal and external displays without updating your XF86Config and restarting X, or YOU CAN DAMAGE YOUR DISPLAYS!

The value for the Vertical Refresh rate of 55-65 was suggested by Charlie Hedlin since ``LCD's don't need 80Hz and the like.''

XF86Config for the clgd7543

I hand crafted a simple XF86Config file that worked to get 8 bpp at 800x600 for the Cirrus Logic grachics chip clgd7543 and plan to include it here sometime (depending on demand).

Windowing Environment

GNOME is my Desktop and Session Manager and Sawfish is the Window Manager. KDE is a GNOME alternative and Window Maker and Enlightenment are alternatives to Sawfish.

The LBX (Low Bandwidth X) server extension is useful for increasing the responsiveness of remote X applications. Remote Emacs windows are now being delivered to my desktop over a 33 K connection at about 3 times more quickly! (Also more quickly than my LBX connection from MS-WindowsNT using Exceed!)

The Kernel

CHECK: I may not need to compile my own kernel any more? The last remaining thing I needed was APM for the laptops. The current kernels have APM configured, but disabled by default, and I beleive you turn it on with the use of "apm=on". Need to check this. If this works, I will move this kernel section to the end of the document as it becomes less important. So add append="apm=on" to lilo.conf.

After upgrading to potato I installed a newer kernel. I will illustrate the process with kernel-image-2.2.14 and the associated pcmcia-source (PCMCIA card support) and alsa-source (sound card support). Tuning the kernel through the CONFIGs can appear daunting.

There are many reasons to install your own kernel. I originally had to do so to get support for the laptop advanced power management and sound. Kernels are becoming more modularised and thus more general, allowing support to be loaded as needed..

The first step is to install the appropriate packages. For slink I installed the following packages:
kernel-source-2.0.36
pcmcia-source
kernel-package

For potato I installed the following packages:
kernel-source-2.2.14
pcmcia-source
alsa-source
kernel-package

The first three install the appropriate tar files in /usr/src. The fourth provides the tools to create your own kernel-image and modules-image as Debian packages that you then install with dpkg. The use of kernel-package is highly recommended and is the Debian way of doing things. It is all very straight forward. Note that you do not need the kernel-headers package as all the headers required are in the kernel-source package. The headers were split out for other reasons. The kernel-source delivers a tarball. You can instead obtain a more recent version from the net yourself and still use the Debian kernel-package utilities.

The steps involved are:

# cd /usr/src
# tar Ixvf kernel-source-2.2.14.tar.bz3
# tar zxvf alsadriver.tar.gz
# tar zxvf pcmcia-cs.tar.gz
# ln -s kernel-source-2.2.14 linux (for convenience)

You now need to configure the kernel. There are many options and I tend to start with the Debian kernel configuration found in /boot/config-2.2.14. The primary changes I made include specifying CONFIG_M686 and enabling APM support. For these kernels Debian out of the box supports sound modules and NTFS.

# cd linux
# make xconfig (or make menuconfig or make config)
(load /boot/config-2.2.14 into the config tool)
# make-kpkg clean
# make-kpkg --revision 2:custom.1 kernel_image
# make-kpkg --revision 2:custom.1 modules_image

Move the old module libraries out of the way:

# cd /lib/modules
# mv 2.2.14 2.2.14.dist

Now install the new kernel and modules:

# cd /usr/src
# dpkg --install kernel-image-2.2.14_2:custom.1_i386.deb
(Boot Floppy: YES)
(LILO: YES but don't install anything in the master boot record)
# dpkg --install alsa-modules-2.2.14_0.4.1i-4+2:custom.1_i386.deb
# dpkg --install pcmcia-modules-2.2.14_3.1.8-10+2:custom.1_i386.deb
# reboot (from floppy)

This should start you up with the new version of the kernel. You can then do the boot sector transfer across to WindowsNT to remove the need to boot from floppy, once all seems okay (assuming you've already set things up for dual boot):

# /sbin/lilo
Warning: /dev/hdc1 is not on the first disk
Added Linux *
# dd if=/dev/hdc1 of=/root/bootsect.lnx bs=512 count=1
# mcopy /root/bootsect.lnx a:
# reboot (into NT)
C:\>copy a:\bootsect.lnx c:\bootsect.lnx
C:\>reboot (into Linux)

Note how this interacts with Debian's package management. By calling my version of the kernel 2:custom.1, this will be a more recent version number than the standard Debian kernel-image package. That is, kernel-image-2.2.14_2:custom.1_i386 is regarded as being more recent than kernel-image-2.2.14_2.2.14-1_i386. Thus, the packaging system will not try to install a more recent 2.2.14 over my own image. Debian kernel packages always have the version number the same as the kernel version number.

Configurations

Kernel configuration is an interesting exercise. You are offered many configuration options, most with brief but helpful documentation (stored in /usr/src/linux/Documentation/Configure.help).

An oddity I noticed is that a couple of files in /usr/src/linux/include/linux are not readable by other. For example:

-rw-r----- 1 root root 126 Apr 28 11:42 version.h

In compiling other programs this is sometimes a problem (for non-root users). You can change this with "chmod o+r version.h".

Recipes

There is no hiding the fact that GNU/Linux is a comprehensive operating system. We now begin tuning the system to suit our needs. Some tuning may require reconfiguring the kernel but many do not. I mention various kernel configurations in the following and you can check in the appropriate config file in /boot (for example /boot/config-2.2.14) to see if the currently running kernel has the option set.

Advanced Power Management

UPDATE I beleive current debian kernels have CONFIG_APM on but CONFIG_APM_DO_ENABLE off. You simply have to add append="apm=on" to lilo.conf to turn APM on and you no longer need to worry abuot copmiling your own kernel.

The relevant parts of the kernel configuration (kernel 2.2.15) are:

CONFIG_APM=y
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
CONFIG_APM_DISPLAY_BLANK=y
CONFIG_APM_POWER_OFF=y
CONFIG_APM_IGNORE_MULTIPLE_SUSPEND=y
CONFIG_APM_IGNORE_SUSPEND_BOUNCE=y

You can now close the lid of the laptop to force a suspend. The laptop will beep then turn itself off. Simply open the laptop lid to resume. This works for both console logins and X sessions.

You can also eject the laptop from a docking station to achieve the same effect. When the laptop lid is opened, or the laptop is inserted back into a docking station, the system resumes. It seems advisable to do this only when in console mode (that is, not while you have an X session running - it's not quite there for X sessions yet).

It is also advisable to install the apmd package which provides the apm command. This produces a more human readable output than a simple cat /proc/apm and can suspend your laptop from the command line:

# apm
AC off-line, battery status high: 56% (2:27)
# apm -s

A suspend while connected to power within a docking station does not seem to suspend the machine completely. It sends it to sleep but it does not beep and power down.

Some useful commands related to rebooting are:

# poweroff(shutdown and turn off the computer)
# reboot(shutdown and reboot the computer)

After installing the apmd package the suspend maintains the clock correctly between a suspend and a resume. (Although I seem to be losing a few seconds each time.)

Note that a suspend will disconnect your modem!

PROBLEMS When you eject the laptop from a docking station while running an X session it does not come back properly when the laptop is reinserted into a docking station. Sometimes the display is half off the screen. Sometimes simply get streaks across the screen. If this happens, you can go back to a console as usual with CTRL-ALT-F1, or exit from the X session with CTRL-ALT-BACKSPACE. If you eject while running an X session and open the laptop lid you will not get the proper display, and may damage the display. It can also freeze the laptop.

Alternative Applications

Debian has a clean mechanism for dealing with applications that provide the same tools and commands. We describe here how this mechanism works and how you can use it to tune your installation.

If you have more than one variant of emacs installed (e.g., emacs19, emacs20, and xemacs) then you can configure which one you get by default with:

# update-alternatives --config emacs

You will be asked to choose from a list of alternatives.

Here's another example: You can use the update-alternatives command to specify which window manager to use as the system default.

# update-alternatives --config x-window-manager

Now suppose the window-manager you want to use as the default is not listed as available. You can install it with:

# update-alternatives --install /usr/bin/x-window-manager \
x-window-manager /usr/bin/mywm PRIORITY

Where PRIORITY is a number higher than the highest existing priority for the x-window-manager alternative. You can get a list of priorities with:

# update-alternatives --display x-window-manager

To remove a Window Manager:

# update-alternatives --remove x-window-manager /usr/bin/mywm

CD-ROM (Docking Station)

For a CD-ROM located in the Docking Station of a Dell Latitude CPi you will need a recent version of the kernel (I'm currently using 2.2.15) so that it will be recognised. On boot the following is displayed:

CMD646: IDE controller on PCI bus 01 dev 28
CMD646: chipset revision 0x03, MultiWord DMA Force Limited
CMD646: 100% native mode on irq 10
ide2: BM-DMA at 0xfcc0-0xfcc7, BIOS settings: hde:pio, hdf:pio
ide3: BM-DMA at 0xfcc8-0xfccf, BIOS settings: hdg:pio, hdh:pio
...
hde: TOSHIBA CD-ROM XM-1802B, ATAPI CDROM drive
...
ide2 at 0xfcf8-0xfcff,0xfcf2 on irq 10
..
hde: ATAPI 24X CD-ROM drive, 128kB Cache
Uniform CDROM driver Revision: 2.56

To make use of the CD-ROM device first create the /dev/hde devices with MAKEDEV as root:

# cd /dev
# ./MAKEDEV hde
# ln -s /dev/hde cdrom
As root you can then mount any data CD-ROM:

# mount /dev/hde /cdrom
# ...
# umount /cdrom

To allow general access to the CD-ROM edit /etc/fstab to add the following line. Any user can then mount /cdrom which is particularly convenient from the GNOME mount applets which you can click on to cause a mount or unmount, or you can leave it to GNOME to magically do the mounting for you when you open the device Make sure you unmount the cdrom before you physically remove the media.

/dev/hde/cdrom auto defaults,noauto,user,ro,nohide 0 0
The various options mean: `ro' mounts the file system as read-only; `user' lets any user mount the file-system; `noauto' means that the file-system is not automatically mounted at boot time; `nohide' shows hidden and associated files.

The command line mounting of the partition can then become:

# mount /cdrom

For audio CD access the default seems to be to add users to the Unix group "disk". That didn't quite seem right. Instead change the Unix group of /dev/hde from "disk" to "cdrom" and add users who need access to the drive to the group "cdrom":

# chgrp cdrom /dev/hde
# adduser fred cdrom

Then, next time user fred logs on he will be in group cdrom in addition to the other groups he was already in. He will then have access to the CD-ROM device.

The Gnome gtcd utility worked just fine, accessing the Internet CDDB database of CD's to display album and track information. All I need to know now is how to get sound from the CD!

CD-ROM Images

You can obtain all of the Debian packages from the network with the support of the Debian package tools. However, one may not always have access to the network and you may want to burn your own CD-ROM image of the distribution. This is fairly straightforward. (The example uses a Solaris machine and ncftp 2.4.3 - don't use ncftp 3 beta.)

First, obtain the appropriate Debian tools to build a CD-ROM image (I build the image on the Solaris machine for now):

$ wget ????/pseudo-image-kit-2.0.tar.gz
$ tar zxvf pseudo-image-kit-2.0.tar.gz
$ cd pseudo-image-kit-2.0
$ perl -pi -e 's|^#! /bin/sh|#! /usr/local/bin/bash|' make-pseudo-image

Obtain a list of files that will make up the contents of the CD-ROM from an appropriate CD-ROM archive. (These archives also contain the actual images, but they get overloaded with people downloading the images so it is turned off. It is more efficient for every one if you build the image yourself using the procedure here. It is quite easy.)

$ wget http://www.uk.debian.org/debian-cd/cd-images/2.1_r4/i386/binary-i386-1.list

Now download from a local server the actual packages that will make up the contents of the CD-ROM:

$ ./make-pseudo-image binary-i386-1.list ftp://ftp.au.debian.org/debian

This takes quite a while! The end product is a file called pseudo-image. All the other pseudo-image* files can be removed (they're used to keep track of where things were up to in case the download is interrupted).

This download is called the pseudo image because it's an approximation of the real image! It's pretty close, but not yet guaranteed perfect. It is a simple process to now turn it into an Official image:

$ mv pseudo-image binary-i386-1.iso
$ rsync --verbose --progress --stats --block-size=8192 \
mirror.aarnet.edu.au::debian-cd/2.1_r4/i386/binary-i386-1.iso .

This uses rsync to synchronise your CD-ROM image with the Official one. You can now burn this image directly to CD-ROM. Most CD-ROM burning software supports burning iso images directly.

Some other useful rsync commads allow you to hunt around the directory structure of an rsync server:

List contents of the rsync server's root directory

$ rsync mirror.aarnet.edu.au::

List the contents of another directory

$ rsync --dry-run mirror.aarnet.edu.au::debian-cd/2.1_r4/*

You can get the potato test images as:

$ rsync --dry-run cdimage.debian.org::potato_nonUS_test/*

Clock
Timezones

With a dual boot system with WindowsNT I have my clock set to local time as suggested by the Debian install. For a sole Linux installation Debian suggest using GMT (the standard approach for Unix). To effect a change use the "tzconfig" command (I've not tried this). You also have to change the line in /etc/default/rcS which states the CMOS clock configuration.
Clock Accuracy

There are two clocks: a system clock and a hardware clock. The date command talks to the system clock that is maintained by the operating system. The hwclock command talks to the hardware clock that is part of the hardware of the computer and usually battery backed up.

Some experimentation is often needed to make sure you get an accurate clock (or close to it). Some hints on dealing with clock problems can be found in the Clock mini HOWTO, but the hwclock and adjtimex man pages are clearer. The adjtimex command can be used to counter systematic drift in the system clock.

To set both clocks do:

# date -s "13 Jun 2000 10:10:00"
# hwclock --systohc

Then monitor how the system and hardware clocks vary over 24 hours.

The "adjtimex" command communicates with the kernel to change the number of ticks in a day (default is 10000 which corresponds to about 8.64 seconds per tick) and the frequency (default is 0) of the system clock. In Debian you can use the command adjtimexconfig to automatically tune the tick and frequency so that the change has effect on each boot. Alternatively, override the automatic settings by editting /etc/adjtimex.conf.

The system clock on the Dell Latitude CPi was losing (very) roughly 1 second per hour. (The hardware clock also seems to lose nearly one second each day.) Not too much on the face of it, but considering the machine does not need rebooting, this can become a significant drift. I found a tick of 10002 and a frequency of 4000000 worked for me on the Dell Lattitude CPi

# adjtimex --tick 10002 --freq 4000000

On the 486/DX66 the system clock was gaining about 22 seconds in 24 hours and the hardware clock gaining about 10 seconds in 24 hours. Removing 3 ticks had the dramatic effect of making the system clock pretty accurate.

# adjtimex --tick=9997
Hardware Clock Drift

The hwclock command provides the interface to the hardware clock. The --adjust option checks information stored in the configuration file /etc/adjtime and makes an actual correction to the time stored in the hardware clock to account for the drift that it (the hwclock utility) has been monitoring. (Each time you set the hardware clock with the hwclock command the current time is compared to the previous time it was corrected to determine the amount of drift.) Thus, when setting the system clock from the hardware clock it is advisable to do the following:

# hwclock --adjust
# hwclock --hctosys

When updating the hardware clock from an accurate system clock do:

# hwclock --systohc

Cron

Debian uses cron in a very neat and stylised fashion. Scripts to be run regularly are maintained in /etc/cron.{daily,weekly,monthly}. The entries in /etc/crontab then simply run any scripts in these directories on a regular basis. The daily scripts, by default, are run at 6:25am each day. The weekly scripts are run each Sunday at 6:47am and the monthly scripts are run at 6:52am on the first day of each month. If these times don't suit (e.g., you like to work early in the morning and get annoyed by the sudden disk whirling each morning at 6:25 am) the simply change the times in /etc/crontab. Unlike traditional versions of cron, the newer versions do not require the running of the crontab command to install the new version when you edit the crontab file.

DHCP

Warning I have not tried this: Some notes here on using DHCP, from Florian Lohoff. First, install dhcpcd-sv 1.3.16-1 (Sergei Viznyuk's DHCP client for 2.1.x kernel). With a self-made pcmcia-cs 3.1 set DHCP=y in /etc/pcmcia/network.opts and then link /sbin/dhcpcd -> ../usr/sbin/dhcpcd-sv, so that the pcmcia utils will find the dhcpd. Then remove the /etc/(init.d|rcn.d)/dhcp scripts as these are not needed as the pcmcia network scripts start the dhcpd itself.

Documentation

Where is documentation on Debian? An interesting question, and one that has not been all that easy to answer.

Ethernet Connection

To connect through the ethernet adaptor in the docking station Eric Dobbs reported that RedHat 6.0 found a 3com Vortex (3C590/905-series) driver auto-detected for him. So getting the ethernet controller in the docking station to work was simply a matter of setting the following kernel configurations (from the defaults supplied):

CONFIG_NET_VENDOR_3COM=y
CONFIG_VORTEX=m

Now on boot I get the following messages (which can also be read using the dmesg command):

3c59x.c:v0.99H 11/17/98 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/vortex.html
eth0: 3Com 3c905 Boomerang 100baseTx at 0xfc80, 00:c0:4f:f7:02:bf, IRQ 10
8K word-wide RAM 3:5 Rx:Tx split, autoselect/MII interface.
MII transceiver found at address 24, status 7849.
Enabling bus-master transmits and whole-frame receives.

Floppy Disks

If you edit /etc/fstab to add the following line any user can then mount /floppy which is particularly convenient from the Gnome mount applets which you can click on to cause a mount or unmount. Or create symbolic links for Gnome from your ~/.gnome-desktop directory to /floppy. Then Gnome seems to magically do the mounting for you when you open them (they will appear on your Gnome desktop and you can change the icons to more appropriate symbols such as a floppy). I guess you better make sure you unmount the floppy before you physically remove the media.

/dev/fd0 /floppy auto defaults,noauto,user,rw 0 0

Fonts

Unless you like large fonts be sure to have the 75dpi fonts ahead of the 100dpi fonts in the FontPath as specified in /etc/X11/XF86config.

GNOME

I run Gnome as my XWindows session manager and Sawfish as my window manager. The HelixCode distribution of Gnome (released end of May 2000) is a professional package, and brings the Linux desktop pretty much up to scratch. They package Gnome for many platforms, including RedHat and Debian. Prior to Gnome 1.2 the default window manager was Enlightenment. Now it is Sawfish, a lightweight, yet themable and very tunable window manager, that leaves all the rest (like session management, multiple desktops, etc.) to Gnome.
Dialogues and Hidden Files

When prompted to load or to save files the dialog does not show any hidden directories (those beginning with a period). To get them displayed, simply enter a period in the Selection text field and press TAB.
GDM Startup

The Gnome Display Manager gdm, when installed, will start up automatically on boot. This presents an X11 interface to log on. If you are used to starting X11 from the command line you will be used to using either .xsession or .xinitrc to tune some of your X11 settings. The System menu in the gdm dialogue lets you start up Debian, Gnome, or XSession. To tune your X11 settings in this environment with your .xsession file be sure to run with the Debian session. If you use the default Gnome session in gdm place your tuning in the file .gnomerc in your home directory, but be sure not to include any window managers, etc., as these are started by the gnome-session command that the Gnome session starts. Some startup tunning I perform incudes:

#
# Left ALT should be META so that it is the way I like it in Emacs.
#
xmodmap -e 'keysym Alt_L = Meta_L'
xmodmap -e 'add mod1 = Meta_L'
#
# Start up by asking for the SSH Pass Phrase
#
ssh-add




Groups and Users: Standards





A Debian system creates some standard groups and users. The system
administrator will also create new users and may also create new
groups. We list below the standard groups and users.


Groups


mailbox spool directories belong to group mail, MUA software runs setgid mail. This makes dot locking possible. Also, mailboxes must be writeable by group mail (Policy Manual, 3.1.1.1, 5.6).
standard group for user news. Why does news have its own group, and many of the other daemon uids don't?
uucp jobs are group accessible to uucp.
web cache files are group accessible to proxy.
/proc/kmem is group accessible to kmem. Programs that need access are sgid kmem.
ppp- and isdn device nodes are group accessible to dialout. Include users allowed to initiate dialout in this group.
fax jobs are group accessible to fax.
voice messages are group accessible to voice (vgetty)
for device nodes. Include users allowed to access these in the appropriate groups.
historical reasons?
for device nodes. Include users allowed to access sound in this group
For daemons running under their own uid/gid. Why are these static?
33: This has been discussed in the past, and the discussion is not finally finished. Today, www data files belong to this group and the web servers run with that group, thus being able to write the files. This has been considered a security hole, but was not yet changed.
(Don't have an explanation yet)
For daemons running under their own uid/gid. Why are these static?
historical reasons?
For daemons running under their own uid/gid. Why are these static?
Include people who should be able to write /usr/src in this group. What is its intended use?
For daemons running under their own uid/gid. Why are these static?
Programs that should be able to access the shadow passwords are sgid shadow.
Programs that should be able to access utmp are sgid utmp.
games that store user independent high score values in /var/lib/games are sgid games
used for qmail
Group gid Description
root 0 This is root's primary group.
daemon 1 A group for non-root daemons.
bin 2 This group exists for historical reasons and some programs won't run without it.
sys 3 This group exists for historical reasons and some programs won't run without it.
adm 4 Most of the log files are group readable by users who belong to his group. You can add users who need to monitor such log files to this group. Note though that sometimes private information can be accidentally included in logs, like passwords when connecting via PPP over a Modem. This should not happen (the scripts that write the logs should identify these as not being echoed) but it can.
tty 5 The terminal devices with names beginning with /dev/tty are group accessible to group tty. Programs such as write and wall need access to tty and they set their group id (sgid) to tty.
disk 6 The disk device nodes are group accessible to disk so that programs that need access to them are sgid disk.
lp 7 Jobs associated with the lp (printer) daemon (lpd) are group accessible to the lp group so that lpd can access them without being root.
mail 8
news 9
uucp 10
proxy 13
kmem 15
dialout 20
fax 21
voice 22
cdrom 24
floppy 25
tape 26
sudo 27
audio 29
dip 30
majordom 30
postgres 32
www-data 33
backup 34
msql 36
operator 37
list 38
irc 39
src 40
gnats 41
shadow 42
utmp 43
video 44
staff 50 This group is used to control access to /usr/local. Add users to this if they should be able to write to /usr/local and /var/local.
games 60
qmail 70
users 100 All users belong to this group. Place files that all users should have access to in this group.








Initialisation





Initialisations of various daemons and other services within Linux
usually occur at boot time but also can occur when the run level is
changed.



Run levels are used by Linux to identify different situations in
which the operating system is run. For Debian the default is run level
2, unless you change it in /etc/inittab, and for Red Hat the
default is run level 3. In genera the run levels 2, 3, 4, and 5 are
all multi-user tun levels.



When the system enters a run level it executes the scripts in
/etc/rc.n where n is the runlevel in question. These scripts
are symbolic links (symlinks) to scripts in /etc/init.d. A
script starting with S starts a service. One starting with
K stops a service. The number after the `S' or `K' specifies
the order in which the scripts are run. For example, S25xdm will start
before S35xdm.



To stop xdm, for example, from starting up by default on boot,
simply remove the symbolic link of the corresponding `S' script from
/etc/rc.2.



See man init for and extensive discussion.



The init script is run with "start" on changing runlevel (S) and
runlevels 0 (the halt runlevel) and 6 (the reboot runlevel). It is not
clear to me why the "start" is sent for runlevels 0 and 6? Should it
not be "stop" (and hence the link from /etc/rc0.d/ should be named
Knnhwclock.sh instead of S25hwclock.sh)? It seems that the hwclock is
adjusted and then the system time is updated from it on boot, reboot,
and halt? Makes no sense to me yet. But it's good that it does this
since otherwise it would be updating the hardware clock with the
incorrect system clock on each halt/reboot (which is actually what I
think is happening).



I am also puzzled as to why there is no link to
/etc/init.d/hwclock.sh from /etc/rc2.d. Maybe I need one there (set up
with update-rc.d as root). Or maybe it's just needed in rcS.d (where
it already is) if that is what happens at boot time.



To remove something (e.g., gdm) from the init scripts:


# update-rc.d -f gdm remove






NT File System Access






Kernel 2.2.12 and beyond support read only access to NTFS, the file
system of Microsoft Windows NT. The kernel needs to be configured to
use it:


CONFIG_NTFS_FS=m




I have two NTFS partitions on the Microsoft Windows NT side of the
machine. So I edit /etc/fstab to include these two lines:


/dev/hda1/nt/c ntfs defaults,user,ro,umask=002,gid=1000 0
/dev/hda2/nt/d ntfs defaults,user,ro,umask=002,gid=100 0 0


The various options mean: `ro' mounts the file system as read-only;
`user' lets any user mount the file-system; `nohide' shows hidden and
associated files; 'noexec' avoids regular files showing up as
non-executable.

Then create directories for the mount points:


# mkdir /nt/c
# mkdir /nt/d


As any user can then mount the drives:


# mount /nt/c
# mount /nt/d




These will be mounted each time you reboot, unless you add the
`noauto' option to the appropriate lines in /etc/fstab.



Users are granted access to /nt/c and /nt/d through the use of the
umask=002,gid=100 in the fstab, and then add trusted users to
this group. You can allow access for only a specific user by adding
"uid=1000,gid=1000" to the options. Or you can remove all security and
give complete access to everyone with umask=000 (this is
dangerous as any login will be able to peruse your possibly private
and password containing files on the NTFS partition).



Note that permissions on the mountpoint itself (/nt/c are
irrelevant: when you mount a filesystem the permissions of the mounted
filesystem's root directory replace the permissions of the mountpoint,
even when the filesystem in question does not support permissions.





Parallel Line Network





You have two copmuters, one somewhat better resourced than another.
You have Debian GNU/Linux installed on both. You want to link them
together using their parallel ports and a Null Modem cable (also
called a LapLink cable) so you can share resources. PLIP is the
answer and the PLIP
Install HOWTO gives some clues. Below is my recipe based on these
clues.



TO BE WRITTEN




Passwords





If you forget your password for root, then you will be in a spot of
bother. One way to fix this is to reboot the machine using the Debian
installation floppy or CD. When you get the first question (about the
having a colour monitor) press CTRL-ALT-F1 to get a shell. Mount your
root partition (let's say it is /dev/hda1):


# mount /dev/hda1 /mnt


then edit the password file to erase the encrypted password for root:


# editor /mnt/etc/passwd


Save the file then reboot (CTRL-ATL-DEL).






PPP





The pppconfig command allows you to configure your modem
connections. Essentially it is a front end to the various scripts in
/etc/ppp. My PCMCIA modem is loaded at /dev/ttyS1. Newer versions of
ppconfig check the serial ports for modems for you. Usually,
/dev/ttyS0 corresponds to COM1 under MSWindows and
/dev/ttyS1 corresponds to COM2.



To allow users other than root to connect through the modem (using
the pon and poff pair of commands) add the users to the Unix group
"dip":


# adduser fred dip




Then, next time user fred logs on he will be in group
dip in addition to the other groups he was already in. He
will then be able to initiate and terminate a dial up
session. However, user fred does not have access to the log file
through the plog command---only root does, presumably for security
reasons, since unless you inhibit it, passwords can be displayed
there.



Further information on PPP is available from:





http://axion.physics.ubc.ca/ppp-linux.html





Last Updated: 2000/05/29 14:23:27 Graham.Williams@cmis.csiro.au



modemlights_applet





This is the Gnome applet I use for modem access. After adding a
user to the "dip" Unix group they can use this applet to dial the
modem, display transfers, and to hangup. Under properties I had to
change the connect and disconnect commands to be pon and poff rather
than pppon and pppoff (which don't exist --- perhaps this is a
"problem"). The newer Potato version of the applet had the defaults
correct.



After moving to the potato distribution pon continued to work just
fine under the slink kernel when booting from the slink Custom Boot
disk. But as soon as I compiled my own kernel (2.2.13_2.2.13-2) and
pcmcia-modules, pon stopped working and I was getting an error from
plog:


pppd 2.3.10 started by root, uid 0
Can't get terminal parameters: Input/output error
Connect script failed
Exit.




I seemed to have "fixed" this by removing the setserial package.






Sound with ALSA





The relevant kernel configuration options are:


CONFIG ...




Debian packages to install:

# apt-get install ...




Both ALSA and the
traditional OSS work as kernel modules so that you are able to load
the modules dynamically, changing and experimenting with parameters as
required, without the need to rebuild the kernel. The module
parameters are located in /etc/modutils/alsa. The
alsaconfig utility provides a graphical interface for
editting this file and then loading the modules. If instead you do
this by hand, after you edit the file you can do the following:


# update-modules




This will update the actual configuration file
/etc/modules.conf. A configuration that I finally got working is:


alias char-major-116 snd
alias snd-card-0 snd-card-cs4236
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
options snd snd_major=116 snd_cards_limit=1 snd_device_mode=0660 \
snd_device_gid=29 snd_device_uid=0
options snd-card-cs4236 snd_index=0 snd_id=CARD_0 snd_port=0x530 \
snd_cport=0x210 snd_mpu_port=0x330 snd_fm_port=0x388 \
snd_irq=5 snd_mpu_irq=9 snd_dma1=0 snd_dma1_size=64 \
snd_dma2=1 snd_dma2_size=64 snd_isapnp=0




(note that the line continuations marked by the \ actually
all need to be on the one line). You can then stop the sound driver if
it is already running and start it up with the new configuration:


# /etc/init.d/alsa stop
Shutting down sound driver: done
# /etc/init.d/alsa start
Starting sound driver: cs4236.




You should hear a click from the speakers. Next, make sure it
works by playing a sound:


$ aplay /usr/share/sounds/panel/slide.wav
Aplay: version 0.5.7 by Jaroslav Kysela
Using soundcard 'CS4237B at 0x530, irq 5, dma 0&1'
Playing WAVE '/usr/share/sounds/panel/slide.wav' :
Signed 16-bit Little Endian, Rate 44100 Hz, Mono




Then get xmms and listen to great mp3 quality.



Note that on boot, and only on boot, the message:


isapnp: No Plug & Play device found




is displayed, but others get this message also and sound works for
them.



If you use xmms to play your mp3 files (recommended) be
sure to select the esound output library in the properties
configuration for xmms since otherwise xmms will lock the
sound device and GNOME sounds will wait for a chance to use it and
time out, making GNOME appear very sluggish.



For ALSA (and OSS) you need to know the parameters of your sound
card. There is some help from Dell. My
settings and other suggestions are in the table below (under the
CS4237B column). In the file /etc/modutils/alsa each of these
parameters is prefixed with snd_ and appear as
options for snd-card-cs4236. You should use the
graphical configuration utilitiy alsoconf to set the values,
which also does the necessary updates and turns muting off.




Parameter CS4232 CS4237B Comment
port 0x534 0x530 [NT] [RB] PnP setup
cport 0x120,0xf00 0x210 [NT] [RB] Control port
mpu_port 0x300 0x220 [NT] [RB=330] For MPU-401 UART: -1 = disable
fm_port 0x388 0x388 [TP] [RB] FM port: -1 = disable
irq 5,7,9,11,12,15 5 [NT] [RB]
mpu_irq 9,11,12,15 9 [RB] [TP=7] For MPU-401 UART
dma1 0,1,3 0 [NT] [TP=1] [RB=1] First DMA
dma1_size 64 [RB] Max first DMA size in kB (4-64kB)
dma2 0 [TP] [RB] Second DMA for Yamaha CS4232 chip (0,1,3), -1 = disable
dma2_size 64 [RB]Max second DMA size in kB (4-64kB)
isapnp 0 [RB] ISA PnP detection - 0 = disable, 1 = enable (default)





The information comes from [TP] Tomas Pihl, [RB]
Robb, and [NT] the MSWindowsNT
Diagnostics under the Administrative Tools menu. In particular, the
information from the MSWindowsNT Diagnostics for the cs32ba11 (on the
ISA bus), which I think is what the MSWindowsNT driver for this sound
card, is:


IRQ5
I/O Port 0210-0217
0220-022F
0388-038B
0530-0533
DMA Channel Port
00 0




Sound and GNOME





Using sound in GNOME (sound is enabled through the Control Center)
when the enlightenment sound daemon (esd) isn't running
causes each GNOME application to pauses each time it tries and fails
to play a sound.





Initially, users do not have access to the sound system. You may
get permission errors on /dev/sound and /dev/dsp. To allow a user,
fred, access to the audio, add them to the "audio" group:


# adduser fred audio




Then, next time user fred logs on he will be in group
audio in addition to the other groups he was already in. He
will then be able to access the audio devices. Be cautious though
since members of the audio group may use the microphone attached to
your computer to eavesdrop on you (even from remote logins through ssh
or telnet)!




SSH





The Secure Shell (abbreviated ssh) provides a secure mechanism for
communicating withremote hosts and is a drop in replacement for things
like rsh, rlogin, and rcp. All communications is encrypted, and is
highly recommended.



The free reimplementation of the now commercial SSH is OpenBSD SSH
which is what Debian provides by default. The package to install is simply:


# apt-get install ssh




However, this package cannot be part of the main Debian
distribution since the US export laws prohibit the export of
cryptography software as it is classified as munitions! You will need
to have a non-US distribution in your sources.list file, such
as one of the following:


deb http://non-us.debian.org/ unstable/non-US main contrib non-free
deb http://ftp.au.debian.org/debian-non-US unstable/non-US main contrib non-free




During the install you may be asked about installing ssh as SETUID
root. The suggesting from the configuration script is that you do not
install as SETUID root and it you have problems, then run
dpk-reconfigure ssh to reconfigure the package. I've had no
problems with this.



Once installed, you can connect to remote hosts running
ssh (e.g., connect as user stu at
wxyz.domain.name.org) or copy files:


$ ssh stu@wxyz.domain.name.org
$ scp file.name stu@wxyz.domain.name.org:remote.file.name



Using rsync with ssh





The rsync application is a related tool that is used to
efficiently copy files across the network. It can also be encouraged
to use ssh to perform it's tasks by setting the appropriate
environment variable:


export RSYNC_RSH=ssh



Using Pass Phrases instead of Passwords





The use of passphrases with public/private keys is more secure than
sending passwords over the network. When connecting to a remote host
that remote host will encrypt a random number with your public key and
require you (automatically) to decrypt it and return it before it agrees to connect.



Once you have ssh installed you can generate a pass phrase
that will be used to secure your communications with the outside
world. Once you've created a pass phrase you need to communicate this
to your remote host. These steps are simple:


$ ssh-keygen
$ cd .ssh
$ scp identity.pub stu@wxyz.domain.name.org:.ssh/authorized_keys




If your remote host already has the authorized_keys file
then don't copy over it, but append the contents of your local
identity.pub to it. You can then do the following so that you
won't be asked for your password nor your passphrase each time you
interact with the remote host:


$ ssh-agent bash
$ ssh-add




The ssh-add will prompt you for your pass phrase but from
then on all further interaction with the remote host will not reqquire
the pass phrase to be type again (it is rembered).

<>NEED TO VERIFY THE FOLLOWING PROCEDURE



For the same effect in X windows start X with (THIS IS NO LONGER
REQUIRED?):


$ ssh-agent startx




and enter your pass phrase on the startup of the X session and
all further ssh connections within this X session will require
no further password or pass phrase.



Better still you can install packages that will prompt you for the
pass phrase when you start up an X session:


# apt-get install ssh-askpass
# apt-get install ssh-askpass-gnome




Then add an ssh-add command to your .xsession file to have
the pass phrase promtped for, using a Gnome dialog box, automatically
each time you start up your X session:


ssh-add < /dev/null
exec gnome-session





XAuthority and SSH and LBX Proxy





XAuthority provides a mechanism for ensuring secure access to your
display from other hosts connected to the network. Refer to the mini
HOWTO for details.



Once connected onto a network (e.g., connecting via modem to a
dialup service) you can use ssh (the Secure SHell) to login
to remote hosts and then have them start up X clients to be displayed
on your local host. The ssh protocol encrypts all
communications and performs some compression of the communications.



By default, Debian ssh does not allow X11 connection
forwarding from remote hosts. This is a security measure. Instead,
for each remote host you would like to connect to and have
applications running there to display on your X11 display you will
need to allow X11 forwarding. This is achieved by adding the
following lines to your /etc/ssh/ssh_config (assuming the
remote host you want to allow is called
wxyz.domain.name.org.au):


Host wxyz.domain.name.org.au
ForwardAgentyes
ForwardX11 yes




The LBX
extension to X11 performs compression of the X11 communications
protocol. On your remote host you run the lbxproxy command
which, by default, creates a `fictional' display called :63
(so, for example, on the remote host you would then run xterm -d
:63). The lbxproxy application will transform all the
communications via display :63 into a copmressed protocol and send them on through to the actual display of your local host.



While ssh takes care of xauth issues when connecting to a
remote host you have to take an extra step to pass this on to clients
displaying through LBX. By default lbxproxy sets up a display on :63.
Thus on your local host (abcd) you grab the xauth key:


abcd$ xauth list $DISPLAY
abcd/unix:0 MIT-MAGIC-COOKIE-1 ece19x123971yy0329f47dbf512345c3
abcd$


Then on the remote host add this cookie:


wxyz$ xauth remove :63
wxyz$ xauth add :63 . ece19x123971yy0329f47dbf512345c3


and then run applications on the remote host through to the display on
your local host:


$ xterm -d :63




You can automate this a little by adding the following to your
.bashrc (on your local machine, abcd). Then type the command
lbxauth (on abcd), be prompted for a password (unless you set
up ssh to not use passwords), and the remote xauth will be set up.
The remove before the add is necessary as an add does nothing if the
:63 is already in the .Xauthority file (on wxyz).


function lbxauth ()
{
lbxhost=wxyz.domain.name.org.au

ssh ${lbxhost} \
xauth remove :63 \; \
xauth add :63 . $(xauth list $DISPLAY | awk '{print $3}')
}









Problems






Finding /dev/hdc






The hard disk is /dev/hdc, however the GNU/Linux boot from floppy
does not always seem to find it, so I (sometimes) need to specify
a boot-time parameter:

boot: linux hdc=13424,15,63

Since installing LILO and setting up dual boot using the
MS-WindowsNT boot loader (see the
Linux with NT Loader mini HOWTO) /dev/hdc has always been found
automatically. Booting from floppy, sometimes won't find it, but will
on a second (or third) boot!




CD AUDIO





The Audio from the CD-ROM does not work. The controls seem just
fine, in something like gtcd, where you can start the CD playing etc.
But no sound is heard. It worked once when I first boot NT then into
Linux. Presumably there is some initialisation that NT did that Linux
does not know about? Perhaps I need to explore using loadlin from
MS-DOS after it has initialised things properly! Or is there some
setting not being set? I can certainly read the audio from the drive
and play it back as wav and mp3!



Last Updated: 2000/04/27 11:12:22 Graham.Williams@cmis.csiro.au






Acknowledgements






Other Dell Latitude Pages








CPt
C333 with Debian GNU/Linux 2.1






CPi
D266XT with RedHat 5.1






CPi
A366XT with RedHat 6.0









Personal Communications








John Seebach has
installed Debian on his CP D266XT and provided
advice on pcmcia compilation and APM.






Eric Dobbs uses Red Hat
and supplied information on the ethernet in the docking station.






Matt Simmons has Red
Hat on a Dell Latitude CPi and has experimented with the
internal CDROM.






Graeme
Stables has Red Hat 6.0 on a Dell Latitude XPi 133ST.






Keith and Gerrit have been helping with advice on getting sound
working.








Contents
The Hardware
Installation
Package Administration
X Windows
Kernel
Recipes
APM
CD-ROM
CD-ROM Images
Clock
DHCP
Init
Ethernet
Gnome
Groups
NT Partition
PPP
Run Levels
Sound
SSH
XAuthority
Problems
Acknowledgements
Resources
Debian GNU/Linux
Linux Documentation
Linux on Laptops
Linux with Laptops

This document is copyright © 1999, 2000 Graham Williams and can be freely redistributed under the terms of the GNU Free Documentation License. Please email corrections and updates to Graham.Williams@cmis.csiro.au

Have Fun!

Site Map

Main - Contact - Education - Information - Resume

(c) Copyright 2000 StacyWebb.biz

Located in Roanoke Virginia, USA..