~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to docs/grub.info

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
This is ../../../docs/grub.info, produced by makeinfo version 4.13 from
 
2
../../../docs/grub.texi.
 
3
 
 
4
This manual is for GNU GRUB (version 1.99~20101123-1, 16 November 2010).
 
5
 
 
6
   Copyright (C) 1999,2000,2001,2002,2004,2006,2008,2009,2010 Free
 
7
Software Foundation, Inc.
 
8
 
 
9
     Permission is granted to copy, distribute and/or modify this
 
10
     document under the terms of the GNU Free Documentation License,
 
11
     Version 1.2 or any later version published by the Free Software
 
12
     Foundation; with no Invariant Sections.
 
13
 
 
14
INFO-DIR-SECTION Kernel
 
15
START-INFO-DIR-ENTRY
 
16
* GRUB: (grub).                 The GRand Unified Bootloader
 
17
* grub-install: (grub)Invoking grub-install.    Install GRUB on your drive
 
18
* grub-mkconfig: (grub)Invoking grub-mkconfig.  Generate GRUB configuration
 
19
* grub-mkpasswd-pbkdf2: (grub)Invoking grub-mkpasswd-pbkdf2.
 
20
END-INFO-DIR-ENTRY
 
21
 
 
22
 
 
23
File: grub.info,  Node: Top,  Next: Introduction,  Up: (dir)
 
24
 
 
25
GNU GRUB manual
 
26
***************
 
27
 
 
28
This is the documentation of GNU GRUB, the GRand Unified Bootloader, a
 
29
flexible and powerful boot loader program for a wide range of
 
30
architectures.
 
31
 
 
32
   This edition documents version 1.99~20101123-1.
 
33
 
 
34
   This manual is for GNU GRUB (version 1.99~20101123-1, 16 November
 
35
2010).
 
36
 
 
37
   Copyright (C) 1999,2000,2001,2002,2004,2006,2008,2009,2010 Free
 
38
Software Foundation, Inc.
 
39
 
 
40
     Permission is granted to copy, distribute and/or modify this
 
41
     document under the terms of the GNU Free Documentation License,
 
42
     Version 1.2 or any later version published by the Free Software
 
43
     Foundation; with no Invariant Sections.
 
44
 
 
45
* Menu:
 
46
 
 
47
* Introduction::                Capturing the spirit of GRUB
 
48
* Naming convention::           Names of your drives in GRUB
 
49
* Installation::                Installing GRUB on your drive
 
50
* Booting::                     How to boot different operating systems
 
51
* Configuration::               Writing your own configuration file
 
52
* Theme file format::           Format of GRUB theme files
 
53
* Network::                     Downloading OS images from a network
 
54
* Serial terminal::             Using GRUB via a serial line
 
55
* Vendor power-on keys::        Changing GRUB behaviour on vendor power-on keys
 
56
* Images::                      GRUB image files
 
57
* Filesystem::                  Filesystem syntax and semantics
 
58
* Interface::                   The menu and the command-line
 
59
* Commands::                    The list of available builtin commands
 
60
* Security::                    Authentication and authorisation
 
61
* Supported kernels::           The list of supported kernels
 
62
* Troubleshooting::             Error messages produced by GRUB
 
63
* Invoking grub-install::       How to use the GRUB installer
 
64
* Invoking grub-mkconfig::      Generate a GRUB configuration file
 
65
* Invoking grub-mkpasswd-pbkdf2::
 
66
                                Generate GRUB password hashes
 
67
* Obtaining and Building GRUB:: How to obtain and build GRUB
 
68
* Reporting bugs::              Where you should send a bug report
 
69
* Future::                      Some future plans on GRUB
 
70
* Internals::                   Hacking GRUB
 
71
* Copying This Manual::         Copying This Manual
 
72
* Index::
 
73
 
 
74
 
 
75
File: grub.info,  Node: Introduction,  Next: Naming convention,  Prev: Top,  Up: Top
 
76
 
 
77
1 Introduction to GRUB
 
78
**********************
 
79
 
 
80
* Menu:
 
81
 
 
82
* Overview::                    What exactly GRUB is and how to use it
 
83
* History::                     From maggot to house fly
 
84
* Changes from GRUB Legacy::    Differences from previous versions
 
85
* Features::                    GRUB features
 
86
* Role of a boot loader::       The role of a boot loader
 
87
 
 
88
 
 
89
File: grub.info,  Node: Overview,  Next: History,  Up: Introduction
 
90
 
 
91
1.1 Overview
 
92
============
 
93
 
 
94
Briefly, a "boot loader" is the first software program that runs when a
 
95
computer starts.  It is responsible for loading and transferring
 
96
control to an operating system "kernel" software (such as Linux or GNU
 
97
Mach).  The kernel, in turn, initializes the rest of the operating
 
98
system (e.g. a GNU system).
 
99
 
 
100
   GNU GRUB is a very powerful boot loader, which can load a wide
 
101
variety of free operating systems, as well as proprietary operating
 
102
systems with chain-loading(1) (*note Overview-Footnote-1::). GRUB is
 
103
designed to address the complexity of booting a personal computer; both
 
104
the program and this manual are tightly bound to that computer platform,
 
105
although porting to other platforms may be addressed in the future.
 
106
 
 
107
   One of the important features in GRUB is flexibility; GRUB
 
108
understands filesystems and kernel executable formats, so you can load
 
109
an arbitrary operating system the way you like, without recording the
 
110
physical position of your kernel on the disk. Thus you can load the
 
111
kernel just by specifying its file name and the drive and partition
 
112
where the kernel resides.
 
113
 
 
114
   When booting with GRUB, you can use either a command-line interface
 
115
(*note Command-line interface::), or a menu interface (*note Menu
 
116
interface::). Using the command-line interface, you type the drive
 
117
specification and file name of the kernel manually. In the menu
 
118
interface, you just select an OS using the arrow keys. The menu is
 
119
based on a configuration file which you prepare beforehand (*note
 
120
Configuration::). While in the menu, you can switch to the command-line
 
121
mode, and vice-versa. You can even edit menu entries before using them.
 
122
 
 
123
   In the following chapters, you will learn how to specify a drive, a
 
124
partition, and a file name (*note Naming convention::) to GRUB, how to
 
125
install GRUB on your drive (*note Installation::), and how to boot your
 
126
OSes (*note Booting::), step by step.
 
127
 
 
128
 
 
129
File: grub.info,  Node: Overview-Footnotes,  Up: Overview
 
130
 
 
131
   (1) "chain-load" is the mechanism for loading unsupported operating
 
132
systems by loading another boot loader. It is typically used for
 
133
loading DOS or Windows.
 
134
 
 
135
 
 
136
File: grub.info,  Node: History,  Next: Changes from GRUB Legacy,  Prev: Overview,  Up: Introduction
 
137
 
 
138
1.2 History of GRUB
 
139
===================
 
140
 
 
141
GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU
 
142
Hurd with the University of Utah's Mach 4 microkernel (now known as GNU
 
143
Mach).  Erich and Brian Ford designed the Multiboot Specification
 
144
(*note Multiboot Specification: (multiboot)Top.), because they were
 
145
determined not to add to the large number of mutually-incompatible PC
 
146
boot methods.
 
147
 
 
148
   Erich then began modifying the FreeBSD boot loader so that it would
 
149
understand Multiboot. He soon realized that it would be a lot easier to
 
150
write his own boot loader from scratch than to keep working on the
 
151
FreeBSD boot loader, and so GRUB was born.
 
152
 
 
153
   Erich added many features to GRUB, but other priorities prevented him
 
154
from keeping up with the demands of its quickly-expanding user base. In
 
155
1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an
 
156
official GNU package, and opened its development by making the latest
 
157
sources available via anonymous CVS. *Note Obtaining and Building
 
158
GRUB::, for more information.
 
159
 
 
160
   Over the next few years, GRUB was extended to meet many needs, but it
 
161
quickly became clear that its design was not keeping up with the
 
162
extensions being made to it, and we reached the point where it was very
 
163
difficult to make any further changes without breaking existing
 
164
features.  Around 2002, Yoshinori K. Okuji started work on PUPA
 
165
(Preliminary Universal Programming Architecture for GNU GRUB), aiming
 
166
to rewrite the core of GRUB to make it cleaner, safer, more robust, and
 
167
more powerful.  PUPA was eventually renamed to GRUB 2, and the original
 
168
version of GRUB was renamed to GRUB Legacy.  Small amounts of
 
169
maintenance continued to be done on GRUB Legacy, but the last release
 
170
(0.97) was made in 2005 and at the time of writing it seems unlikely
 
171
that there will be another.
 
172
 
 
173
   By around 2007, GNU/Linux distributions started to use GRUB 2 to
 
174
limited extents, and by the end of 2009 multiple major distributions
 
175
were installing it by default.
 
176
 
 
177
 
 
178
File: grub.info,  Node: Changes from GRUB Legacy,  Next: Features,  Prev: History,  Up: Introduction
 
179
 
 
180
1.3 Differences from previous versions
 
181
======================================
 
182
 
 
183
GRUB 2 is a rewrite of GRUB (*note History::), although it shares many
 
184
characteristics with the previous version, now known as GRUB Legacy.
 
185
Users of GRUB Legacy may need some guidance to find their way around
 
186
this new version.
 
187
 
 
188
   * The configuration file has a new name (`grub.cfg' rather than
 
189
     `menu.lst' or `grub.conf'), new syntax (*note Configuration::) and
 
190
     many new commands (*note Commands::).  Configuration cannot be
 
191
     copied over directly, although most GRUB Legacy users should not
 
192
     find the syntax too surprising.
 
193
 
 
194
   * `grub.cfg' is typically automatically generated by `grub-mkconfig'
 
195
     (*note Simple configuration::).  This makes it easier to handle
 
196
     versioned kernel upgrades.
 
197
 
 
198
   * Partition numbers in GRUB device names now start at 1, not 0
 
199
     (*note Naming convention::).
 
200
 
 
201
   * The configuration file is now written in something closer to a full
 
202
     scripting language: variables, conditionals, and loops are
 
203
     available.
 
204
 
 
205
   * A small amount of persistent storage is available across reboots,
 
206
     using the `save_env' and `load_env' commands in GRUB and the
 
207
     `grub-editenv' utility. For safety reasons this storage is only
 
208
     available when installed on plain disk (no LVM or RAID), using
 
209
     non-checksumming filesystem (no ZFS) and using BIOS or EFI
 
210
     functions (no ATA, USB or IEEE1275)
 
211
 
 
212
   * GRUB 2 has more reliable ways to find its own files and those of
 
213
     target kernels on multiple-disk systems, and has commands (*note
 
214
     search::) to find devices using file system labels or Universally
 
215
     Unique Identifiers (UUIDs).
 
216
 
 
217
   * GRUB 2 is available for several other types of system in addition
 
218
     to the PC BIOS systems supported by GRUB Legacy: PC EFI, PC
 
219
     coreboot, PowerPC, SPARC, and MIPS Lemote Yeeloong are all
 
220
     supported.
 
221
 
 
222
   * Many more file systems are supported, including but not limited to
 
223
     ext4, HFS+, and NTFS.
 
224
 
 
225
   * GRUB 2 can read files directly from LVM and RAID devices.
 
226
 
 
227
   * A graphical terminal and a graphical menu system are available.
 
228
 
 
229
   * GRUB 2's interface can be translated, including menu entry names.
 
230
 
 
231
   * The image files (*note Images::) that make up GRUB have been
 
232
     reorganised; Stage 1, Stage 1.5, and Stage 2 are no more.
 
233
 
 
234
   * GRUB 2 puts many facilities in dynamically loaded modules,
 
235
     allowing the core image to be smaller, and allowing the core image
 
236
     to be built in more flexible ways.
 
237
 
 
238
 
 
239
File: grub.info,  Node: Features,  Next: Role of a boot loader,  Prev: Changes from GRUB Legacy,  Up: Introduction
 
240
 
 
241
1.4 GRUB features
 
242
=================
 
243
 
 
244
The primary requirement for GRUB is that it be compliant with the
 
245
"Multiboot Specification", which is described in *note Multiboot
 
246
Specification: (multiboot)Top.
 
247
 
 
248
   The other goals, listed in approximate order of importance, are:
 
249
 
 
250
   * Basic functions must be straightforward for end-users.
 
251
 
 
252
   * Rich functionality to support kernel experts and designers.
 
253
 
 
254
   * Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and
 
255
     Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are
 
256
     supported via a chain-loading function.
 
257
 
 
258
   Except for specific compatibility modes (chain-loading and the Linux
 
259
"piggyback" format), all kernels will be started in much the same state
 
260
as in the Multiboot Specification. Only kernels loaded at 1 megabyte or
 
261
above are presently supported. Any attempt to load below that boundary
 
262
will simply result in immediate failure and an error message reporting
 
263
the problem.
 
264
 
 
265
   In addition to the requirements above, GRUB has the following
 
266
features (note that the Multiboot Specification doesn't require all the
 
267
features that GRUB supports):
 
268
 
 
269
Recognize multiple executable formats
 
270
     Support many of the "a.out" variants plus "ELF". Symbol tables are
 
271
     also loaded.
 
272
 
 
273
Support non-Multiboot kernels
 
274
     Support many of the various free 32-bit kernels that lack Multiboot
 
275
     compliance (primarily FreeBSD, NetBSD, OpenBSD, and Linux).
 
276
     Chain-loading of other boot loaders is also supported.
 
277
 
 
278
Load multiples modules
 
279
     Fully support the Multiboot feature of loading multiple modules.
 
280
 
 
281
Load a configuration file
 
282
     Support a human-readable text configuration file with preset boot
 
283
     commands. You can also load another configuration file dynamically
 
284
     and embed a preset configuration file in a GRUB image file. The
 
285
     list of commands (*note Commands::) are a superset of those
 
286
     supported on the command-line. An example configuration file is
 
287
     provided in *note Configuration::.
 
288
 
 
289
Provide a menu interface
 
290
     A menu interface listing preset boot commands, with a programmable
 
291
     timeout, is available. There is no fixed limit on the number of
 
292
     boot entries, and the current implementation has space for several
 
293
     hundred.
 
294
 
 
295
Have a flexible command-line interface
 
296
     A fairly flexible command-line interface, accessible from the menu,
 
297
     is available to edit any preset commands, or write a new boot
 
298
     command set from scratch. If no configuration file is present,
 
299
     GRUB drops to the command-line.
 
300
 
 
301
     The list of commands (*note Commands::) are a subset of those
 
302
     supported for configuration files. Editing commands closely
 
303
     resembles the Bash command-line (*note Bash: (features)Command
 
304
     Line Editing.), with <TAB>-completion of commands, devices,
 
305
     partitions, and files in a directory depending on context.
 
306
 
 
307
Support multiple filesystem types
 
308
     Support multiple filesystem types transparently, plus a useful
 
309
     explicit blocklist notation. The currently supported filesystem
 
310
     types are "Amiga Fast FileSystem (AFFS)", "AtheOS fs", "BeFS",
 
311
     "cpio", "Linux ext2/ext3/ext4", "DOS FAT12/FAT16/FAT32", "HFS",
 
312
     "HFS+", "ISO9660", "JFS", "Minix fs", "nilfs2", "NTFS",
 
313
     "ReiserFS", "Amiga Smart FileSystem (SFS)", "tar", "UDF", "BSD
 
314
     UFS/UFS2", and "XFS". *Note Filesystem::, for more information.
 
315
 
 
316
Support automatic decompression
 
317
     Can decompress files which were compressed by `gzip'. This
 
318
     function is both automatic and transparent to the user (i.e. all
 
319
     functions operate upon the uncompressed contents of the specified
 
320
     files). This greatly reduces a file size and loading time, a
 
321
     particularly great benefit for floppies.(1) (*note
 
322
     Features-Footnote-1::)
 
323
 
 
324
     It is conceivable that some kernel modules should be loaded in a
 
325
     compressed state, so a different module-loading command can be
 
326
     specified to avoid uncompressing the modules.
 
327
 
 
328
Access data on any installed device
 
329
     Support reading data from any or all floppies or hard disk(s)
 
330
     recognized by the BIOS, independent of the setting of the root
 
331
     device.
 
332
 
 
333
Be independent of drive geometry translations
 
334
     Unlike many other boot loaders, GRUB makes the particular drive
 
335
     translation irrelevant. A drive installed and running with one
 
336
     translation may be converted to another translation without any
 
337
     adverse effects or changes in GRUB's configuration.
 
338
 
 
339
Detect all installed RAM
 
340
     GRUB can generally find all the installed RAM on a PC-compatible
 
341
     machine. It uses an advanced BIOS query technique for finding all
 
342
     memory regions. As described on the Multiboot Specification (*note
 
343
     Multiboot Specification: (multiboot)Top.), not all kernels make
 
344
     use of this information, but GRUB provides it for those who do.
 
345
 
 
346
Support Logical Block Address mode
 
347
     In traditional disk calls (called "CHS mode"), there is a geometry
 
348
     translation problem, that is, the BIOS cannot access over 1024
 
349
     cylinders, so the accessible space is limited to at least 508 MB
 
350
     and to at most 8GB. GRUB can't universally solve this problem, as
 
351
     there is no standard interface used in all machines. However,
 
352
     several newer machines have the new interface, Logical Block
 
353
     Address ("LBA") mode. GRUB automatically detects if LBA mode is
 
354
     available and uses it if available. In LBA mode, GRUB can access
 
355
     the entire disk.
 
356
 
 
357
Support network booting
 
358
     GRUB is basically a disk-based boot loader but also has network
 
359
     support. You can load OS images from a network by using the "TFTP"
 
360
     protocol.
 
361
 
 
362
Support remote terminals
 
363
     To support computers with no console, GRUB provides remote terminal
 
364
     support, so that you can control GRUB from a remote host. Only
 
365
     serial terminal support is implemented at the moment.
 
366
 
 
367
 
 
368
File: grub.info,  Node: Features-Footnotes,  Up: Features
 
369
 
 
370
   (1) There are a few pathological cases where loading a very badly
 
371
organized ELF kernel might take longer, but in practice this never
 
372
happen.
 
373
 
 
374
 
 
375
File: grub.info,  Node: Role of a boot loader,  Prev: Features,  Up: Introduction
 
376
 
 
377
1.5 The role of a boot loader
 
378
=============================
 
379
 
 
380
The following is a quotation from Gordon Matzigkeit, a GRUB fanatic:
 
381
 
 
382
     Some people like to acknowledge both the operating system and
 
383
     kernel when they talk about their computers, so they might say
 
384
     they use "GNU/Linux" or "GNU/Hurd".  Other people seem to think
 
385
     that the kernel is the most important part of the system, so they
 
386
     like to call their GNU operating systems "Linux systems."
 
387
 
 
388
     I, personally, believe that this is a grave injustice, because the
 
389
     _boot loader_ is the most important software of all. I used to
 
390
     refer to the above systems as either "LILO"(1) (*note Role of a
 
391
     boot loader-Footnote-1::) or "GRUB" systems.
 
392
 
 
393
     Unfortunately, nobody ever understood what I was talking about;
 
394
     now I just use the word "GNU" as a pseudonym for GRUB.
 
395
 
 
396
     So, if you ever hear people talking about their alleged "GNU"
 
397
     systems, remember that they are actually paying homage to the best
 
398
     boot loader around... GRUB!
 
399
 
 
400
   We, the GRUB maintainers, do not (usually) encourage Gordon's level
 
401
of fanaticism, but it helps to remember that boot loaders deserve
 
402
recognition.  We hope that you enjoy using GNU GRUB as much as we did
 
403
writing it.
 
404
 
 
405
 
 
406
File: grub.info,  Node: Role of a boot loader-Footnotes,  Up: Role of a boot loader
 
407
 
 
408
   (1) The LInux LOader, a boot loader that everybody uses, but nobody
 
409
likes.
 
410
 
 
411
 
 
412
File: grub.info,  Node: Naming convention,  Next: Installation,  Prev: Introduction,  Up: Top
 
413
 
 
414
2 Naming convention
 
415
*******************
 
416
 
 
417
The device syntax used in GRUB is a wee bit different from what you may
 
418
have seen before in your operating system(s), and you need to know it so
 
419
that you can specify a drive/partition.
 
420
 
 
421
   Look at the following examples and explanations:
 
422
 
 
423
     (fd0)
 
424
 
 
425
   First of all, GRUB requires that the device name be enclosed with
 
426
`(' and `)'. The `fd' part means that it is a floppy disk. The number
 
427
`0' is the drive number, which is counted from _zero_. This expression
 
428
means that GRUB will use the whole floppy disk.
 
429
 
 
430
     (hd0,msdos2)
 
431
 
 
432
   Here, `hd' means it is a hard disk drive. The first integer `0'
 
433
indicates the drive number, that is, the first hard disk, the string
 
434
`msdos' indicates the partition scheme, while the second integer, `2',
 
435
indicates the partition number (or the PC slice number in the BSD
 
436
terminology). The partition numbers are counted from _one_, not from
 
437
zero (as was the case in previous versions of GRUB). This expression
 
438
means the second partition of the first hard disk drive. In this case,
 
439
GRUB uses one partition of the disk, instead of the whole disk.
 
440
 
 
441
     (hd0,msdos5)
 
442
 
 
443
   This specifies the first "extended partition" of the first hard disk
 
444
drive. Note that the partition numbers for extended partitions are
 
445
counted from `5', regardless of the actual number of primary partitions
 
446
on your hard disk.
 
447
 
 
448
     (hd1,msdos1,bsd1)
 
449
 
 
450
   This means the BSD `a' partition on first PC slice number of the
 
451
second hard disk.
 
452
 
 
453
   Of course, to actually access the disks or partitions with GRUB, you
 
454
need to use the device specification in a command, like `set
 
455
root=(fd0)' or `parttool (hd0,msdos3) hidden-'. To help you find out
 
456
which number specifies a partition you want, the GRUB command-line
 
457
(*note Command-line interface::) options have argument completion. This
 
458
means that, for example, you only need to type
 
459
 
 
460
     set root=(
 
461
 
 
462
   followed by a <TAB>, and GRUB will display the list of drives,
 
463
partitions, or file names. So it should be quite easy to determine the
 
464
name of your target partition, even with minimal knowledge of the
 
465
syntax.
 
466
 
 
467
   Note that GRUB does _not_ distinguish IDE from SCSI - it simply
 
468
counts the drive numbers from zero, regardless of their type. Normally,
 
469
any IDE drive number is less than any SCSI drive number, although that
 
470
is not true if you change the boot sequence by swapping IDE and SCSI
 
471
drives in your BIOS.
 
472
 
 
473
   Now the question is, how to specify a file? Again, consider an
 
474
example:
 
475
 
 
476
     (hd0,msdos1)/vmlinuz
 
477
 
 
478
   This specifies the file named `vmlinuz', found on the first
 
479
partition of the first hard disk drive. Note that the argument
 
480
completion works with file names, too.
 
481
 
 
482
   That was easy, admit it. Now read the next chapter, to find out how
 
483
to actually install GRUB on your drive.
 
484
 
 
485
 
 
486
File: grub.info,  Node: Installation,  Next: Booting,  Prev: Naming convention,  Up: Top
 
487
 
 
488
3 Installation
 
489
**************
 
490
 
 
491
In order to install GRUB as your boot loader, you need to first install
 
492
the GRUB system and utilities under your UNIX-like operating system
 
493
(*note Obtaining and Building GRUB::). You can do this either from the
 
494
source tarball, or as a package for your OS.
 
495
 
 
496
   After you have done that, you need to install the boot loader on a
 
497
drive (floppy or hard disk). There are two ways of doing that - either
 
498
using the utility `grub-install' (*note Invoking grub-install::) on a
 
499
UNIX-like OS, or by running GRUB itself from a floppy. These are quite
 
500
similar, however the utility might probe a wrong BIOS drive, so you
 
501
should be careful.
 
502
 
 
503
   Also, if you install GRUB on a UNIX-like OS, please make sure that
 
504
you have an emergency boot disk ready, so that you can rescue your
 
505
computer if, by any chance, your hard drive becomes unusable
 
506
(unbootable).
 
507
 
 
508
   GRUB comes with boot images, which are normally put in the directory
 
509
`/usr/lib/grub/i386-pc'. Hereafter, the directory where GRUB images are
 
510
initially placed (normally `/usr/lib/grub/i386-pc') will be called the
 
511
"image directory", and the directory where the boot loader needs to
 
512
find them (usually `/boot/grub') will be called the "boot directory".
 
513
 
 
514
* Menu:
 
515
 
 
516
* Installing GRUB using grub-install::
 
517
* Making a GRUB bootable CD-ROM::
 
518
* Device map::
 
519
 
 
520
 
 
521
File: grub.info,  Node: Installing GRUB using grub-install,  Next: Making a GRUB bootable CD-ROM,  Up: Installation
 
522
 
 
523
3.1 Installing GRUB using grub-install
 
524
======================================
 
525
 
 
526
*Caution:* This procedure is definitely less safe, because there are
 
527
several ways in which your computer can become unbootable. For example,
 
528
most operating systems don't tell GRUB how to map BIOS drives to OS
 
529
devices correctly--GRUB merely "guesses" the mapping. This will succeed
 
530
in most cases, but not always. Therefore, GRUB provides you with a map
 
531
file called the "device map", which you must fix if it is wrong. *Note
 
532
Device map::, for more details.
 
533
 
 
534
   On BIOS platforms GRUB has to use a so-called embedding zone. On
 
535
msdos partition tables, this is the space between the MBR and the first
 
536
partition (called the MBR gap or the boot track), while on GPT
 
537
partition tables it uses a BIOS Boot Partition (a partition with GUID
 
538
21686148-6449-6e6f-744e656564454649). If you use GRUB on a BIOS system,
 
539
make sure that the embedding zone is at least 31 KiB (512KiB or more
 
540
recommended).
 
541
 
 
542
   If you still do want to install GRUB under a UNIX-like OS (such as
 
543
GNU), invoke the program `grub-install' (*note Invoking grub-install::)
 
544
as the superuser ("root").
 
545
 
 
546
   The usage is basically very simple. You only need to specify one
 
547
argument to the program, namely, where to install the boot loader. The
 
548
argument can be either a device file (like `/dev/hda') or a partition
 
549
specified in GRUB's notation. For example, under Linux the following
 
550
will install GRUB into the MBR of the first IDE disk:
 
551
 
 
552
     # grub-install /dev/hda
 
553
 
 
554
   Likewise, under GNU/Hurd, this has the same effect:
 
555
 
 
556
     # grub-install /dev/hd0
 
557
 
 
558
   But all the above examples assume that GRUB should use images under
 
559
the root directory. If you want GRUB to use images under a directory
 
560
other than the root directory, you need to specify the option
 
561
`--root-directory'. The typical usage is that you create a GRUB boot
 
562
floppy with a filesystem. Here is an example:
 
563
 
 
564
     # mke2fs /dev/fd0
 
565
     # mount -t ext2 /dev/fd0 /mnt
 
566
     # grub-install --root-directory=/mnt fd0
 
567
     # umount /mnt
 
568
 
 
569
   Another example is when you have a separate boot partition which is
 
570
mounted at `/boot'. Since GRUB is a boot loader, it doesn't know
 
571
anything about mountpoints at all. Thus, you need to run `grub-install'
 
572
like this:
 
573
 
 
574
     # grub-install --root-directory=/boot /dev/hda
 
575
 
 
576
   By the way, as noted above, it is quite difficult to guess BIOS
 
577
drives correctly under a UNIX-like OS. Thus, `grub-install' will prompt
 
578
you to check if it could really guess the correct mappings, after the
 
579
installation. The format is defined in *note Device map::. Please be
 
580
quite careful. If the output is wrong, it is unlikely that your
 
581
computer will be able to boot with no problem.
 
582
 
 
583
   Some BIOSes have a bug of exposing the first partition of a USB
 
584
drive as a floppy instead of exposing the USB drive as a hard disk
 
585
(they call it "USB-FDD" boot). In such cases, you need to install like
 
586
this:
 
587
 
 
588
     # losetup /dev/loop0 /dev/sdb1
 
589
     # mount /dev/loop0 /mnt/usb
 
590
     # grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0
 
591
 
 
592
   This install doesn't conflict with standard install as long as they
 
593
are in separate directories.
 
594
 
 
595
   Note that `grub-install' is actually just a shell script and the
 
596
real task is done by `grub-mkimage' and `grub-setup'.  Therefore, you
 
597
may run those commands directly to install GRUB, without using
 
598
`grub-install'. Don't do that, however, unless you are very familiar
 
599
with the internals of GRUB. Installing a boot loader on a running OS
 
600
may be extremely dangerous.
 
601
 
 
602
 
 
603
File: grub.info,  Node: Making a GRUB bootable CD-ROM,  Next: Device map,  Prev: Installing GRUB using grub-install,  Up: Installation
 
604
 
 
605
3.2 Making a GRUB bootable CD-ROM
 
606
=================================
 
607
 
 
608
GRUB supports the "no emulation mode" in the El Torito specification(1)
 
609
(*note Making a GRUB bootable CD-ROM-Footnote-1::). This means that you
 
610
can use the whole CD-ROM from GRUB and you don't have to make a floppy
 
611
or hard disk image file, which can cause compatibility problems.
 
612
 
 
613
   For booting from a CD-ROM, GRUB uses a special Stage 2 called
 
614
`stage2_eltorito'. The only GRUB files you need to have in your
 
615
bootable CD-ROM are this `stage2_eltorito' and optionally a config file
 
616
`grub.cfg'. You don't need to use `stage1' or `stage2', because El
 
617
Torito is quite different from the standard boot process.
 
618
 
 
619
   Here is an example of procedures to make a bootable CD-ROM image.
 
620
First, make a top directory for the bootable image, say, `iso':
 
621
 
 
622
     $ mkdir iso
 
623
 
 
624
   Make a directory for GRUB:
 
625
 
 
626
     $ mkdir -p iso/boot/grub
 
627
 
 
628
   Copy the file `stage2_eltorito':
 
629
 
 
630
     $ cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub
 
631
 
 
632
   If desired, make the config file `grub.cfg' under `iso/boot/grub'
 
633
(*note Configuration::), and copy any files and directories for the
 
634
disc to the directory `iso/'.
 
635
 
 
636
   Finally, make a ISO9660 image file like this:
 
637
 
 
638
     $ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
 
639
         -boot-load-size 4 -boot-info-table -o grub.iso iso
 
640
 
 
641
   This produces a file named `grub.iso', which then can be burned into
 
642
a CD (or a DVD).  `mkisofs' has already set up the disc to boot from
 
643
the `boot/grub/stage2_eltorito' file, so there is no need to setup GRUB
 
644
on the disc.  (Note that the `-boot-load-size 4' bit is required for
 
645
compatibility with the BIOS on many older machines.)
 
646
 
 
647
   You can use the device `(cd)' to access a CD-ROM in your config
 
648
file. This is not required; GRUB automatically sets the root device to
 
649
`(cd)' when booted from a CD-ROM. It is only necessary to refer to
 
650
`(cd)' if you want to access other drives as well.
 
651
 
 
652
 
 
653
File: grub.info,  Node: Making a GRUB bootable CD-ROM-Footnotes,  Up: Making a GRUB bootable CD-ROM
 
654
 
 
655
   (1) El Torito is a specification for bootable CD using BIOS
 
656
functions.
 
657
 
 
658
 
 
659
File: grub.info,  Node: Device map,  Prev: Making a GRUB bootable CD-ROM,  Up: Installation
 
660
 
 
661
3.3 The map between BIOS drives and OS devices
 
662
==============================================
 
663
 
 
664
The `grub-mkdevicemap' program can be used to create the "device map
 
665
file".  It is often run automatically by tools such as `grub-install'
 
666
if the device map file does not already exist.  The file name
 
667
`/boot/grub/device.map' is preferred.
 
668
 
 
669
   If the device map file exists, the GRUB utilities (`grub-probe',
 
670
`grub-setup', etc.) read it to map BIOS drives to OS devices.  This
 
671
file consists of lines like this:
 
672
 
 
673
     DEVICE FILE
 
674
 
 
675
   DEVICE is a drive specified in the GRUB syntax (*note Device
 
676
syntax::), and FILE is an OS file, which is normally a device file.
 
677
 
 
678
   Historically, the device map file was used because GRUB device names
 
679
had to be used in the configuration file, and they were derived from
 
680
BIOS drive numbers.  The map between BIOS drives and OS devices cannot
 
681
always be guessed correctly: for example, GRUB will get the order wrong
 
682
if you exchange the boot sequence between IDE and SCSI in your BIOS.
 
683
 
 
684
   Unfortunately, even OS device names are not always stable.  Modern
 
685
versions of the Linux kernel may probe drives in a different order from
 
686
boot to boot, and the prefix (`/dev/hd*' versus `/dev/sd*') may change
 
687
depending on the driver subsystem in use.  As a result, the device map
 
688
file required frequent editing on some systems.
 
689
 
 
690
   GRUB avoids this problem nowadays by using UUIDs or file system
 
691
labels when generating `grub.cfg', and we advise that you do the same
 
692
for any custom menu entries you write.  If the device map file does not
 
693
exist, then the GRUB utilities will assume a temporary device map on
 
694
the fly.  This is often good enough, particularly in the common case of
 
695
single-disk systems.
 
696
 
 
697
   However, the device map file is not entirely obsolete yet, and there
 
698
are still some situations that require it to exist.  If necessary, you
 
699
may edit the file if `grub-mkdevicemap' makes a mistake.  You can put
 
700
any comments in the file if needed, as the GRUB utilities assume that a
 
701
line is just a comment if the first character is `#'.
 
702
 
 
703
 
 
704
File: grub.info,  Node: Booting,  Next: Configuration,  Prev: Installation,  Up: Top
 
705
 
 
706
4 Booting
 
707
*********
 
708
 
 
709
GRUB can load Multiboot-compliant kernels in a consistent way, but for
 
710
some free operating systems you need to use some OS-specific magic.
 
711
 
 
712
* Menu:
 
713
 
 
714
* General boot methods::        How to boot OSes with GRUB generally
 
715
* OS-specific notes::           Notes on some operating systems
 
716
 
 
717
 
 
718
File: grub.info,  Node: General boot methods,  Next: OS-specific notes,  Up: Booting
 
719
 
 
720
4.1 How to boot operating systems
 
721
=================================
 
722
 
 
723
GRUB has two distinct boot methods. One of the two is to load an
 
724
operating system directly, and the other is to chain-load another boot
 
725
loader which then will load an operating system actually. Generally
 
726
speaking, the former is more desirable, because you don't need to
 
727
install or maintain other boot loaders and GRUB is flexible enough to
 
728
load an operating system from an arbitrary disk/partition. However, the
 
729
latter is sometimes required, since GRUB doesn't support all the
 
730
existing operating systems natively.
 
731
 
 
732
* Menu:
 
733
 
 
734
* Loading an operating system directly::
 
735
* Chain-loading::
 
736
 
 
737
 
 
738
File: grub.info,  Node: Loading an operating system directly,  Next: Chain-loading,  Up: General boot methods
 
739
 
 
740
4.1.1 How to boot an OS directly with GRUB
 
741
------------------------------------------
 
742
 
 
743
Multiboot (*note Multiboot Specification: (multiboot)Top.) is the
 
744
native format supported by GRUB.  For the sake of convenience, there is
 
745
also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to
 
746
boot other operating systems, you will have to chain-load them (*note
 
747
Chain-loading::).
 
748
 
 
749
   FIXME: this section is incomplete.
 
750
 
 
751
  1. Run the command `boot' (*note boot::).
 
752
 
 
753
   However, DOS and Windows have some deficiencies, so you might have to
 
754
use more complicated instructions. *Note DOS/Windows::, for more
 
755
information.
 
756
 
 
757
 
 
758
File: grub.info,  Node: Chain-loading,  Prev: Loading an operating system directly,  Up: General boot methods
 
759
 
 
760
4.1.2 Chain-loading an OS
 
761
-------------------------
 
762
 
 
763
Operating systems that do not support Multiboot and do not have specific
 
764
support in GRUB (specific support is available for Linux, FreeBSD,
 
765
NetBSD and OpenBSD) must be chain-loaded, which involves loading
 
766
another boot loader and jumping to it in real mode.
 
767
 
 
768
   The `chainloader' command (*note chainloader::) is used to set this
 
769
up.  It is normally also necessary to load some GRUB modules and set the
 
770
appropriate root device.  Putting this together, we get something like
 
771
this, for a Windows system on the first partition of the first hard
 
772
disk:
 
773
 
 
774
menuentry "Windows" {
 
775
        insmod chain
 
776
        insmod ntfs
 
777
        set root=(hd0,1)
 
778
        chainloader +1
 
779
}
 
780
 
 
781
   On systems with multiple hard disks, an additional workaround may be
 
782
required.  *Note DOS/Windows::.
 
783
 
 
784
   Chain-loading is only supported on PC BIOS and EFI platforms.
 
785
 
 
786
 
 
787
File: grub.info,  Node: OS-specific notes,  Prev: General boot methods,  Up: Booting
 
788
 
 
789
4.2 Some caveats on OS-specific issues
 
790
======================================
 
791
 
 
792
Here, we describe some caveats on several operating systems.
 
793
 
 
794
* Menu:
 
795
 
 
796
* GNU/Hurd::
 
797
* GNU/Linux::
 
798
* DOS/Windows::
 
799
 
 
800
 
 
801
File: grub.info,  Node: GNU/Hurd,  Next: GNU/Linux,  Up: OS-specific notes
 
802
 
 
803
4.2.1 GNU/Hurd
 
804
--------------
 
805
 
 
806
Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is
 
807
nothing special about it. But do not forget that you have to specify a
 
808
root partition to the kernel.
 
809
 
 
810
  1. Set GRUB's root device to the same drive as GNU/Hurd's.  The
 
811
     command `search --file --set /boot/gnumach.gz' or similar may help
 
812
     you (*note search::).
 
813
 
 
814
  2. Load the kernel and the modules, like this:
 
815
 
 
816
          grub> multiboot /boot/gnumach.gz root=device:hd0s1
 
817
          grub> module  /hurd/ext2fs.static ext2fs --readonly \
 
818
                             --multiboot-command-line='${kernel-command-line}' \
 
819
                             --host-priv-port='${host-port}' \
 
820
                             --device-master-port='${device-port}' \
 
821
                             --exec-server-task='${exec-task}' -T typed '${root}' \
 
822
                             '$(task-create)' '$(task-resume)'
 
823
          grub> module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
 
824
 
 
825
  3. Finally, run the command `boot' (*note boot::).
 
826
 
 
827
 
 
828
File: grub.info,  Node: GNU/Linux,  Next: DOS/Windows,  Prev: GNU/Hurd,  Up: OS-specific notes
 
829
 
 
830
4.2.2 GNU/Linux
 
831
---------------
 
832
 
 
833
It is relatively easy to boot GNU/Linux from GRUB, because it somewhat
 
834
resembles to boot a Multiboot-compliant OS.
 
835
 
 
836
  1. Set GRUB's root device to the same drive as GNU/Linux's.  The
 
837
     command `search --file --set /vmlinuz' or similar may help you
 
838
     (*note search::).
 
839
 
 
840
  2. Load the kernel using the command `linux' (*note linux::):
 
841
 
 
842
          grub> linux /vmlinuz root=/dev/sda1
 
843
 
 
844
     If you need to specify some kernel parameters, just append them to
 
845
     the command.  For example, to set `acpi' to `off', do this:
 
846
 
 
847
          grub> linux /vmlinuz root=/dev/sda1 acpi=off
 
848
 
 
849
     See the documentation in the Linux source tree for complete
 
850
     information on the available options.
 
851
 
 
852
     With `linux' GRUB uses 32-bit protocol. Some BIOS services like APM
 
853
     or EDD aren't available with this protocol. In this case you need
 
854
     to use `linux16'
 
855
 
 
856
          grub> linux16 /vmlinuz root=/dev/sda1 acpi=off
 
857
 
 
858
  3. If you use an initrd, execute the command `initrd' (*note initrd::)
 
859
     after `linux':
 
860
 
 
861
          grub> initrd /initrd
 
862
 
 
863
     If you used `linux16' you need to use `initrd16':
 
864
 
 
865
          grub> initrd16 /initrd
 
866
 
 
867
  4. Finally, run the command `boot' (*note boot::).
 
868
 
 
869
   *Caution:* If you use an initrd and specify the `mem=' option to the
 
870
kernel to let it use less than actual memory size, you will also have
 
871
to specify the same memory size to GRUB. To let GRUB know the size, run
 
872
the command `uppermem' _before_ loading the kernel. *Note uppermem::,
 
873
for more information.
 
874
 
 
875
 
 
876
File: grub.info,  Node: DOS/Windows,  Prev: GNU/Linux,  Up: OS-specific notes
 
877
 
 
878
4.2.3 DOS/Windows
 
879
-----------------
 
880
 
 
881
GRUB cannot boot DOS or Windows directly, so you must chain-load them
 
882
(*note Chain-loading::). However, their boot loaders have some critical
 
883
deficiencies, so it may not work to just chain-load them. To overcome
 
884
the problems, GRUB provides you with two helper functions.
 
885
 
 
886
   If you have installed DOS (or Windows) on a non-first hard disk, you
 
887
have to use the disk swapping technique, because that OS cannot boot
 
888
from any disks but the first one. The workaround used in GRUB is the
 
889
command `drivemap' (*note drivemap::), like this:
 
890
 
 
891
     drivemap -s (hd0) (hd1)
 
892
 
 
893
   This performs a "virtual" swap between your first and second hard
 
894
drive.
 
895
 
 
896
   *Caution:* This is effective only if DOS (or Windows) uses BIOS to
 
897
access the swapped disks. If that OS uses a special driver for the
 
898
disks, this probably won't work.
 
899
 
 
900
   Another problem arises if you installed more than one set of
 
901
DOS/Windows onto one disk, because they could be confused if there are
 
902
more than one primary partitions for DOS/Windows. Certainly you should
 
903
avoid doing this, but there is a solution if you do want to do so. Use
 
904
the partition hiding/unhiding technique.
 
905
 
 
906
   If GRUB "hides" a DOS (or Windows) partition (*note parttool::), DOS
 
907
(or Windows) will ignore the partition. If GRUB "unhides" a DOS (or
 
908
Windows) partition, DOS (or Windows) will detect the partition. Thus,
 
909
if you have installed DOS (or Windows) on the first and the second
 
910
partition of the first hard disk, and you want to boot the copy on the
 
911
first partition, do the following:
 
912
 
 
913
     parttool (hd0,1) hidden-
 
914
     parttool (hd0,2) hidden+
 
915
     set root=(hd0,1)
 
916
     chainloader +1
 
917
     parttool ${root} boot+
 
918
     boot
 
919
 
 
920
 
 
921
File: grub.info,  Node: Configuration,  Next: Theme file format,  Prev: Booting,  Up: Top
 
922
 
 
923
5 Writing your own configuration file
 
924
*************************************
 
925
 
 
926
GRUB is configured using `grub.cfg', usually located under
 
927
`/boot/grub'.  This file is quite flexible, but most users will not
 
928
need to write the whole thing by hand.
 
929
 
 
930
* Menu:
 
931
 
 
932
* Simple configuration::        Recommended for most users
 
933
* Shell-like scripting::        For power users and developers
 
934
* Embedded configuration::      Embedding a configuration file into GRUB
 
935
 
 
936
 
 
937
File: grub.info,  Node: Simple configuration,  Next: Shell-like scripting,  Up: Configuration
 
938
 
 
939
5.1 Simple configuration handling
 
940
=================================
 
941
 
 
942
The program `grub-mkconfig' (*note Invoking grub-mkconfig::) generates
 
943
`grub.cfg' files suitable for most cases.  It is suitable for use when
 
944
upgrading a distribution, and will discover available kernels and
 
945
attempt to generate menu entries for them.
 
946
 
 
947
   The file `/etc/default/grub' controls the operation of
 
948
`grub-mkconfig'.  It is sourced by a shell script, and so must be valid
 
949
POSIX shell input; normally, it will just be a sequence of `KEY=value'
 
950
lines, but if the value contains spaces or other special characters
 
951
then it must be quoted.  For example:
 
952
 
 
953
     GRUB_TERMINAL_INPUT="console serial"
 
954
 
 
955
   Valid keys in `/etc/default/grub' are as follows:
 
956
 
 
957
`GRUB_DEFAULT'
 
958
     The default menu entry.  This may be a number, in which case it
 
959
     identifies the Nth entry in the generated menu counted from zero,
 
960
     or the full name of a menu entry, or the special string `saved'.
 
961
     Using the full name may be useful if you want to set a menu entry
 
962
     as the default even though there may be a variable number of
 
963
     entries before it.
 
964
 
 
965
     If you set this to `saved', then the default menu entry will be
 
966
     that saved by `GRUB_SAVEDEFAULT', `grub-set-default', or
 
967
     `grub-reboot'.
 
968
 
 
969
     The default is `0'.
 
970
 
 
971
`GRUB_SAVEDEFAULT'
 
972
     If this option is set to `true', then, when an entry is selected,
 
973
     save it as a new default entry for use by future runs of GRUB.
 
974
     This is only useful if `GRUB_DEFAULT=saved'; it is a separate
 
975
     option because `GRUB_DEFAULT=saved' is useful without this option,
 
976
     in conjunction with `grub-set-default' or `grub-reboot'.  Unset by
 
977
     default.  The remarks of *note Changes from GRUB Legacy:: on the
 
978
     availability of `save_env' apply.
 
979
 
 
980
`GRUB_TIMEOUT'
 
981
     Boot the default entry this many seconds after the menu is
 
982
     displayed, unless a key is pressed.  The default is `5'.  Set to
 
983
     `0' to boot immediately without displaying the menu, or to `-1' to
 
984
     wait indefinitely.
 
985
 
 
986
`GRUB_HIDDEN_TIMEOUT'
 
987
     Wait this many seconds for a key to be pressed before displaying
 
988
     the menu.  If no key is pressed during that time, boot
 
989
     immediately.  Unset by default.
 
990
 
 
991
`GRUB_HIDDEN_TIMEOUT_QUIET'
 
992
     In conjunction with `GRUB_HIDDEN_TIMEOUT', set this to `true' to
 
993
     suppress the verbose countdown while waiting for a key to be
 
994
     pressed before displaying the menu.  Unset by default.
 
995
 
 
996
`GRUB_DEFAULT_BUTTON'
 
997
`GRUB_TIMEOUT_BUTTON'
 
998
`GRUB_HIDDEN_TIMEOUT_BUTTON'
 
999
`GRUB_BUTTON_CMOS_ADDRESS'
 
1000
     Variants of the corresponding variables without the `_BUTTON'
 
1001
     suffix, used to support vendor-specific power buttons.  *Note
 
1002
     Vendor power-on keys::.
 
1003
 
 
1004
`GRUB_DISTRIBUTOR'
 
1005
     Set by distributors of GRUB to their identifying name.  This is
 
1006
     used to generate more informative menu entry titles.
 
1007
 
 
1008
`GRUB_TERMINAL_INPUT'
 
1009
     Select the terminal input device.  You may select multiple devices
 
1010
     here, separated by spaces.
 
1011
 
 
1012
     Valid terminal input names depend on the platform, but may include
 
1013
     `console' (PC BIOS and EFI consoles), `serial' (serial terminal),
 
1014
     `ofconsole' (Open Firmware console), `at_keyboard' (PC AT
 
1015
     keyboard, mainly useful with Coreboot), or `usb_keyboard' (USB
 
1016
     keyboard using the HID Boot Protocol, for cases where the firmware
 
1017
     does not handle this).
 
1018
 
 
1019
     The default is to use the platform's native terminal input.
 
1020
 
 
1021
`GRUB_TERMINAL_OUTPUT'
 
1022
     Select the terminal output device.  You may select multiple
 
1023
     devices here, separated by spaces.
 
1024
 
 
1025
     Valid terminal output names depend on the platform, but may include
 
1026
     `console' (PC BIOS and EFI consoles), `serial' (serial terminal),
 
1027
     `gfxterm' (graphics-mode output), `ofconsole' (Open Firmware
 
1028
     console), or `vga_text' (VGA text output, mainly useful with
 
1029
     Coreboot).
 
1030
 
 
1031
     The default is to use the platform's native terminal output.
 
1032
 
 
1033
`GRUB_TERMINAL'
 
1034
     If this option is set, it overrides both `GRUB_TERMINAL_INPUT' and
 
1035
     `GRUB_TERMINAL_OUTPUT' to the same value.
 
1036
 
 
1037
`GRUB_SERIAL_COMMAND'
 
1038
     A command to configure the serial port when using the serial
 
1039
     console.  *Note serial::.  Defaults to `serial'.
 
1040
 
 
1041
`GRUB_CMDLINE_LINUX'
 
1042
     Command-line arguments to add to menu entries for the Linux kernel.
 
1043
 
 
1044
`GRUB_CMDLINE_LINUX_DEFAULT'
 
1045
     Unless `GRUB_DISABLE_RECOVERY' is set to `true', two menu entries
 
1046
     will be generated for each Linux kernel: one default entry and one
 
1047
     entry for recovery mode.  This option lists command-line arguments
 
1048
     to add only to the default menu entry, after those listed in
 
1049
     `GRUB_CMDLINE_LINUX'.
 
1050
 
 
1051
`GRUB_CMDLINE_NETBSD'
 
1052
`GRUB_CMDLINE_NETBSD_DEFAULT'
 
1053
     As `GRUB_CMDLINE_LINUX' and `GRUB_CMDLINE_LINUX_DEFAULT', but for
 
1054
     NetBSD.
 
1055
 
 
1056
`GRUB_CMDLINE_XEN'
 
1057
`GRUB_CMDLINE_XEN_DEFAULT'
 
1058
     As `GRUB_CMDLINE_LINUX' and `GRUB_CMDLINE_LINUX_DEFAULT', but for
 
1059
     Linux and Xen.
 
1060
 
 
1061
`GRUB_DISABLE_LINUX_UUID'
 
1062
     Normally, `grub-mkconfig' will generate menu entries that use
 
1063
     universally-unique identifiers (UUIDs) to identify the root
 
1064
     filesystem to the Linux kernel, using a `root=UUID=...' kernel
 
1065
     parameter.  This is usually more reliable, but in some cases it
 
1066
     may not be appropriate.  To disable the use of UUIDs, set this
 
1067
     option to `true'.
 
1068
 
 
1069
`GRUB_DISABLE_RECOVERY'
 
1070
     If this option is set to `true', disable the generation of recovery
 
1071
     mode menu entries.
 
1072
 
 
1073
`GRUB_VIDEO_BACKEND'
 
1074
     If graphical video support is required, either because the
 
1075
     `gfxterm' graphical terminal is in use or because
 
1076
     `GRUB_GFXPAYLOAD_LINUX' is set, then `grub-mkconfig' will normally
 
1077
     load all available GRUB video drivers and use the one most
 
1078
     appropriate for your hardware.  If you need to override this for
 
1079
     some reason, then you can set this option.
 
1080
 
 
1081
     After `grub-install' has been run, the available video drivers are
 
1082
     listed in `/boot/grub/video.lst'.
 
1083
 
 
1084
`GRUB_GFXMODE'
 
1085
     Set the resolution used on the `gfxterm' graphical terminal.  Note
 
1086
     that you can only use modes which your graphics card supports via
 
1087
     VESA BIOS Extensions (VBE), so for example native LCD panel
 
1088
     resolutions may not be available.  The default is `640x480'.
 
1089
 
 
1090
`GRUB_BACKGROUND'
 
1091
     Set a background image for use with the `gfxterm' graphical
 
1092
     terminal.  The value of this option must be a file readable by
 
1093
     GRUB at boot time, and it must end with `.png', `.tga', `.jpg', or
 
1094
     `.jpeg'.  The image will be scaled if necessary to fit the screen.
 
1095
 
 
1096
`GRUB_THEME'
 
1097
     Set a theme for use with the `gfxterm' graphical terminal.
 
1098
 
 
1099
`GRUB_GFXPAYLOAD_LINUX'
 
1100
     Set to `text' to force the Linux kernel to boot in normal text
 
1101
     mode, `keep' to preserve the graphics mode set using
 
1102
     `GRUB_GFXMODE', `WIDTHxHEIGHT'[`xDEPTH'] to set a particular
 
1103
     graphics mode, or a sequence of these separated by commas or
 
1104
     semicolons to try several modes in sequence.
 
1105
 
 
1106
     Depending on your kernel, your distribution, your graphics card,
 
1107
     and the phase of the moon, note that using this option may cause
 
1108
     GNU/Linux to suffer from various display problems, particularly
 
1109
     during the early part of the boot sequence.  If you have problems,
 
1110
     set this option to `text' and GRUB will tell Linux to boot in
 
1111
     normal text mode.
 
1112
 
 
1113
`GRUB_DISABLE_OS_PROBER'
 
1114
     Normally, `grub-mkconfig' will try to use the external `os-prober'
 
1115
     program, if installed, to discover other operating systems
 
1116
     installed on the same system and generate appropriate menu entries
 
1117
     for them.  Set this option to `true' to disable this.
 
1118
 
 
1119
`GRUB_INIT_TUNE'
 
1120
     Play a tune on the speaker when GRUB starts.  This is particularly
 
1121
     useful for users unable to see the screen.  The value of this
 
1122
     option is passed directly to *note play::.
 
1123
 
 
1124
`GRUB_BADRAM'
 
1125
     If this option is set, GRUB will issue a *note badram:: command to
 
1126
     filter out specified regions of RAM.
 
1127
 
 
1128
 
 
1129
   For more detailed customisation of `grub-mkconfig''s output, you may
 
1130
edit the scripts in `/etc/grub.d' directly.  `/etc/grub.d/40_custom' is
 
1131
particularly useful for adding entire custom menu entries; simply type
 
1132
the menu entries you want to add at the end of that file, making sure
 
1133
to leave at least the first two lines intact.
 
1134
 
 
1135
 
 
1136
File: grub.info,  Node: Shell-like scripting,  Next: Embedded configuration,  Prev: Simple configuration,  Up: Configuration
 
1137
 
 
1138
5.2 Writing full configuration files directly
 
1139
=============================================
 
1140
 
 
1141
`grub.cfg' is written in GRUB's built-in scripting language, which has
 
1142
a syntax quite similar to that of GNU Bash and other Bourne shell
 
1143
derivatives.
 
1144
 
 
1145
Words
 
1146
=====
 
1147
 
 
1148
A "word" is a sequence of characters considered as a single unit by
 
1149
GRUB.  Words are separated by "metacharacters", which are the following
 
1150
plus space, tab, and newline:
 
1151
 
 
1152
     { } | & $ ; < >
 
1153
 
 
1154
   Quoting may be used to include metacharacters in words; see below.
 
1155
 
 
1156
Reserved words
 
1157
==============
 
1158
 
 
1159
Reserved words have a special meaning to GRUB.  The following words are
 
1160
recognised as reserved when unquoted and either the first word of a
 
1161
simple command or the third word of a `for' command:
 
1162
 
 
1163
     ! [[ ]] { }
 
1164
     case do done elif else esac fi for function
 
1165
     if in menuentry select then time until while
 
1166
 
 
1167
   Not all of these reserved words have a useful purpose yet; some are
 
1168
reserved for future expansion.
 
1169
 
 
1170
Quoting
 
1171
=======
 
1172
 
 
1173
Quoting is used to remove the special meaning of certain characters or
 
1174
words.  It can be used to treat metacharacters as part of a word, to
 
1175
prevent reserved words from being recognised as such, and to prevent
 
1176
variable expansion.
 
1177
 
 
1178
   There are three quoting mechanisms: the escape character, single
 
1179
quotes, and double quotes.
 
1180
 
 
1181
   A non-quoted backslash (\) is the "escape character".  It preserves
 
1182
the literal value of the next character that follows, with the
 
1183
exception of newline.
 
1184
 
 
1185
   Enclosing characters in single quotes preserves the literal value of
 
1186
each character within the quotes.  A single quote may not occur between
 
1187
single quotes, even when preceded by a backslash.
 
1188
 
 
1189
   Enclosing characters in double quotes preserves the literal value of
 
1190
all characters within the quotes, with the exception of `$' and `\'.
 
1191
The `$' character retains its special meaning within double quotes.
 
1192
The backslash retains its special meaning only when followed by one of
 
1193
the following characters: `$', `"', `\', or newline.  A
 
1194
backslash-newline pair is treated as a line continuation (that is, it is
 
1195
removed from the input stream and effectively ignored(1) (*note
 
1196
Shell-like scripting-Footnote-1::)).  A double quote may be quoted
 
1197
within double quotes by preceding it with a backslash.
 
1198
 
 
1199
Variable expansion
 
1200
==================
 
1201
 
 
1202
The `$' character introduces variable expansion.  The variable name to
 
1203
be expanded may be enclosed in braces, which are optional but serve to
 
1204
protect the variable to be expanded from characters immediately
 
1205
following it which could be interpreted as part of the name.
 
1206
 
 
1207
   Normal variable names begin with an alphabetic character, followed
 
1208
by zero or more alphanumeric characters.
 
1209
 
 
1210
   Positional variable names consist of one or more digits.  They
 
1211
represent parameters passed to function calls, with `$1' representing
 
1212
the first parameter, and so on.
 
1213
 
 
1214
   The special variable name `?' expands to the exit status of the most
 
1215
recently executed command.  When positional variable names are active,
 
1216
other special variable names `@', `*' and `#' are defined and they
 
1217
expand to all positional parameters with necessary quoting, positional
 
1218
parameters without any quoting, and positional parameter count
 
1219
respectively.
 
1220
 
 
1221
Comments
 
1222
========
 
1223
 
 
1224
A word beginning with `#' causes that word and all remaining characters
 
1225
on that line to be ignored.
 
1226
 
 
1227
Simple commands
 
1228
===============
 
1229
 
 
1230
A "simple command" is a sequence of words separated by spaces or tabs
 
1231
and terminated by a semicolon or a newline.  The first word specifies
 
1232
the command to be executed.  The remaining words are passed as
 
1233
arguments to the invoked command.
 
1234
 
 
1235
   The return value of a simple command is its exit status.  If the
 
1236
reserved word `!' precedes the command, then the return value is
 
1237
instead the logical negation of the command's exit status.
 
1238
 
 
1239
Compound commands
 
1240
=================
 
1241
 
 
1242
A "compound command" is one of the following:
 
1243
 
 
1244
for NAME in WORD ...; do LIST; done
 
1245
     The list of words following `in' is expanded, generating a list of
 
1246
     items.  The variable NAME is set to each element of this list in
 
1247
     turn, and LIST is executed each time.  The return value is the
 
1248
     exit status of the last command that executes.  If the expansion
 
1249
     of the items following `in' results in an empty list, no commands
 
1250
     are executed, and the return status is 0.
 
1251
 
 
1252
if LIST; then LIST; [elif LIST; then LIST;] ... [else LIST;] fi
 
1253
     The `if' LIST is executed.  If its exit status is zero, the `then'
 
1254
     LIST is executed.  Otherwise, each `elif' LIST is executed in
 
1255
     turn, and if its exit status is zero, the corresponding `then'
 
1256
     LIST is executed and the command completes.  Otherwise, the `else'
 
1257
     LIST is executed, if present.  The exit status is the exit status
 
1258
     of the last command executed, or zero if no condition tested true.
 
1259
 
 
1260
while COND; do LIST; done
 
1261
until COND; do LIST; done
 
1262
     The `while' command continuously executes the `do' LIST as long as
 
1263
     the last command in COND returns an exit status of zero.  The
 
1264
     `until' command is identical to the `while' command, except that
 
1265
     the test is negated; the `do' LIST is executed as long as the last
 
1266
     command in COND returns a non-zero exit status.  The exit status
 
1267
     of the `while' and `until' commands is the exit status of the last
 
1268
     `do' LIST command executed, or zero if none was executed.
 
1269
 
 
1270
function NAME { COMMAND; ... }
 
1271
     This defines a function named NAME.  The "body" of the function is
 
1272
     the list of commands within braces, each of which must be
 
1273
     terminated with a semicolon or a newline.  This list of commands
 
1274
     will be executed whenever NAME is specified as the name of a
 
1275
     simple command.  Function definitions do not affect the exit
 
1276
     status in `$?'.  When executed, the exit status of a function is
 
1277
     the exit status of the last command executed in the body.
 
1278
 
 
1279
menuentry TITLE [`--class=class' ...] [`--users=users'] [`--hotkey=key'] { COMMAND; ... }
 
1280
     *Note menuentry::.
 
1281
 
 
1282
Built-in Commands
 
1283
=================
 
1284
 
 
1285
Some built-in commands are also provided by GRUB script to help script
 
1286
writers perform actions that are otherwise not possible.  For example,
 
1287
these include commands to jump out of a loop without fully completing
 
1288
it, etc.
 
1289
 
 
1290
break [`n']
 
1291
     Exit from within a `for', `while', or `until' loop.  If `n' is
 
1292
     specified, break `n' levels.  `n' must be greater than or equal to
 
1293
     1.  If `n' is greater than the number of enclosing loops, all
 
1294
     enclosing loops are exited.  The return value is 0 unless `n' is
 
1295
     not greater than or equal to 1.
 
1296
 
 
1297
continue [`n']
 
1298
     Resume the next iteration of the enclosing `for', `while' or
 
1299
     `until' loop.  If `n' is specified, resume at the `n'th enclosing
 
1300
     loop.  `n' must be greater than or equal to 1.  If `n' is greater
 
1301
     than the number of enclosing loops, the last enclosing loop (the
 
1302
     "top-level" loop) is resumed.  The return value is 0 unless `n' is
 
1303
     not greater than or equal to 1.
 
1304
 
 
1305
return [`n']
 
1306
     Causes a function to exit with the return value specified by `n'.
 
1307
     If `n' is omitted, the return status is that of the last command
 
1308
     executed in the function body.  If used outside a function the
 
1309
     return status is false.
 
1310
 
 
1311
shift [`n']
 
1312
     The positional parameters from `n'+1 ... are renamed to `$1'....
 
1313
     Parameters represented by the numbers `$#' down to `$#'-`n'+1 are
 
1314
     unset.  `n' must be a non-negative number less than or equal to
 
1315
     `$#'.  If `n' is 0, no parameters are changed.  If `n' is not
 
1316
     given, it is assumed to be 1.  If `n' is greater than `$#', the
 
1317
     positional parameters are not changed.  The return status is
 
1318
     greater than zero if `n' is greater than `$#' or less than zero;
 
1319
     otherwise 0.
 
1320
 
 
1321
 
 
1322
 
 
1323
File: grub.info,  Node: Shell-like scripting-Footnotes,  Up: Shell-like scripting
 
1324
 
 
1325
   (1) Currently a backslash-newline pair within a variable name is not
 
1326
handled properly, so use this feature with some care.
 
1327
 
 
1328
 
 
1329
File: grub.info,  Node: Embedded configuration,  Prev: Shell-like scripting,  Up: Configuration
 
1330
 
 
1331
5.3 Embedding a configuration file into GRUB
 
1332
============================================
 
1333
 
 
1334
GRUB supports embedding a configuration file directly into the core
 
1335
image, so that it is loaded before entering normal mode.  This is
 
1336
useful, for example, when it is not straightforward to find the real
 
1337
configuration file, or when you need to debug problems with loading
 
1338
that file.  `grub-install' uses this feature when it is not using BIOS
 
1339
disk functions or when installing to a different disk from the one
 
1340
containing `/boot/grub', in which case it needs to use the `search'
 
1341
command (*note search::) to find `/boot/grub'.
 
1342
 
 
1343
   To embed a configuration file, use the `-c' option to
 
1344
`grub-mkimage'.  The file is copied into the core image, so it may
 
1345
reside anywhere on the file system, and may be removed after running
 
1346
`grub-mkimage'.
 
1347
 
 
1348
   After the embedded configuration file (if any) is executed, GRUB
 
1349
will load the `normal' module, which will then read the real
 
1350
configuration file from `$prefix/grub.cfg'.  By this point, the `root'
 
1351
variable will also have been set to the root device name.  For example,
 
1352
`prefix' might be set to `(hd0,1)/boot/grub', and `root' might be set to
 
1353
`hd0,1'.  Thus, in most cases, the embedded configuration file only
 
1354
needs to set the `prefix' and `root' variables, and then drop through
 
1355
to GRUB's normal processing.  A typical example of this might look like
 
1356
this:
 
1357
 
 
1358
     search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root
 
1359
     set prefix=($root)/boot/grub
 
1360
 
 
1361
   (The `search_fs_uuid' module must be included in the core image for
 
1362
this example to work.)
 
1363
 
 
1364
   In more complex cases, it may be useful to read other configuration
 
1365
files directly from the embedded configuration file.  This allows such
 
1366
things as reading files not called `grub.cfg', or reading files from a
 
1367
directory other than that where GRUB's loadable modules are installed.
 
1368
To do this, include the `configfile' and `normal' modules in the core
 
1369
image, and embed a configuration file that uses the `configfile'
 
1370
command to load another file.  The following example of this also
 
1371
requires the `echo', `search_label', and `test' modules to be included
 
1372
in the core image:
 
1373
 
 
1374
     search.fs_label grub root
 
1375
     if [ -e /boot/grub/example/test1.cfg ]; then
 
1376
         set prefix=($root)/boot/grub
 
1377
         configfile /boot/grub/example/test1.cfg
 
1378
     else
 
1379
         if [ -e /boot/grub/example/test2.cfg ]; then
 
1380
             set prefix=($root)/boot/grub
 
1381
             configfile /boot/grub/example/test2.cfg
 
1382
         else
 
1383
             echo "Could not find an example configuration file!"
 
1384
         fi
 
1385
     fi
 
1386
 
 
1387
   The embedded configuration file may not contain menu entries
 
1388
directly, but may only read them from elsewhere using `configfile'.
 
1389
 
 
1390
 
 
1391
File: grub.info,  Node: Theme file format,  Next: Network,  Prev: Configuration,  Up: Top
 
1392
 
 
1393
6 Theme file format
 
1394
*******************
 
1395
 
 
1396
6.1 Introduction
 
1397
================
 
1398
 
 
1399
The GRUB graphical menu supports themes that can customize the layout
 
1400
and appearance of the GRUB boot menu.  The theme is configured through
 
1401
a plain text file that specifies the layout of the various GUI
 
1402
components (including the boot menu, timeout progress bar, and text
 
1403
messages) as well as the appearance using colors, fonts, and images.
 
1404
Example is available in docs/example_theme.txt
 
1405
 
 
1406
6.2 Theme Elements
 
1407
==================
 
1408
 
 
1409
6.2.1 Colors
 
1410
------------
 
1411
 
 
1412
Colors can be specified in several ways:
 
1413
 
 
1414
   * HTML-style "#RRGGBB" or "#RGB" format, where *R*, *G*, and *B* are
 
1415
     hexadecimal digits (e.g., "#8899FF")
 
1416
 
 
1417
   * as comma-separated decimal RGB values (e.g., "128, 128, 255")
 
1418
 
 
1419
   * with "SVG 1.0 color names" (e.g., "cornflowerblue") which must be
 
1420
     specified in lowercase.
 
1421
 
 
1422
6.2.2 Fonts
 
1423
-----------
 
1424
 
 
1425
The fonts GRUB uses "PFF2 font format" bitmap fonts.  Fonts are
 
1426
specified with full font names.  Currently there is no provision for a
 
1427
preference list of fonts, or deriving one font from another.  Fonts are
 
1428
loaded with the "loadfont" command in GRUB.  To see the list of loaded
 
1429
fonts, execute the "lsfonts" command.  If there are too many fonts to
 
1430
fit on screen, do "set pager=1" before executing "lsfonts".
 
1431
 
 
1432
6.2.3 Progress Bar
 
1433
------------------
 
1434
 
 
1435
Figure 6.1
 
1436
 
 
1437
Figure 6.2
 
1438
 
 
1439
   Progress bars are used to display the remaining time before GRUB
 
1440
boots the default menu entry.  To create a progress bar that will
 
1441
display the remaining time before automatic boot, simply create a
 
1442
"progress_bar" component with the id "__timeout__".  This indicates to
 
1443
GRUB that the progress bar should be updated as time passes, and it
 
1444
should be made invisible if the countdown to automatic boot is
 
1445
interrupted by the user.
 
1446
 
 
1447
   Progress bars may optionally have text displayed on them.  This is
 
1448
controlled through the "show_text" property, which can be set to either
 
1449
"true" or "false" to control whether text is displayed.  When GRUB is
 
1450
counting down to automatic boot, the text informs the user of the
 
1451
number of seconds remaining.
 
1452
 
 
1453
6.2.4 Circular Progress Indicator
 
1454
---------------------------------
 
1455
 
 
1456
The circular progress indicator functions similarly to the progress
 
1457
bar.  When given an id of "__timeout__", GRUB updates the circular
 
1458
progress indicator's value to indicate the time remaining.  For the
 
1459
circular progress indicator, there are two images used to render it:
 
1460
the *center* image, and the *tick* image.  The center image is rendered
 
1461
in the center of the component, while the tick image is used to render
 
1462
each mark along the circumference of the indicator.
 
1463
 
 
1464
6.2.5 Labels
 
1465
------------
 
1466
 
 
1467
Text labels can be placed on the boot screen.  The font, color, and
 
1468
horizontal alignment can be specified for labels.  If a label is given
 
1469
the id "__timeout__", then the "text" property for that label is also
 
1470
updated with a message informing the user of the number of seconds
 
1471
remaining until automatic boot.  This is useful in case you want the
 
1472
text displayed somewhere else instead of directly on the progress bar.
 
1473
 
 
1474
6.2.6 Boot Menu
 
1475
---------------
 
1476
 
 
1477
The boot menu where GRUB displays the menu entries from the "grub.cfg"
 
1478
file.  It is a list of items, where each item has a title and an
 
1479
optional icon.  The icon is selected based on the *classes* specified
 
1480
for the menu entry.  If there is a PNG file named "myclass.png" in the
 
1481
"grub/themes/icons" directory, it will be displayed for items which
 
1482
have the class *myclass*.  The boot menu can be customized in several
 
1483
ways, such as the font and color used for the menu entry title, and by
 
1484
specifying styled boxes for the menu itself and for the selected item
 
1485
highlight.
 
1486
 
 
1487
6.2.7 Styled Boxes
 
1488
------------------
 
1489
 
 
1490
One of the most important features for customizing the layout is the
 
1491
use of  *styled boxes*.  A styled box is composed of 9 rectangular (and
 
1492
potentially empty) regions, which are used to seamlessly draw the
 
1493
styled box on screen:
 
1494
 
 
1495
Northwest (nw)         North (n)              Northeast (ne)
 
1496
West (w)               Center (c)             East (e)
 
1497
Southwest (sw)         South (s)              Southeast (se)
 
1498
 
 
1499
   To support any size of box on screen, the center slice and the
 
1500
slices for the top, bottom, and sides are all scaled to the correct
 
1501
size for the component on screen, using the following rules:
 
1502
 
 
1503
  1. The edge slices (north, south, east, and west) are scaled in the
 
1504
     direction of the edge they are adjacent to.  For instance, the
 
1505
     west slice is scaled vertically.
 
1506
 
 
1507
  2. The corner slices (northwest, northeast, southeast, and southwest)
 
1508
     are not scaled.
 
1509
 
 
1510
  3. The center slice is scaled to fill the remaining space in the
 
1511
     middle.
 
1512
 
 
1513
   As an example of how an image might be sliced up, consider the
 
1514
styled box used for a terminal view.
 
1515
 
 
1516
Figure 6.3
 
1517
 
 
1518
6.2.8 Creating Styled Box Images
 
1519
--------------------------------
 
1520
 
 
1521
The Inkscape_ scalable vector graphics editor is a very useful tool for
 
1522
creating styled box images.  One process that works well for slicing a
 
1523
drawing into the necessary image slices is:
 
1524
 
 
1525
  1. Create or open the drawing you'd like use.
 
1526
 
 
1527
  2. Create a new layer on the top of the layer stack.  Make it
 
1528
     visible.  Select this layer as the current layer.
 
1529
 
 
1530
  3. Draw 9 rectangles on your drawing where you'd like the slices to
 
1531
     be.  Clear the fill option, and set the stroke to 1 pixel wide
 
1532
     solid stroke.  The corners of the slices must meet precisely; if
 
1533
     it is off by a single pixel, it will probably be evident when the
 
1534
     styled box is rendered in the GRUB menu.  You should probably go
 
1535
     to File | Document Properties | Grids and enable a grid or create
 
1536
     a guide (click on one of the rulers next to the drawing and drag
 
1537
     over the drawing; release the mouse button to place the guide) to
 
1538
     help place the rectangles precisely.
 
1539
 
 
1540
  4. Right click on the center slice rectangle and choose Object
 
1541
     Properties. Change the "Id" to "slice_c" and click Set.  Repeat
 
1542
     this for the remaining 8 rectangles, giving them Id values of
 
1543
     "slice_n", "slice_ne", "slice_e", and so on according to the
 
1544
     location.
 
1545
 
 
1546
  5. Save the drawing.
 
1547
 
 
1548
  6. Select all the slice rectangles.  With the slice layer selected,
 
1549
     you can simply press Ctrl+A to select all rectangles.  The status
 
1550
     bar should indicate that 9 rectangles are selected.
 
1551
 
 
1552
  7. Click the layer hide icon for the slice layer in the layer
 
1553
     palette.  The rectangles will remain selected, even though they
 
1554
     are hidden.
 
1555
 
 
1556
  8. Choose File | Export Bitmap and check the *Batch export 9 selected
 
1557
     objects* box.  Make sure that *Hide all except selected* is
 
1558
     unchecked. click *Export*.  This will create PNG files in the same
 
1559
     directory as the drawing, named after the slices.  These can now
 
1560
     be used for a styled box in a GRUB theme.
 
1561
 
 
1562
6.3 Theme File Manual
 
1563
=====================
 
1564
 
 
1565
The theme file is a plain text file.  Lines that begin with "#" are
 
1566
ignored and considered comments.  (Note: This may not be the case if
 
1567
the previous line ended where a value was expected.)
 
1568
 
 
1569
   The theme file contains two types of statements:
 
1570
  1. Global properties.
 
1571
 
 
1572
  2. Component construction.
 
1573
 
 
1574
6.3.1 Global Properties
 
1575
-----------------------
 
1576
 
 
1577
6.3.2 Format
 
1578
------------
 
1579
 
 
1580
Global properties are specified with the simple format:
 
1581
   * name1: value1
 
1582
 
 
1583
   * name2: "value which may contain spaces"
 
1584
 
 
1585
   * name3: #88F
 
1586
 
 
1587
   In this example, name3 is assigned a color value.
 
1588
 
 
1589
6.3.3 Global Property List
 
1590
--------------------------
 
1591
 
 
1592
title-text             Specifies the text to display at the top
 
1593
                       center of the screen as a title.
 
1594
title-font             Defines the font used for the title
 
1595
                       message at the top of the screen.
 
1596
title-color            Defines the color of the title message.
 
1597
message-font           Defines the font used for messages, such
 
1598
                       as when GRUB is unable to automatically
 
1599
                       boot an entry.
 
1600
message-color          Defines the color of the message text.
 
1601
message-bg-color       Defines the background color of the
 
1602
                       message text area.
 
1603
desktop-image          Specifies the image to use as the
 
1604
                       background.  It will be scaled to fit the
 
1605
                       screen size.
 
1606
desktop-color          Specifies the color for the background if
 
1607
                       *desktop-image* is not specified.
 
1608
terminal-box           Specifies the file name pattern for the
 
1609
                       styled box slices used for the command
 
1610
                       line terminal window.  For example,
 
1611
                       "terminal-box: terminal_*.png" will use
 
1612
                       the images "terminal_c.png" as the center
 
1613
                       area, "terminal_n.png" as the north (top)
 
1614
                       edge, "terminal_nw.png" as the northwest
 
1615
                       (upper left) corner, and so on.  If the
 
1616
                       image for any slice is not found, it will
 
1617
                       simply be left empty.
 
1618
 
 
1619
6.3.4 Component Construction
 
1620
----------------------------
 
1621
 
 
1622
Greater customizability comes is provided by components.  A tree of
 
1623
components forms the user interface.  *Containers* are components that
 
1624
can contain other components, and there is always a single root
 
1625
component which is an instance of a *canvas* container.
 
1626
 
 
1627
   Components are created in the theme file by prefixing the type of
 
1628
component with a '+' sign:
 
1629
 
 
1630
   `   + label { text="GRUB" font="aqui 11" color="#8FF" } '
 
1631
 
 
1632
   properties of a component are specified as "name = value" (whitespace
 
1633
surrounding tokens is optional and is ignored) where *value* may be:
 
1634
   * a single word (e.g., "align = center", "color = #FF8080"),
 
1635
 
 
1636
   * a quoted string (e.g., "text = "Hello, World!""), or
 
1637
 
 
1638
   * a tuple (e.g., "preferred_size = (120, 80)").
 
1639
 
 
1640
6.3.5 Component List
 
1641
--------------------
 
1642
 
 
1643
The following is a list of the components and the properties they
 
1644
support.
 
1645
 
 
1646
   * label    A label displays a line of text.
 
1647
 
 
1648
     Properties:
 
1649
     text          The text to display.
 
1650
     font          The font to use for text display.
 
1651
     color         The color of the text.
 
1652
     align         The horizontal alignment of the text within
 
1653
                   the component. Options are "left", "center",
 
1654
                   and "right".
 
1655
 
 
1656
   * image    A component that displays an image.  The image is scaled
 
1657
     to fit the    component, although the preferred size defaults to
 
1658
     the image's original    size unless the "preferred_size" property
 
1659
     is explicitly set.
 
1660
 
 
1661
     Properties:
 
1662
 
 
1663
     file          The full path to the image file to load.
 
1664
 
 
1665
   * progress_bar    Displays a horizontally oriented progress bar.  It
 
1666
     can be rendered using    simple solid filled rectangles, or using
 
1667
     a pair of pixmap styled boxes.
 
1668
 
 
1669
     Properties:
 
1670
 
 
1671
     fg_color      The foreground color for plain solid color
 
1672
                   rendering.
 
1673
     bg_color      The background color for plain solid color
 
1674
                   rendering.
 
1675
     border_color  The border color for plain solid color
 
1676
                   rendering.
 
1677
     text_color    The text color.
 
1678
     show_text     Boolean value indicating whether or not text
 
1679
                   should be displayed on the progress bar.  If
 
1680
                   set to *false*, then no text will be displayed
 
1681
                   on the bar.  If set to any other value, text
 
1682
                   will be displayed on the bar.
 
1683
     bar_style     The styled box specification for the frame of
 
1684
                   the progress bar. Example:
 
1685
                   "progress_frame_*.png"
 
1686
     highlight_styleThe styled box specification for the
 
1687
                   highlighted region of the progress bar. This
 
1688
                   box will be used to paint just the highlighted
 
1689
                   region of the bar, and will be increased in
 
1690
                   size as the bar nears completion. Example:
 
1691
                   "progress_hl_*.png".
 
1692
     text          The text to display on the progress bar.  If
 
1693
                   the progress bar's ID is set to "__timeout__",
 
1694
                   then GRUB will updated this property with an
 
1695
                   informative message as the timeout approaches.
 
1696
     value         The progress bar current value.  Normally not
 
1697
                   set manually.
 
1698
     start         The progress bar start value.  Normally not
 
1699
                   set manually.
 
1700
     end           The progress bar end value.  Normally not set
 
1701
                   manually.
 
1702
 
 
1703
   * circular_progress    Displays a circular progress indicator.  The
 
1704
     appearance of this component    is determined by two images:  the
 
1705
     *center* image and the *tick* image.  The    center image is
 
1706
     generally larger and will be drawn in the center of the
 
1707
     component.  Around the circumference of a circle within the
 
1708
     component, the    tick image will be drawn a certain number of
 
1709
     times, depending on the    properties of the component.
 
1710
 
 
1711
     Properties:
 
1712
 
 
1713
     center_bitmap        The file name of the image to draw in
 
1714
                          the center of the component.
 
1715
     tick_bitmap          The file name of the image to draw for
 
1716
                          the tick marks.
 
1717
     num_ticks            The number of ticks that make up a full
 
1718
                          circle.
 
1719
     ticks_disappear      Boolean value indicating whether tick
 
1720
                          marks should progressively appear,
 
1721
                          or progressively disappear as *value*
 
1722
                          approaches *end*.  Specify       "true"
 
1723
                          or "false".
 
1724
     value                The progress indicator current value.
 
1725
                          Normally not set manually.
 
1726
     start                The progress indicator start value.
 
1727
                          Normally not set manually.
 
1728
     end                  The progress indicator end value.
 
1729
                          Normally not set manually.
 
1730
 
 
1731
   * boot_menu    Displays the GRUB boot menu.  It allows selecting
 
1732
     items and executing them.
 
1733
 
 
1734
     Properties:
 
1735
 
 
1736
     item_font                   The font to use for the menu item
 
1737
                                 titles.
 
1738
     selected_item_font          The font to use for the selected
 
1739
                                 menu item, or "inherit" (the
 
1740
                                 default)       to use "item_font"
 
1741
                                 for the selected menu item as
 
1742
                                 well.
 
1743
     item_color                  The color to use for the menu
 
1744
                                 item titles.
 
1745
     selected_item_color         The color to use for the selected
 
1746
                                 menu item, or "inherit" (the
 
1747
                                 default)       to use
 
1748
                                 "item_color" for the selected
 
1749
                                 menu item as well.
 
1750
     icon_width                  The width of menu item icons.
 
1751
                                 Icons are scaled to the specified
 
1752
                                 size.
 
1753
     icon_height                 The height of menu item icons.
 
1754
     item_height                 The height of each menu item in
 
1755
                                 pixels.
 
1756
     item_padding                The amount of space in pixels to
 
1757
                                 leave on each side of the menu
 
1758
                                 item       contents.
 
1759
     item_icon_space             The space between an item's icon
 
1760
                                 and the title text, in pixels.
 
1761
     item_spacing                The amount of space to leave
 
1762
                                 between menu items, in pixels.
 
1763
     menu_pixmap_style           The image file pattern for the
 
1764
                                 menu frame styled box.
 
1765
                                 Example:  "menu_*.png" (this will
 
1766
                                 use images such as "menu_c.png",
 
1767
                                     "menu_w.png", `menu_nw.png",
 
1768
                                 etc.)
 
1769
     selected_item_pixmap_style  The image file pattern for the
 
1770
                                 selected item highlight styled
 
1771
                                 box.
 
1772
     scrollbar                   Boolean value indicating whether
 
1773
                                 the scroll bar should be drawn if
 
1774
                                 the       frame and thumb styled
 
1775
                                 boxes are configured.
 
1776
     scrollbar_frame             The image file pattern for the
 
1777
                                 entire scroll bar.
 
1778
                                 Example:  "scrollbar_*.png"
 
1779
     scrollbar_thumb             The image file pattern for the
 
1780
                                 scroll bar thumb (the part of the
 
1781
                                 scroll       bar that moves as
 
1782
                                 scrolling occurs).
 
1783
                                 Example:  "scrollbar_thumb_*.png"
 
1784
     max_items_shown             The maximum number of items to
 
1785
                                 show on the menu.  If there are
 
1786
                                 more than       *max_items_shown*
 
1787
                                 items in the menu, the list will
 
1788
                                 scroll to make all       items
 
1789
                                 accessible.
 
1790
 
 
1791
   * canvas    Canvas is a container that allows manual placement of
 
1792
     components within it.     It does not alter the positions of its
 
1793
     child components.  It assigns all    child components their
 
1794
     preferred sizes.
 
1795
 
 
1796
   * hbox    The *hbox* container lays out its children from left to
 
1797
     right, giving each    one its preferred width.  The height of each
 
1798
     child is set to the maximum of    the preferred heights of all
 
1799
     children.
 
1800
 
 
1801
   * vbox    The *vbox* container lays out its children from top to
 
1802
     bottom, giving each    one its preferred height.  The width of
 
1803
     each child is set to the maximum of    the preferred widths of all
 
1804
     children.
 
1805
 
 
1806
6.3.6 Common properties
 
1807
-----------------------
 
1808
 
 
1809
The following properties are supported by all components:
 
1810
`left'
 
1811
     The distance from the left border of container to left border of
 
1812
     the object in either of three formats:
 
1813
     x             Value in pixels
 
1814
     p%            Percentage
 
1815
     p%+x          mixture of both
 
1816
 
 
1817
`top'
 
1818
     The distance from the left border of container to left border of
 
1819
     the object in same format.
 
1820
 
 
1821
`width'
 
1822
     The width of object in same format.
 
1823
 
 
1824
`height'
 
1825
     The height of object in same format.
 
1826
 
 
1827
`id'
 
1828
     The identifier for the component.  This can be any arbitrary
 
1829
     string.     The ID can be used by scripts to refer to various
 
1830
     components in the GUI    component tree.  Currently, there is one
 
1831
     special ID value that GRUB    recognizes:
 
1832
 
 
1833
     "__timeout__" Any component with this ID will have its
 
1834
                   *text*, *start*, *end*, *value*, and *visible*
 
1835
                   properties set by GRUB when it is counting
 
1836
                   down to an automatic boot of the default menu
 
1837
                   entry.
 
1838
 
 
1839
 
 
1840
File: grub.info,  Node: Network,  Next: Serial terminal,  Prev: Theme file format,  Up: Top
 
1841
 
 
1842
7 Booting GRUB from the network
 
1843
*******************************
 
1844
 
 
1845
The following instructions only work on PC BIOS systems where the
 
1846
Preboot eXecution Environment (PXE) is available.
 
1847
 
 
1848
   To generate a PXE boot image, run:
 
1849
 
 
1850
     grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
 
1851
 
 
1852
   Copy `grub.pxe', `/boot/grub/*.mod', and `/boot/grub/*.lst' to the
 
1853
PXE (TFTP) server, ensuring that `*.mod' and `*.lst' are accessible via
 
1854
the `/boot/grub/' path from the TFTP server root.  Set the DHCP server
 
1855
configuration to offer `grub.pxe' as the boot file (the `filename'
 
1856
option in ISC dhcpd).
 
1857
 
 
1858
   You can also use the `grub-mknetdir' utility to generate an image
 
1859
and a GRUB directory tree, rather than copying files around manually.
 
1860
 
 
1861
   After GRUB has started, files on the TFTP server will be accessible
 
1862
via the `(pxe)' device.
 
1863
 
 
1864
   The server and gateway IP address can be controlled by changing the
 
1865
`(pxe)' device name to `(pxe:SERVER-IP)' or
 
1866
`(pxe:SERVER-IP:GATEWAY-IP)'.  Note that this should be changed both in
 
1867
the prefix and in any references to the device name in the
 
1868
configuration file.
 
1869
 
 
1870
   GRUB provides several environment variables which may be used to
 
1871
inspect or change the behaviour of the PXE device:
 
1872
 
 
1873
`net_pxe_ip'
 
1874
     The IP address of this machine.  Read-only.
 
1875
 
 
1876
`net_pxe_mac'
 
1877
     The network interface's MAC address.  Read-only.
 
1878
 
 
1879
`net_pxe_hostname'
 
1880
     The client host name provided by DHCP.  Read-only.
 
1881
 
 
1882
`net_pxe_domain'
 
1883
     The client domain name provided by DHCP.  Read-only.
 
1884
 
 
1885
`net_pxe_rootpath'
 
1886
     The path to the client's root disk provided by DHCP.  Read-only.
 
1887
 
 
1888
`net_pxe_extensionspath'
 
1889
     The path to additional DHCP vendor extensions provided by DHCP.
 
1890
     Read-only.
 
1891
 
 
1892
`net_pxe_boot_file'
 
1893
     The boot file name provided by DHCP.  Read-only.
 
1894
 
 
1895
`net_pxe_dhcp_server_name'
 
1896
     The name of the DHCP server responsible for these boot parameters.
 
1897
     Read-only.
 
1898
 
 
1899
`pxe_blksize'
 
1900
     The PXE transfer block size.  Read-write, defaults to 512.
 
1901
 
 
1902
`pxe_default_server'
 
1903
     The default PXE server.  Read-write, although setting this is only
 
1904
     useful before opening a PXE device.
 
1905
 
 
1906
`pxe_default_gateway'
 
1907
     The default gateway to use when contacting the PXE server.
 
1908
     Read-write, although setting this is only useful before opening a
 
1909
     PXE device.
 
1910
 
 
1911
 
 
1912
File: grub.info,  Node: Serial terminal,  Next: Vendor power-on keys,  Prev: Network,  Up: Top
 
1913
 
 
1914
8 Using GRUB via a serial line
 
1915
******************************
 
1916
 
 
1917
This chapter describes how to use the serial terminal support in GRUB.
 
1918
 
 
1919
   If you have many computers or computers with no display/keyboard, it
 
1920
could be very useful to control the computers through serial
 
1921
communications. To connect one computer with another via a serial line,
 
1922
you need to prepare a null-modem (cross) serial cable, and you may need
 
1923
to have multiport serial boards, if your computer doesn't have extra
 
1924
serial ports. In addition, a terminal emulator is also required, such as
 
1925
minicom. Refer to a manual of your operating system, for more
 
1926
information.
 
1927
 
 
1928
   As for GRUB, the instruction to set up a serial terminal is quite
 
1929
simple.  Here is an example:
 
1930
 
 
1931
     grub> serial --unit=0 --speed=9600
 
1932
     grub> terminal_input serial; terminal_output serial
 
1933
 
 
1934
   The command `serial' initializes the serial unit 0 with the speed
 
1935
9600bps. The serial unit 0 is usually called `COM1', so, if you want to
 
1936
use COM2, you must specify `--unit=1' instead. This command accepts
 
1937
many other options, so please refer to *note serial::, for more details.
 
1938
 
 
1939
   The commands `terminal_input' (*note terminal_input::) and
 
1940
`terminal_output' (*note terminal_output::) choose which type of
 
1941
terminal you want to use. In the case above, the terminal will be a
 
1942
serial terminal, but you can also pass `console' to the command, as
 
1943
`terminal serial console'. In this case, a terminal in which you press
 
1944
any key will be selected as a GRUB terminal. In the example above, note
 
1945
that you need to put both commands on the same command line, as you
 
1946
will lose the ability to type commands on the console after the first
 
1947
command.
 
1948
 
 
1949
   However, note that GRUB assumes that your terminal emulator is
 
1950
compatible with VT100 by default. This is true for most terminal
 
1951
emulators nowadays, but you should pass the option `--dumb' to the
 
1952
command if your terminal emulator is not VT100-compatible or implements
 
1953
few VT100 escape sequences. If you specify this option then GRUB
 
1954
provides you with an alternative menu interface, because the normal
 
1955
menu requires several fancy features of your terminal.
 
1956
 
 
1957
 
 
1958
File: grub.info,  Node: Vendor power-on keys,  Next: Images,  Prev: Serial terminal,  Up: Top
 
1959
 
 
1960
9 Using GRUB with vendor power-on keys
 
1961
**************************************
 
1962
 
 
1963
Some laptop vendors provide an additional power-on button which boots
 
1964
another OS.  GRUB supports such buttons with the `GRUB_TIMEOUT_BUTTON',
 
1965
`GRUB_DEFAULT_BUTTON', `GRUB_HIDDEN_TIMEOUT_BUTTON' and
 
1966
`GRUB_BUTTON_CMOS_ADDRESS' variables in default/grub (*note Simple
 
1967
configuration::).  `GRUB_TIMEOUT_BUTTON', `GRUB_DEFAULT_BUTTON' and
 
1968
`GRUB_HIDDEN_TIMEOUT_BUTTON' are used instead of the corresponding
 
1969
variables without the `_BUTTON' suffix when powered on using the special
 
1970
button.  `GRUB_BUTTON_CMOS_ADDRESS' is vendor-specific and partially
 
1971
model-specific.  Values known to the GRUB team are:
 
1972
 
 
1973
<Dell XPS M1530>
 
1974
     85:3
 
1975
 
 
1976
<Asus EeePC 1005PE>
 
1977
     84:1 (unconfirmed)
 
1978
 
 
1979
   To take full advantage of this function, install GRUB into the MBR
 
1980
(*note Installing GRUB using grub-install::).
 
1981
 
 
1982
 
 
1983
File: grub.info,  Node: Images,  Next: Filesystem,  Prev: Vendor power-on keys,  Up: Top
 
1984
 
 
1985
10 GRUB image files
 
1986
*******************
 
1987
 
 
1988
GRUB consists of several images: a variety of bootstrap images for
 
1989
starting GRUB in various ways, a kernel image, and a set of modules
 
1990
which are combined with the kernel image to form a core image.  Here is
 
1991
a short overview of them.
 
1992
 
 
1993
`boot.img'
 
1994
     On PC BIOS systems, this image is the first part of GRUB to start.
 
1995
     It is written to a master boot record (MBR) or to the boot sector
 
1996
     of a partition.  Because a PC boot sector is 512 bytes, the size
 
1997
     of this image is exactly 512 bytes.
 
1998
 
 
1999
     The sole function of `boot.img' is to read the first sector of the
 
2000
     core image from a local disk and jump to it.  Because of the size
 
2001
     restriction, `boot.img' cannot understand any file system
 
2002
     structure, so `grub-setup' hardcodes the location of the first
 
2003
     sector of the core image into `boot.img' when installing GRUB.
 
2004
 
 
2005
`diskboot.img'
 
2006
     This image is used as the first sector of the core image when
 
2007
     booting from a hard disk.  It reads the rest of the core image
 
2008
     into memory and starts the kernel.  Since file system handling is
 
2009
     not yet available, it encodes the location of the core image using
 
2010
     a block list format.
 
2011
 
 
2012
`cdboot.img'
 
2013
     This image is used as the first sector of the core image when
 
2014
     booting from a CD-ROM drive.  It performs a similar function to
 
2015
     `diskboot.img'.
 
2016
 
 
2017
`pxeboot.img'
 
2018
     This image is used as the start of the core image when booting
 
2019
     from the network using PXE.  *Note Network::.
 
2020
 
 
2021
`lnxboot.img'
 
2022
     This image may be placed at the start of the core image in order
 
2023
     to make GRUB look enough like a Linux kernel that it can be booted
 
2024
     by LILO using an `image=' section.
 
2025
 
 
2026
`kernel.img'
 
2027
     This image contains GRUB's basic run-time facilities: frameworks
 
2028
     for device and file handling, environment variables, the rescue
 
2029
     mode command-line parser, and so on.  It is rarely used directly,
 
2030
     but is built into all core images.
 
2031
 
 
2032
`core.img'
 
2033
     This is the core image of GRUB.  It is built dynamically from the
 
2034
     kernel image and an arbitrary list of modules by the `grub-mkimage'
 
2035
     program.  Usually, it contains enough modules to access
 
2036
     `/boot/grub', and loads everything else (including menu handling,
 
2037
     the ability to load target operating systems, and so on) from the
 
2038
     file system at run-time.  The modular design allows the core image
 
2039
     to be kept small, since the areas of disk where it must be
 
2040
     installed are often as small as 32KB.
 
2041
 
 
2042
     On PC systems using the traditional MBR partition table format,
 
2043
     the core image is usually installed in the "MBR gap" between the
 
2044
     master boot record and the first partition, or sometimes it is
 
2045
     installed in a file system and read directly from that.  The
 
2046
     latter is not recommended because GRUB needs to encode the
 
2047
     location of all the core image sectors in `diskboot.img', and if
 
2048
     the file system ever moves the core image around (as it is entitled
 
2049
     to do) then GRUB must be reinstalled; it also means that GRUB will
 
2050
     not be able to reliably find the core image if it resides on a
 
2051
     different disk than the one to which `boot.img' was installed.
 
2052
 
 
2053
     On PC systems using the more recent GUID Partition Table (GPT)
 
2054
     format, the core image should be installed to a BIOS Boot
 
2055
     Partition.  This may be created by GNU Parted using a command such
 
2056
     as the following:
 
2057
 
 
2058
          # parted /dev/DISK set PARTITION-NUMBER bios_grub on
 
2059
 
 
2060
     *Caution:* Be very careful which partition you select!  When GRUB
 
2061
     finds a BIOS Boot Partition during installation, it will
 
2062
     automatically overwrite part of it.  Make sure that the partition
 
2063
     does not contain any other data.
 
2064
 
 
2065
`*.mod'
 
2066
     Everything else in GRUB resides in dynamically loadable modules.
 
2067
     These are often loaded automatically, or built into the core image
 
2068
     if they are essential, but may also be loaded manually using the
 
2069
     `insmod' command (*note insmod::).
 
2070
 
 
2071
For GRUB Legacy users
 
2072
=====================
 
2073
 
 
2074
GRUB 2 has a different design from GRUB Legacy, and so correspondences
 
2075
with the images it used cannot be exact.  Nevertheless, GRUB Legacy
 
2076
users often ask questions in the terms they are familiar with, and so
 
2077
here is a brief guide to how GRUB 2's images relate to that.
 
2078
 
 
2079
`stage1'
 
2080
     Stage 1 from GRUB Legacy was very similar to `boot.img' in GRUB 2,
 
2081
     and they serve the same function.
 
2082
 
 
2083
`*_stage1_5'
 
2084
     In GRUB Legacy, Stage 1.5's function was to include enough
 
2085
     filesystem code to allow the much larger Stage 2 to be read from
 
2086
     an ordinary filesystem.  In this respect, its function was similar
 
2087
     to `core.img' in GRUB 2.  However, `core.img' is much more capable
 
2088
     than Stage 1.5 was; since it offers a rescue shell, it is
 
2089
     sometimes possible to recover manually in the event that it is
 
2090
     unable to load any other modules, for example if partition numbers
 
2091
     have changed.  `core.img' is built in a more flexible way,
 
2092
     allowing GRUB 2 to support reading modules from advanced disk
 
2093
     types such as LVM and RAID.
 
2094
 
 
2095
     GRUB Legacy could run with only Stage 1 and Stage 2 in some limited
 
2096
     configurations, while GRUB 2 requires `core.img' and cannot work
 
2097
     without it.
 
2098
 
 
2099
`stage2'
 
2100
     GRUB 2 has no single Stage 2 image.  Instead, it loads modules from
 
2101
     `/boot/grub' at run-time.
 
2102
 
 
2103
`stage2_eltorito'
 
2104
     In GRUB 2, images for booting from CD-ROM drives are now
 
2105
     constructed using `cdboot.img' and `core.img', making sure that
 
2106
     the core image contains the `iso9660' module.  It is usually best
 
2107
     to use the `grub-mkrescue' program for this.
 
2108
 
 
2109
`nbgrub'
 
2110
     There is as yet no equivalent for `nbgrub' in GRUB 2; it was used
 
2111
     by Etherboot and some other network boot loaders.
 
2112
 
 
2113
`pxegrub'
 
2114
     In GRUB 2, images for PXE network booting are now constructed using
 
2115
     `pxeboot.img' and `core.img', making sure that the core image
 
2116
     contains the `pxe' and `pxecmd' modules.  *Note Network::.
 
2117
 
 
2118
 
 
2119
File: grub.info,  Node: Filesystem,  Next: Interface,  Prev: Images,  Up: Top
 
2120
 
 
2121
11 Filesystem syntax and semantics
 
2122
**********************************
 
2123
 
 
2124
GRUB uses a special syntax for specifying disk drives which can be
 
2125
accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
 
2126
between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
 
2127
device is equivalent to which OS device. Normally, that will be clear if
 
2128
you see the files in a device or use the command `search' (*note
 
2129
search::).
 
2130
 
 
2131
* Menu:
 
2132
 
 
2133
* Device syntax::               How to specify devices
 
2134
* File name syntax::            How to specify files
 
2135
* Block list syntax::           How to specify block lists
 
2136
 
 
2137
 
 
2138
File: grub.info,  Node: Device syntax,  Next: File name syntax,  Up: Filesystem
 
2139
 
 
2140
11.1 How to specify devices
 
2141
===========================
 
2142
 
 
2143
The device syntax is like this:
 
2144
 
 
2145
     `(DEVICE[,PART-NUM][,BSD-SUBPART-LETTER])'
 
2146
 
 
2147
   `[]' means the parameter is optional. DEVICE should be either `fd'
 
2148
or `hd' followed by a digit, like `fd0'.  But you can also set DEVICE
 
2149
to a hexadecimal or a decimal number which is a BIOS drive number, so
 
2150
the following are equivalent:
 
2151
 
 
2152
     (hd0)
 
2153
     (0x80)
 
2154
     (128)
 
2155
 
 
2156
   PART-NUM represents the partition number of DEVICE, starting from
 
2157
one for primary partitions and from five for extended partitions, and
 
2158
BSD-SUBPART-LETTER represents the BSD disklabel subpartition, such as
 
2159
`a' or `e'.
 
2160
 
 
2161
   A shortcut for specifying BSD subpartitions is
 
2162
`(DEVICE,BSD-SUBPART-LETTER)', in this case, GRUB searches for the
 
2163
first PC partition containing a BSD disklabel, then finds the
 
2164
subpartition BSD-SUBPART-LETTER. Here is an example:
 
2165
 
 
2166
     (hd0,a)
 
2167
 
 
2168
   The syntax `(hd0)' represents using the entire disk (or the MBR when
 
2169
installing GRUB), while the syntax `(hd0,1)' represents using the first
 
2170
partition of the disk (or the boot sector of the partition when
 
2171
installing GRUB).
 
2172
 
 
2173
   If you enabled the network support, the special drive `(pxe)' is
 
2174
also available. Before using the network drive, you must initialize the
 
2175
network. *Note Network::, for more information.
 
2176
 
 
2177
   If you boot GRUB from a CD-ROM, `(cd)' is available. *Note Making a
 
2178
GRUB bootable CD-ROM::, for details.
 
2179
 
 
2180
 
 
2181
File: grub.info,  Node: File name syntax,  Next: Block list syntax,  Prev: Device syntax,  Up: Filesystem
 
2182
 
 
2183
11.2 How to specify files
 
2184
=========================
 
2185
 
 
2186
There are two ways to specify files, by "absolute file name" and by
 
2187
"block list".
 
2188
 
 
2189
   An absolute file name resembles a Unix absolute file name, using `/'
 
2190
for the directory separator (not `\' as in DOS). One example is
 
2191
`(hd0,1)/boot/grub/grub.cfg'. This means the file `/boot/grub/grub.cfg'
 
2192
in the first partition of the first hard disk. If you omit the device
 
2193
name in an absolute file name, GRUB uses GRUB's "root device"
 
2194
implicitly. So if you set the root device to, say, `(hd1,1)' by the
 
2195
command `set root=(hd1,1)' (*note set::), then `/boot/kernel' is the
 
2196
same as `(hd1,1)/boot/kernel'.
 
2197
 
 
2198
 
 
2199
File: grub.info,  Node: Block list syntax,  Prev: File name syntax,  Up: Filesystem
 
2200
 
 
2201
11.3 How to specify block lists
 
2202
===============================
 
2203
 
 
2204
A block list is used for specifying a file that doesn't appear in the
 
2205
filesystem, like a chainloader. The syntax is
 
2206
`[OFFSET]+LENGTH[,[OFFSET]+LENGTH]...'.  Here is an example:
 
2207
 
 
2208
     `0+100,200+1,300+300'
 
2209
 
 
2210
   This represents that GRUB should read blocks 0 through 99, block 200,
 
2211
and blocks 300 through 599. If you omit an offset, then GRUB assumes
 
2212
the offset is zero.
 
2213
 
 
2214
   Like the file name syntax (*note File name syntax::), if a blocklist
 
2215
does not contain a device name, then GRUB uses GRUB's "root device". So
 
2216
`(hd0,2)+1' is the same as `+1' when the root device is `(hd0,2)'.
 
2217
 
 
2218
 
 
2219
File: grub.info,  Node: Interface,  Next: Commands,  Prev: Filesystem,  Up: Top
 
2220
 
 
2221
12 GRUB's user interface
 
2222
************************
 
2223
 
 
2224
GRUB has both a simple menu interface for choosing preset entries from a
 
2225
configuration file, and a highly flexible command-line for performing
 
2226
any desired combination of boot commands.
 
2227
 
 
2228
   GRUB looks for its configuration file as soon as it is loaded. If one
 
2229
is found, then the full menu interface is activated using whatever
 
2230
entries were found in the file. If you choose the "command-line" menu
 
2231
option, or if the configuration file was not found, then GRUB drops to
 
2232
the command-line interface.
 
2233
 
 
2234
* Menu:
 
2235
 
 
2236
* Command-line interface::      The flexible command-line interface
 
2237
* Menu interface::              The simple menu interface
 
2238
* Menu entry editor::           Editing a menu entry
 
2239
 
 
2240
 
 
2241
File: grub.info,  Node: Command-line interface,  Next: Menu interface,  Up: Interface
 
2242
 
 
2243
12.1 The flexible command-line interface
 
2244
========================================
 
2245
 
 
2246
The command-line interface provides a prompt and after it an editable
 
2247
text area much like a command-line in Unix or DOS. Each command is
 
2248
immediately executed after it is entered(1) (*note Command-line
 
2249
interface-Footnote-1::). The commands (*note Command-line and menu
 
2250
entry commands::) are a subset of those available in the configuration
 
2251
file, used with exactly the same syntax.
 
2252
 
 
2253
   Cursor movement and editing of the text on the line can be done via a
 
2254
subset of the functions available in the Bash shell:
 
2255
 
 
2256
<C-f>
 
2257
<PC right key>
 
2258
     Move forward one character.
 
2259
 
 
2260
<C-b>
 
2261
<PC left key>
 
2262
     Move back one character.
 
2263
 
 
2264
<C-a>
 
2265
<HOME>
 
2266
     Move to the start of the line.
 
2267
 
 
2268
<C-e>
 
2269
<END>
 
2270
     Move the the end of the line.
 
2271
 
 
2272
<C-d>
 
2273
<DEL>
 
2274
     Delete the character underneath the cursor.
 
2275
 
 
2276
<C-h>
 
2277
<BS>
 
2278
     Delete the character to the left of the cursor.
 
2279
 
 
2280
<C-k>
 
2281
     Kill the text from the current cursor position to the end of the
 
2282
     line.
 
2283
 
 
2284
<C-u>
 
2285
     Kill backward from the cursor to the beginning of the line.
 
2286
 
 
2287
<C-y>
 
2288
     Yank the killed text back into the buffer at the cursor.
 
2289
 
 
2290
<C-p>
 
2291
<PC up key>
 
2292
     Move up through the history list.
 
2293
 
 
2294
<C-n>
 
2295
<PC down key>
 
2296
     Move down through the history list.
 
2297
 
 
2298
   When typing commands interactively, if the cursor is within or before
 
2299
the first word in the command-line, pressing the <TAB> key (or <C-i>)
 
2300
will display a listing of the available commands, and if the cursor is
 
2301
after the first word, the `<TAB>' will provide a completion listing of
 
2302
disks, partitions, and file names depending on the context. Note that
 
2303
to obtain a list of drives, one must open a parenthesis, as `root ('.
 
2304
 
 
2305
   Note that you cannot use the completion functionality in the TFTP
 
2306
filesystem. This is because TFTP doesn't support file name listing for
 
2307
the security.
 
2308
 
 
2309
 
 
2310
File: grub.info,  Node: Command-line interface-Footnotes,  Up: Command-line interface
 
2311
 
 
2312
   (1) However, this behavior will be changed in the future version, in
 
2313
a user-invisible way.
 
2314
 
 
2315
 
 
2316
File: grub.info,  Node: Menu interface,  Next: Menu entry editor,  Prev: Command-line interface,  Up: Interface
 
2317
 
 
2318
12.2 The simple menu interface
 
2319
==============================
 
2320
 
 
2321
The menu interface is quite easy to use. Its commands are both
 
2322
reasonably intuitive and described on screen.
 
2323
 
 
2324
   Basically, the menu interface provides a list of "boot entries" to
 
2325
the user to choose from. Use the arrow keys to select the entry of
 
2326
choice, then press <RET> to run it.  An optional timeout is available
 
2327
to boot the default entry (the first one if not set), which is aborted
 
2328
by pressing any key.
 
2329
 
 
2330
   Commands are available to enter a bare command-line by pressing <c>
 
2331
(which operates exactly like the non-config-file version of GRUB, but
 
2332
allows one to return to the menu if desired by pressing <ESC>) or to
 
2333
edit any of the "boot entries" by pressing <e>.
 
2334
 
 
2335
   If you protect the menu interface with a password (*note Security::),
 
2336
all you can do is choose an entry by pressing <RET>, or press <p> to
 
2337
enter the password.
 
2338
 
 
2339
 
 
2340
File: grub.info,  Node: Menu entry editor,  Prev: Menu interface,  Up: Interface
 
2341
 
 
2342
12.3 Editing a menu entry
 
2343
=========================
 
2344
 
 
2345
The menu entry editor looks much like the main menu interface, but the
 
2346
lines in the menu are individual commands in the selected entry instead
 
2347
of entry names.
 
2348
 
 
2349
   If an <ESC> is pressed in the editor, it aborts all the changes made
 
2350
to the configuration entry and returns to the main menu interface.
 
2351
 
 
2352
   Each line in the menu entry can be edited freely, and you can add
 
2353
new lines by pressing <RET> at the end of a line.  To boot the edited
 
2354
entry, press <Ctrl-x>.
 
2355
 
 
2356
   Although GRUB unfortunately does not support "undo", you can do
 
2357
almost the same thing by just returning to the main menu using <ESC>.
 
2358
 
 
2359
 
 
2360
File: grub.info,  Node: Commands,  Next: Security,  Prev: Interface,  Up: Top
 
2361
 
 
2362
13 The list of available commands
 
2363
*********************************
 
2364
 
 
2365
In this chapter, we list all commands that are available in GRUB.
 
2366
 
 
2367
   Commands belong to different groups. A few can only be used in the
 
2368
global section of the configuration file (or "menu"); most of them can
 
2369
be entered on the command-line and can be used either anywhere in the
 
2370
menu or specifically in the menu entries.
 
2371
 
 
2372
   In rescue mode, only the `insmod' (*note insmod::), `ls' (*note
 
2373
ls::), `set' (*note set::), and `unset' (*note unset::) commands are
 
2374
normally available.
 
2375
 
 
2376
* Menu:
 
2377
 
 
2378
* Menu-specific commands::
 
2379
* General commands::
 
2380
* Command-line and menu entry commands::
 
2381
 
 
2382
 
 
2383
File: grub.info,  Node: Menu-specific commands,  Next: General commands,  Up: Commands
 
2384
 
 
2385
13.1 The list of commands for the menu only
 
2386
===========================================
 
2387
 
 
2388
The semantics used in parsing the configuration file are the following:
 
2389
 
 
2390
   * The menu-specific commands have to be used before any others.
 
2391
 
 
2392
   * The files _must_ be in plain-text format.
 
2393
 
 
2394
   * `#' at the beginning of a line in a configuration file means it is
 
2395
     only a comment.
 
2396
 
 
2397
   * Options are separated by spaces.
 
2398
 
 
2399
   * All numbers can be either decimal or hexadecimal. A hexadecimal
 
2400
     number must be preceded by `0x', and is case-insensitive.
 
2401
 
 
2402
   * Extra options or text at the end of the line are ignored unless
 
2403
     otherwise specified.
 
2404
 
 
2405
   * Unrecognized commands are added to the current entry, except
 
2406
     before entries start, where they are ignored.
 
2407
 
 
2408
   These commands can only be used in the menu:
 
2409
 
 
2410
* Menu:
 
2411
 
 
2412
* menuentry::                   Start a menu entry
 
2413
 
 
2414
 
 
2415
File: grub.info,  Node: menuentry,  Up: Menu-specific commands
 
2416
 
 
2417
13.1.1 menuentry
 
2418
----------------
 
2419
 
 
2420
 -- Command: menuentry TITLE [`--class=class' ...] [`--users=users']
 
2421
          [`--hotkey=key'] { COMMAND; ... }
 
2422
     This defines a GRUB menu entry named TITLE.  When this entry is
 
2423
     selected from the menu, GRUB will set the CHOSEN environment
 
2424
     variable to TITLE, execute the list of commands given within
 
2425
     braces, and if the last command in the list returned successfully
 
2426
     and a kernel was loaded it will execute the `boot' command.
 
2427
 
 
2428
     The `--class' option may be used any number of times to group menu
 
2429
     entries into classes.  Menu themes may display different classes
 
2430
     using different styles.
 
2431
 
 
2432
     The `--users' option grants specific users access to specific menu
 
2433
     entries.  *Note Security::.
 
2434
 
 
2435
     The `--hotkey' option associates a hotkey with a menu entry.  KEY
 
2436
     may be a single letter, or one of the aliases `backspace', `tab',
 
2437
     or `delete'.
 
2438
 
 
2439
 
 
2440
File: grub.info,  Node: General commands,  Next: Command-line and menu entry commands,  Prev: Menu-specific commands,  Up: Commands
 
2441
 
 
2442
13.2 The list of general commands
 
2443
=================================
 
2444
 
 
2445
Commands usable anywhere in the menu and in the command-line.
 
2446
 
 
2447
* Menu:
 
2448
 
 
2449
* serial::                      Set up a serial device
 
2450
* terminal_input::              Manage input terminals
 
2451
* terminal_output::             Manage output terminals
 
2452
* terminfo::                    Define terminal type
 
2453
 
 
2454
 
 
2455
File: grub.info,  Node: serial,  Next: terminal_input,  Up: General commands
 
2456
 
 
2457
13.2.1 serial
 
2458
-------------
 
2459
 
 
2460
 -- Command: serial [`--unit=unit'] [`--port=port'] [`--speed=speed']
 
2461
          [`--word=word'] [`--parity=parity'] [`--stop=stop']
 
2462
     Initialize a serial device. UNIT is a number in the range 0-3
 
2463
     specifying which serial port to use; default is 0, which
 
2464
     corresponds to the port often called COM1. PORT is the I/O port
 
2465
     where the UART is to be found; if specified it takes precedence
 
2466
     over UNIT.  SPEED is the transmission speed; default is 9600. WORD
 
2467
     and STOP are the number of data bits and stop bits. Data bits must
 
2468
     be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data
 
2469
     bits and one stop bit. PARITY is one of `no', `odd', `even' and
 
2470
     defaults to `no'.
 
2471
 
 
2472
     The serial port is not used as a communication channel unless the
 
2473
     `terminal_input' or `terminal_output' command is used (*note
 
2474
     terminal_input::, *note terminal_output::).
 
2475
 
 
2476
     See also *note Serial terminal::.
 
2477
 
 
2478
 
 
2479
File: grub.info,  Node: terminal_input,  Next: terminal_output,  Prev: serial,  Up: General commands
 
2480
 
 
2481
13.2.2 terminal_input
 
2482
---------------------
 
2483
 
 
2484
 -- Command: terminal_input [`--append'|`--remove'] [terminal1]
 
2485
          [terminal2] ...
 
2486
     List or select an input terminal.
 
2487
 
 
2488
     With no arguments, list the active and available input terminals.
 
2489
 
 
2490
     With `--append', add the named terminals to the list of active
 
2491
     input terminals; any of these may be used to provide input to GRUB.
 
2492
 
 
2493
     With `--remove', remove the named terminals from the active list.
 
2494
 
 
2495
     With no options but a list of terminal names, make only the listed
 
2496
     terminal names active.
 
2497
 
 
2498
 
 
2499
File: grub.info,  Node: terminal_output,  Next: terminfo,  Prev: terminal_input,  Up: General commands
 
2500
 
 
2501
13.2.3 terminal_output
 
2502
----------------------
 
2503
 
 
2504
 -- Command: terminal_output [`--append'|`--remove'] [terminal1]
 
2505
          [terminal2] ...
 
2506
     List or select an output terminal.
 
2507
 
 
2508
     With no arguments, list the active and available output terminals.
 
2509
 
 
2510
     With `--append', add the named terminals to the list of active
 
2511
     output terminals; all of these will receive output from GRUB.
 
2512
 
 
2513
     With `--remove', remove the named terminals from the active list.
 
2514
 
 
2515
     With no options but a list of terminal names, make only the listed
 
2516
     terminal names active.
 
2517
 
 
2518
 
 
2519
File: grub.info,  Node: terminfo,  Prev: terminal_output,  Up: General commands
 
2520
 
 
2521
13.2.4 terminfo
 
2522
---------------
 
2523
 
 
2524
 -- Command: terminfo [-a|-u|-v] [term]
 
2525
     Define the capabilities of your terminal by giving the name of an
 
2526
     entry in the terminfo database, which should correspond roughly to
 
2527
     a `TERM' environment variable in Unix.
 
2528
 
 
2529
     The currently available terminal types are `vt100', `vt100-color',
 
2530
     `ieee1275', and `dumb'.  If you need other terminal types, please
 
2531
     contact us to discuss the best way to include support for these in
 
2532
     GRUB.
 
2533
 
 
2534
     The `-a' (`--ascii'), `-u' (`--utf8'), and `-v' (`--visual-utf8')
 
2535
     options control how non-ASCII text is displayed.  `-a' specifies
 
2536
     an ASCII-only terminal; `-u' specifies logically-ordered UTF-8;
 
2537
     and `-v' specifies "visually-ordered UTF-8" (in other words,
 
2538
     arranged such that a terminal emulator without bidirectional text
 
2539
     support will display right-to-left text in the proper order; this
 
2540
     is not really proper UTF-8, but a workaround).
 
2541
 
 
2542
     If no option or terminal type is specified, the current terminal
 
2543
     type is printed.
 
2544
 
 
2545
 
 
2546
File: grub.info,  Node: Command-line and menu entry commands,  Prev: General commands,  Up: Commands
 
2547
 
 
2548
13.3 The list of command-line and menu entry commands
 
2549
=====================================================
 
2550
 
 
2551
These commands are usable in the command-line and in menu entries.  If
 
2552
you forget a command, you can run the command `help' (*note help::).
 
2553
 
 
2554
* Menu:
 
2555
 
 
2556
* acpi::                        Load ACPI tables
 
2557
* badram::                      Filter out bad regions of RAM
 
2558
* blocklist::                   Print a block list
 
2559
* boot::                        Start up your operating system
 
2560
* cat::                         Show the contents of a file
 
2561
* chainloader::                 Chain-load another boot loader
 
2562
* cmp::                         Compare two files
 
2563
* configfile::                  Load a configuration file
 
2564
* cpuid::                       Check for CPU features
 
2565
* crc::                         Calculate CRC32 checksums
 
2566
* date::                        Display or set current date and time
 
2567
* drivemap::                    Map a drive to another
 
2568
* echo::                        Display a line of text
 
2569
* export::                      Export an environment variable
 
2570
* gettext::                     Translate a string
 
2571
* gptsync::                     Fill an MBR based on GPT entries
 
2572
* halt::                        Shut down your computer
 
2573
* help::                        Show help messages
 
2574
* initrd::                      Load a Linux initrd
 
2575
* initrd16::                    Load a Linux initrd (16-bit mode)
 
2576
* insmod::                      Insert a module
 
2577
* keystatus::                   Check key modifier status
 
2578
* linux::                       Load a Linux kernel
 
2579
* linux16::                     Load a Linux kernel (16-bit mode)
 
2580
* ls::                          List devices or files
 
2581
* parttool::                    Modify partition table entries
 
2582
* password::                    Set a clear-text password
 
2583
* password_pbkdf2::             Set a hashed password
 
2584
* play::                        Play a tune
 
2585
* pxe_unload::                  Unload the PXE environment
 
2586
* reboot::                      Reboot your computer
 
2587
* search::                      Search devices by file, label, or UUID
 
2588
* sendkey::                     Emulate keystrokes
 
2589
* set::                         Set an environment variable
 
2590
* unset::                       Unset an environment variable
 
2591
* uppermem::                    Set the upper memory size
 
2592
 
 
2593
 
 
2594
File: grub.info,  Node: acpi,  Next: badram,  Up: Command-line and menu entry commands
 
2595
 
 
2596
13.3.1 acpi
 
2597
-----------
 
2598
 
 
2599
 -- Command: acpi [`-1'|`-2']
 
2600
          [`--exclude=table1,...'|`--load-only=table1,...']
 
2601
          [`--oemid=id'] [`--oemtable=table'] [`--oemtablerev=rev']
 
2602
          [`--oemtablecreator=creator'] [`--oemtablecreatorrev=rev']
 
2603
          [`--no-ebda'] filename ...
 
2604
     Modern BIOS systems normally implement the Advanced Configuration
 
2605
     and Power Interface (ACPI), and define various tables that
 
2606
     describe the interface between an ACPI-compliant operating system
 
2607
     and the firmware. In some cases, the tables provided by default
 
2608
     only work well with certain operating systems, and it may be
 
2609
     necessary to replace some of them.
 
2610
 
 
2611
     Normally, this command will replace the Root System Description
 
2612
     Pointer (RSDP) in the Extended BIOS Data Area to point to the new
 
2613
     tables. If the `--no-ebda' option is used, the new tables will be
 
2614
     known only to GRUB, but may be used by GRUB's EFI emulation.
 
2615
 
 
2616
 
 
2617
File: grub.info,  Node: badram,  Next: blocklist,  Prev: acpi,  Up: Command-line and menu entry commands
 
2618
 
 
2619
13.3.2 badram
 
2620
-------------
 
2621
 
 
2622
 -- Command: badram addr,mask[,addr,mask...]
 
2623
     Filter out bad RAM.
 
2624
 
 
2625
   This command notifies the memory manager that specified regions of
 
2626
RAM ought to be filtered out (usually, because they're damaged).  This
 
2627
remains in effect after a payload kernel has been loaded by GRUB, as
 
2628
long as the loaded kernel obtains its memory map from GRUB.  Kernels
 
2629
that support this include Linux, GNU Mach, the kernel of FreeBSD and
 
2630
Multiboot kernels in general.
 
2631
 
 
2632
   Syntax is the same as provided by the Memtest86+ utility
 
2633
(http://www.memtest.org/): a list of address/mask pairs.  Given a
 
2634
page-aligned address and a base address / mask pair, if all the bits of
 
2635
the page-aligned address that are enabled by the mask match with the
 
2636
base address, it means this page is to be filtered.  This syntax makes
 
2637
it easy to represent patterns that are often result of memory damage,
 
2638
due to physical distribution of memory cells.
 
2639
 
 
2640
 
 
2641
File: grub.info,  Node: blocklist,  Next: boot,  Prev: badram,  Up: Command-line and menu entry commands
 
2642
 
 
2643
13.3.3 blocklist
 
2644
----------------
 
2645
 
 
2646
 -- Command: blocklist file
 
2647
     Print a block list (*note Block list syntax::) for FILE.
 
2648
 
 
2649
 
 
2650
File: grub.info,  Node: boot,  Next: cat,  Prev: blocklist,  Up: Command-line and menu entry commands
 
2651
 
 
2652
13.3.4 boot
 
2653
-----------
 
2654
 
 
2655
 -- Command: boot
 
2656
     Boot the OS or chain-loader which has been loaded. Only necessary
 
2657
     if running the fully interactive command-line (it is implicit at
 
2658
     the end of a menu entry).
 
2659
 
 
2660
 
 
2661
File: grub.info,  Node: cat,  Next: chainloader,  Prev: boot,  Up: Command-line and menu entry commands
 
2662
 
 
2663
13.3.5 cat
 
2664
----------
 
2665
 
 
2666
 -- Command: cat [`--dos'] file
 
2667
     Display the contents of the file FILE. This command may be useful
 
2668
     to remind you of your OS's root partition:
 
2669
 
 
2670
          grub> cat /etc/fstab
 
2671
 
 
2672
     If the `--dos' option is used, then carriage return / new line
 
2673
     pairs will be displayed as a simple new line.  Otherwise, the
 
2674
     carriage return will be displayed as a control character (`<d>')
 
2675
     to make it easier to see when boot problems are caused by a file
 
2676
     formatted using DOS-style line endings.
 
2677
 
 
2678
 
 
2679
File: grub.info,  Node: chainloader,  Next: cmp,  Prev: cat,  Up: Command-line and menu entry commands
 
2680
 
 
2681
13.3.6 chainloader
 
2682
------------------
 
2683
 
 
2684
 -- Command: chainloader [`--force'] file
 
2685
     Load FILE as a chain-loader. Like any other file loaded by the
 
2686
     filesystem code, it can use the blocklist notation (*note Block
 
2687
     list syntax::) to grab the first sector of the current partition
 
2688
     with `+1'.  If you specify the option `--force', then load FILE
 
2689
     forcibly, whether it has a correct signature or not. This is
 
2690
     required when you want to load a defective boot loader, such as
 
2691
     SCO UnixWare 7.1.
 
2692
 
 
2693
 
 
2694
File: grub.info,  Node: cmp,  Next: configfile,  Prev: chainloader,  Up: Command-line and menu entry commands
 
2695
 
 
2696
13.3.7 cmp
 
2697
----------
 
2698
 
 
2699
 -- Command: cmp file1 file2
 
2700
     Compare the file FILE1 with the file FILE2. If they differ in
 
2701
     size, print the sizes like this:
 
2702
 
 
2703
          Differ in size: 0x1234 [foo], 0x4321 [bar]
 
2704
 
 
2705
     If the sizes are equal but the bytes at an offset differ, then
 
2706
     print the bytes like this:
 
2707
 
 
2708
          Differ at the offset 777: 0xbe [foo], 0xef [bar]
 
2709
 
 
2710
     If they are completely identical, nothing will be printed.
 
2711
 
 
2712
 
 
2713
File: grub.info,  Node: configfile,  Next: cpuid,  Prev: cmp,  Up: Command-line and menu entry commands
 
2714
 
 
2715
13.3.8 configfile
 
2716
-----------------
 
2717
 
 
2718
 -- Command: configfile file
 
2719
     Load FILE as a configuration file.  If FILE defines any menu
 
2720
     entries, then show a menu containing them immediately.
 
2721
 
 
2722
 
 
2723
File: grub.info,  Node: cpuid,  Next: crc,  Prev: configfile,  Up: Command-line and menu entry commands
 
2724
 
 
2725
13.3.9 cpuid
 
2726
------------
 
2727
 
 
2728
 -- Command: cpuid [-l]
 
2729
     Check for CPU features.  This command is only available on x86
 
2730
     systems.
 
2731
 
 
2732
     With the `-l' option, return true if the CPU supports long mode
 
2733
     (64-bit).
 
2734
 
 
2735
     If invoked without options, this command currently behaves as if
 
2736
     it had been invoked with `-l'.  This may change in the future.
 
2737
 
 
2738
 
 
2739
File: grub.info,  Node: crc,  Next: date,  Prev: cpuid,  Up: Command-line and menu entry commands
 
2740
 
 
2741
13.3.10 crc
 
2742
-----------
 
2743
 
 
2744
 -- Command: crc file
 
2745
     Display the CRC32 checksum of FILE.
 
2746
 
 
2747
 
 
2748
File: grub.info,  Node: date,  Next: drivemap,  Prev: crc,  Up: Command-line and menu entry commands
 
2749
 
 
2750
13.3.11 date
 
2751
------------
 
2752
 
 
2753
 -- Command: date [[year-]month-day] [hour:minute[:second]]
 
2754
     With no arguments, print the current date and time.
 
2755
 
 
2756
     Otherwise, take the current date and time, change any elements
 
2757
     specified as arguments, and set the result as the new date and
 
2758
     time.  For example, `date 01-01' will set the current month and
 
2759
     day to January 1, but leave the year, hour, minute, and second
 
2760
     unchanged.
 
2761
 
 
2762
 
 
2763
File: grub.info,  Node: drivemap,  Next: echo,  Prev: date,  Up: Command-line and menu entry commands
 
2764
 
 
2765
13.3.12 drivemap
 
2766
----------------
 
2767
 
 
2768
 -- Command: drivemap `-l'|`-r'|[`-s'] from_drive to_drive
 
2769
     Without options, map the drive FROM_DRIVE to the drive TO_DRIVE.
 
2770
     This is necessary when you chain-load some operating systems, such
 
2771
     as DOS, if such an OS resides at a non-first drive.  For
 
2772
     convenience, any partition suffix on the drive is ignored, so you
 
2773
     can safely use ${root} as a drive specification.
 
2774
 
 
2775
     With the `-s' option, perform the reverse mapping as well, swapping
 
2776
     the two drives.
 
2777
 
 
2778
     With the `-l' option, list the current mappings.
 
2779
 
 
2780
     With the `-r' option, reset all mappings to the default values.
 
2781
 
 
2782
     For example:
 
2783
 
 
2784
          drivemap -s (hd0) (hd1)
 
2785
 
 
2786
 
 
2787
File: grub.info,  Node: echo,  Next: export,  Prev: drivemap,  Up: Command-line and menu entry commands
 
2788
 
 
2789
13.3.13 echo
 
2790
------------
 
2791
 
 
2792
 -- Command: echo [`-n'] [`-e'] string ...
 
2793
     Display the requested text and, unless the `-n' option is used, a
 
2794
     trailing new line.  If there is more than one string, they are
 
2795
     separated by spaces in the output.  As usual in GRUB commands,
 
2796
     variables may be substituted using `${var}'.
 
2797
 
 
2798
     The `-e' option enables interpretation of backslash escapes.  The
 
2799
     following sequences are recognised:
 
2800
 
 
2801
    `\\'
 
2802
          backslash
 
2803
 
 
2804
    `\a'
 
2805
          alert (BEL)
 
2806
 
 
2807
    `\c'
 
2808
          suppress trailing new line
 
2809
 
 
2810
    `\f'
 
2811
          form feed
 
2812
 
 
2813
    `\n'
 
2814
          new line
 
2815
 
 
2816
    `\r'
 
2817
          carriage return
 
2818
 
 
2819
    `\t'
 
2820
          horizontal tab
 
2821
 
 
2822
    `\v'
 
2823
          vertical tab
 
2824
 
 
2825
     When interpreting backslash escapes, backslash followed by any
 
2826
     other character will print that character.
 
2827
 
 
2828
 
 
2829
File: grub.info,  Node: export,  Next: gettext,  Prev: echo,  Up: Command-line and menu entry commands
 
2830
 
 
2831
13.3.14 export
 
2832
--------------
 
2833
 
 
2834
 -- Command: export envvar
 
2835
     Export the environment variable ENVVAR. Exported variables are
 
2836
     visible to subsidiary configuration files loaded using
 
2837
     `configfile'.
 
2838
 
 
2839
 
 
2840
File: grub.info,  Node: gettext,  Next: gptsync,  Prev: export,  Up: Command-line and menu entry commands
 
2841
 
 
2842
13.3.15 gettext
 
2843
---------------
 
2844
 
 
2845
 -- Command: gettext string
 
2846
     Translate STRING into the current language.
 
2847
 
 
2848
     The current language code is stored in the `lang' variable in
 
2849
     GRUB's environment.  Translation files in MO format are read from
 
2850
     `locale_dir', usually `/boot/grub/locale'.
 
2851
 
 
2852
 
 
2853
File: grub.info,  Node: gptsync,  Next: halt,  Prev: gettext,  Up: Command-line and menu entry commands
 
2854
 
 
2855
13.3.16 gptsync
 
2856
---------------
 
2857
 
 
2858
 -- Command: gptsync device [partition[+/-[type]]] ...
 
2859
     Disks using the GUID Partition Table (GPT) also have a legacy
 
2860
     Master Boot Record (MBR) partition table for compatibility with
 
2861
     the BIOS and with older operating systems.  The legacy MBR can
 
2862
     only represent a limited subset of GPT partition entries.
 
2863
 
 
2864
     This command populates the legacy MBR with the specified PARTITION
 
2865
     entries on DEVICE.  Up to three partitions may be used.
 
2866
 
 
2867
     TYPE is an MBR partition type code; prefix with `0x' if you want
 
2868
     to enter this in hexadecimal.  The separator between PARTITION and
 
2869
     TYPE may be `+' to make the partition active, or `-' to make it
 
2870
     inactive; only one partition may be active.  If both the separator
 
2871
     and type are omitted, then the partition will be inactive.
 
2872
 
 
2873
 
 
2874
File: grub.info,  Node: halt,  Next: help,  Prev: gptsync,  Up: Command-line and menu entry commands
 
2875
 
 
2876
13.3.17 halt
 
2877
------------
 
2878
 
 
2879
 -- Command: halt `--no-apm'
 
2880
     The command halts the computer. If the `--no-apm' option is
 
2881
     specified, no APM BIOS call is performed. Otherwise, the computer
 
2882
     is shut down using APM.
 
2883
 
 
2884
 
 
2885
File: grub.info,  Node: help,  Next: initrd,  Prev: halt,  Up: Command-line and menu entry commands
 
2886
 
 
2887
13.3.18 help
 
2888
------------
 
2889
 
 
2890
 -- Command: help [pattern ...]
 
2891
     Display helpful information about builtin commands. If you do not
 
2892
     specify PATTERN, this command shows short descriptions of all
 
2893
     available commands.
 
2894
 
 
2895
     If you specify any PATTERNS, it displays longer information about
 
2896
     each of the commands whose names begin with those PATTERNS.
 
2897
 
 
2898
 
 
2899
File: grub.info,  Node: initrd,  Next: initrd16,  Prev: help,  Up: Command-line and menu entry commands
 
2900
 
 
2901
13.3.19 initrd
 
2902
--------------
 
2903
 
 
2904
 -- Command: initrd file
 
2905
     Load an initial ramdisk for a Linux kernel image, and set the
 
2906
     appropriate parameters in the Linux setup area in memory.  This
 
2907
     may only be used after the `linux' command (*note linux::) has
 
2908
     been run.  See also *note GNU/Linux::.
 
2909
 
 
2910
 
 
2911
File: grub.info,  Node: initrd16,  Next: insmod,  Prev: initrd,  Up: Command-line and menu entry commands
 
2912
 
 
2913
13.3.20 initrd16
 
2914
----------------
 
2915
 
 
2916
 -- Command: initrd16 file
 
2917
     Load an initial ramdisk for a Linux kernel image to be booted in
 
2918
     16-bit mode, and set the appropriate parameters in the Linux setup
 
2919
     area in memory.  This may only be used after the `linux16' command
 
2920
     (*note linux16::) has been run.  See also *note GNU/Linux::.
 
2921
 
 
2922
     This command is only available on x86 systems.
 
2923
 
 
2924
 
 
2925
File: grub.info,  Node: insmod,  Next: keystatus,  Prev: initrd16,  Up: Command-line and menu entry commands
 
2926
 
 
2927
13.3.21 insmod
 
2928
--------------
 
2929
 
 
2930
 -- Command: insmod module
 
2931
     Insert the dynamic GRUB module called MODULE.
 
2932
 
 
2933
 
 
2934
File: grub.info,  Node: keystatus,  Next: linux,  Prev: insmod,  Up: Command-line and menu entry commands
 
2935
 
 
2936
13.3.22 keystatus
 
2937
-----------------
 
2938
 
 
2939
 -- Command: keystatus [`--shift'] [`--ctrl'] [`--alt']
 
2940
     Return true if the Shift, Control, or Alt modifier keys are held
 
2941
     down, as requested by options. This is useful in scripting, to
 
2942
     allow some user control over behaviour without having to wait for
 
2943
     a keypress.
 
2944
 
 
2945
     Checking key modifier status is only supported on some platforms.
 
2946
     If invoked without any options, the `keystatus' command returns
 
2947
     true if and only if checking key modifier status is supported.
 
2948
 
 
2949
 
 
2950
File: grub.info,  Node: linux,  Next: linux16,  Prev: keystatus,  Up: Command-line and menu entry commands
 
2951
 
 
2952
13.3.23 linux
 
2953
-------------
 
2954
 
 
2955
 -- Command: linux file ...
 
2956
     Load a Linux kernel image from FILE.  The rest of the line is
 
2957
     passed verbatim as the "kernel command-line".  Any initrd must be
 
2958
     reloaded after using this command (*note initrd::).
 
2959
 
 
2960
     On x86 systems, the kernel will be booted using the 32-bit boot
 
2961
     protocol.  Note that this means that the `vga=' boot option will
 
2962
     not work; if you want to set a special video mode, you will need
 
2963
     to use GRUB commands such as `set gfxpayload=1024x768' or `set
 
2964
     gfxpayload=keep' (to keep the same mode as used in GRUB) instead.
 
2965
     GRUB can automatically detect some uses of `vga=' and translate
 
2966
     them to appropriate settings of `gfxpayload'.  The `linux16'
 
2967
     command (*note linux16::) avoids this restriction.
 
2968
 
 
2969
 
 
2970
File: grub.info,  Node: linux16,  Next: ls,  Prev: linux,  Up: Command-line and menu entry commands
 
2971
 
 
2972
13.3.24 linux16
 
2973
---------------
 
2974
 
 
2975
 -- Command: linux16 file ...
 
2976
     Load a Linux kernel image from FILE in 16-bit mode.  The rest of
 
2977
     the line is passed verbatim as the "kernel command-line".  Any
 
2978
     initrd must be reloaded after using this command (*note
 
2979
     initrd16::).
 
2980
 
 
2981
     The kernel will be booted using the traditional 16-bit boot
 
2982
     protocol.  As well as bypassing problems with `vga=' described in
 
2983
     *note linux::, this permits booting some other programs that
 
2984
     implement the Linux boot protocol for the sake of convenience.
 
2985
 
 
2986
     This command is only available on x86 systems.
 
2987
 
 
2988
 
 
2989
File: grub.info,  Node: ls,  Next: parttool,  Prev: linux16,  Up: Command-line and menu entry commands
 
2990
 
 
2991
13.3.25 ls
 
2992
----------
 
2993
 
 
2994
 -- Command: ls [arg ...]
 
2995
     List devices or files.
 
2996
 
 
2997
     With no arguments, print all devices known to GRUB.
 
2998
 
 
2999
     If the argument is a device name enclosed in parentheses (*note
 
3000
     Device syntax::), then list all files at the root directory of
 
3001
     that device.
 
3002
 
 
3003
     If the argument is a directory given as an absolute file name
 
3004
     (*note File name syntax::), then list the contents of that
 
3005
     directory.
 
3006
 
 
3007
 
 
3008
File: grub.info,  Node: parttool,  Next: password,  Prev: ls,  Up: Command-line and menu entry commands
 
3009
 
 
3010
13.3.26 parttool
 
3011
----------------
 
3012
 
 
3013
 -- Command: parttool partition commands
 
3014
     Make various modifications to partition table entries.
 
3015
 
 
3016
     Each COMMAND is either a boolean option, in which case it must be
 
3017
     followed with `+' or `-' (with no intervening space) to enable or
 
3018
     disable that option, or else it takes a value in the form
 
3019
     `COMMAND=VALUE'.
 
3020
 
 
3021
     Currently, `parttool' is only useful on DOS partition tables (also
 
3022
     known as Master Boot Record, or MBR).  On these partition tables,
 
3023
     the following commands are available:
 
3024
 
 
3025
    `boot' (boolean)
 
3026
          When enabled, this makes the selected partition be the active
 
3027
          (bootable) partition on its disk, clearing the active flag on
 
3028
          all other partitions.  This command is limited to _primary_
 
3029
          partitions.
 
3030
 
 
3031
    `type' (value)
 
3032
          Change the type of an existing partition.  The value must be
 
3033
          a number in the range 0-0xFF (prefix with `0x' to enter it in
 
3034
          hexadecimal).
 
3035
 
 
3036
    `hidden' (boolean)
 
3037
          When enabled, this hides the selected partition by setting
 
3038
          the "hidden" bit in its partition type code; when disabled,
 
3039
          unhides the selected partition by clearing this bit.  This is
 
3040
          useful only when booting DOS or Wwindows and multiple primary
 
3041
          FAT partitions exist in one disk.  See also *note
 
3042
          DOS/Windows::.
 
3043
 
 
3044
 
 
3045
File: grub.info,  Node: password,  Next: password_pbkdf2,  Prev: parttool,  Up: Command-line and menu entry commands
 
3046
 
 
3047
13.3.27 password
 
3048
----------------
 
3049
 
 
3050
 -- Command: password user clear-password
 
3051
     Define a user named USER with password CLEAR-PASSWORD.  *Note
 
3052
     Security::.
 
3053
 
 
3054
 
 
3055
File: grub.info,  Node: password_pbkdf2,  Next: play,  Prev: password,  Up: Command-line and menu entry commands
 
3056
 
 
3057
13.3.28 password_pbkdf2
 
3058
-----------------------
 
3059
 
 
3060
 -- Command: password_pbkdf2 user hashed-password
 
3061
     Define a user named USER with password hash HASHED-PASSWORD.  Use
 
3062
     `grub-mkpasswd-pbkdf2' (*note Invoking grub-mkpasswd-pbkdf2::) to
 
3063
     generate password hashes.  *Note Security::.
 
3064
 
 
3065
 
 
3066
File: grub.info,  Node: play,  Next: pxe_unload,  Prev: password_pbkdf2,  Up: Command-line and menu entry commands
 
3067
 
 
3068
13.3.29 play
 
3069
------------
 
3070
 
 
3071
 -- Command: play file | tempo [pitch1 duration1] [pitch2 duration2] ...
 
3072
     Plays a tune
 
3073
 
 
3074
     If the argument is a file name (*note File name syntax::), play
 
3075
     the tune recorded in it.  The file format is first the tempo as an
 
3076
     unsigned 32bit little-endian number, then pairs of unsigned 16bit
 
3077
     little-endian numbers for pitch and duration pairs.
 
3078
 
 
3079
     If the arguments are a series of numbers, play the inline tune.
 
3080
 
 
3081
     The tempo is the base for all note durations. 60 gives a 1-second
 
3082
     base, 120 gives a half-second base, etc.  Pitches are Hz.  Set
 
3083
     pitch to 0 to produce a rest.
 
3084
 
 
3085
 
 
3086
File: grub.info,  Node: pxe_unload,  Next: reboot,  Prev: play,  Up: Command-line and menu entry commands
 
3087
 
 
3088
13.3.30 pxe_unload
 
3089
------------------
 
3090
 
 
3091
 -- Command: pxe_unload
 
3092
     Unload the PXE environment (*note Network::).
 
3093
 
 
3094
     This command is only available on PC BIOS systems.
 
3095
 
 
3096
 
 
3097
File: grub.info,  Node: reboot,  Next: search,  Prev: pxe_unload,  Up: Command-line and menu entry commands
 
3098
 
 
3099
13.3.31 reboot
 
3100
--------------
 
3101
 
 
3102
 -- Command: reboot
 
3103
     Reboot the computer.
 
3104
 
 
3105
 
 
3106
File: grub.info,  Node: search,  Next: sendkey,  Prev: reboot,  Up: Command-line and menu entry commands
 
3107
 
 
3108
13.3.32 search
 
3109
--------------
 
3110
 
 
3111
 -- Command: search [`--file'|`--label'|`--fs-uuid'] [`--set' [var]]
 
3112
          [`--no-floppy'] name
 
3113
     Search devices by file (`-f', `--file'), filesystem label (`-l',
 
3114
     `--label'), or filesystem UUID (`-u', `--fs-uuid').
 
3115
 
 
3116
     If the `--set' option is used, the first device found is set as the
 
3117
     value of environment variable VAR.  The default variable is `root'.
 
3118
 
 
3119
     The `--no-floppy' option prevents searching floppy devices, which
 
3120
     can be slow.
 
3121
 
 
3122
     The `search.file', `search.fs_label', and `search.fs_uuid'
 
3123
     commands are aliases for `search --file', `search --label', and
 
3124
     `search --fs-uuid' respectively.
 
3125
 
 
3126
 
 
3127
File: grub.info,  Node: sendkey,  Next: set,  Prev: search,  Up: Command-line and menu entry commands
 
3128
 
 
3129
13.3.33 sendkey
 
3130
---------------
 
3131
 
 
3132
 -- Command: sendkey [`--num'|`--caps'|`--scroll'|`--insert'|
 
3133
          `--pause'|`--left-shift'|`--right-shift'|
 
3134
          `--sysrq'|`--numkey'|`--capskey'|`--scrollkey'|
 
3135
          `--insertkey'|`--left-alt'|`--right-alt'|
 
3136
          `--left-ctrl'|`--right-ctrl' `on'|`off']... [`no-led']
 
3137
          keystroke
 
3138
     Insert keystrokes into the keyboard buffer when booting.
 
3139
     Sometimes an operating system or chainloaded boot loader requires
 
3140
     particular keys to be pressed: for example, one might need to
 
3141
     press a particular key to enter "safe mode", or when chainloading
 
3142
     another boot loader one might send keystrokes to it to navigate
 
3143
     its menu.
 
3144
 
 
3145
     You may provide up to 16 keystrokes (the length of the BIOS
 
3146
     keyboard buffer).  Keystroke names may be upper-case or lower-case
 
3147
     letters, digits, or taken from the following table:
 
3148
 
 
3149
     Name                        Key
 
3150
     --------------------------------------------------------------- 
 
3151
     escape                      Escape
 
3152
     exclam                      !
 
3153
     at                          @
 
3154
     numbersign                  #
 
3155
     dollar                      $
 
3156
     percent                     %
 
3157
     caret                       ^
 
3158
     ampersand                   &
 
3159
     asterisk                    *
 
3160
     parenleft                   (
 
3161
     parenright                  )
 
3162
     minus                       -
 
3163
     underscore                  _
 
3164
     equal                       =
 
3165
     plus                        +
 
3166
     backspace                   Backspace
 
3167
     tab                         Tab
 
3168
     bracketleft                 [
 
3169
     braceleft                   {
 
3170
     bracketright                ]
 
3171
     braceright                  }
 
3172
     enter                       Enter
 
3173
     control                     press and release Control
 
3174
     semicolon                   ;
 
3175
     colon                       :
 
3176
     quote                       '
 
3177
     doublequote                 "
 
3178
     backquote                   `
 
3179
     tilde                       ~
 
3180
     shift                       press and release left Shift
 
3181
     backslash                   \
 
3182
     bar                         |
 
3183
     comma                       ,
 
3184
     less                        <
 
3185
     period                      .
 
3186
     greater                     >
 
3187
     slash                       /
 
3188
     question                    ?
 
3189
     rshift                      press and release right Shift
 
3190
     alt                         press and release Alt
 
3191
     space                       space bar
 
3192
     capslock                    Caps Lock
 
3193
     F1                          F1
 
3194
     F2                          F2
 
3195
     F3                          F3
 
3196
     F4                          F4
 
3197
     F5                          F5
 
3198
     F6                          F6
 
3199
     F7                          F7
 
3200
     F8                          F8
 
3201
     F9                          F9
 
3202
     F10                         F10
 
3203
     F11                         F11
 
3204
     F12                         F12
 
3205
     num1                        1 (numeric keypad)
 
3206
     num2                        2 (numeric keypad)
 
3207
     num3                        3 (numeric keypad)
 
3208
     num4                        4 (numeric keypad)
 
3209
     num5                        5 (numeric keypad)
 
3210
     num6                        6 (numeric keypad)
 
3211
     num7                        7 (numeric keypad)
 
3212
     num8                        8 (numeric keypad)
 
3213
     num9                        9 (numeric keypad)
 
3214
     num0                        0 (numeric keypad)
 
3215
     numperiod                   . (numeric keypad)
 
3216
     numend                      End (numeric keypad)
 
3217
     numdown                     Down (numeric keypad)
 
3218
     numpgdown                   Page Down (numeric keypad)
 
3219
     numleft                     Left (numeric keypad)
 
3220
     numcenter                   5 with Num Lock inactive (numeric
 
3221
                                 keypad)
 
3222
     numright                    Right (numeric keypad)
 
3223
     numhome                     Home (numeric keypad)
 
3224
     numup                       Up (numeric keypad)
 
3225
     numpgup                     Page Up (numeric keypad)
 
3226
     numinsert                   Insert (numeric keypad)
 
3227
     numdelete                   Delete (numeric keypad)
 
3228
     numasterisk                 * (numeric keypad)
 
3229
     numminus                    - (numeric keypad)
 
3230
     numplus                     + (numeric keypad)
 
3231
     numslash                    / (numeric keypad)
 
3232
     numenter                    Enter (numeric keypad)
 
3233
     delete                      Delete
 
3234
     insert                      Insert
 
3235
     home                        Home
 
3236
     end                         End
 
3237
     pgdown                      Page Down
 
3238
     pgup                        Page Up
 
3239
     down                        Down
 
3240
     up                          Up
 
3241
     left                        Left
 
3242
     right                       Right
 
3243
 
 
3244
     As well as keystrokes, the `sendkey' command takes various options
 
3245
     that affect the BIOS keyboard status flags.  These options take an
 
3246
     `on' or `off' parameter, specifying that the corresponding status
 
3247
     flag be set or unset; omitting the option for a given status flag
 
3248
     will leave that flag at its initial state at boot.  The `--num',
 
3249
     `--caps', `--scroll', and `--insert' options emulate setting the
 
3250
     corresponding mode, while the `--numkey', `--capskey',
 
3251
     `--scrollkey', and `--insertkey' options emulate pressing and
 
3252
     holding the corresponding key.  The other status flag options are
 
3253
     self-explanatory.
 
3254
 
 
3255
     If the `--no-led' option is given, the status flag options will
 
3256
     have no effect on keyboard LEDs.
 
3257
 
 
3258
     If the `sendkey' command is given multiple times, then only the
 
3259
     last invocation has any effect.
 
3260
 
 
3261
     Since `sendkey' manipulates the BIOS keyboard buffer, it may cause
 
3262
     hangs, reboots, or other misbehaviour on some systems.  If the
 
3263
     operating system or boot loader that runs after GRUB uses its own
 
3264
     keyboard driver rather than the BIOS keyboard functions, then
 
3265
     `sendkey' will have no effect.
 
3266
 
 
3267
     This command is only available on PC BIOS systems.
 
3268
 
 
3269
 
 
3270
File: grub.info,  Node: set,  Next: unset,  Prev: sendkey,  Up: Command-line and menu entry commands
 
3271
 
 
3272
13.3.34 set
 
3273
-----------
 
3274
 
 
3275
 -- Command: set [envvar=value]
 
3276
     Set the environment variable ENVVAR to VALUE. If invoked with no
 
3277
     arguments, print all environment variables with their values.
 
3278
 
 
3279
 
 
3280
File: grub.info,  Node: unset,  Next: uppermem,  Prev: set,  Up: Command-line and menu entry commands
 
3281
 
 
3282
13.3.35 unset
 
3283
-------------
 
3284
 
 
3285
 -- Command: unset envvar
 
3286
     Unset the environment variable ENVVAR.
 
3287
 
 
3288
 
 
3289
File: grub.info,  Node: uppermem,  Prev: unset,  Up: Command-line and menu entry commands
 
3290
 
 
3291
13.3.36 uppermem
 
3292
----------------
 
3293
 
 
3294
This command is not yet implemented for GRUB 2, although it is planned.
 
3295
 
 
3296
 
 
3297
File: grub.info,  Node: Security,  Next: Supported kernels,  Prev: Commands,  Up: Top
 
3298
 
 
3299
14 Authentication and authorisation
 
3300
***********************************
 
3301
 
 
3302
By default, the boot loader interface is accessible to anyone with
 
3303
physical access to the console: anyone can select and edit any menu
 
3304
entry, and anyone can get direct access to a GRUB shell prompt.  For
 
3305
most systems, this is reasonable since anyone with direct physical
 
3306
access has a variety of other ways to gain full access, and requiring
 
3307
authentication at the boot loader level would only serve to make it
 
3308
difficult to recover broken systems.
 
3309
 
 
3310
   However, in some environments, such as kiosks, it may be appropriate
 
3311
to lock down the boot loader to require authentication before
 
3312
performing certain operations.
 
3313
 
 
3314
   The `password' (*note password::) and `password_pbkdf2' (*note
 
3315
password_pbkdf2::) commands can be used to define users, each of which
 
3316
has an associated password.  `password' sets the password in plain
 
3317
text, requiring `grub.cfg' to be secure; `password_pbkdf2' sets the
 
3318
password hashed using the Password-Based Key Derivation Function (RFC
 
3319
2898), requiring the use of `grub-mkpasswd-pbkdf2' (*note Invoking
 
3320
grub-mkpasswd-pbkdf2::) to generate password hashes.
 
3321
 
 
3322
   In order to enable authentication support, the `superusers'
 
3323
environment variable must be set to a list of usernames, separated by
 
3324
any of spaces, commas, semicolons, pipes, or ampersands.  Superusers
 
3325
are permitted to use the GRUB command line, edit menu entries, and
 
3326
execute any menu entry.  If `superusers' is set, then use of the
 
3327
command line is automatically restricted to superusers.
 
3328
 
 
3329
   Other users may be given access to specific menu entries by giving a
 
3330
list of usernames (as above) using the `--users' option to the
 
3331
`menuentry' command (*note menuentry::).  If the `--users' option is
 
3332
not used for a menu entry, then that entry is unrestricted.
 
3333
 
 
3334
   Putting this together, a typical `grub.cfg' fragment might look like
 
3335
this:
 
3336
 
 
3337
     set superusers="root"
 
3338
     password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring
 
3339
     password user1 insecure
 
3340
 
 
3341
     menuentry "May be run by any user" {
 
3342
        set root=(hd0,1)
 
3343
        linux /vmlinuz
 
3344
     }
 
3345
 
 
3346
     menuentry "Superusers only" --users "" {
 
3347
        set root=(hd0,1)
 
3348
        linux /vmlinuz single
 
3349
     }
 
3350
 
 
3351
     menuentry "May be run by user1 or a superuser" --users user1 {
 
3352
        set root=(hd0,2)
 
3353
        chainloader +1
 
3354
     }
 
3355
 
 
3356
   The `grub-mkconfig' program does not yet have built-in support for
 
3357
generating configuration files with authentication.  You can use
 
3358
`/etc/grub.d/40_custom' to add simple superuser authentication, by
 
3359
adding `set superusers=' and `password' or `password_pbkdf2' commands.
 
3360
 
 
3361
 
 
3362
File: grub.info,  Node: Supported kernels,  Next: Troubleshooting,  Prev: Security,  Up: Top
 
3363
 
 
3364
15 Supported boot targets
 
3365
*************************
 
3366
 
 
3367
X86 support is summarised in the following table. "Yes" means that the
 
3368
kernel works on the given platform, "crashes" means an early kernel
 
3369
crash which we hope will be fixed by concerned kernel developers. "no"
 
3370
means GRUB doesn't load the given kernel on a given platform.
 
3371
"headless" means that the kernel works but lacks console drivers (you
 
3372
can still use serial or network console).  In case of "no" and
 
3373
"crashes" the reason is given in footnote.
 
3374
                                     BIOS             Coreboot
 
3375
BIOS chainloading                    yes              no (1)
 
3376
NTLDR                                yes              no (1)
 
3377
FreeBSD bootloader                   yes              crashes (1)
 
3378
32-bit kFreeBSD                      yes              crashes (2,6)
 
3379
64-bit kFreeBSD                      yes              crashes (2,6)
 
3380
32-bit kNetBSD                       yes              crashes (1)
 
3381
64-bit kNetBSD                       yes              crashes (2)
 
3382
32-bit kOpenBSD                      yes              yes
 
3383
64-bit kOpenBSD                      yes              yes
 
3384
Multiboot                            yes              yes
 
3385
Multiboot2                           yes              yes
 
3386
32-bit Linux (legacy protocol)       yes              no (1)
 
3387
64-bit Linux (legacy protocol)       yes              no (1)
 
3388
32-bit Linux (modern protocol)       yes              yes
 
3389
64-bit Linux (modern protocol)       yes              yes
 
3390
32-bit XNU                           yes              ?
 
3391
64-bit XNU                           yes              ?
 
3392
32-bit EFI chainloader               no (3)           no (3)
 
3393
64-bit EFI chainloader               no (3)           no (3)
 
3394
Appleloader                          no (3)           no (3)
 
3395
 
 
3396
                                     Multiboot        Qemu
 
3397
BIOS chainloading                    no (1)           no (1)
 
3398
NTLDR                                no (1)           no (1)
 
3399
FreeBSD bootloader                   crashes (1)      crashes (1)
 
3400
32-bit kFreeBSD                      crashes (6)      crashes (6)
 
3401
64-bit kFreeBSD                      crashes (6)      crashes (6)
 
3402
32-bit kNetBSD                       crashes (1)      crashes (1)
 
3403
64-bit kNetBSD                       yes              yes
 
3404
32-bit kOpenBSD                      yes              yes
 
3405
64-bit kOpenBSD                      yes              yes
 
3406
Multiboot                            yes              yes
 
3407
Multiboot2                           yes              yes
 
3408
32-bit Linux (legacy protocol)       no (1)           no (1)
 
3409
64-bit Linux (legacy protocol)       no (1)           no (1)
 
3410
32-bit Linux (modern protocol)       yes              yes
 
3411
64-bit Linux (modern protocol)       yes              yes
 
3412
32-bit XNU                           ?                ?
 
3413
64-bit XNU                           ?                ?
 
3414
32-bit EFI chainloader               no (3)           no (3)
 
3415
64-bit EFI chainloader               no (3)           no (3)
 
3416
Appleloader                          no (3)           no (3)
 
3417
 
 
3418
                                     32-bit EFI       64-bit EFI
 
3419
BIOS chainloading                    no (1)           no (1)
 
3420
NTLDR                                no (1)           no (1)
 
3421
FreeBSD bootloader                   crashes (1)      crashes (1)
 
3422
32-bit kFreeBSD                      headless         headless
 
3423
64-bit kFreeBSD                      headless         headless
 
3424
32-bit kNetBSD                       crashes (1)      crashes (1)
 
3425
64-bit kNetBSD                       yes              yes
 
3426
32-bit kOpenBSD                      headless         headless
 
3427
64-bit kOpenBSD                      headless         headless
 
3428
Multiboot                            yes              yes
 
3429
Multiboot2                           yes              yes
 
3430
32-bit Linux (legacy protocol)       no (1)           no (1)
 
3431
64-bit Linux (legacy protocol)       no (1)           no (1)
 
3432
32-bit Linux (modern protocol)       yes              yes
 
3433
64-bit Linux (modern protocol)       yes              yes
 
3434
32-bit XNU                           yes              yes
 
3435
64-bit XNU                           yes (5)          yes
 
3436
32-bit EFI chainloader               yes              no (4)
 
3437
64-bit EFI chainloader               no (4)           yes
 
3438
Appleloader                          yes              yes
 
3439
 
 
3440
                                     IEEE1275         
 
3441
BIOS chainloading                    no (1)           
 
3442
NTLDR                                no (1)           
 
3443
FreeBSD bootloader                   crashes (1)      
 
3444
32-bit kFreeBSD                      crashes (6)      
 
3445
64-bit kFreeBSD                      crashes (6)      
 
3446
32-bit kNetBSD                       crashes (1)      
 
3447
64-bit kNetBSD                       ?                
 
3448
32-bit kOpenBSD                      ?                
 
3449
64-bit kOpenBSD                      ?                
 
3450
Multiboot                            ?                
 
3451
Multiboot2                           ?                
 
3452
32-bit Linux (legacy protocol)       no (1)           
 
3453
64-bit Linux (legacy protocol)       no (1)           
 
3454
32-bit Linux (modern protocol)       ?                
 
3455
64-bit Linux (modern protocol)       ?                
 
3456
32-bit XNU                           ?                
 
3457
64-bit XNU                           ?                
 
3458
32-bit EFI chainloader               no (3)           
 
3459
64-bit EFI chainloader               no (3)           
 
3460
Appleloader                          no (3)           
 
3461
 
 
3462
  1. Requires BIOS
 
3463
 
 
3464
  2. Crashes because the memory at 0x0-0x1000 isn't available
 
3465
 
 
3466
  3. EFI only
 
3467
 
 
3468
  4. 32-bit and 64-bit EFI have different structures and work in
 
3469
     different CPU modes so it's not possible to chainload 32-bit
 
3470
     bootloader on 64-bit platform and vice-versa
 
3471
 
 
3472
  5. Some modules may need to be disabled
 
3473
 
 
3474
  6. Requires ACPI
 
3475
 
 
3476
   PowerPC and Sparc ports support only Linux. MIPS port supports Linux
 
3477
and multiboot2.
 
3478
 
 
3479
16 Boot tests
 
3480
*************
 
3481
 
 
3482
As you have seen in previous chapter the support matrix is pretty big
 
3483
and some of the configurations are only rarely used. To ensure the
 
3484
quality bootchecks are available for all x86 targets except EFI
 
3485
chainloader, Appleloader and XNU. All x86 platforms have bootcheck
 
3486
facility except ieee1275. Multiboot, multiboot2, BIOS chainloader,
 
3487
ntldr and freebsd-bootloader boot targets are tested only with a fake
 
3488
kernel images. Only Linux is tested among the payloads using Linux
 
3489
protocols.
 
3490
 
 
3491
   Following variables must be defined:
 
3492
 
 
3493
GRUB_PAYLOADS_DIR      directory containing the required kernels
 
3494
GRUB_CBFSTOOL          cbfstoll from Coreboot package (for coreboot
 
3495
                       platform only)
 
3496
GRUB_COREBOOT_ROM      empty Coreboot ROM
 
3497
GRUB_QEMU_OPTS         additional options to be supplied to QEMU
 
3498
 
 
3499
   Required files are:
 
3500
 
 
3501
kfreebsd_env.i386             32-bit kFreeBSD device hints
 
3502
kfreebsd.i386                 32-bit FreeBSD kernel image
 
3503
kfreebsd.x86_64,              same from 64-bit kFreeBSD
 
3504
kfreebsd_env.x86_64           
 
3505
knetbsd.i386                  32-bit NetBSD kernel image
 
3506
knetbsd.miniroot.i386         32-bit kNetBSD miniroot.kmod.
 
3507
knetbsd.x86_64,               same from 64-bit kNetBSD
 
3508
knetbsd.miniroot.x86_64       
 
3509
kopenbsd.i386                 32-bit OpenBSD kernel bsd.rd image
 
3510
kopenbsd.x86_64               same from 64-bit kOpenBSD
 
3511
linux.i386                    32-bit Linux
 
3512
linux.x86_64                  64-bit Linux
 
3513
 
 
3514
 
 
3515
File: grub.info,  Node: Troubleshooting,  Next: Invoking grub-install,  Prev: Supported kernels,  Up: Top
 
3516
 
 
3517
17 Error messages produced by GRUB
 
3518
**********************************
 
3519
 
 
3520
* Menu:
 
3521
 
 
3522
* GRUB only offers a rescue shell::
 
3523
 
 
3524
 
 
3525
File: grub.info,  Node: GRUB only offers a rescue shell,  Up: Troubleshooting
 
3526
 
 
3527
17.1 GRUB only offers a rescue shell
 
3528
====================================
 
3529
 
 
3530
GRUB's normal start-up procedure involves setting the `prefix'
 
3531
environment variable to a value set in the core image by
 
3532
`grub-install', setting the `root' variable to match, loading the
 
3533
`normal' module from the prefix, and running the `normal' command.
 
3534
This command is responsible for reading `/boot/grub/grub.cfg', running
 
3535
the menu, and doing all the useful things GRUB is supposed to do.
 
3536
 
 
3537
   If, instead, you only get a rescue shell, this usually means that
 
3538
GRUB failed to load the `normal' module for some reason.  It may be
 
3539
possible to work around this temporarily: for instance, if the reason
 
3540
for the failure is that `prefix' is wrong (perhaps it refers to the
 
3541
wrong device, or perhaps the path to `/boot/grub' was not correctly
 
3542
made relative to the device), then you can correct this and enter
 
3543
normal mode manually:
 
3544
 
 
3545
     # Inspect the current prefix (and other preset variables):
 
3546
     set
 
3547
     # Set to the correct value, which might be something like this:
 
3548
     set prefix=(hd0,1)/grub
 
3549
     set root=(hd0,1)
 
3550
     insmod normal
 
3551
     normal
 
3552
 
 
3553
   However, any problem that leaves you in the rescue shell probably
 
3554
means that GRUB was not correctly installed.  It may be more useful to
 
3555
try to reinstall it properly using `grub-install DEVICE' (*note
 
3556
Invoking grub-install::).  When doing this, there are a few things to
 
3557
remember:
 
3558
 
 
3559
   * Drive ordering in your operating system may not be the same as the
 
3560
     boot drive ordering used by your firmware.  Do not assume that
 
3561
     your first hard drive (e.g. `/dev/sda') is the one that your
 
3562
     firmware will boot from.  `device.map' (*note Device map::) can be
 
3563
     used to override this, but it is usually better to use UUIDs or
 
3564
     file system labels and avoid depending on drive ordering entirely.
 
3565
 
 
3566
   * At least on BIOS systems, if you tell `grub-install' to install
 
3567
     GRUB to a partition but GRUB has already been installed in the
 
3568
     master boot record, then the GRUB installation in the partition
 
3569
     will be ignored.
 
3570
 
 
3571
   * If possible, it is generally best to avoid installing GRUB to a
 
3572
     partition (unless it is a special partition for the use of GRUB
 
3573
     alone, such as the BIOS Boot Partition used on GPT).  Doing this
 
3574
     means that GRUB may stop being able to read its core image due to
 
3575
     a file system moving blocks around, such as while defragmenting,
 
3576
     running checks, or even during normal operation.  Installing to
 
3577
     the whole disk device is normally more robust.
 
3578
 
 
3579
   * Check that GRUB actually knows how to read from the device and
 
3580
     file system containing `/boot/grub'.  It will not be able to read
 
3581
     from encrypted devices, nor from file systems for which support
 
3582
     has not yet been added to GRUB.
 
3583
 
 
3584
 
 
3585
File: grub.info,  Node: Invoking grub-install,  Next: Invoking grub-mkconfig,  Prev: Troubleshooting,  Up: Top
 
3586
 
 
3587
18 Invoking grub-install
 
3588
************************
 
3589
 
 
3590
The program `grub-install' installs GRUB on your drive using
 
3591
`grub-mkimage' and (on some platforms) `grub-setup'.  You must specify
 
3592
the device name on which you want to install GRUB, like this:
 
3593
 
 
3594
     grub-install INSTALL_DEVICE
 
3595
 
 
3596
   The device name INSTALL_DEVICE is an OS device name or a GRUB device
 
3597
name.
 
3598
 
 
3599
   `grub-install' accepts the following options:
 
3600
 
 
3601
`--help'
 
3602
     Print a summary of the command-line options and exit.
 
3603
 
 
3604
`--version'
 
3605
     Print the version number of GRUB and exit.
 
3606
 
 
3607
`--root-directory=DIR'
 
3608
     Install GRUB images under the directory DIR instead of the root
 
3609
     directory. This option is useful when you want to install GRUB
 
3610
     into a separate partition or a removable disk. Here is an example
 
3611
     in which you have a separate "boot" partition which is mounted on
 
3612
     `/boot':
 
3613
 
 
3614
          grub-install --root-directory=/boot hd0
 
3615
 
 
3616
`--recheck'
 
3617
     Recheck the device map, even if `/boot/grub/device.map' already
 
3618
     exists. You should use this option whenever you add/remove a disk
 
3619
     into/from your computer.
 
3620
 
 
3621
 
 
3622
File: grub.info,  Node: Invoking grub-mkconfig,  Next: Invoking grub-mkpasswd-pbkdf2,  Prev: Invoking grub-install,  Up: Top
 
3623
 
 
3624
19 Invoking grub-mkconfig
 
3625
*************************
 
3626
 
 
3627
The program `grub-mkconfig' generates a configuration file for GRUB
 
3628
(*note Simple configuration::).
 
3629
 
 
3630
     grub-mkconfig -o /boot/grub/grub.cfg
 
3631
 
 
3632
   `grub-mkconfig' accepts the following options:
 
3633
 
 
3634
`--help'
 
3635
     Print a summary of the command-line options and exit.
 
3636
 
 
3637
`--version'
 
3638
     Print the version number of GRUB and exit.
 
3639
 
 
3640
`-o FILE'
 
3641
`--output=FILE'
 
3642
     Send the generated configuration file to FILE.  The default is to
 
3643
     send it to standard output.
 
3644
 
 
3645
 
 
3646
File: grub.info,  Node: Invoking grub-mkpasswd-pbkdf2,  Next: Obtaining and Building GRUB,  Prev: Invoking grub-mkconfig,  Up: Top
 
3647
 
 
3648
20 Invoking grub-mkpasswd-pbkdf2
 
3649
********************************
 
3650
 
 
3651
The program `grub-mkpasswd-pbkdf2' generates password hashes for GRUB
 
3652
(*note Security::).
 
3653
 
 
3654
     grub-mkpasswd-pbkdf2
 
3655
 
 
3656
   `grub-mkpasswd-pbkdf2' accepts the following options:
 
3657
 
 
3658
`-c NUMBER'
 
3659
`--iteration-count=NUMBER'
 
3660
     Number of iterations of the underlying pseudo-random function.
 
3661
     Defaults to 10000.
 
3662
 
 
3663
`-l NUMBER'
 
3664
`--buflen=NUMBER'
 
3665
     Length of the generated hash.  Defaults to 64.
 
3666
 
 
3667
`-s NUMBER'
 
3668
`--salt=NUMBER'
 
3669
     Length of the salt.  Defaults to 64.
 
3670
 
 
3671
 
 
3672
File: grub.info,  Node: Obtaining and Building GRUB,  Next: Reporting bugs,  Prev: Invoking grub-mkpasswd-pbkdf2,  Up: Top
 
3673
 
 
3674
Appendix A How to obtain and build GRUB
 
3675
***************************************
 
3676
 
 
3677
     *Caution:* GRUB requires binutils-2.9.1.0.23 or later because the
 
3678
     GNU assembler has been changed so that it can produce real 16bits
 
3679
     machine code between 2.9.1 and 2.9.1.0.x. See
 
3680
     `http://sources.redhat.com/binutils/', to obtain information on
 
3681
     how to get the latest version.
 
3682
 
 
3683
   GRUB is available from the GNU alpha archive site
 
3684
`ftp://alpha.gnu.org/gnu/grub' or any of its mirrors. The file will be
 
3685
named grub-version.tar.gz. The current version is 1.99~20101123-1, so
 
3686
the file you should grab is:
 
3687
 
 
3688
   `ftp://alpha.gnu.org/gnu/grub/grub-1.99~20101123-1.tar.gz'
 
3689
 
 
3690
   To unbundle GRUB use the instruction:
 
3691
 
 
3692
     zcat grub-1.99~20101123-1.tar.gz | tar xvf -
 
3693
 
 
3694
   which will create a directory called `grub-1.99~20101123-1' with all
 
3695
the sources. You can look at the file `INSTALL' for detailed
 
3696
instructions on how to build and install GRUB, but you should be able to
 
3697
just do:
 
3698
 
 
3699
     cd grub-1.99~20101123-1
 
3700
     ./configure
 
3701
     make install
 
3702
 
 
3703
   Also, the latest version is available using Bazaar. See
 
3704
`http://www.gnu.org/software/grub/grub-download.en.html' for more
 
3705
information.
 
3706
 
 
3707
 
 
3708
File: grub.info,  Node: Reporting bugs,  Next: Future,  Prev: Obtaining and Building GRUB,  Up: Top
 
3709
 
 
3710
Appendix B Reporting bugs
 
3711
*************************
 
3712
 
 
3713
These are the guideline for how to report bugs. Take a look at this
 
3714
list below before you submit bugs:
 
3715
 
 
3716
  1. Before getting unsettled, read this manual through and through.
 
3717
     Also, see the GNU GRUB FAQ
 
3718
     (http://www.gnu.org/software/grub/grub-faq.html).
 
3719
 
 
3720
  2. Always mention the information on your GRUB. The version number
 
3721
     and the configuration are quite important. If you build it
 
3722
     yourself, write the options specified to the configure script and
 
3723
     your operating system, including the versions of gcc and binutils.
 
3724
 
 
3725
  3. If you have trouble with the installation, inform us of how you
 
3726
     installed GRUB. Don't omit error messages, if any. Just `GRUB hangs
 
3727
     up when it boots' is not enough.
 
3728
 
 
3729
     The information on your hardware is also essential. These are
 
3730
     especially important: the geometries and the partition tables of
 
3731
     your hard disk drives and your BIOS.
 
3732
 
 
3733
  4. If GRUB cannot boot your operating system, write down _everything_
 
3734
     you see on the screen. Don't paraphrase them, like `The foo OS
 
3735
     crashes with GRUB, even though it can boot with the bar boot
 
3736
     loader just fine'. Mention the commands you executed, the messages
 
3737
     printed by them, and information on your operating system
 
3738
     including the version number.
 
3739
 
 
3740
  5. Explain what you wanted to do. It is very useful to know your
 
3741
     purpose and your wish, and how GRUB didn't satisfy you.
 
3742
 
 
3743
  6. If you can investigate the problem yourself, please do. That will
 
3744
     give you and us much more information on the problem. Attaching a
 
3745
     patch is even better.
 
3746
 
 
3747
     When you attach a patch, make the patch in unified diff format, and
 
3748
     write ChangeLog entries. But, even when you make a patch, don't
 
3749
     forget to explain the problem, so that we can understand what your
 
3750
     patch is for.
 
3751
 
 
3752
  7. Write down anything that you think might be related. Please
 
3753
     understand that we often need to reproduce the same problem you
 
3754
     encounterred in our environment. So your information should be
 
3755
     sufficient for us to do the same thing--Don't forget that we
 
3756
     cannot see your computer directly. If you are not sure whether to
 
3757
     state a fact or leave it out, state it!  Reporting too many things
 
3758
     is much better than omitting something important.
 
3759
 
 
3760
   If you follow the guideline above, submit a report to the Bug
 
3761
Tracking System (http://savannah.gnu.org/bugs/?group=grub).
 
3762
Alternatively, you can submit a report via electronic mail to
 
3763
<bug-grub@gnu.org>, but we strongly recommend that you use the Bug
 
3764
Tracking System, because e-mail can be passed over easily.
 
3765
 
 
3766
   Once we get your report, we will try to fix the bugs.
 
3767
 
 
3768
 
 
3769
File: grub.info,  Node: Future,  Next: Internals,  Prev: Reporting bugs,  Up: Top
 
3770
 
 
3771
Appendix C Where GRUB will go
 
3772
*****************************
 
3773
 
 
3774
We started the next generation of GRUB, GRUB 2. GRUB 2 includes
 
3775
internationalization, dynamic module loading, real memory management,
 
3776
multiple architecture support, a scripting language, and many other
 
3777
nice features. If you are interested in the development of GRUB 2, take
 
3778
a look at the homepage (http://www.gnu.org/software/grub/grub.html).
 
3779
 
 
3780
 
 
3781
File: grub.info,  Node: Internals,  Next: Copying This Manual,  Prev: Future,  Up: Top
 
3782
 
 
3783
Appendix D Hacking GRUB
 
3784
***********************
 
3785
 
 
3786
* Menu:
 
3787
 
 
3788
* Getting the source code::
 
3789
* Finding your way around::
 
3790
 
 
3791
 
 
3792
File: grub.info,  Node: Getting the source code,  Next: Finding your way around,  Up: Internals
 
3793
 
 
3794
D.1 Getting the source code
 
3795
===========================
 
3796
 
 
3797
GRUB is maintained using the Bazaar revision control system
 
3798
(http://bazaar-vcs.org/).  To fetch the primary development branch:
 
3799
 
 
3800
     bzr get http://bzr.savannah.gnu.org/r/grub/trunk/grub
 
3801
 
 
3802
   The GRUB developers maintain several other branches with work in
 
3803
progress.  Of these, the most interesting is the experimental branch,
 
3804
which is a staging area for new code which we expect to eventually
 
3805
merge into trunk but which is not yet ready:
 
3806
 
 
3807
     bzr get http://bzr.savannah.gnu.org/r/grub/branches/experimental
 
3808
 
 
3809
   Once you have used `bzr get' to fetch an initial copy of a branch,
 
3810
you can use `bzr pull' to keep it up to date.  If you have modified your
 
3811
local version, you may need to resolve conflicts when pulling.
 
3812
 
 
3813
 
 
3814
File: grub.info,  Node: Finding your way around,  Prev: Getting the source code,  Up: Internals
 
3815
 
 
3816
D.2 Finding your way around
 
3817
===========================
 
3818
 
 
3819
Here is a brief map of the GRUB code base.
 
3820
 
 
3821
   GRUB uses Autoconf, but not (yet) Automake.  The top-level build
 
3822
rules are in `configure.ac', `Makefile.in', and `conf/*.rmk'.  Each
 
3823
`conf/*.rmk' file represents a particular target configuration, and is
 
3824
processed into GNU Make rules by `genmk.rb' (which you only need to
 
3825
look at if you are extending the build system).  If you are adding a new
 
3826
module which follows an existing pattern, such as a new command or a new
 
3827
filesystem implementation, it is usually easiest to grep `conf/*.rmk'
 
3828
for an existing example of that pattern to find out where it should be
 
3829
added.
 
3830
 
 
3831
   Low-level boot code, such as the MBR implementation on PC BIOS
 
3832
systems, is in the `boot/' directory.
 
3833
 
 
3834
   The GRUB kernel is in `kern/'.  This contains core facilities such as
 
3835
the device, disk, and file frameworks, environment variable handling,
 
3836
list processing, and so on.  The kernel should contain enough to get up
 
3837
to a rescue prompt.  Header files for kernel facilities, among others,
 
3838
are in `include/'.
 
3839
 
 
3840
   Terminal implementations are in `term/'.
 
3841
 
 
3842
   Disk access code is spread across `disk/' (for accessing the disk
 
3843
devices themselves), `partmap/' (for interpreting partition table
 
3844
data), and `fs/' (for accessing filesystems).  Note that, with the odd
 
3845
specialised exception, GRUB only contains code to _read_ from
 
3846
filesystems and tries to avoid containing any code to _write_ to
 
3847
filesystems; this lets us confidently assure users that GRUB cannot be
 
3848
responsible for filesystem corruption.
 
3849
 
 
3850
   PCI and USB bus handling is in `bus/'.
 
3851
 
 
3852
   Video handling code is in `video/'.  The graphical menu system uses
 
3853
this heavily, but is in a separate directory, `gfxmenu/'.
 
3854
 
 
3855
   Most commands are implemented by files in `commands/', with the
 
3856
following exceptions:
 
3857
 
 
3858
   * A few core commands live in `kern/corecmd.c'.
 
3859
 
 
3860
   * Commands related to normal mode live under `normal/'.
 
3861
 
 
3862
   * Commands that load and boot kernels live under `loader/'.
 
3863
 
 
3864
   * The `loopback' command is really a disk device, and so lives in
 
3865
     `disk/loopback.c'.
 
3866
 
 
3867
   * The `gettext' command lives under `gettext/'.
 
3868
 
 
3869
   * The `loadfont' and `lsfonts' commands live under `font/'.
 
3870
 
 
3871
   * The `serial', `terminfo', and `background_image' commands live
 
3872
     under `term/'.
 
3873
 
 
3874
   * The `efiemu_*' commands live under `efiemu/'.
 
3875
 
 
3876
   There are a few other special-purpose exceptions; grep for them if
 
3877
they matter to you.
 
3878
 
 
3879
 
 
3880
File: grub.info,  Node: Copying This Manual,  Next: Index,  Prev: Internals,  Up: Top
 
3881
 
 
3882
Appendix E Copying This Manual
 
3883
******************************
 
3884
 
 
3885
* Menu:
 
3886
 
 
3887
* GNU Free Documentation License::  License for copying this manual.
 
3888
 
 
3889
 
 
3890
File: grub.info,  Node: GNU Free Documentation License,  Up: Copying This Manual
 
3891
 
 
3892
E.1 GNU Free Documentation License
 
3893
==================================
 
3894
 
 
3895
                      Version 1.2, November 2002
 
3896
 
 
3897
     Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
 
3898
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 
3899
 
 
3900
     Everyone is permitted to copy and distribute verbatim copies
 
3901
     of this license document, but changing it is not allowed.
 
3902
 
 
3903
  0. PREAMBLE
 
3904
 
 
3905
     The purpose of this License is to make a manual, textbook, or other
 
3906
     functional and useful document "free" in the sense of freedom: to
 
3907
     assure everyone the effective freedom to copy and redistribute it,
 
3908
     with or without modifying it, either commercially or
 
3909
     noncommercially.  Secondarily, this License preserves for the
 
3910
     author and publisher a way to get credit for their work, while not
 
3911
     being considered responsible for modifications made by others.
 
3912
 
 
3913
     This License is a kind of "copyleft", which means that derivative
 
3914
     works of the document must themselves be free in the same sense.
 
3915
     It complements the GNU General Public License, which is a copyleft
 
3916
     license designed for free software.
 
3917
 
 
3918
     We have designed this License in order to use it for manuals for
 
3919
     free software, because free software needs free documentation: a
 
3920
     free program should come with manuals providing the same freedoms
 
3921
     that the software does.  But this License is not limited to
 
3922
     software manuals; it can be used for any textual work, regardless
 
3923
     of subject matter or whether it is published as a printed book.
 
3924
     We recommend this License principally for works whose purpose is
 
3925
     instruction or reference.
 
3926
 
 
3927
  1. APPLICABILITY AND DEFINITIONS
 
3928
 
 
3929
     This License applies to any manual or other work, in any medium,
 
3930
     that contains a notice placed by the copyright holder saying it
 
3931
     can be distributed under the terms of this License.  Such a notice
 
3932
     grants a world-wide, royalty-free license, unlimited in duration,
 
3933
     to use that work under the conditions stated herein.  The
 
3934
     "Document", below, refers to any such manual or work.  Any member
 
3935
     of the public is a licensee, and is addressed as "you".  You
 
3936
     accept the license if you copy, modify or distribute the work in a
 
3937
     way requiring permission under copyright law.
 
3938
 
 
3939
     A "Modified Version" of the Document means any work containing the
 
3940
     Document or a portion of it, either copied verbatim, or with
 
3941
     modifications and/or translated into another language.
 
3942
 
 
3943
     A "Secondary Section" is a named appendix or a front-matter section
 
3944
     of the Document that deals exclusively with the relationship of the
 
3945
     publishers or authors of the Document to the Document's overall
 
3946
     subject (or to related matters) and contains nothing that could
 
3947
     fall directly within that overall subject.  (Thus, if the Document
 
3948
     is in part a textbook of mathematics, a Secondary Section may not
 
3949
     explain any mathematics.)  The relationship could be a matter of
 
3950
     historical connection with the subject or with related matters, or
 
3951
     of legal, commercial, philosophical, ethical or political position
 
3952
     regarding them.
 
3953
 
 
3954
     The "Invariant Sections" are certain Secondary Sections whose
 
3955
     titles are designated, as being those of Invariant Sections, in
 
3956
     the notice that says that the Document is released under this
 
3957
     License.  If a section does not fit the above definition of
 
3958
     Secondary then it is not allowed to be designated as Invariant.
 
3959
     The Document may contain zero Invariant Sections.  If the Document
 
3960
     does not identify any Invariant Sections then there are none.
 
3961
 
 
3962
     The "Cover Texts" are certain short passages of text that are
 
3963
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
 
3964
     that says that the Document is released under this License.  A
 
3965
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
 
3966
     be at most 25 words.
 
3967
 
 
3968
     A "Transparent" copy of the Document means a machine-readable copy,
 
3969
     represented in a format whose specification is available to the
 
3970
     general public, that is suitable for revising the document
 
3971
     straightforwardly with generic text editors or (for images
 
3972
     composed of pixels) generic paint programs or (for drawings) some
 
3973
     widely available drawing editor, and that is suitable for input to
 
3974
     text formatters or for automatic translation to a variety of
 
3975
     formats suitable for input to text formatters.  A copy made in an
 
3976
     otherwise Transparent file format whose markup, or absence of
 
3977
     markup, has been arranged to thwart or discourage subsequent
 
3978
     modification by readers is not Transparent.  An image format is
 
3979
     not Transparent if used for any substantial amount of text.  A
 
3980
     copy that is not "Transparent" is called "Opaque".
 
3981
 
 
3982
     Examples of suitable formats for Transparent copies include plain
 
3983
     ASCII without markup, Texinfo input format, LaTeX input format,
 
3984
     SGML or XML using a publicly available DTD, and
 
3985
     standard-conforming simple HTML, PostScript or PDF designed for
 
3986
     human modification.  Examples of transparent image formats include
 
3987
     PNG, XCF and JPG.  Opaque formats include proprietary formats that
 
3988
     can be read and edited only by proprietary word processors, SGML or
 
3989
     XML for which the DTD and/or processing tools are not generally
 
3990
     available, and the machine-generated HTML, PostScript or PDF
 
3991
     produced by some word processors for output purposes only.
 
3992
 
 
3993
     The "Title Page" means, for a printed book, the title page itself,
 
3994
     plus such following pages as are needed to hold, legibly, the
 
3995
     material this License requires to appear in the title page.  For
 
3996
     works in formats which do not have any title page as such, "Title
 
3997
     Page" means the text near the most prominent appearance of the
 
3998
     work's title, preceding the beginning of the body of the text.
 
3999
 
 
4000
     A section "Entitled XYZ" means a named subunit of the Document
 
4001
     whose title either is precisely XYZ or contains XYZ in parentheses
 
4002
     following text that translates XYZ in another language.  (Here XYZ
 
4003
     stands for a specific section name mentioned below, such as
 
4004
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
 
4005
     To "Preserve the Title" of such a section when you modify the
 
4006
     Document means that it remains a section "Entitled XYZ" according
 
4007
     to this definition.
 
4008
 
 
4009
     The Document may include Warranty Disclaimers next to the notice
 
4010
     which states that this License applies to the Document.  These
 
4011
     Warranty Disclaimers are considered to be included by reference in
 
4012
     this License, but only as regards disclaiming warranties: any other
 
4013
     implication that these Warranty Disclaimers may have is void and
 
4014
     has no effect on the meaning of this License.
 
4015
 
 
4016
  2. VERBATIM COPYING
 
4017
 
 
4018
     You may copy and distribute the Document in any medium, either
 
4019
     commercially or noncommercially, provided that this License, the
 
4020
     copyright notices, and the license notice saying this License
 
4021
     applies to the Document are reproduced in all copies, and that you
 
4022
     add no other conditions whatsoever to those of this License.  You
 
4023
     may not use technical measures to obstruct or control the reading
 
4024
     or further copying of the copies you make or distribute.  However,
 
4025
     you may accept compensation in exchange for copies.  If you
 
4026
     distribute a large enough number of copies you must also follow
 
4027
     the conditions in section 3.
 
4028
 
 
4029
     You may also lend copies, under the same conditions stated above,
 
4030
     and you may publicly display copies.
 
4031
 
 
4032
  3. COPYING IN QUANTITY
 
4033
 
 
4034
     If you publish printed copies (or copies in media that commonly
 
4035
     have printed covers) of the Document, numbering more than 100, and
 
4036
     the Document's license notice requires Cover Texts, you must
 
4037
     enclose the copies in covers that carry, clearly and legibly, all
 
4038
     these Cover Texts: Front-Cover Texts on the front cover, and
 
4039
     Back-Cover Texts on the back cover.  Both covers must also clearly
 
4040
     and legibly identify you as the publisher of these copies.  The
 
4041
     front cover must present the full title with all words of the
 
4042
     title equally prominent and visible.  You may add other material
 
4043
     on the covers in addition.  Copying with changes limited to the
 
4044
     covers, as long as they preserve the title of the Document and
 
4045
     satisfy these conditions, can be treated as verbatim copying in
 
4046
     other respects.
 
4047
 
 
4048
     If the required texts for either cover are too voluminous to fit
 
4049
     legibly, you should put the first ones listed (as many as fit
 
4050
     reasonably) on the actual cover, and continue the rest onto
 
4051
     adjacent pages.
 
4052
 
 
4053
     If you publish or distribute Opaque copies of the Document
 
4054
     numbering more than 100, you must either include a
 
4055
     machine-readable Transparent copy along with each Opaque copy, or
 
4056
     state in or with each Opaque copy a computer-network location from
 
4057
     which the general network-using public has access to download
 
4058
     using public-standard network protocols a complete Transparent
 
4059
     copy of the Document, free of added material.  If you use the
 
4060
     latter option, you must take reasonably prudent steps, when you
 
4061
     begin distribution of Opaque copies in quantity, to ensure that
 
4062
     this Transparent copy will remain thus accessible at the stated
 
4063
     location until at least one year after the last time you
 
4064
     distribute an Opaque copy (directly or through your agents or
 
4065
     retailers) of that edition to the public.
 
4066
 
 
4067
     It is requested, but not required, that you contact the authors of
 
4068
     the Document well before redistributing any large number of
 
4069
     copies, to give them a chance to provide you with an updated
 
4070
     version of the Document.
 
4071
 
 
4072
  4. MODIFICATIONS
 
4073
 
 
4074
     You may copy and distribute a Modified Version of the Document
 
4075
     under the conditions of sections 2 and 3 above, provided that you
 
4076
     release the Modified Version under precisely this License, with
 
4077
     the Modified Version filling the role of the Document, thus
 
4078
     licensing distribution and modification of the Modified Version to
 
4079
     whoever possesses a copy of it.  In addition, you must do these
 
4080
     things in the Modified Version:
 
4081
 
 
4082
       A. Use in the Title Page (and on the covers, if any) a title
 
4083
          distinct from that of the Document, and from those of
 
4084
          previous versions (which should, if there were any, be listed
 
4085
          in the History section of the Document).  You may use the
 
4086
          same title as a previous version if the original publisher of
 
4087
          that version gives permission.
 
4088
 
 
4089
       B. List on the Title Page, as authors, one or more persons or
 
4090
          entities responsible for authorship of the modifications in
 
4091
          the Modified Version, together with at least five of the
 
4092
          principal authors of the Document (all of its principal
 
4093
          authors, if it has fewer than five), unless they release you
 
4094
          from this requirement.
 
4095
 
 
4096
       C. State on the Title page the name of the publisher of the
 
4097
          Modified Version, as the publisher.
 
4098
 
 
4099
       D. Preserve all the copyright notices of the Document.
 
4100
 
 
4101
       E. Add an appropriate copyright notice for your modifications
 
4102
          adjacent to the other copyright notices.
 
4103
 
 
4104
       F. Include, immediately after the copyright notices, a license
 
4105
          notice giving the public permission to use the Modified
 
4106
          Version under the terms of this License, in the form shown in
 
4107
          the Addendum below.
 
4108
 
 
4109
       G. Preserve in that license notice the full lists of Invariant
 
4110
          Sections and required Cover Texts given in the Document's
 
4111
          license notice.
 
4112
 
 
4113
       H. Include an unaltered copy of this License.
 
4114
 
 
4115
       I. Preserve the section Entitled "History", Preserve its Title,
 
4116
          and add to it an item stating at least the title, year, new
 
4117
          authors, and publisher of the Modified Version as given on
 
4118
          the Title Page.  If there is no section Entitled "History" in
 
4119
          the Document, create one stating the title, year, authors,
 
4120
          and publisher of the Document as given on its Title Page,
 
4121
          then add an item describing the Modified Version as stated in
 
4122
          the previous sentence.
 
4123
 
 
4124
       J. Preserve the network location, if any, given in the Document
 
4125
          for public access to a Transparent copy of the Document, and
 
4126
          likewise the network locations given in the Document for
 
4127
          previous versions it was based on.  These may be placed in
 
4128
          the "History" section.  You may omit a network location for a
 
4129
          work that was published at least four years before the
 
4130
          Document itself, or if the original publisher of the version
 
4131
          it refers to gives permission.
 
4132
 
 
4133
       K. For any section Entitled "Acknowledgements" or "Dedications",
 
4134
          Preserve the Title of the section, and preserve in the
 
4135
          section all the substance and tone of each of the contributor
 
4136
          acknowledgements and/or dedications given therein.
 
4137
 
 
4138
       L. Preserve all the Invariant Sections of the Document,
 
4139
          unaltered in their text and in their titles.  Section numbers
 
4140
          or the equivalent are not considered part of the section
 
4141
          titles.
 
4142
 
 
4143
       M. Delete any section Entitled "Endorsements".  Such a section
 
4144
          may not be included in the Modified Version.
 
4145
 
 
4146
       N. Do not retitle any existing section to be Entitled
 
4147
          "Endorsements" or to conflict in title with any Invariant
 
4148
          Section.
 
4149
 
 
4150
       O. Preserve any Warranty Disclaimers.
 
4151
 
 
4152
     If the Modified Version includes new front-matter sections or
 
4153
     appendices that qualify as Secondary Sections and contain no
 
4154
     material copied from the Document, you may at your option
 
4155
     designate some or all of these sections as invariant.  To do this,
 
4156
     add their titles to the list of Invariant Sections in the Modified
 
4157
     Version's license notice.  These titles must be distinct from any
 
4158
     other section titles.
 
4159
 
 
4160
     You may add a section Entitled "Endorsements", provided it contains
 
4161
     nothing but endorsements of your Modified Version by various
 
4162
     parties--for example, statements of peer review or that the text
 
4163
     has been approved by an organization as the authoritative
 
4164
     definition of a standard.
 
4165
 
 
4166
     You may add a passage of up to five words as a Front-Cover Text,
 
4167
     and a passage of up to 25 words as a Back-Cover Text, to the end
 
4168
     of the list of Cover Texts in the Modified Version.  Only one
 
4169
     passage of Front-Cover Text and one of Back-Cover Text may be
 
4170
     added by (or through arrangements made by) any one entity.  If the
 
4171
     Document already includes a cover text for the same cover,
 
4172
     previously added by you or by arrangement made by the same entity
 
4173
     you are acting on behalf of, you may not add another; but you may
 
4174
     replace the old one, on explicit permission from the previous
 
4175
     publisher that added the old one.
 
4176
 
 
4177
     The author(s) and publisher(s) of the Document do not by this
 
4178
     License give permission to use their names for publicity for or to
 
4179
     assert or imply endorsement of any Modified Version.
 
4180
 
 
4181
  5. COMBINING DOCUMENTS
 
4182
 
 
4183
     You may combine the Document with other documents released under
 
4184
     this License, under the terms defined in section 4 above for
 
4185
     modified versions, provided that you include in the combination
 
4186
     all of the Invariant Sections of all of the original documents,
 
4187
     unmodified, and list them all as Invariant Sections of your
 
4188
     combined work in its license notice, and that you preserve all
 
4189
     their Warranty Disclaimers.
 
4190
 
 
4191
     The combined work need only contain one copy of this License, and
 
4192
     multiple identical Invariant Sections may be replaced with a single
 
4193
     copy.  If there are multiple Invariant Sections with the same name
 
4194
     but different contents, make the title of each such section unique
 
4195
     by adding at the end of it, in parentheses, the name of the
 
4196
     original author or publisher of that section if known, or else a
 
4197
     unique number.  Make the same adjustment to the section titles in
 
4198
     the list of Invariant Sections in the license notice of the
 
4199
     combined work.
 
4200
 
 
4201
     In the combination, you must combine any sections Entitled
 
4202
     "History" in the various original documents, forming one section
 
4203
     Entitled "History"; likewise combine any sections Entitled
 
4204
     "Acknowledgements", and any sections Entitled "Dedications".  You
 
4205
     must delete all sections Entitled "Endorsements."
 
4206
 
 
4207
  6. COLLECTIONS OF DOCUMENTS
 
4208
 
 
4209
     You may make a collection consisting of the Document and other
 
4210
     documents released under this License, and replace the individual
 
4211
     copies of this License in the various documents with a single copy
 
4212
     that is included in the collection, provided that you follow the
 
4213
     rules of this License for verbatim copying of each of the
 
4214
     documents in all other respects.
 
4215
 
 
4216
     You may extract a single document from such a collection, and
 
4217
     distribute it individually under this License, provided you insert
 
4218
     a copy of this License into the extracted document, and follow
 
4219
     this License in all other respects regarding verbatim copying of
 
4220
     that document.
 
4221
 
 
4222
  7. AGGREGATION WITH INDEPENDENT WORKS
 
4223
 
 
4224
     A compilation of the Document or its derivatives with other
 
4225
     separate and independent documents or works, in or on a volume of
 
4226
     a storage or distribution medium, is called an "aggregate" if the
 
4227
     copyright resulting from the compilation is not used to limit the
 
4228
     legal rights of the compilation's users beyond what the individual
 
4229
     works permit.  When the Document is included in an aggregate, this
 
4230
     License does not apply to the other works in the aggregate which
 
4231
     are not themselves derivative works of the Document.
 
4232
 
 
4233
     If the Cover Text requirement of section 3 is applicable to these
 
4234
     copies of the Document, then if the Document is less than one half
 
4235
     of the entire aggregate, the Document's Cover Texts may be placed
 
4236
     on covers that bracket the Document within the aggregate, or the
 
4237
     electronic equivalent of covers if the Document is in electronic
 
4238
     form.  Otherwise they must appear on printed covers that bracket
 
4239
     the whole aggregate.
 
4240
 
 
4241
  8. TRANSLATION
 
4242
 
 
4243
     Translation is considered a kind of modification, so you may
 
4244
     distribute translations of the Document under the terms of section
 
4245
     4.  Replacing Invariant Sections with translations requires special
 
4246
     permission from their copyright holders, but you may include
 
4247
     translations of some or all Invariant Sections in addition to the
 
4248
     original versions of these Invariant Sections.  You may include a
 
4249
     translation of this License, and all the license notices in the
 
4250
     Document, and any Warranty Disclaimers, provided that you also
 
4251
     include the original English version of this License and the
 
4252
     original versions of those notices and disclaimers.  In case of a
 
4253
     disagreement between the translation and the original version of
 
4254
     this License or a notice or disclaimer, the original version will
 
4255
     prevail.
 
4256
 
 
4257
     If a section in the Document is Entitled "Acknowledgements",
 
4258
     "Dedications", or "History", the requirement (section 4) to
 
4259
     Preserve its Title (section 1) will typically require changing the
 
4260
     actual title.
 
4261
 
 
4262
  9. TERMINATION
 
4263
 
 
4264
     You may not copy, modify, sublicense, or distribute the Document
 
4265
     except as expressly provided for under this License.  Any other
 
4266
     attempt to copy, modify, sublicense or distribute the Document is
 
4267
     void, and will automatically terminate your rights under this
 
4268
     License.  However, parties who have received copies, or rights,
 
4269
     from you under this License will not have their licenses
 
4270
     terminated so long as such parties remain in full compliance.
 
4271
 
 
4272
 10. FUTURE REVISIONS OF THIS LICENSE
 
4273
 
 
4274
     The Free Software Foundation may publish new, revised versions of
 
4275
     the GNU Free Documentation License from time to time.  Such new
 
4276
     versions will be similar in spirit to the present version, but may
 
4277
     differ in detail to address new problems or concerns.  See
 
4278
     `http://www.gnu.org/copyleft/'.
 
4279
 
 
4280
     Each version of the License is given a distinguishing version
 
4281
     number.  If the Document specifies that a particular numbered
 
4282
     version of this License "or any later version" applies to it, you
 
4283
     have the option of following the terms and conditions either of
 
4284
     that specified version or of any later version that has been
 
4285
     published (not as a draft) by the Free Software Foundation.  If
 
4286
     the Document does not specify a version number of this License,
 
4287
     you may choose any version ever published (not as a draft) by the
 
4288
     Free Software Foundation.
 
4289
 
 
4290
E.1.1 ADDENDUM: How to use this License for your documents
 
4291
----------------------------------------------------------
 
4292
 
 
4293
To use this License in a document you have written, include a copy of
 
4294
the License in the document and put the following copyright and license
 
4295
notices just after the title page:
 
4296
 
 
4297
       Copyright (C)  YEAR  YOUR NAME.
 
4298
       Permission is granted to copy, distribute and/or modify this document
 
4299
       under the terms of the GNU Free Documentation License, Version 1.2
 
4300
       or any later version published by the Free Software Foundation;
 
4301
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
 
4302
       Texts.  A copy of the license is included in the section entitled ``GNU
 
4303
       Free Documentation License''.
 
4304
 
 
4305
   If you have Invariant Sections, Front-Cover Texts and Back-Cover
 
4306
Texts, replace the "with...Texts." line with this:
 
4307
 
 
4308
         with the Invariant Sections being LIST THEIR TITLES, with
 
4309
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
 
4310
         being LIST.
 
4311
 
 
4312
   If you have Invariant Sections without Cover Texts, or some other
 
4313
combination of the three, merge those two alternatives to suit the
 
4314
situation.
 
4315
 
 
4316
   If your document contains nontrivial examples of program code, we
 
4317
recommend releasing these examples in parallel under your choice of
 
4318
free software license, such as the GNU General Public License, to
 
4319
permit their use in free software.
 
4320
 
 
4321
 
 
4322
File: grub.info,  Node: Index,  Prev: Copying This Manual,  Up: Top
 
4323
 
 
4324
Index
 
4325
*****
 
4326
 
 
4327
[index]
 
4328
* Menu:
 
4329
 
 
4330
* acpi:                                  acpi.                 (line 11)
 
4331
* badram:                                badram.               (line  7)
 
4332
* blocklist:                             blocklist.            (line  7)
 
4333
* boot:                                  boot.                 (line  7)
 
4334
* cat:                                   cat.                  (line  7)
 
4335
* chainloader:                           chainloader.          (line  7)
 
4336
* cmp:                                   cmp.                  (line  7)
 
4337
* configfile:                            configfile.           (line  7)
 
4338
* cpuid:                                 cpuid.                (line  7)
 
4339
* crc:                                   crc.                  (line  7)
 
4340
* date:                                  date.                 (line  7)
 
4341
* drivemap:                              drivemap.             (line  7)
 
4342
* echo:                                  echo.                 (line  7)
 
4343
* export:                                export.               (line  7)
 
4344
* FDL, GNU Free Documentation License:   GNU Free Documentation License.
 
4345
                                                               (line  6)
 
4346
* gettext:                               gettext.              (line  7)
 
4347
* gptsync:                               gptsync.              (line  7)
 
4348
* halt:                                  halt.                 (line  7)
 
4349
* help:                                  help.                 (line  7)
 
4350
* initrd:                                initrd.               (line  7)
 
4351
* initrd16:                              initrd16.             (line  7)
 
4352
* insmod:                                insmod.               (line  7)
 
4353
* keystatus:                             keystatus.            (line  7)
 
4354
* linux:                                 linux.                (line  7)
 
4355
* linux16:                               linux16.              (line  7)
 
4356
* ls:                                    ls.                   (line  7)
 
4357
* menuentry:                             menuentry.            (line  8)
 
4358
* parttool:                              parttool.             (line  7)
 
4359
* password:                              password.             (line  7)
 
4360
* password_pbkdf2:                       password_pbkdf2.      (line  7)
 
4361
* play:                                  play.                 (line  7)
 
4362
* pxe_unload:                            pxe_unload.           (line  7)
 
4363
* reboot:                                reboot.               (line  7)
 
4364
* search:                                search.               (line  8)
 
4365
* sendkey:                               sendkey.              (line 12)
 
4366
* serial:                                serial.               (line  8)
 
4367
* set:                                   set.                  (line  7)
 
4368
* terminal_input:                        terminal_input.       (line  8)
 
4369
* terminal_output:                       terminal_output.      (line  8)
 
4370
* terminfo:                              terminfo.             (line  7)
 
4371
* unset:                                 unset.                (line  7)
 
4372
 
 
4373
 
 
4374
 
 
4375
Tag Table:
 
4376
Node: Top854
 
4377
Node: Introduction3131
 
4378
Node: Overview3575
 
4379
Node: Overview-Footnotes5559
 
4380
Ref: Overview-Footnote-15620
 
4381
Node: History5781
 
4382
Node: Changes from GRUB Legacy7869
 
4383
Node: Features10479
 
4384
Node: Features-Footnotes16429
 
4385
Ref: Features-Footnote-116490
 
4386
Node: Role of a boot loader16635
 
4387
Node: Role of a boot loader-Footnotes17973
 
4388
Ref: Role of a boot loader-Footnote-118060
 
4389
Node: Naming convention18139
 
4390
Node: Installation21014
 
4391
Node: Installing GRUB using grub-install22429
 
4392
Node: Making a GRUB bootable CD-ROM26075
 
4393
Node: Making a GRUB bootable CD-ROM-Footnotes28139
 
4394
Ref: Making a GRUB bootable CD-ROM-Footnote-128242
 
4395
Node: Device map28317
 
4396
Node: Booting30468
 
4397
Node: General boot methods30860
 
4398
Node: Loading an operating system directly31601
 
4399
Node: Chain-loading32332
 
4400
Node: OS-specific notes33303
 
4401
Node: GNU/Hurd33585
 
4402
Node: GNU/Linux34702
 
4403
Node: DOS/Windows36325
 
4404
Node: Configuration38098
 
4405
Node: Simple configuration38640
 
4406
Node: Shell-like scripting46968
 
4407
Node: Shell-like scripting-Footnotes54801
 
4408
Ref: Shell-like scripting-Footnote-154886
 
4409
Node: Embedded configuration55013
 
4410
Node: Theme file format57829
 
4411
Ref: Pixmap-styled progress bar59252
 
4412
Ref: Plain progress bar59264
 
4413
Ref: An example of the slices (in red) used for a terminal window. This drawing was created and sliced in Inkscape_62693
 
4414
Node: Network76915
 
4415
Node: Serial terminal79318
 
4416
Node: Vendor power-on keys81539
 
4417
Node: Images82500
 
4418
Node: Filesystem88577
 
4419
Node: Device syntax89264
 
4420
Node: File name syntax90756
 
4421
Node: Block list syntax91510
 
4422
Node: Interface92243
 
4423
Node: Command-line interface93062
 
4424
Node: Command-line interface-Footnotes95003
 
4425
Ref: Command-line interface-Footnote-195092
 
4426
Node: Menu interface95187
 
4427
Node: Menu entry editor96197
 
4428
Node: Commands96935
 
4429
Node: Menu-specific commands97662
 
4430
Node: menuentry98620
 
4431
Node: General commands99611
 
4432
Node: serial100107
 
4433
Node: terminal_input101152
 
4434
Node: terminal_output101818
 
4435
Node: terminfo102485
 
4436
Node: Command-line and menu entry commands103620
 
4437
Node: acpi106047
 
4438
Node: badram107086
 
4439
Node: blocklist108128
 
4440
Node: boot108362
 
4441
Node: cat108683
 
4442
Node: chainloader109318
 
4443
Node: cmp109940
 
4444
Node: configfile110491
 
4445
Node: cpuid110791
 
4446
Node: crc111256
 
4447
Node: date111446
 
4448
Node: drivemap111985
 
4449
Node: echo112788
 
4450
Node: export113725
 
4451
Node: gettext114037
 
4452
Node: gptsync114444
 
4453
Node: halt115389
 
4454
Node: help115715
 
4455
Node: initrd116178
 
4456
Node: initrd16116590
 
4457
Node: insmod117095
 
4458
Node: keystatus117317
 
4459
Node: linux117955
 
4460
Node: linux16118858
 
4461
Node: ls119566
 
4462
Node: parttool120112
 
4463
Node: password121608
 
4464
Node: password_pbkdf2121890
 
4465
Node: play122298
 
4466
Node: pxe_unload123050
 
4467
Node: reboot123331
 
4468
Node: search123520
 
4469
Node: sendkey124296
 
4470
Node: set130570
 
4471
Node: unset130869
 
4472
Node: uppermem131074
 
4473
Node: Security131275
 
4474
Node: Supported kernels133963
 
4475
Node: Troubleshooting141451
 
4476
Node: GRUB only offers a rescue shell141677
 
4477
Node: Invoking grub-install144532
 
4478
Node: Invoking grub-mkconfig145736
 
4479
Node: Invoking grub-mkpasswd-pbkdf2146373
 
4480
Node: Obtaining and Building GRUB147036
 
4481
Node: Reporting bugs148342
 
4482
Node: Future151146
 
4483
Node: Internals151636
 
4484
Node: Getting the source code151841
 
4485
Node: Finding your way around152715
 
4486
Node: Copying This Manual155266
 
4487
Node: GNU Free Documentation License155497
 
4488
Node: Index177905
 
4489
 
 
4490
End Tag Table