📄 user.tex
字号:
\raw{reserve=\meta{base},\meta{size},$\ldots$} reserves IO port regions.This can be used to prevent device drivers from auto-probing addresseswhere other devices are located, which get confused by the probing.\raw{ro} instructs the kernel to mount the root file system read-only.\raw{rw} mounts it read-write. If neither \raw{ro} nor \raw{rw} isspecified, the setting from the boot image is used.\raw{no-hlt} avoids executing a \raw{HLT} instructions whenever the systemis idle. \raw{HLT} normally significantly reduces power consumption andtherefore also heatdissipation of the CPU, but may not work properly with some clone CPUs.\raw{no387} disables using the hardware FPU even if one is present.\raw{debug} enables more verbose console logging.Recent kernels also accept the options \raw{init=\meta{name}} and\raw{noinitrd}. \raw{init} specifies the name of the \name{init} programto execute. Therefore, if single mode cannot be entered because \name{init}is mis-configured, one may still be able to reach a shell using\verb"init=/bin/sh". \raw{noinitrd} disables automatic loading of the initialRAM disk. Instead, its content is then available on \path{/dev/initrd}.\raw{vga=\meta{mode}} alters the VGA mode set at startup. The values\raw{normal}, \raw{extended}, \raw{ask} or a decimal number arerecognized. (See also page \pageref{vga}.)\raw{kbd=\meta{code},$\ldots$} preloads a sequence of keystrokes in theBIOS keyboard buffer. The keystrokes have to be entered as 16 bit hexadecimalnumbers, with the upper byte containing the scan code and the lower bytecontaining the ASCII code. Note that most programs only use the ASCIIcode, so the scan code can frequently be omitted. Scan code tables can befound in many books on PC hardware. Note that scan codes depend on thekeyboard layout.Finally, \raw{lock} stores the current command-line as the defaultcommand-line, so that \LILO\ boots the same image with the same options(including \raw{lock}) when invoked the next time.\subsubsection{Device-specific options}There is also a plethora of options to specify certain characteristics(e.g. IO and memory addresses) of devices. Some common ones are\raw{ether}, \raw{floppy}, \raw{hd}, \raw{bmouse}, and \raw{sound}.The usage of these options is \raw{\meta{option}=\meta{number},$\ldots$}.Please consult the corresponding FAQs and HOWTOs for details. For an overviewof all available options, consult the file \path{init/main.c} in the kernelsource tree.\subsubsection{Other options}Options of the type \raw{\meta{variable}=\meta{value}} which are neitherstandard options nor device-specific options,cause the respective variables to be set in the environment passed to\name{init}. The case of the variable name is preserved, i.e. it isn'tautomatically converted to upper case.Note that environment variables passed to \name{init} are typicallyavailable in system initialization scripts (e.g. \path{/etc/rc.local}),but they're not visible from ordinary login sessions, because the \name{login}program removes them from the user's environment.\subsubsection{Repeating options}The effect of repeating boot command-line options depends on the options.%\footnote{Options are frequently repeated when a string defined with\craw{append} or \craw{literal} is prepended to the parameters typed in bythe user. Also, \LILO\ implicitly prepends the options \raw{ramdisk},\raw{ro}, \raw{root}, or \raw{rw} when \craw{ramdisk}, \craw{read-only},\craw{read-write}, or \craw{root}, respectively, are set in the configurationfile.(\raw{lock} and \raw{vga} are handled by a different internal mechanism.)}There are three possible behaviours:Options that only enable or disable a certain functionality can be repeatedany number of times. \raw{debug}, \raw{lock}, \raw{no-hlt}, and \raw{no387}fall into this category.Other options change a global setting whenever they appear, so only thevalue or presence of the last option matters. The antagonists \raw{ro} and\raw{rw} are such options. Also, \raw{ramdisk}, \raw{root}, and \raw{vga}work this way. Example: \raw{ro rw} would mount the root file systemread-write.Finally, when \raw{reserve} and many device-specific options are repeated,each occurrence has its own meaning, e.g. \raw{hd=$\ldots$ hd=$\ldots$} wouldconfigure two hard disks, and \raw{reserve=0x300,8 reserve=0x5f0,16} wouldreserve the ranges 0x300 to 0x307 and 0x5f0 to 0x5ff (which is equivalent towriting \raw{reserve=0x300,8,0x5f0,16}).\subsubsection{Implicit options}\LILO\ always passes the string \raw{BOOT\_IMAGE=\meta{name}} to thekernel, where \meta{name} is the name by which the kernel is identified(e.g. the label). This variable can be used in \path{/etc/rc} to selecta different behaviour, depending on the kernel.When booting automatically, i.e. without human intervention, the word\raw{auto} is also passed onthe command line. This can be used by \name{init} to suppress interactiveprompts in the boot phase.\subsection{Boot image selection}\label{bootsel}The details of selecting the boot image are somewhat complicated. Thefollowing tables illustrate them. First, if neither \craw{prompt} isset nor a shift key is being pressed:$$\begin{tabular}{cc|cl} Externally & Command & Auto- & Booted image \\ provided & line in & matic & \\ cmd. line\footnotemark & map file\footnotemark & boot\footnotemark & \\ \hline No & No & Yes & Default image \\ Yes & --- & Yes & Specified by external \\ & & & command line \\ No & Yes & Yes & Specified by command line \\ & & & in map file \\\end{tabular}\addtocounter{footnote}{-2}\footnotetext{Externally provided command lines could be used to add front-ends to \LILO. They would pass the respective command string to LILO, which would then interpret it like keyboard input. This feature is currently not used.}\addtocounter{footnote}{1}\footnotetext{This command line is set by invoking the map installer with the \raw{-R} option, by using the boot command-line option \raw{lock}, or if a fallback command line is set (with \craw{fallback}).}\addtocounter{footnote}{1}\footnotetext{I.e. the keyword \raw{auto} is added.}$$If \craw{prompt} is not set and a shift key is being pressed:$$\begin{tabular}{cccc|cl} Input & Empty & Extern. & Cmd.l. & Auto- & Booted image \\ timeout & cmd.l. & cmd.l. & in map & matic & \\ & & & file & boot & \\ \hline No & No & --- & --- & No & Specified by the user \\ No & Yes & --- & --- & No & Default image \\ Yes & n/a & --- & --- & Yes & Default image \\\end{tabular}$$Finally, if the configuration variable \craw{prompt} is set:$$\begin{tabular}{cccc|cl} Input & Empty & Extern. & Cmd.l. & Auto- & Booted image \\ timeout & cmd.l. & cmd.l. & in map & matic & \\ & & & file & boot & \\ \hline No & No & No & No & No & Specified by the user \\ No & Yes & No & No & No & Default image \\ Yes & n/a & No & No & Yes & Default image \\ n/a & n/a & Yes & --- & Yes & Specified by external \\ & & & & & command line \\ n/a & n/a & No & Yes & Yes & Specified by command \\ & & & & & line in map file \\\end{tabular}$$Note that \LILO\ pauses for the amount of time specified in \craw{delay}when at the end of a default command line. The automatic boot can thenbe interrupted by pressing a modifier key (\key{Shift}, \key{Ctrl}, etc.).The default image is the first image in the map file or the image specifiedwith the \craw{default} variable. However,after an unsuccessful boot attempt, the respective image becomes thedefault image.\newpage\section{Map installer}The map installer program \path{/sbin/lilo} updates the boot sectorand creates the map file. If the map installer detects an error, it terminatesimmediately and does not touch the boot sector and the map file.Whenever the map installer updates a boot sector, the original bootsector is copiedto \path{/boot/boot.\meta{number}}, where \meta{number} is thehexadecimal device number. If such a file already exists, no backupcopy is made. Similarly, a file \raw{/boot/part.\meta{number}} iscreated if \LILO\ modifies the partition table. (See page \pageref{fix-table}.)\subsection{Command-line options}The \LILO\ map installer can be invoked in the following ways:%%beginskip\def\seealso{See also sections \ref{corropt} and \ref{cfgglo}.}%%def\\seealso=See also sections \\ref{corropt} and \\ref{cfgglo}.%%endskip\subsubsection{Show current installation}\label{invshow}The currently mapped files are listed. With \raw{-v}, also many parametersare shown.\begin{command} /sbin/lilo \unit{\[ -C \meta{config\_file} \]} \unit{-q} \unit{\[ -m \meta{map\_file} \]} \unit{\[ -v $\ldots$ \]}\end{command}\begin{description} \item[\raw{-C \meta{config\_file}}]~\\ Specifies the configuration file that is used by the map installer (see section \ref{config}). If \raw{-C} is omitted, \path{/etc/lilo.conf} is used. \item[\raw{-m \meta{map\_file}}]~\\ Specifies an alternate map file. \seealso \item[\raw{-q}]~ \\ Lists the currently mapped files. \item[\raw{-v $\ldots$}]~\\ Increase verbosity. \seealso\end{description}\subsubsection{Create or update map}\label{creupd}A new map is created for the images described in the configuration file\path{/etc/lilo.conf} and they are registered in the boot sector.\begin{command} /sbin/lilo \unit{\[ -C \meta{config\_file} \]} \unit{\[ -b \meta{boot\_device} \]} \unit{\[ -c \]} \unit{\[ -l \]} \unit{\[ -i \meta{boot\_sector} \]} \unit{\[ -f \meta{disk\_tab} \]} \unit{\[ -m \meta{map\_file} \]} \unit{\[ -d \meta{delay\/} \]} \unit{\[ -v $\ldots$ \]} \unit{\[ -t \]} \unit{\[ -s \meta{save\_file} \|} \unit{-S \meta{save\_file} \]} \unit{\[ -P fix \|} \unit{-P ignore \]} \unit{\[ -r \meta{root\_dir} \]}\end{command}\begin{description} \item[\raw{-b \meta{boot\_device}}]~\\ Specifies the boot device. \seealso \item[\raw{-c}]~\\ Enables map compaction. \seealso \item[\raw{-C \meta{config\_file}}]~\\ Specifies an alternate configuration file. See also section \ref{invshow}. \item[\raw{-d \meta{delay}}]~\\ Sets the delay before \LILO\ boots the default image. Note that the delay is specified in \emphasize{tenths} of a second. \seealso \item[\raw{-D \meta{name}}]~\\ Specifies the default image. \seealso \item[\raw{-f \meta{disk\_tab}}]~\\ Specifies a disk parameter table file. \seealso \item[\raw{-i \meta{boot\_sector}}]~\\ Specifies an alternate boot file. \seealso \item[\raw{-L}]~\\ Enables lba32 sector addresses. \seealso \item[\raw{-l}]~\\ Enables linear sector addresses. \seealso \item[\raw{-m \meta{map\_file}}]~\\ Specifies an alternate map file. \seealso \item[\raw{-P \meta{mode}}]~\\ Specifies how invalid partition table entries should be handled. \seealso \item[\raw{-r \meta{root\_directory}}]~ \\ Chroots to the specified directory before doing anything else. This is useful when running the map installer while the normal root file system is mounted somewhere else, e.g. when recovering from an installation failure with a recovery disk. The \raw{-r} option is implied if the environment variable \raw{ROOT} is set.\footnote{E.g. if your root partition is mounted on \path{/mnt}, you can update the map by simply running \raw{ROOT=/mnt /mnt/sbin/lilo}} The current directory is changed to the new root directory, so using relative paths may not work. \item[\raw{-s \meta{save\_file}}]~\\ Specifies an alternate boot sector save file. \seealso \item[\raw{-S \meta{save\_file}}]~\\ Like \raw{-s}, but overwrites old save files. \item[\raw{-t}]~ \\ Test only. This performs the entire installation procedure except replacing the map file, writing the modified boot sector and fixing partition tables. This can be used in conjunction with the \raw{-v} option to verify that \LILO\ will use sane values. \item[\raw{-v $\ldots$}]~\\ Increase verbosity. \seealso\end{description}\subsubsection{Change default command line}\label{invcmd}Changes \LILO's default command line. See also section \ref{bootsel}.\begin{command} /sbin/lilo \unit{\[ -C \meta{config\_file} \]} \unit{\[ -m \meta{map\_file} \]} \unit{-R \[ \meta{word} $\ldots$ \]}\end{command}\begin{description} \item[\raw{-C \meta{config\_file}}]~\\ Specifies an alternate configuration file. See also section \ref{invshow}. \item[\raw{-m \meta{map\_file}}]~\\ Specifies an alternate map file. \seealso \item[\raw{-R \meta{word $\ldots$}}]~ \\ Stores the specified words in the map file. The boot loader uses those words as the default command line when booting the next time. That command line is removed from the map file by the boot loader by overwriting the sector immediately after reading it. The first word has to be the name of a boot image. If \raw{-R} is not followed by any words, the current default command line in the map file is erased.\footnote{%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -