~ubuntu-branches/debian/stretch/grub2/stretch

« back to all changes in this revision

Viewing changes to docs/grub.texi

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-06-15 12:45:35 UTC
  • mto: (1.14.1 upstream) (17.3.18 experimental)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20100615124535-9vfbis4kzv0h5bgy
Tags: upstream-1.98+20100614
ImportĀ upstreamĀ versionĀ 1.98+20100614

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
* GRUB: (grub).                 The GRand Unified Bootloader
36
36
* grub-install: (grub)Invoking grub-install.    Install GRUB on your drive
37
37
* grub-mkconfig: (grub)Invoking grub-mkconfig.  Generate GRUB configuration
 
38
* grub-mkpasswd-pbkdf2: (grub)Invoking grub-mkpasswd-pbkdf2.
38
39
@end direntry
39
40
 
40
41
@setchapternewpage odd
84
85
* Filesystem::                  Filesystem syntax and semantics
85
86
* Interface::                   The menu and the command-line
86
87
* Commands::                    The list of available builtin commands
 
88
* Security::                    Authentication and authorisation
87
89
* Troubleshooting::             Error messages produced by GRUB
88
90
* Invoking grub-install::       How to use the GRUB installer
89
91
* Invoking grub-mkconfig::      Generate a GRUB configuration file
 
92
* Invoking grub-mkpasswd-pbkdf2::
 
93
                                Generate GRUB password hashes
90
94
* Obtaining and Building GRUB:: How to obtain and build GRUB
91
95
* Reporting bugs::              Where you should send a bug report
92
96
* Future::                      Some future plans on GRUB
170
174
sources available via anonymous CVS. @xref{Obtaining and Building
171
175
GRUB}, for more information.
172
176
 
 
177
Over the next few years, GRUB was extended to meet many needs, but it
 
178
quickly became clear that its design was not keeping up with the extensions
 
179
being made to it, and we reached the point where it was very difficult to
 
180
make any further changes without breaking existing features.  Around 2002,
 
181
Yoshinori K. Okuji started work on PUPA (Preliminary Universal Programming
 
182
Architecture for GNU GRUB), aiming to rewrite the core of GRUB to make it
 
183
cleaner, safer, more robust, and more powerful.  PUPA was eventually renamed
 
184
to GRUB 2, and the original version of GRUB was renamed to GRUB Legacy.
 
185
Small amounts of maintenance continued to be done on GRUB Legacy, but the
 
186
last release (0.97) was made in 2005 and at the time of writing it seems
 
187
unlikely that there will be another.
 
188
 
 
189
By around 2007, GNU/Linux distributions started to use GRUB 2 to limited
 
190
extents, and by the end of 2009 multiple major distributions were installing
 
191
it by default.
 
192
 
173
193
 
174
194
@node Features
175
195
@section GRUB features
386
406
partition.
387
407
 
388
408
Of course, to actually access the disks or partitions with GRUB, you
389
 
need to use the device specification in a command, like @samp{root
390
 
(fd0)} or @samp{unhide (hd0,3)}. To help you find out which number
391
 
specifies a partition you want, the GRUB command-line
 
409
need to use the device specification in a command, like @samp{set
 
410
root=(fd0)} or @samp{parttool (hd0,3) hidden-}. To help you find out
 
411
which number specifies a partition you want, the GRUB command-line
392
412
(@pxref{Command-line interface}) options have argument
393
413
completion. This means that, for example, you only need to type
394
414
 
395
415
@example
396
 
