Tailoring MCC Interim Linux to Your Taste ***************************************** There are several changes which you might make to your newly installed Linux system, whether to make it run better on your machine, or to adapt it to suit your personal taste. Some of these changes are discussed in this file. Recompiling the kernel ====================== There are many good reasons why you might wish, or even need, to recompile the kernel. You may wish to remove or add drivers or file systems, to add some of the available patches, to remove features you may not need, such as maths coprocessor emulation, or to add support for more than 16 Mb of RAM. To recompile the kernel, you should install the gcca, gccb, and linux packages from the MCC distribution. Then `cd' to `/usr/src/linux-mcc'. Then type `make config' and answer the questions with `y' or `n'. Finally give these commands: make dep make zlilo The last command installs the newly compiled kernel in /boot and uses LILO to prepare to boot from it. It also runs the command `psupdate' to change the file `/etc/psdatabase' so that the `ps' commands work with the new kernel. The `make zlilo' command also saves the old `/boot/vmlinuz' as `/boot/vmlinuz.old'. This should allow you to boot using LILO with the option `linux.old' if you have any difficulty booting with the new kernel. Note that the commands for the `zlilo' target have been altered slightly in the MCC Makefile to conform to the conventions of this distribution: the variable `VMLINUZ' has been added, and the copying of `zSystem.map' removed. You may wish to make similar changes to the Makefile which comes with later versions of the Linux kernel: VMLINUZ = /boot/vmlinuz zlilo: $(CONFIGURE) zImage if [ -f $(VMLINUZ) ]; then mv $(VMLINUZ) $(VMLINUZ).old; fi cat zImage > $(VMLINUZ) /usr/bin/rdev -R /boot/vmlinuz 1 /usr/sbin/psupdate if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi *Note*: This release installs the include files in `/usr/include/asm' and `/usr/include/linux' in the directory `/usr/include' rather than in `/usr/src/linux(-mcc)'. This is actually more convenient if you are not recompiling the kernel repeatedly. It means that the C compiler works without installing the kernel sources, and continues to work after you delete the kernel sources. Nevertheless, if you are doing a lot of work with different kernels, you may find it more convenient to move these two directories and their contents to `/usr/src/linux/include', and put symbolic links to them in the `/usr/include' directory: mkdir -p -m 755 /usr/src/linux/include (cd /usr/include;tar cf - asm linux)|(cd /usr/src/linux/include; \ tar xvfp -) rm -rf /usr/include/asm /usr/include/linux ln -s /usr/src/linux/include/* /usr/include Note that this is not necessary; the kernel source installed from the linux package should compile without changing anything. Setting up Ethernet cards ========================= The `standard' kernel as distributed by Linus Torvalds currently contains support for a limited number of Ethernet cards. See README.linux. Western Digital cards should be installed with the two jumpers set to `soft'. It is a good idea to have the DOS program `EZSETUP' to hand, so that you can use it to configure the card in case `wdsetup' doesn't work. (The `EZSETUP' command is supplied with most Western Digital cards on a DOS floppy. If you don't have such a floppy, ask the dealer from whom you bought the card.) The manual page for `wdsetup' is installed as part of the tcpip package, and contains more information about this program. Login as root, then `cd /etc'. You should configure the card before starting the networking software; otherwise you must (after issuing `shutdown -h', of course) press the `RESET' button or switch the power off and on before the changes take effect. Give the command ./wdsetup -a 280 -i 5 to set the card's address and IRQ to appropriate values. The current kernel source sets the IRQ for some tape devices to 5, which conflicts with the most usual Ethernet card IRQ. Either change the kernel source, or change the Ethernet card's IRQ to another value, e.g., 10. If this doesn't work, you need to read the file `README.wdsetup' for more information. Besides changing the cards themselves, the new net-2 software allows you to configure the drivers in the kernel to work with your card. You need to do this only if the kernel fails to recognise your Ethernet card at boot time, and writes the message `No ethernet device found' on your screen and in the file `/var/adm/messages'. In this case, after running `install.net', read the manpages for the commands `ifsetup' and `iflink'. As I understand it, you will need to use `ifsetup' to reconfigure the driver, and then user `iflink' to link the driver to `/dev/inet'. Unfortunately, the net-2 FAQ file contains no information about these commands, and I do not find the man pages clear. Once you determine the correct form of these commands for your machine, edit `/etc/rc.net' and insert them where the note about `ifsetup' appears. Configuring the tcpip package ============================= The TCP/IP programs included in this release of MCC Interim Linux will not work unless you use a version of the kernel which includes TCP/IP and, if you wish, NFS. All kernels distributed in this MCC release include both TCP/IP and NFS. This software should work even if you have no Ethernet card. In that case, of course, you cannot contact other machines, unless you use SLIP or PLIP. This MCC release does not contain the `dip' software usually used to start SLIP connections. More information about SLIP appears in the Linux networking HOWTO. See README.documents. The kernel source supplied, like the compiled kernels, contains only the Ethernet drivers contained in Linus Torvald's official release of the kernel. If you want support for one of the other Ethernet cards, you must get patches from somewhere else and install them before recompiling the kernel. A recent version of many such patches is available by anonymous ftp from ftp.mcc.ac.uk in the directory `/pub/linux/newether'. Before you configure the tcpip package, you should know your hostname, domain name, IP address, netmask, gateway address, and the address of a Domain Name Server. In particular, you may need to have your network manager assign you an IP address. If you have no Domain Name Server, or no gateway, you may use the loopback address `127.0.0.1' for these values. After installing the tcpip package, give the command `install.net'. (This is done during installation if you answer `y' to the question about configuring networking software.) The following dialogue ensues: # install.net What is your hostname (default = linux): *avl0* Internet address of avl0 (default = 127.0.0.1): *130.88.201.62* Domain name for avl0 (default = (none)): *mcc.ac.uk* Netmask for avl0 (default = 255.255.255.0): _ Gateway address (default = 130.88.201.250): _ IP address of your domain name server (default = 130.88.13.7): _ Hostname: avl0 Domain name: mcc.ac.uk Fully qualified: avl0.mcc.ac.uk Internet address: 130.88.201.62 Netmask: 255.255.255.0 Network address: 130.88.201.0 Gateway address: 130.88.201.250 DNS server: 130.88.13.7 Is this correct (Y or N): *y* HOSTNAME: "avl0" You may add more nameservers by editing /etc/resolv.conf Networking software is now configured. Here instead of `avl0' your hostname should appear, and you must give your own addresses instead of `130.88.x.x', and your own domain instead of `mcc.ac.uk'. Before you try to run any TCP/IP software, you might need to run `wdsetup' or `ifsetup'. Ethernet cards. Note that the `install.net' script is aware of the peculiar gateways and netmasks used in Manchester, and makes what ought to be sensible guesses at default values for other sites. After installing networking software, you should edit the file `/etc/inetd.conf' to comment out any services you wish not to allow. To remove a service, insert an initial `#'. If `inetd' is already running, you must send it SIGHUP or reboot after changing this file; otherwise the changes have no effect. Some services, particularly `tftp', may expose your machine to crackers if you have a network connection. Read the man pages and be cautious! If you have no local domain name server, you may wish to delete the file `/etc/resolv.conf' and to remove `bind' from the file `/etc/host.conf'. Other networking programs are available from the various Linux ftp sites. They should compile and fit into the MCC installation with little difficulty. Note that MCC does not use shadow passwords, so any programs which have the option of shadow password support must be compiled without it. *Note*: These programs are compiled from the most recent source I could find. I have fixed a few bugs, but there may still be more. The source I actually compiled can be found (with no patches needed) in the file `netsrc25m' in the directory `sources' in the current MCC Interim distribution. Editing the system configuration files ====================================== After installing this version of MCC Interim Linux, you may wish to customise it. The following files should probably be edited: `/etc/rc.local' This is intended to contain local commands which you want to be run at boot time. The distributed file contains the `selection' command (commented out). This command will not work unless you have an appropriate `/dev/mouse' device. For a serial mouse, this is usually the same as `cua0' or `cua1'. For a bus mouse, this is usually the same as one of the devices `logibm', `psaux', `inportbm', `atibm'. Link the appropriate device to `/dev/mouse', for example with the command `ln /dev/cua0 /dev/mouse'. Note that no MCC kernel comes with support for bus mice already compiled, and that some bus mice will cause problems if `selection' is running at the same time as the X windowing software. `/etc/mtools' See README.linux. `/etc/passwd' If you wish to add a new user, edit this file. The format is pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell where the fields have the meanings defined in the file `/usr/include/pwd.h': user name, encrypted password, user ID number, group ID number, real name, login directory, login shell. `/etc/lilo.conf' This contains the command which controls what happens whenever LILO is reinstalled. You must give the command `lilo' whenever the system file (`/boot/vmlinuz' by default) is modified (for example, by the `rdev' command) or moved: LILO does not use the directory structure to find the file. The file `/etc/README.lilo' contains information about the contents of the file `/etc/lilo.conf'. `/etc/disktab' If you have one of the SCSI disks for which Linux cannot get the geometry, you must edit this file before installing LILO; otherwise the installation will fail. `/etc/inetd.conf' Some services for inetd are commented out. `/etc/kbmap' This file contains the key definitions for your keyboard. By default the British (UK) keyboard map is installed. Other available keymaps are installed in part two of the base package, and the MCC installation gives you the opportunity to change your default. The command `kbdinstall' allows the root user to change the system default keyboard map. Some users with special requirements have asked whether the Shift, Control, and Alt keys can be changed to toggles. To do this, simply edit the file `/etc/kbmap', changing the keysyms `Shift', `Control', and `Alt' to `Shift_Lock', `Control_Lock', and `Alt_Lock' respectively. If you do this, it is a good idea to set some key (for example, Caps_Lock or a function key) to Alt, to avoid problems which occur when switching between virtual consoles. Passing parameters to the kernel ================================ It is possible to pass parameters to the kernel in two ways: by specifying them at the LILO prompt, or by an option in the file `/etc/lilo.conf' such as `append = "hd=202,64,32"'. These options may be useful if your kernel does not detect your hardware configuration completely, or in other circumstances. Unfortunately they are not widely or clearly documented. Among the parameters accepted by MCC kernels are these: aha152x=portbase,irq,scsiid,reconnect Four integers required for Adaptec AHA-152x driver. bmouse=mouse_irq One number describing a bus mouse. debug Set the console log level to 10. ether=irq,base_addr,mem_start,mem_end,name One to four numbers and a device name for Ethercard drivers. All arguments are optional, with name being the first non-numeric argument. irq `0' means to use autmatic detection. base_addr `0' means to probe. mem_start Some drivers use this to specify the debug level: `0'-`7', with 0 meaning no messages, and 7 the maximum. mem_end The 3c502 driver uses this to select between internal and external transceivers: `0' for internal (the default), `1' for external. The name argument should be, for bus-attached Ethernet cards, one of the following: `eth0', `eth1', `eth2', `eth3'. The following names are accepted for parallel port adaptors: `atp0', `dl0'. hd=cyl,head,sector Three numbers describing geometry of the (first) hard disk. mcd=port mcd=port,irq One or two numbers describing Mitsumi CD ROM. ncr5380=port,irq,dma Three numbers required for NCR 5380 driver. Because of a bug, it appears that only the first two may be specified. no387 There is no maths coprocessor on this machine. pas16=io_port,irq Two numbers required for Pro Audio Spectrum/Studio 16 driver. The kernel doesn't actually allow this to be specified at the moment. ramdisk=nnn Reserve nnn Kb of memory for a ramdisk. The MCC kernels have the following patch applied to `linux/init/main.c' to enable this option: @@ -298,4 +298,6 @@ } else if (!strcmp(line,"ro")) root_mountflags |= MS_RDONLY; + else if (!strncmp(line,"ramdisk=",8)) + ramdisk_size = simple_strtoul(line+8,NULL,0); else if (!strcmp(line,"rw")) root_mountflags |= ~MS_RDONLY; reserve=start,extent{,start,extent} One or more pairs of numbers specifying the base address of a reserved region of memory and the size of that region. This prevents other drivers from probing the region unless another kernel argument explicitly tells them to do so. For example, `reserve=0x300,32, ether=0,0x300,eth0' keeps all device drivers except the Ethernet card drivers from probing `0x300'-`0x31f'. ro The root file system is to be mounted in read-only mode. root=nnn root=/dev/xxx Specify the hex number or device name for the root file system partition. rw The root file system is to be mounted in read-write mode. sbpcd=ioaddr,type One number and a string for the IDE-style Soundblaster/Panasonic CD ROM driver. The ioaddr might be, for example, `0x230'. The string is case sensitive, and may be either `LaserMate' (the default) or `SoundBlaster'. sound=integers It is not clear to me from `drivers/sound/dev_table.c' exactly how many integers are passed, or what they mean. st0x=base_address,irq Two numbers required for Seagate ST01/ST02 SCSI driver. t128=address,irq Two numbers required for Trantor T128/T128F/T228 driver. tmc8xx=base_address,irq Two numbers required for Future Domain TMC-885/TMC-950 SCSI driver. xd=type,irq,iobase,dma Four numbers required for XT hard disk controller (`/dev/xda'). Installing the XFree86 software =============================== This release of Linux is compatible with XFree86 release 2.1. The software is available from ftp sites; for example, from ftp.mcc.ac.uk in the directory `/pub/linux/packages/X11/XFree86-2.1'. This directory contains two files, `INSTALL' and `README.Linux', which you should read with care. Select the files you need: one of the seven server files, together with the six other required files, form a minimum installation, as described in `README.Linux'. The required files are small enough to fit on floppy disks. Place these files in a directory somewhere on your Linux machine, e.g., in `/tmp'. Then give the following commands: cd /usr/X386 for i in /tmp/XF86-2.1-*.tar.gz;do tar xzfp $i;done *Note*: Be sure to include the `p' modifier on the `tar' command, or some of the binaries will not work properly. After the software is installed, you must give the command `ldconfig', so that programs can access the new shared libraries. Only then should you tackle the job of creating an `Xconfig' file for your machine. Producing a suitable `Xconfig' file tricky, since it is dependent on both your graphics chip and your monitor specifications. The instructions in the file `/usr/lib/X11/etc/README.Config' should be followed *very carefully*, since you can damage your monitor if you specify values which are very far from the correct ones for your hardware. Calculating the correct values for the `Xconfig' file is the most difficult aspect of installing X windowing software. Once the XFree86 software is installed and configured, you will probably want to fine-tune the installation. If you are using the SVGA server, the command `vgaset' may be useful for this purpose. It is not part of the standard X distribution, but the source is available from most ftp sites. A binary for this command can be found at ftp.mcc.ac.uk in `/pub/linux/binaries-4.5.21/usr/sbin'. The current version of XFree86 sets up the same keyboard mapping which is current when X is started, so that it is no longer necessary to have a special `Xmodmap' file if you do not have a US keyboard. When X is properly configured and fine-tuned, you may wish to change your Linux installation so that it starts X when the system boots and uses `xdm' to log in from the console. To do this, edit the file `/etc/inittab' and change the `initdefault' line to read id:5:initdefault: The files for configuring `xdm' are contained in the `/usr/lib/X11/xdm' directory. You may wish to edit `Xsetup_0' to remove the console from the `xdm' login screen, or to change the default paths in `xdm-config' to conform more closely to the new file system standard. Among the entries which may be useful are these: DisplayManager.errorLogFile: /var/adm/xdm-errors DisplayManager.pidFile: /var/X11/xdm-pid DisplayManager.authDir: /var/X11 DisplayManager.*.userPath: /usr/local/bin:/usr/bin:/usr/bin/X11:/bin:. You may also find it useful to set `DisplayManager.*.systemPath', the default `PATH' variable for root, to include `/sbin:/usr/sbin'. Some examples of files configuring `xdm' can be found at ftp.mcc.ac.uk in the `/pub/linux/binaries-4.5.21/usr/X386/lib/X11/xdm' directory.