📄 user_guide.tex
字号:
Note that depending on the BIOS, it might not be possible to bootfrom anything but the first two hard disks installed in thesystem.What to do if your target disk is not partitioned yet? ttylinuxincludes the \url{fdisk} program that can be used to partitionhard disks. For example, to partition a hard disk connectedas master to the first IDE controller, use:\begin{lstlisting} fdisk /dev/hda\end{lstlisting}The user interface of {\tt fdisk} is somewhat primitive, so becareful. If you haven't used it before, a good idea would beto search the Internet for instructions. The basic commandsyou may need are "d" to delete a partition, "n" to create anew partition, "p" to print the current partition table, and"w" to write the edited partition table to disk. You can alsouse "q" to exit {\tt fdisk} without saving your changes.\subsubsection{Boot loader location}You can install the LILO boot loader in one of two places: eitherinto the master boot record (MBR) of the hard disk you are installingto or into the boot sector of the partition you are installing to.With LILO installed in the MBR of your first hard disk, it will takeover the boot process of your computer completely. If you have otheroperating systems installed on the computer, you will need to addthem to the LILO configuration file (\url{/etc/lilo.conf}) inttylinux to be able to boot into them.With LILO installed in the boot sector of the target partitionor in the MBR of a hard disk other than the first one in yourcomputer, you will need to have another boot loader installed inthe MBR of your first hard disk. You have to add the MBR orboot sector where the ttylinux LILO is installed to the setupof that boot loader in order to be able to boot ttylinux.\subsubsection{Running the installer}Once you have decided on target device and boot loader location,you can run the installer. The script is called \url{installer}and can be invoked as follows (the square brackets indicatean optional parameter):\begin{lstlisting} installer [mbr] source-device target-device\end{lstlisting}For example, to install from the CD-ROM device {\tt /dev/hdc}onto the partition {\tt /dev/hda2}, placing LILO into the MBRof the {\tt /dev/hda} hard disk, you would use:\begin{lstlisting} installer mbr /dev/hdc /dev/hda2\end{lstlisting}Another example, installing from the second SATA CD-ROMdevice {\tt /dev/scd1} onto the third partition of the secondSATA hard disk, placing LILO in the boot sector of thetarget partition:\begin{lstlisting} installer /dev/scd1 /dev/sdb3\end{lstlisting}The installer will check if your source device contains attylinux CD-ROM before proceeeding. If the CD-ROM is found,a summary of what is going to be installed where is printedand you are given a last chance of aborting the wholeinstall. Enter "yes" to continue the installation or anythingelse to abort.The installer creates an ext2 filesystem on the targetpartition, then copies the distribution files onto thenew filesystem, and finally installs the LILO bootloader.Once the installer is finished, it prints out a successmessage. At this point you can remove the CD-ROM from yourcomputer and reboot.\subsection{Customization}\label{customize}The following instructions are mainly useful for installingttylinux by hand, but the configuration files and optionsdescribed here are also present in a ttylinux systeminstalled from the bootable CD-ROM.Before you go about installing ttylinux, you may want to change afew settings inside the image file to fit your own system. This isdone by uncompressing and mounting the image and then making theappropriate changes. If the image is in the current working directory,do the following as the \url{root} user:\begin{lstlisting} gunzip rootfs.gz mkdir mnt mount -o loop rootfs mnt\end{lstlisting} Now the ttylinux filesystem is mounted on the directory \url{mnt}. Take alook at it if you wish. If you want to install ttylinux to a harddisk by hand, you can now create an installation archive for thatpurpose as follows:\begin{lstlisting} cd mnt tar cvzf ../ttylinux-hd.tar.gz . cd ..\end{lstlisting} After this, you have a file called \url{ttylinux-hd.tar.gz} that can beunpacked onto any filesystem you like. The things you will probably want to customize on ttylinux are thekeyboard map and timezone in use and the Internet provider settings.You can copy over the keyboard and timezone setting from your workingsystem as follows:\begin{lstlisting} mnt/bin/dumpkmap > mnt/etc/i18n/keymap.dat cat /etc/localtime > mnt/etc/localtime\end{lstlisting} To set up the dial information for an Internet provider, you need toknow the following:\begin{itemize} \item the device your modem is connected to, i.e. {\tt /dev/ttyS1}\item the init string for your modem, i.e. {\tt ATZ}\item the speed your modem can talk to the computer, i.e. {\tt 115200}\item the phone number of your ISP, i.e. {\tt 1-800-LETMEIN}\item your user name at the ISP, i.e. {\tt joeuser}\item your password at the ISP, i.e. {\tt joepass}\end{itemize}The above is for dialup using a modem. If you want to use ISDN dialup,you need to know the following:\begin{itemize} \item the phone number of your ISP, i.e. {\tt 1-800-12345678}\item your user name at the ISP, i.e. {\tt joeuser}\item your password at the ISP, i.e. {\tt joepass}\item the phone number you want to use for dialing out\item whether you want to use automatic or manual dialing\end{itemize}Edit the file \url{mnt/etc/isp.conf} and change the settings there toyour liking. Note that ttylinux only knows about providers thatlaunch a PPP session immediately after dialup (which should be truefor almost all providers these days), so if some specialprocedure is needed to log you in, your Internet connection will notwork with ttylinux. The ttylinux approach will work with almost allproviders in Germany, but I don't know about other countries.For ttylinux to use ISDN, you need to have \url{USE_ISDN=yes}in \url{/etc/isp.conf}, the default is not to use ISDN. Obviously, youalso need a kernel with ISDN support and hardware support for your ISDNhardware. If you need kernel modules to run your ISDN hardware, youwill also need to add those and a suitable \url{/etc/modules.conf} to the ttylinux filesystem.Once you are finished making changes, unmount the filesystem and run\url{gzip} to compress it again:\begin{lstlisting} umount mnt gzip -9 rootfs\end{lstlisting} You are now ready for the real installation. Note that this section has only covered the minimum customizationneeded to run ttylinux. There is more to tune, have a look at thesystem guide (section \ref{sysguide}) below for information. If you aimat the approach of running ttylinux from ramdisk, you mustconfigure everything for your needs before you continue the installation,so it may be a wise idea to read the system guide section before youcountinue. If you install to a hard disk, you can always configurethings later. \subsection{Installation by hand} I am assuming that you use \url{LILO} (short for Linux Loader) as yourboot loader. You can also use others like \url{loadlin}, but you willobviously need some \url{LILO} experience to convert the \url{LILO}example given here to some other boot manager. I am also assumingthat you want to add ttylinux to an existing LILO setup that isalready used to boot other (Linux) systems on your machine.If you want to use the \url{syslinux} boot loader to load ttylinuxfrom a \url{FAT} filesystem, please see the appendix on creating abootable CD-ROM (appendix \ref{makecdrom}) for an example. Put the \url{rootfs.gz} image and the Linux kernel you want to use to runttylinux into the directory that holds your other boot files, mostlikely this will be \url{/boot}. Let us assume your kernel image file iscalled \url{bzImage-ttylinux}. You now need to add the following sectionto \url{/etc/lilo.conf}:\begin{lstlisting} image=/boot/bzImage-ttylinux label=ttylinux initrd=/boot/rootfs.gz root=/dev/ram0 read-only\end{lstlisting} Now rerun the \url{LILO} installer by typing \url{/sbin/lilo}.On your next boot, you can enter \url{ttylinux} on the \url{LILO} bootprompt 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 partitionof at least 4 megabytes size available. Assuming this partition is\url{/dev/hda8}, do the following, using the file \url{ttylinux-hd.tar.gz}obtained above (in section \ref{customize}):\begin{lstlisting} mke2fs /dev/hda8 mount -t ext2 /dev/hda8 mnt cd mnt tar xvzf ../ttylinux-hd.tar.gz cd ..\end{lstlisting} Now do the customization as outlined above. You will also need tochange the root device configured in \url{mnt/etc/fstab}. Once you aredone, you just need to unmount the partition:\begin{lstlisting} umount mnt\end{lstlisting} Now you can setup \url{LILO} as explained above, only change the line forthe root filesystem to \url{root=/dev/hda8} and remove the \url{initrd}line. Ready to go. \section{System guide}\label{sysguide} This section gives a short overview over the system, its configuration,and some of the installed programs.\subsection{Basic Features} On bootup, ttylinux provides 6 text consoles for login. The defaultsetup has two user accounts: \url{root} (the administrator account)with password \url{root} and \url{guest} with password \url{guest}. The \url{syslogd} and \url{klog} daemons are running and log kerneland system messages to the file \url{/var/log/messages}.If you need a text editor, \url{e3} is installed. Simply invoke it bytyping \url{e3} \url{/path/to/filename}. A help screen is available bypressing \url{Alt-H}. \url{e3} understands a lot of the old WordStarcommands, so it feels a bit like WordStar, an old Borland IDE, or thecommon Linux editor \url{joe}. For those accustomed to differenteditors, \url{e3vi} will startup \url{e3} in \url{vi} emulationmode (\url{e3em} for \url{emacs} emulation mode, \url{e3pi} for\url{pico} emulation mode).For manipulation of users, groups and passwords, the tools {\tt passwd},{\tt adduser}, {\tt addgroup}, {\tt del\-user}, and {\tt delgroup} arepresent.If you have not changed the timezone and keyboard settings as outlinedin the customization section (\ref{customize}, above), ttylinux will useits default settings. The default timezone is UTC, the default keyboardmapping is for a US keyboard.The \url{inetd} super-server and the \url{dropbear} SSH server arerunning by default. A telnet server will be forked by \url{inetd} whena telnet connection comes in.ttylinux includes a basic packet filtering firewall which isenabled by default on the dialup interface. Note that the telnetserver is not visible from the external side of the dialupinterface in the default firewall configuration.\subsection{Bootup and Shutdown} On system bootup, the init process runs the script\url{/etc/rc.d/rc.sysinit} to get the system up. The script will do theusual business of checking and remounting the root filesystem and willstart up basic networking.After that is done, \url{rc.sysinit} will run all executables from thedirectory \url{/etc/rc.d/rc.start}. It does not matter whether these arescripts or compiled programs. All executables will be passed theparameter \url{start}. For example, if there is a script called{\url runme}, \url{rc.sysinit} will execute \url{runme} \url{start}.The default initscripts that come with ttylinux are stored in thedirectory \url{/etc/rc.d/init.d}. Those that need to be run at bootup aresymlinked into the \url{rc.start} directory. If you want to write your owninitscripts, place them in the \url{init.d} directory and place a symlinkin the \url{rc.start} and perhaps also in the \url{rc.stop} directory.If you don't want to write your own script, you can also add commandsto the file \url{/etc/rc.d/rc.local} - this script will be run at the veryend of the boot process, after all others scripts have run. On shutdown, the script \url{/etc/rc.d/rc.reboot} gets run. This will runall the programs from the \url{/etc/rc.d/rc.stop} directory, and each programwill be passed a \url{stop} parameter. Our example script called \url{runme}would be executed as \url{runme} \url{stop}. Both scripts from \url{rc.start} and \url{rc.stop} will be run in ASCIIorder. If you need them to run in a specific order, you could forexample use names like \url{01.first} and \url{02.second}. This is how the scripts that come with ttylinux are named. Everything in \url{rc.start}and \url{rc.stop} should be a symlink, so you can simply remove thatlink if you want to disable a specific script.Initscripts can also be called manually in case you want to start orstop something while the system is running. To make this easier, ahelper script called \url{service} is provided. For example:\begin{lstlisting} service inetd stop\end{lstlisting} will stop the \url{inetd} server daemon. All scripts (except \url{pppconf},which understands few options) know about the options \url{start},\url{stop}, and \url{restart} that do the obvious things. Some scripts alsoknow about \url{status} and \url{reload} for displaying status informationand for reloading service configuration files.All scripts will print a list of supported options if they are calledwith no option present.\subsection{Using PPP dialup} What to put into \url{/etc/isp.conf} to configure the dailup informationis outlined above in the customization section (\ref{customize}, above).What you will find here is an overview of how to actually use the PPPsubsystem for Internet dialup. Assuming \url{/etc/isp.conf} was setup correctly before boot, you only need one command to start up the Internet connection:\begin{lstlisting} ppp-up\end{lstlisting}If you use ISDN with autodialing enabled (\url{ISDN_MODE=auto}set in \url{/etc/isp.conf}), you do not need to run \url{ppp-up}. Justrun a program that sends packets to an Internet host. \url{ppp-up} triggers the PPP daemon, which will dial the provider and tryto login. \url{ppp-up} can be run by any user in the \url{ppp} group. In thedefault ttylinux configuration, the \url{ppp} group has no members, so only\url{root} can start and stop the internet connection. You can watch\url{/var/log/messages} (using \url{tail} \url{-f}) to see when theconnection is up and running. After that, the Internet connection is readyfor use. For example, the SSH server will be reachable from the outsideworld.You can browse the web by using the \url{retawq} web browser. Use the\url{g} key to enter a URL, then navigate around using the cursor andreturn keys. You can leave the browser by pressing \url{Shift-Q}.If you use ISDN, you can enable and disable channel bundling bycalling the \url{bundle} and \url{unbundle} scripts while the connectionis up. The default for new connections is to always use a single channel,even if channel bundling was enabled before. To check whether channelbundling is currently enabled, use the command:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -