home *** CD-ROM | disk | FTP | other *** search
- +-+
-
- TTYLINUX USER GUIDE
- | ttylinux 2.2
- (c) 2001,2002 Pascal Schmidt <pharao90@tzi.de>
-
- | Last update: Wed Jun 5 17:00:22 CEST 2002
- A vertical bar at the left margin indicates changes since the last version.
-
- +-+
-
- Contents
-
- 1. Introduction
- 1.1 What is ttylinux?
- 1.2 What is ttylinux not?
- 1.3 Who is ttylinux aimed at?
- 1.4 License
-
- 2. Installation guide
- 2.1 Requirements
- | 2.2 Download
- 2.3 Customization
- 2.4 Installation
-
- 3. System guide
- 3.1 Features
- 3.2 Bootup and shutdown (initscripts)
- 3.3 Using PPP
- 3.4 Using thttpd
- 3.5 Setting up network devices
- 3.6 Using the firewall
- 3.7 Shell environment
- 3.8 pkg script
-
- 4. Contact
-
- Appendices
-
- A. How to make a bootable ttylinux CD
-
- +-+
-
- 1. Introduction
-
- This section gives an overview on ttylinux. What is it, who can use
- it, why it is there.
-
- +-+
-
- 1.1 What is ttylinux?
-
- ttylinux is a minimalistic Linux distribution. In fact, it is so
- minimalistic that it can't even run standalone without the help of
- another Linux system, even if this system is only really needed for
- installation.
-
- ttylinux aims to put as much as possible into as little space as
- possible. It provides multi-tasking, multi-user, and networking
- capabilities within less than 4 megabytes of operating system size.
-
- The main use that ttylinux comes prepared for is dialing into an
- Internet provider by modem or ISDN and then browse the world wide
- web. There is also a WWW server present for serving content to other
- people.
-
- ttylinux can be installed on hard disk, CD-ROM, or any other media
- you can boot from and has at least 2.88 megabytes of room. The
- preferred way to run ttylinux is to install its image files somewhere
- on the hard disk (needs at most 2.88 megabytes of space) and then run
- the system itself from ramdisk. This makes the system immune to
- crashes and user errors and takes less space than a normal install
- on hard disk, which would take at least 4 megabytes of space.
-
- +-+
-
- 1.2 What is ttylinux not?
-
- ttylinux is not a standalone distribution, you need another working
- Linux system to get it up and running.
-
- +-+
-
- 1.3 Who is ttylinux aimed at?
-
- As ttylinux can be used on machines which are considered obsolete by
- now, such as 386SX class PCs, it is aimed at people who want to have
- a minimalistic Linux distribution to run when little space is
- available.
-
- ttylinux is aimed at people who already have some Linux experience.
- There is no big user manual describing how to use the system, so a
- bit of Unix or Linux experience is very useful when trying to use
- ttylinux. Most of the programs present are smaller versions of common
- Unix utilities, documentation on those can be found in various places
- on the Internet.
-
- ttylinux fits into an eltorito image useful for bootable CD-ROMs. It
- could be used for installation CDs or rescue systems on CD. ttylinux
- provides a working Linux environment from the boot image, and then
- some script could mount the rest of the CD to provide a full system.
-
- Note: ttylinux is really not aimed at Linux beginners. Knowledge
- about how to compile a kernel and find your way around a Linux system
- in general is assumed.
-
- +-+
-
- 1.4 License
-
- All of the software that is used on ttylinux is under the GNU Public
- License. A copy is included in the file COPYING. There are a few
- scripts on the system which I wrote to keep it all together. I place
- them and the system as a whole under the GPL, too.
-
- +-+
-
- 2. Installation guide
-
- This section describes the requirements of ttylinux, where to down-
- load it, and how to customize and install it.
-
- +-+
-
- 2.1 Requirements
-
- This installation guide describes how to setup ttylinux to run from
- a ramdisk image. You will need at least a 386SX processor and 10
- megabytes of RAM to use this approach. Installation on hard disk is
- only described in brief but should work on systems with as low as 6
- megabytes of RAM.
-
- You will also need a Linux kernel suitable for your system, but with
- some addition requirements for ttylinux. The kernel used for running
- ttylinux needs to have ramdisk support, initial ramdisk support, and
- a default ramdisk size of at least 4096. Note that the stock kernel
- configuration will use a ramdisk size of 4096, which is enough. If
- you want to use the basic firewall script of ttylinux, your kernel
- also needs ipchains support.
-
- If you want to use the telnet server in ttylinux, your kernel will
- need to have Unix98 pty support and support for the devpts file-
- system.
-
- The Linux kernel on the system that is used to install ttylinux needs
- to have support for the ext2 filesystem and loopback device. If there
- is no loopback support, you cannot customize ttylinux for your
- system. No problem if the defaults suit you, but this is rather
- unlikely for anybody outside Germany.
-
- For the default installation process describes below, it is also
- required that the system used to install ttylinux is based on glibc,
- aka libc6. The installation process needs to run a program from
- ttylinux at one point that is linked against glibc.
-
- This may all sound like a lot of requirements for the preparation
- system, but almost any half-recent Linux distribution with its
- default kernel will do.
-
- +-+
-
- 2.2 Download
-
- You can download ttylinux from the official homepage, which at the
- moment is at:
-
- http://www.informatik.uni-bremen.de/~pharao90/ttylinux/
-
- | There you will find an archive named "ttylinux-2.2.tar.gz". Grab
- this. Inside the archive you will find this user guide and a file
- called "rootfs.gz", which is the compressed filesystem image for
- ttylinux itself.
-
- +-+
-
- 2.3 Customization
-
- Before you can run ttylinux, you need to change a few settings inside
- the image file to fit your own system. This is done by uncompressing
- and mounting the image and then making the appropriate changes. If
- the image is in the current working directory, do the following as
- root:
-
- gunzip rootfs.gz
- mkdir mnt
- mount -o loop rootfs mnt
-
- Now the ttylinux filesystem is mounted on the directory "mnt". Take a
- look at it if you wish. If you want to install ttylinux to a hard
- disk, you can now create an installation archive for that purpose as
- follows:
-
- cd mnt
- tar cvzf ../ttylinux-hd.tar.gz .
- cd ..
-
- After this, you have a file called "ttylinux-hd.tar.gz" that can be
- unpacked onto any filesystem you like.
-
- The things you will probably want to customize on ttylinux are the
- keyboard map and timezone in use and the Internet provider settings.
- You can copy over the keyboard and timezone setting from your working
- system as follows:
-
- mnt/bin/dumpkmap > mnt/etc/i18n/keymap.dat
- cp /etc/localtime mnt/etc/localtime
-
- To set up the dial information for an Internet provider, you need to
- know the following:
-
- - the device your modem is connected to, i.e. /dev/ttyS1
- - the init string for your modem, i.e. ATZ
- - the speed your modem can talk to the computer, i.e. 115200
- - the phone number of your ISP, i.e. 1-800-LETMEIN
- - your user name at the ISP, i.e. joeuser
- - your password at the ISP, i.e. joepass
-
- The above is for dialup using a modem. If you have ISDN, you need to
- know the following:
-
- - the phone number of your ISP, i.e. 1-800-12345678
- - your user name at the ISP, i.e. joeuser
- - your password at the ISP, i.e. joepass
- - the phone number you want to use for dialing out (one of your
- MSNs [multiple subscriber number])
- - whether you want to use automatic or manual dialing
-
- Edit the file "mnt/etc/isp.conf" and change the settings there to
- your liking. Note that ttylinux only knows about providers that
- launch a PPP session immediately after dialup, so if some special
- procedure is needed to log you in, your Internet connection will not
- work with ttylinux. The ttylinux approach will work with almost all
- providers in Germany, but I don't know about other countries.
-
- NOTE: If you have ISDN, please also change mnt/etc/firewall.conf so
- that the line defining the external interface has "ippp0" instead of
- the default "ppp0" setting.
-
- NOTE: For ttylinux to use ISDN, you need to have USE_ISDN=yes in
- /etc/isp.conf, the default is not to use ISDN. Obviously, you also
- need a kernel with ISDN support and hardware support for your ISDN
- hardware. If you need some module(s) to run your ISDN hardware, you
- will also need to add those and a suitable /etc/modules.conf to the
- ttylinux filesystem.
-
- Once you are finished making changes, unmount the filesystem and run
- gzip to compress it again:
-
- umount mnt
- gzip -9 rootfs
-
- You are now ready for the real installation.
-
- Note that this section has only covered the minimum customization
- needed to run ttylinux. There is more to tune, have a look at the
- system guide section below for information. If you aim at the default
- approach of running ttylinux from ramdisk, you must configure
- everything for your needs before you continue the installation, so it
- may be a wise idea to read the system guide section before you
- countinue. If you install to a hard disk, you can always configure
- things later.
-
- +-+
-
- 2.4 Installation
-
- I am assuming that you use LILO as your boot loader. You can also use
- others like loadlin, but you will obviously need some LILO experience
- to convert the LILO example given here to some other boot manager.
-
- Put the "rootfs.gz" image and the Linux kernel you want to use to run
- ttylinux into the directory that holds your other boot files, most
- likely this will be "/boot". Let's say your kernel image file is
- called "bzImage-ttylinux". You now need to add the following section
- to "/etc/lilo.conf":
-
- image=/boot/bzImage-ttylinux
- label=ttylinux
- initrd=/boot/rootfs.gz
- root=/dev/ram0
- read-only
-
- Now rerun LILO by saying "/sbin/lilo". On your next boot, you can
- just say "ttylinux" on the LILO boot prompt to boot ttylinux. That is
- all, you are now ready to try ttylinux.
-
- If you want to install onto hard disk, you need to have a partition
- of at least 4 megabytes size available. Assuming this partition is
- "/dev/hda8", do the following, using the file "ttylinux-hd.tar.gz"
- obtained above:
-
- mke2fs /dev/hda8
- mount -t ext2 /dev/hda8 mnt
- cd mnt
- tar xvzf ../ttylinux-hd.tar.gz
- cd ..
-
- Now do the customization as outlines above. You will also need to
- change the root device configured in "mnt/etc/fstab". Once you are
- done, you just need to unmount the partition:
-
- umount mnt
-
- Now you can setup LILO as explained above, only change the line for
- the root filesystem to "root=/dev/hda8". Ready to go.
-
- +-+
-
- 3. System guide
-
- This section gives a short overview over the system and some of the
- installed programs.
-
- +-+
-
- 3.1 Features
-
- On bootup, ttylinux provides 6 text consoles for login. The default
- setup has two users: root with password "root" and guest with pass-
- word "guest".
-
- Syslog and klog daemons are running and log kernel and system
- messages to "/var/log/messages".
-
- If you need a text editor, "e3" is installed. Simply invoke it by
- typing "e3 /path/to/filename". A help screen is available, simply
- press "Alt-h". e3 unstands a lot of the old WordStar commands, so it
- feels a bit like WordStar or the common Linux editor "joe".
-
- For manipulation of users, groups and passwords, the tools "passwd",
- "adduser", "addgroup", "deluser", and "delgroup" are present.
-
- If you have not changed the timezone and keyboard settings as out-
- lined above, ttylinux will use its default settings. The default
- timezone is Europe/Berlin and the default keyboard mapping is for a
- 102-key German keyboard. These setting should work in Germany.
-
- The inetd super-server is running by default. A telnet server will be
- forked by inetd when a telnet connection comes in.
-
- ttylinux includes a basic packet filtering firewall.
-
- +-+
-
- 3.2 Bootup and shutdown (initscripts)
-
- On system bootup, init runs the script "/etc/rc.d/rc.sysinit" to get
- the system up. The script will do the usual business of checking and
- remounting the root filesystem and will start up basic networking.
- After all is done, "rc.sysinit" will run all executables from the
- directory "/etc/rc.d/rc.start". It does not matter whether these are
- scripts or compiled programs. All executables will be passed the
- parameter "start". For example, if there is a script called "runme",
- "rc.sysinit" will execute "runme start".
-
- The default initscripts that come with ttylinux are stored in the
- directory "/etc/rc.d/init.d". Those that need to be run at bootup are
- symlinked to the "rc.start" directory. If you want to write your own
- initscripts, place them in the "init.d" directory and place a symlink
- in the "rc.start" and perhaps also in the "rc.stop" directory.
-
- If you don't want to write your own script, you can also add commands
- to the file /etc/rc.d/rc.local - this script will be run at the very
- end of the boot process, after all others scripts have run.
-
- On shutdown, the script "/etc/rc.d/rc.reboot" gets run. This will run
- all the programs from the "/etc/rc.d/rc.stop" directory, each program
- will be passed a "stop" parameter. Our example script called "runme"
- would be executed as "runme stop".
-
- Both scripts from "rc.start" and "rc.stop" will be run in ASCII
- order. If you need them to run in a specific order, you could for
- example use names like "01.first" and "02.second". This is how the
- scripts that come with ttylinux are named. Everything in "rc.start"
- and "rc.stop" should be a symlink, so you can simply remove that
- link if you want to disable a specific script.
-
- Initscripts can also be called manually in case you want to start or
- stop something while the system is running. For example,
-
- /etc/rc.d/init.d/inetd stop
-
- will stop the inetd server daemon. All scripts (except pppconf, which
- understands no options) know about the options "start", "stop", and
- "restart" that do the obvious things. Some scripts also know about
- "status" and "reload" for displaying status information and for re-
- loading service configuration files.
-
- +-+
-
- 3.3 Using PPP
-
- What to put into "/etc/isp.conf" to configure the dailup information
- is outlined above in the customization subsection. What you will find
- here is an overview of how to actually use the PPP system.
-
- Assuming "/etc/isp.conf" was setup correctly before boot, you only
- need one command to start up the Internet connection:
-
- ppp-up
-
- NOTE: If you use ISDN with autodialing enabled (ISDN_MODE=auto set),
- you do not need to run ppp-up.
-
- ppp-up triggers the ppp daemon, which will dial the provider and try
- to login. ppp-up can be run by any user in the ppp group. In the
- default ttylinux configuration, the ppp group has no members, so only
- root can start and stop the internet connection. You can watch
- "/var/log/messages" (using tail -f) to see when the connection is up
- and running. After that, you can browse the web by using the "links"
- browser. Type in something like:
-
- links http://www.slashdot.org/
-
- Inside links, press ESC (escape) to active the menu. You can use the
- cursor and return keys to navigate links' menu. Outside the menu, use
- cursor up and down to jump from link to link. Press cursor right to
- follow a link and cursor left to go back to the previous page.
-
- Now you can browse the Internet for a while. If you decide that you
- want to cut the link, just issue:
-
- ppp-down
-
- This will take the connection down. Once again, this can be done by
- root or any user from the ppp group that started the connection.
-
- NOTE: If you change any of the settings in /etc/isp.conf, you need to
- reboot for the changes to take effect or do one of the following. For
- modem users, just run:
-
- pppconf
-
- ISDN users will have to do more:
-
- /etc/rc.d/init.d/isdn stop
- pppconf
- /etc/rc.d/init.d/isdn start
-
- After that, you can again use ppp-up and ppp-down. Note that both of
- these methods only work for root, not ordinary users.
-
- SECURITY NOTE: Users in the ppp group will be able to read the file
- /etc/isp.conf which contains your session password. This may or may
- not be a good idea, depending on how much you trust your users. If
- you only wish to use ISDN, you can remove the group read permission
- with
-
- chmod g-r /etc/isp.conf
-
- +-+
-
- 3.4 Using thttpd
-
- thttpd is a small but fast web server. It will be started on system
- bootup and will by default serve the contents of "/home/web" to the
- world. The default web page is a congratulation message with a link
- to the ttylinux homepage.
-
- You can change some of the settings of thttpd in "/etc/httpd.conf".
- The default settings will also allow CGI scripts to run if they are
- in the directory "/home/web/cgi-bin" or their name ends in ".cgi".
-
- +-+
-
- 3.5 Setting up network devices
-
- To set up a network device, go to the directory "/etc/network.d" and
- copy the file "sample" found there to a file named "interface.dev".
- For example, if you want to setup the device "eth0", name the file
- "interface.eth0":
-
- cp sample interface.eth0
-
- Now edit the new file to adjust the settings for the device. You can
- either let the system use the DHCP protocol to obtain the settings
- from a DHCP server or you can set the IP address and other parameters
- manually within the file.
-
- +-+
-
- 3.6 Using the firewall
-
- The default settings of the ttylinux firewall script assume that the
- network interface to the rest of the world is called "ppp0", which is
- only true for modem PPP connections to the Internet. By default, the
- firewall will allow the world to access the HTTP server, but will
- deny access to the telnet server. Access to any other server running
- on a port below 1024 is denied, and the outside world is not allowed
- to ping the ttylinux machine.
-
- You can change the settings of the firewall in "/etc/firewall.conf".
-
- Note that this firewall script is very simple and assumes that local
- users are always trusted. There is no protection against users
- running server daemons on ports above 1024. If you don't trust your
- users, this firewall script is not enough for you!
-
- +-+
-
- 3.7 Shell environment
-
- The default shell used by ttylinux is bash. You can change the
- startup environment (variables, aliases, etc) in /etc/profile. You
- can also put files into the directory /etc/profile.d - all readable
- files in this directory will be sourced by bash when you login on
- the ttylinux machine.
-
- Using /etc/profile.d is a good choice for your own personal changes.
- You may want to update to a new version of ttylinux sometime later,
- and then you could end up loosing all your changes to /etc/profile
- if you forget to make a backup. In /etc/profile.d, your changes are
- safe.
-
- +-+
-
- 3.8 pkg script
-
- There is a script called pkg that can give some information about
- programs and packages that are part of ttylinux. The script is built
- to mimic some of RPM's query options. You can list all packages, find
- out to which package a file belongs, and list the files that belong
- to a specific package.
-
- To get a list of all packages, run
-
- pkg -qa
-
- To find out which package /bin/login belongs to, use
-
- pkg -qf /bin/login
-
- To list all files from the bash package, run
-
- pkg -ql bash
-
- +-+
-
- 4. Contact
-
- If you have bug reports, suggestions, or anything else about ttylinux
- that you think is important, feel free to contact me. You can reach
- me by email at:
-
- Pascal Schmidt <pharao90@tzi.de>
-
- Or by FidoNet netmail to:
-
- Pascal Schmidt @ 2:241/215.72
-
- See the file AUTHORS in the ttylinux distribution for a list of
- people who contributed ideas, bug reports, or code so far.
-
- +-+
-
- A. How to make a bootable ttylinux CD
-
- To follow these instructions, you need the following programs on your
- working system: mkisofs, mkdosfs, and syslinux. mkdosfs is usually
- found inside a package called "dosfstools", syslinux can be found on
- the Internet and on Red Hat installer CDs.
-
- You will need the ttylinux filesystem image rootfs.gz and a linux
- kernel image (the result of a "make zImage" or "make bzImage"). I
- assume you have these files in your current working directory and the
- kernel image file is called "vmlinuz". The following instructions
- will only work for root, not normal users.
-
- First, go through the rest of this user guide and do all the
- customization you want to do. Once ttylinux is burned onto the CD,
- you don't get any further chances to change anything.
-
- Now we start preparing the CD image.
-
- mkdir mnt
- mkdir -p iso/boot
- dd if=/dev/zero of=image bs=10k count=288
- mkdosfs image
- syslinux image
- mount -o loop image mnt
- cp vmlinuz mnt/linux
- rdev mnt/linux /dev/ram0
- cp rootfs.gz mnt
-
- At this point, we have created an image file resembling a 2.88 mega-
- byte floppy disk, syslinux has put a bootloader onto this image, we
- have mounted the image on the "mnt" directory and copied our kernel
- image and filesystem image files onto the disk image. We also told
- the kernel to expect the root filesystem on /dev/ram0 when booting.
-
- Now we need to create a syslinux config file on the disk image.
-
- vi mnt/syslinux.cfg
-
- In this file, place the line
-
- append initrd=rootfs.gz
-
- If you need to pass kernel parameters to your kernel, do this on the
- same append line. For example, if you need to pass, say "idebus=33",
- your line should be
-
- append initrd=rootfs.gz idebus=33
-
- Now we are finished creating the disk image we need for making a
- bootable CD. Let's start putting together the iso image.
-
- umount mnt
- cp image iso/boot/boot.img
-
- The boot image itself is only 2.88 megabytes, so you will have extra
- space available. You can mount the CD after booting to get access to
- all the files you put on the iso image in addition to the boot.img
- file. Simply put anything you want into the "iso" directory now. Once
- you are done with that:
-
- cd iso
- mkisofs -r -b boot/boot.img -c boot/boot.cat -o ../bootcd.iso .
- cd ..
-
- Congratulations, you finished the job of creating a bootable iso
- image with ttylinux on it. All you need to do now is use some CD
- burning program to put the "bootcd.iso" image on a real CD.
-
- +-+
-