121 lines
4 KiB
Text
121 lines
4 KiB
Text
|
14 GRUB's user interface
|
||
|
************************
|
||
|
|
||
|
GRUB has both a simple menu interface for choosing preset entries from a
|
||
|
configuration file, and a highly flexible command-line for performing
|
||
|
any desired combination of boot commands.
|
||
|
|
||
|
GRUB looks for its configuration file as soon as it is loaded. If
|
||
|
one is found, then the full menu interface is activated using whatever
|
||
|
entries were found in the file. If you choose the "command-line" menu
|
||
|
option, or if the configuration file was not found, then GRUB drops to
|
||
|
the command-line interface.
|
||
|
|
||
|
14.1 The flexible command-line interface
|
||
|
========================================
|
||
|
|
||
|
The command-line interface provides a prompt and after it an editable
|
||
|
text area much like a command-line in Unix or DOS. Each command is
|
||
|
immediately executed after it is entered(1) (*note Command-line
|
||
|
interface-Footnote-1::). The commands (*note Command-line and menu
|
||
|
entry commands::) are a subset of those available in the configuration
|
||
|
file, used with exactly the same syntax.
|
||
|
|
||
|
Cursor movement and editing of the text on the line can be done via a
|
||
|
subset of the functions available in the Bash shell:
|
||
|
|
||
|
<C-f>
|
||
|
<PC right key>
|
||
|
Move forward one character.
|
||
|
|
||
|
<C-b>
|
||
|
<PC left key>
|
||
|
Move back one character.
|
||
|
|
||
|
<C-a>
|
||
|
<HOME>
|
||
|
Move to the start of the line.
|
||
|
|
||
|
<C-e>
|
||
|
<END>
|
||
|
Move the the end of the line.
|
||
|
|
||
|
<C-d>
|
||
|
<DEL>
|
||
|
Delete the character underneath the cursor.
|
||
|
|
||
|
<C-h>
|
||
|
<BS>
|
||
|
Delete the character to the left of the cursor.
|
||
|
|
||
|
<C-k>
|
||
|
Kill the text from the current cursor position to the end of the
|
||
|
line.
|
||
|
|
||
|
<C-u>
|
||
|
Kill backward from the cursor to the beginning of the line.
|
||
|
|
||
|
<C-y>
|
||
|
Yank the killed text back into the buffer at the cursor.
|
||
|
|
||
|
<C-p>
|
||
|
<PC up key>
|
||
|
Move up through the history list.
|
||
|
|
||
|
<C-n>
|
||
|
<PC down key>
|
||
|
Move down through the history list.
|
||
|
|
||
|
When typing commands interactively, if the cursor is within or before
|
||
|
the first word in the command-line, pressing the <TAB> key (or <C-i>)
|
||
|
will display a listing of the available commands, and if the cursor is
|
||
|
after the first word, the '<TAB>' will provide a completion listing of
|
||
|
disks, partitions, and file names depending on the context. Note that
|
||
|
to obtain a list of drives, one must open a parenthesis, as 'root ('.
|
||
|
|
||
|
Note that you cannot use the completion functionality in the TFTP
|
||
|
filesystem. This is because TFTP doesn't support file name listing for
|
||
|
the security.
|
||
|
|
||
|
(1) However, this behavior will be changed in the future version, in
|
||
|
a user-invisible way.
|
||
|
|
||
|
14.2 The simple menu interface
|
||
|
==============================
|
||
|
|
||
|
The menu interface is quite easy to use. Its commands are both
|
||
|
reasonably intuitive and described on screen.
|
||
|
|
||
|
Basically, the menu interface provides a list of "boot entries" to
|
||
|
the user to choose from. Use the arrow keys to select the entry of
|
||
|
choice, then press <RET> to run it. An optional timeout is available to
|
||
|
boot the default entry (the first one if not set), which is aborted by
|
||
|
pressing any key.
|
||
|
|
||
|
Commands are available to enter a bare command-line by pressing <c>
|
||
|
(which operates exactly like the non-config-file version of GRUB, but
|
||
|
allows one to return to the menu if desired by pressing <ESC>) or to
|
||
|
edit any of the "boot entries" by pressing <e>.
|
||
|
|
||
|
If you protect the menu interface with a password (*note Security::),
|
||
|
all you can do is choose an entry by pressing <RET>, or press <p> to
|
||
|
enter the password.
|
||
|
|
||
|
14.3 Editing a menu entry
|
||
|
=========================
|
||
|
|
||
|
The menu entry editor looks much like the main menu interface, but the
|
||
|
lines in the menu are individual commands in the selected entry instead
|
||
|
of entry names.
|
||
|
|
||
|
If an <ESC> is pressed in the editor, it aborts all the changes made
|
||
|
to the configuration entry and returns to the main menu interface.
|
||
|
|
||
|
Each line in the menu entry can be edited freely, and you can add new
|
||
|
lines by pressing <RET> at the end of a line. To boot the edited entry,
|
||
|
press <Ctrl-x>.
|
||
|
|
||
|
Although GRUB unfortunately does not support "undo", you can do
|
||
|
almost the same thing by just returning to the main menu using <ESC>.
|
||
|
|