root (
 
416
set root=(
397
417
@end example
398
418
 
399
419
followed by a @key{TAB}, and GRUB will display the list of drives,
966
986
@section Writing full configuration files directly
967
987
 
968
988
 
 
989
@node Network
 
990
@chapter Booting GRUB from the network
 
991
 
 
992
The following instructions only work on PC BIOS systems where the Preboot
 
993
eXecution Environment (PXE) is available.
 
994
 
 
995
To generate a PXE boot image, run:
 
996
 
 
997
@example
 
998
@group
 
999
grub-mkimage --format=i386-pc --output=core.img --prefix='(pxe)/boot/grub' pxe pxecmd
 
1000
cat /boot/grub/pxeboot.img core.img >grub.pxe
 
1001
@end group
 
1002
@end example
 
1003
 
 
1004
Copy @file{grub.pxe}, @file{/boot/grub/*.mod}, and @file{/boot/grub/*.lst}
 
1005
to the PXE (TFTP) server, ensuring that @file{*.mod} and @file{*.lst} are
 
1006
accessible via the @file{/boot/grub/} path from the TFTP server root.  Set
 
1007
the DHCP server configuration to offer @file{grub.pxe} as the boot file (the
 
1008
@samp{filename} option in ISC dhcpd).
 
1009
 
 
1010
After GRUB has started, files on the TFTP server will be accessible via the
 
1011
@samp{(pxe)} device.
 
1012
 
 
1013
The server and gateway IP address can be controlled by changing the
 
1014
@samp{(pxe)} device name to @samp{(pxe:@var{server-ip})} or
 
1015
@samp{(pxe:@var{server-ip}:@var{gateway-ip})}.  Note that this should be
 
1016
changed both in the prefix and in any references to the device name in the
 
1017
configuration file.
 
1018
 
 
1019
GRUB provides several environment variables which may be used to inspect or
 
1020
change the behaviour of the PXE device:
 
1021
 
 
1022
@table @samp
 
1023
@item net_pxe_ip
 
1024
The IP address of this machine.  Read-only.
 
1025
 
 
1026
@item net_pxe_mac
 
1027
The network interface's MAC address.  Read-only.
 
1028
 
 
1029
@item net_pxe_hostname
 
1030
The client host name provided by DHCP.  Read-only.
 
1031
 
 
1032
@item net_pxe_domain
 
1033
The client domain name provided by DHCP.  Read-only.
 
1034
 
 
1035
@item net_pxe_rootpath
 
1036
The path to the client's root disk provided by DHCP.  Read-only.
 
1037
 
 
1038
@item net_pxe_extensionspath
 
1039
The path to additional DHCP vendor extensions provided by DHCP.  Read-only.
 
1040
 
 
1041
@item net_pxe_boot_file
 
1042
The boot file name provided by DHCP.  Read-only.
 
1043
 
 
1044
@item net_pxe_dhcp_server_name
 
1045
The name of the DHCP server responsible for these boot parameters.
 
1046
Read-only.
 
1047
 
 
1048
@item net_pxe_blksize
 
1049
The PXE transfer block size.  Read-write, defaults to 512.
 
1050
 
 
1051
@item pxe_default_server
 
1052
The default PXE server.  Read-write, although setting this is only useful
 
1053
before opening a PXE device.
 
1054
 
 
1055
@item pxe_default_gateway
 
1056
The default gateway to use when contacting the PXE server.  Read-write,
 
1057
although setting this is only useful before opening a PXE device.
 
1058
@end table
 
1059
 
 
1060
 
969
1061
@node Serial terminal
970
1062
@chapter Using GRUB via a serial line
971
1063
 
1002
1094
command accepts many other options, so please refer to @ref{serial},
1003
1095
for more details.
1004
1096
 
1005
 
The command @command{terminal} (@pxref{terminal}) chooses which type of
 
1097
The commands @command{terminal_input} (@pxref{terminal_input}) and
 
1098
@command{terminal_output} (@pxref{terminal_output} choose which type of
1006
1099
terminal you want to use. In the case above, the terminal will be a
1007
1100
serial terminal, but you can also pass @code{console} to the command,
1008
1101
as @samp{terminal serial console}. In this case, a terminal in which
1030
1123
@table @key
1031
1124
@item Dell XPS M1530
1032
1125
85:3
 
1126
@item Asus EeePC 1005PE 
 
1127
84:1 (unconfirmed)
1033
1128
@end table
1034
1129
 
1035
1130
To take full advantage of this function install GRUB into MBR.
1041
1136
accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
1042
1137
between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
1043
1138
device is equivalent to which OS device. Normally, that will be clear if
1044
 
you see the files in a device or use the command @command{find}
1045
 
(@pxref{find}).
 
1139
you see the files in a device or use the command @command{search}
 
1140
(@pxref{search}).
1046
1141
 
1047
1142
@menu
1048
1143
* Device syntax::               How to specify devices
1090
1185
represents using the first partition of the disk (or the boot sector
1091
1186
of the partition when installing GRUB).
1092
1187
 
1093
 
If you enabled the network support, the special drive, @samp{(nd)}, is
 
1188
If you enabled the network support, the special drive @samp{(pxe)} is
1094
1189
also available. Before using the network drive, you must initialize the
1095
1190
network. @xref{Network}, for more information.
1096
1191
 
1110
1205
@file{/boot/grub/grub.cfg} in the first partition of the first hard
1111
1206
disk. If you omit the device name in an absolute file name, GRUB uses
1112
1207
GRUB's @dfn{root device} implicitly. So if you set the root device to,
1113
 
say, @samp{(hd1,1)} by the command @command{root} (@pxref{root}), then
1114
 
@code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}.
 
1208
say, @samp{(hd1,1)} by the command @samp{set root=(hd1,1)} (@pxref{set}),
 
1209
then @code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}.
1115
1210
 
1116
1211
 
1117
1212
@node Block list syntax
1283
1378
of them can be entered on the command-line and can be used either
1284
1379
anywhere in the menu or specifically in the menu entries.
1285
1380
 
 
1381
In rescue mode, only the @command{insmod} (@pxref{insmod}), @command{ls}
 
1382
(@pxref{ls}), @command{set} (@pxref{set}), and @command{unset}
 
1383
(@pxref{unset}) commands are normally available.
 
1384
 
1286
1385
@menu
1287
1386
* Menu-specific commands::
1288
1387
* General commands::
1345
1444
 
1346
1445
@menu
1347
1446
* serial::                      Set up a serial device
 
1447
* terminal_input::              Manage input terminals
 
1448
* terminal_output::             Manage output terminals
1348
1449
* terminfo::                    Define terminal type
1349
1450
@end menu
1350
1451
 
1364
1465
@samp{even} and defaults to @samp{no}.
1365
1466
 
1366
1467
The serial port is not used as a communication channel unless the
1367
 
@command{terminal} command is used (@pxref{terminal}).
 
1468
@command{terminal_input} or @command{terminal_output} command is used
 
1469
(@pxref{terminal_input}, @pxref{terminal_output}).
1368
1470
 
1369
1471
This command is only available if GRUB is compiled with serial
1370
1472
support. See also @ref{Serial terminal}.
1371
1473
@end deffn
1372
1474
 
1373
1475
 
 
1476
@node terminal_input
 
1477
@subsection terminal_input
 
1478
 
 
1479
@deffn Command terminal_input [@option{--append}|@option{--remove}] @
 
1480
 [terminal1] [terminal2] @dots{}
 
1481
List or select an input terminal.
 
1482
 
 
1483
With no arguments, list the active and available input terminals.
 
1484
 
 
1485
With @option{--append}, add the named terminals to the list of active input
 
1486
terminals; any of these may be used to provide input to GRUB.
 
1487
 
 
1488
With @option{--remove}, remove the named terminals from the active list.
 
1489
 
 
1490
With no options but a list of terminal names, make only the listed terminal
 
1491
names active.
 
1492
@end deffn
 
1493
 
 
1494
 
 
1495
@node terminal_output
 
1496
@subsection terminal_output
 
1497
 
 
1498
@deffn Command terminal_output [@option{--append}|@option{--remove}] @
 
1499
 [terminal1] [terminal2] @dots{}
 
1500
List or select an output terminal.
 
1501
 
 
1502
With no arguments, list the active and available output terminals.
 
1503
 
 
1504
With @option{--append}, add the named terminals to the list of active output
 
1505
terminals; all of these will receive output from GRUB.
 
1506
 
 
1507
With @option{--remove}, remove the named terminals from the active list.
 
1508
 
 
1509
With no options but a list of terminal names, make only the listed terminal
 
1510
names active.
 
1511
@end deffn
 
1512
 
 
1513
 
1374
1514
@node terminfo
1375
1515
@subsection terminfo
1376
1516
 
1402
1542
* chainloader::                 Chain-load another boot loader
1403
1543
* cmp::                         Compare two files
1404
1544
* configfile::                  Load a configuration file
 
1545
* cpuid::                       Check for CPU features
1405
1546
* crc::                         Calculate CRC32 checksums
1406
1547
* date::                        Display or set current date and time
1407
1548
* drivemap::                    Map a drive to another
1415
1556
* keystatus::                   Check key modifier status
1416
1557
* ls::                          List devices or files
1417
1558
* parttool::                    Modify partition table entries
 
1559
* password::                    Set a clear-text password
 
1560
* password_pbkdf2::             Set a hashed password
1418
1561
* play::                        Play a tune
 
1562
* pxe_unload::                  Unload the PXE environment
1419
1563
* reboot::                      Reboot your computer
 
1564
* search::                      Search devices by file, label, or UUID
1420
1565
* set::                         Set an environment variable
1421
1566
* unset::                       Unset an environment variable
 
1567
* uppermem::                    Set the upper memory size
1422
1568
@end menu
1423
1569
 
1424
1570
 
1518
1664
@end deffn
1519
1665
 
1520
1666
 
 
1667
@node cpuid
 
1668
@subsection cpuid
 
1669
 
 
1670
@deffn Command cpuid [-l]
 
1671
Check for CPU features.  This command is only available on x86 systems.
 
1672
 
 
1673
With the @option{-l} option, return true if the CPU supports long mode
 
1674
(64-bit).
 
1675
 
 
1676
If invoked without options, this command currently behaves as if it had been
 
1677
invoked with @option{-l}.  This may change in the future.
 
1678
@end deffn
 
1679
 
 
1680
 
1521
1681
@node crc
1522
1682
@subsection crc
1523
1683
 
1662
1822
@node help
1663
1823
@subsection help
1664
1824
 
1665
 
@deffn Command help @option{--all} [pattern @dots{}]
 
1825
@deffn Command help [pattern @dots{}]
1666
1826
Display helpful information about builtin commands. If you do not
1667
 
specify @var{pattern}, this command shows short descriptions of most of
1668
 
available commands. If you specify the option @option{--all} to this
1669
 
command, short descriptions of rarely used commands (such as
1670
 
@ref{testload}) are displayed as well.
 
1827
specify @var{pattern}, this command shows short descriptions of all
 
1828
available commands.
1671
1829
 
1672
1830
If you specify any @var{patterns}, it displays longer information
1673
 
about each of the commands which match those @var{patterns}.
 
1831
about each of the commands whose names begin with those @var{patterns}.
1674
1832
@end deffn
1675
1833
 
1676
1834
 
1747
1905
@end deffn
1748
1906
 
1749
1907
 
 
1908
@node password
 
1909
@subsection password
 
1910
 
 
1911
@deffn Command password user clear-password
 
1912
Define a user named @var{user} with password @var{clear-password}.
 
1913
@xref{Security}.
 
1914
@end deffn
 
1915
 
 
1916
 
 
1917
@node password_pbkdf2
 
1918
@subsection password_pbkdf2
 
1919
 
 
1920
@deffn Command password_pbkdf2 user hashed-password
 
1921
Define a user named @var{user} with password hash @var{hashed-password}.
 
1922
Use @command{grub-mkpasswd-pbkdf2} (@pxref{Invoking grub-mkpasswd-pbkdf2})
 
1923
to generate password hashes.  @xref{Security}.
 
1924
@end deffn
 
1925
 
 
1926
 
1750
1927
@node play
1751
1928
@subsection play
1752
1929
 
1766
1943
@end deffn
1767
1944
 
1768
1945
 
 
1946
@node pxe_unload
 
1947
@subsection pxe_unload
 
1948
 
 
1949
@deffn Command pxe_unload
 
1950
Unload the PXE environment (@pxref{Network}).
 
1951
 
 
1952
This command is only available on PC BIOS systems.
 
1953
@end deffn
 
1954
 
 
1955
 
1769
1956
@node reboot
1770
1957
@subsection reboot
1771
1958
 
1774
1961
@end deffn
1775
1962
 
1776
1963
 
 
1964
@node search
 
1965
@subsection search
 
1966
 
 
1967
@deffn Command search @
 
1968
 [@option{--file}|@option{--label}|@option{--fs-uuid}] @
 
1969
 [@option{--set} var] [@option{--no-floppy}] name
 
1970
Search devices by file (@option{-f}, @option{--file}), filesystem label
 
1971
(@option{-l}, @option{--label}), or filesystem UUID (@option{-u},
 
1972
@option{--fs-uuid}).
 
1973
 
 
1974
If the @option{--set} option is used, the first device found is set as the
 
1975
value of environment variable @var{var}.  The default variable is
 
1976
@samp{root}.
 
1977
 
 
1978
The @option{--no-floppy} option prevents searching floppy devices, which can
 
1979
be slow.
 
1980
 
 
1981
The @samp{search.file}, @samp{search.fs_label}, and @samp{search.fs_uuid}
 
1982
commands are aliases for @samp{search --file}, @samp{search --label}, and
 
1983
@samp{search --fs-uuid} respectively.
 
1984
@end deffn
 
1985
 
 
1986
 
1777
1987
@node set
1778
1988
@subsection set
1779
1989
 
1791
2001
@end deffn
1792
2002
 
1793
2003
 
 
2004
@node uppermem
 
2005
@subsection uppermem
 
2006
 
 
2007
This command is not yet implemented for GRUB 2, although it is planned.
 
2008
 
 
2009
 
 
2010
@node Security
 
2011
@chapter Authentication and authorisation
 
2012
 
 
2013
By default, the boot loader interface is accessible to anyone with physical
 
2014
access to the console: anyone can select and edit any menu entry, and anyone
 
2015
can get direct access to a GRUB shell prompt.  For most systems, this is
 
2016
reasonable since anyone with direct physical access has a variety of other
 
2017
ways to gain full access, and requiring authentication at the boot loader
 
2018
level would only serve to make it difficult to recover broken systems.
 
2019
 
 
2020
However, in some environments, such as kiosks, it may be appropriate to lock
 
2021
down the boot loader to require authentication before performing certain
 
2022
operations.
 
2023
 
 
2024
The @samp{password} (@pxref{password}) and @samp{password_pbkdf2}
 
2025
(@pxref{password_pbkdf2}) commands can be used to define users, each of
 
2026
which has an associated password.  @samp{password} sets the password in
 
2027
plain text, requiring @file{grub.cfg} to be secure; @samp{password_pbkdf2}
 
2028
sets the password hashed using the Password-Based Key Derivation Function
 
2029
(RFC 2898), requiring the use of @command{grub-mkpasswd-pbkdf2}
 
2030
(@pxref{Invoking grub-mkpasswd-pbkdf2}) to generate password hashes.
 
2031
 
 
2032
In order to enable authentication support, the @samp{superusers} environment
 
2033
variable must be set to a list of usernames, separated by any of spaces,
 
2034
commas, semicolons, pipes, or ampersands.  Superusers are permitted to use
 
2035
the GRUB command line, edit menu entries, and execute any menu entry.  If
 
2036
@samp{superusers} is set, then use of the command line is automatically
 
2037
restricted to superusers.
 
2038
 
 
2039
Other users may be given access to specific menu entries by giving a list of
 
2040
usernames (as above) using the @option{--users} option to the
 
2041
@samp{menuentry} command (@pxref{menuentry}).  If the @option{--users}
 
2042
option is not used for a menu entry, then that entry is unrestricted.
 
2043
 
 
2044
Putting this together, a typical @file{grub.cfg} fragment might look like
 
2045
this:
 
2046
 
 
2047
@example
 
2048
@group
 
2049
set superusers="root"
 
2050
password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring
 
2051
password user1 insecure
 
2052
 
 
2053
menuentry "May be run by any user" @{
 
2054
        set root=(hd0,1)
 
2055
        linux /vmlinuz
 
2056
@}
 
2057
 
 
2058
menuentry "Superusers only" --users "" @{
 
2059
        set root=(hd0,1)
 
2060
        linux /vmlinuz single
 
2061
@}
 
2062
 
 
2063
menuentry "May be run by user1 or a superuser" --users user1 @{
 
2064
        set root=(hd0,2)
 
2065
        chainloader +1
 
2066
@}
 
2067
@end group
 
2068
@end example
 
2069
 
 
2070
The @command{grub-mkconfig} program does not yet have built-in support for
 
2071
generating configuration files with authentication.  You can use
 
2072
@file{/etc/grub.d/40_custom} to add simple superuser authentication, by
 
2073
adding @kbd{set superusers=} and @kbd{password} or @kbd{password_pbkdf2}
 
2074
commands.
 
2075
 
 
2076
 
 
2077
@node Troubleshooting
 
2078
@chapter Error messages produced by GRUB
 
2079
 
 
2080
@menu
 
2081
* GRUB only offers a rescue shell::
 
2082
@end menu
 
2083
 
 
2084
 
 
2085
@node GRUB only offers a rescue shell
 
2086
@section GRUB only offers a rescue shell
 
2087
 
 
2088
GRUB's normal start-up procedure involves setting the @samp{prefix}
 
2089
environment variable to a value set in the core image by
 
2090
@command{grub-install}, setting the @samp{root} variable to match, loading
 
2091
the @samp{normal} module from the prefix, and running the @samp{normal}
 
2092
command.  This command is responsible for reading
 
2093
@file{/boot/grub/grub.cfg}, running the menu, and doing all the useful
 
2094
things GRUB is supposed to do.
 
2095
 
 
2096
If, instead, you only get a rescue shell, this usually means that GRUB
 
2097
failed to load the @samp{normal} module for some reason.  It may be possible
 
2098
to work around this temporarily: for instance, if the reason for the failure
 
2099
is that @samp{prefix} is wrong (perhaps it refers to the wrong device, or
 
2100
perhaps the path to @file{/boot/grub} was not correctly made relative to the
 
2101
device), then you can correct this and enter normal mode manually:
 
2102
 
 
2103
@example
 
2104
@group
 
2105
# Inspect the current prefix (and other preset variables):
 
2106
set
 
2107
# Set to the correct value, which might be something like this:
 
2108
set prefix=(hd0,1)/grub
 
2109
set root=(hd0,1)
 
2110
insmod normal
 
2111
normal
 
2112
@end group
 
2113
@end example
 
2114
 
 
2115
However, any problem that leaves you in the rescue shell probably means that
 
2116
GRUB was not correctly installed.  It may be more useful to try to reinstall
 
2117
it properly using @kbd{grub-install @var{device}} (@pxref{Invoking
 
2118
grub-install}).  When doing this, there are a few things to remember:
 
2119
 
 
2120
@itemize @bullet{}
 
2121
@item
 
2122
Drive ordering in your operating system may not be the same as the boot
 
2123
drive ordering used by your firmware.  Do not assume that your first hard
 
2124
drive (e.g. @samp{/dev/sda}) is the one that your firmware will boot from.
 
2125
 
 
2126
@item
 
2127
At least on BIOS systems, if you tell @command{grub-install} to install GRUB
 
2128
to a partition but GRUB has already been installed in the master boot
 
2129
record, then the GRUB installation in the partition will be ignored.
 
2130
 
 
2131
@item
 
2132
If possible, it is generally best to avoid installing GRUB to a partition
 
2133
(unless it is a special partition for the use of GRUB alone, such as the
 
2134
BIOS Boot Partition used on GPT).  Doing this means that GRUB may stop being
 
2135
able to read its core image due to a file system moving blocks around, such
 
2136
as while defragmenting, running checks, or even during normal operation.
 
2137
Installing to the whole disk device is normally more robust.
 
2138
 
 
2139
@item
 
2140
Check that GRUB actually knows how to read from the device and file system
 
2141
containing @file{/boot/grub}.  It will not be able to read from encrypted
 
2142
devices, nor from file systems for which support has not yet been added to
 
2143
GRUB.
 
2144
@end itemize
 
2145
 
 
2146
 
1794
2147
@node Invoking grub-install
1795
2148
@chapter Invoking grub-install
1796
2149
 
1858
2211
@end table
1859
2212
 
1860
2213
 
 
2214
@node Invoking grub-mkpasswd-pbkdf2
 
2215
@chapter Invoking grub-mkpasswd-pbkdf2
 
2216
 
 
2217
The program @command{grub-mkpasswd-pbkdf2} generates password hashes for
 
2218
GRUB (@pxref{Security}).
 
2219
 
 
2220
@example
 
2221
grub-mkpasswd-pbkdf2
 
2222
@end example
 
2223
 
 
2224
@command{grub-mkpasswd-pbkdf2} accepts the following options:
 
2225
 
 
2226
@table @option
 
2227
@item -c @var{number}
 
2228
@itemx --iteration-count=@var{number}
 
2229
Number of iterations of the underlying pseudo-random function.  Defaults to
 
2230
10000.
 
2231
 
 
2232
@item -l @var{number}
 
2233
@itemx --buflen=@var{number}
 
2234
Length of the generated hash.  Defaults to 64.
 
2235
 
 
2236
@item -s @var{number}
 
2237
@itemx --salt=@var{number}
 
2238
Length of the salt.  Defaults to 64.
 
2239
@end table
 
2240
 
 
2241
 
1861
2242
@node Obtaining and Building GRUB
1862
2243
@appendix How to obtain and build GRUB
1863
2244
 
1895
2276
@end group
1896
2277
@end example
1897
2278
 
1898
 
Also, the latest version is available from the SVN. See
1899
 
@uref{http://savannah.gnu.org/svn/?group=grub} for more information.
 
2279
Also, the latest version is available using Bazaar. See
 
2280
@uref{http://www.gnu.org/software/grub/grub-download.en.html} for more
 
2281
information.
1900
2282
 
1901
2283
@node Reporting bugs
1902
2284
@appendix Reporting bugs
1976
2358
homepage}.
1977
2359
 
1978
2360
 
 
2361
@node Internals
 
2362
@appendix Hacking GRUB
 
2363
 
 
2364
@menu
 
2365
* Getting the source code::
 
2366
* Finding your way around::
 
2367
@end menu
 
2368
 
 
2369
 
 
2370
@node Getting the source code
 
2371
@section Getting the source code
 
2372
 
 
2373
GRUB is maintained using the @uref{http://bazaar-vcs.org/, Bazaar revision
 
2374
control system}.  To fetch the primary development branch:
 
2375
 
 
2376
@example
 
2377
bzr get http://bzr.savannah.gnu.org/r/grub/trunk/grub
 
2378
@end example
 
2379
 
 
2380
The GRUB developers maintain several other branches with work in progress.
 
2381
Of these, the most interesting is the experimental branch, which is a
 
2382
staging area for new code which we expect to eventually merge into trunk but
 
2383
which is not yet ready:
 
2384
 
 
2385
@example
 
2386
bzr get http://bzr.savannah.gnu.org/r/grub/branches/experimental
 
2387
@end example
 
2388
 
 
2389
Once you have used @kbd{bzr get} to fetch an initial copy of a branch, you
 
2390
can use @kbd{bzr pull} to keep it up to date.  If you have modified your
 
2391
local version, you may need to resolve conflicts when pulling.
 
2392
 
 
2393
 
 
2394
@node Finding your way around
 
2395
@section Finding your way around
 
2396
 
 
2397
Here is a brief map of the GRUB code base.
 
2398
 
 
2399
GRUB uses Autoconf, but not (yet) Automake.  The top-level build rules are
 
2400
in @file{configure.ac}, @file{Makefile.in}, and @file{conf/*.rmk}.  Each
 
2401
@file{conf/*.rmk} file represents a particular target configuration, and is
 
2402
processed into GNU Make rules by @file{genmk.rb} (which you only need to
 
2403
look at if you are extending the build system).  If you are adding a new
 
2404
module which follows an existing pattern, such as a new command or a new
 
2405
filesystem implementation, it is usually easiest to grep @file{conf/*.rmk}
 
2406
for an existing example of that pattern to find out where it should be
 
2407
added.
 
2408
 
 
2409
Low-level boot code, such as the MBR implementation on PC BIOS systems, is
 
2410
in the @file{boot/} directory.
 
2411
 
 
2412
The GRUB kernel is in @file{kern/}.  This contains core facilities such as
 
2413
the device, disk, and file frameworks, environment variable handling, list
 
2414
processing, and so on.  The kernel should contain enough to get up to a
 
2415
rescue prompt.  Header files for kernel facilities, among others, are in
 
2416
@file{include/}.
 
2417
 
 
2418
Terminal implementations are in @file{term/}.
 
2419
 
 
2420
Disk access code is spread across @file{disk/} (for accessing the disk
 
2421
devices themselves), @file{partmap/} (for interpreting partition table
 
2422
data), and @file{fs/} (for accessing filesystems).  Note that, with the odd
 
2423
specialised exception, GRUB only contains code to @emph{read} from
 
2424
filesystems and tries to avoid containing any code to @emph{write} to
 
2425
filesystems; this lets us confidently assure users that GRUB cannot be
 
2426
responsible for filesystem corruption.
 
2427
 
 
2428
PCI and USB bus handling is in @file{bus/}.
 
2429
 
 
2430
Video handling code is in @file{video/}.  The graphical menu system uses
 
2431
this heavily, but is in a separate directory, @file{gfxmenu/}.
 
2432
 
 
2433
Most commands are implemented by files in @file{commands/}, with the
 
2434
following exceptions:
 
2435
 
 
2436
@itemize
 
2437
@item
 
2438
A few core commands live in @file{kern/corecmd.c}.
 
2439
 
 
2440
@item
 
2441
Commands related to normal mode live under @file{normal/}.
 
2442
 
 
2443
@item
 
2444
Commands that load and boot kernels live under @file{loader/}.
 
2445
 
 
2446
@item
 
2447
The @samp{loopback} command is really a disk device, and so lives in
 
2448
@file{disk/loopback.c}.
 
2449
 
 
2450
@item
 
2451
The @samp{gettext} command lives under @file{gettext/}.
 
2452
 
 
2453
@item
 
2454
The @samp{loadfont} and @samp{lsfonts} commands live under @file{font/}.
 
2455
 
 
2456
@item
 
2457
The @samp{serial}, @samp{terminfo}, and @samp{background_image} commands
 
2458
live under @file{term/}.
 
2459
 
 
2460
@item
 
2461
The @samp{efiemu_*} commands live under @file{efiemu/}.
 
2462
@end itemize
 
2463
 
 
2464
There are a few other special-purpose exceptions; grep for them if they
 
2465
matter to you.
 
2466
 
 
2467
 
1979
2468
 
1980
2469
@node Copying This Manual
1981
2470
@appendix Copying This Manual