2002-12-27 08:53:07 +00:00
|
|
|
-*- Text -*-
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
This is the GRUB. Welcome.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
This file contains instructions for compiling and installing the GRUB.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
The Requirements
|
|
|
|
================
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
GRUB depends on some software packages installed into your system. If
|
2002-12-27 08:53:07 +00:00
|
|
|
you don't have any of them, please obtain and install them before
|
2004-04-04 13:46:03 +00:00
|
|
|
configuring the GRUB.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2009-09-06 15:20:33 +00:00
|
|
|
* GCC 4.1.3 or later
|
2013-11-08 05:05:54 +00:00
|
|
|
Note: older versions may work but support is limited
|
2015-02-21 15:22:48 +00:00
|
|
|
|
|
|
|
Experimental support for clang 3.3 or later (results in much bigger binaries)
|
2017-02-02 00:11:52 +00:00
|
|
|
for i386, x86_64, arm (including thumb), arm64, mips(el), powerpc, sparc64
|
2013-11-08 05:05:54 +00:00
|
|
|
Note: clang 3.2 or later works for i386 and x86_64 targets but results in
|
|
|
|
much bigger binaries.
|
2013-11-23 00:16:47 +00:00
|
|
|
earlier versions not tested
|
2013-11-14 07:36:35 +00:00
|
|
|
Note: clang 3.2 or later works for arm
|
2013-11-23 00:16:47 +00:00
|
|
|
earlier versions not tested
|
2017-02-02 00:11:52 +00:00
|
|
|
Note: clang on arm64 is not supported due to
|
|
|
|
https://llvm.org/bugs/show_bug.cgi?id=26030
|
2013-11-22 23:41:32 +00:00
|
|
|
Note: clang 3.3 or later works for mips(el)
|
2013-11-23 00:16:47 +00:00
|
|
|
earlier versions fail to generate .reginfo and hence gprel relocations
|
|
|
|
fail.
|
2013-12-04 11:20:56 +00:00
|
|
|
Note: clang 3.2 or later works for powerpc
|
|
|
|
earlier versions not tested
|
2015-02-22 00:53:00 +00:00
|
|
|
Note: clang 3.5 or later works for sparc64
|
|
|
|
earlier versions return "error: unable to interface with target machine"
|
2013-11-23 11:49:41 +00:00
|
|
|
Note: clang has no support for ia64 and hence you can't compile GRUB
|
|
|
|
for ia64 with clang
|
2002-12-27 08:53:07 +00:00
|
|
|
* GNU Make
|
2009-09-03 14:12:27 +00:00
|
|
|
* GNU Bison 2.3 or later
|
2010-03-04 15:28:57 +00:00
|
|
|
* GNU gettext 0.17 or later
|
2002-12-27 08:53:07 +00:00
|
|
|
* GNU binutils 2.9.1.0.23 or later
|
2010-05-25 12:54:46 +00:00
|
|
|
* Flex 2.5.35 or later
|
2018-01-30 21:59:09 +00:00
|
|
|
* pkg-config
|
2002-12-27 08:53:07 +00:00
|
|
|
* Other standard GNU/Unix tools
|
2015-01-22 18:54:36 +00:00
|
|
|
* a libc with large file support (e.g. glibc 2.1 or later)
|
2009-11-04 08:20:53 +00:00
|
|
|
|
2010-06-03 08:48:23 +00:00
|
|
|
On GNU/Linux, you also need:
|
|
|
|
|
2010-09-02 22:57:21 +00:00
|
|
|
* libdevmapper 1.02.34 or later (recommended)
|
2010-06-03 08:48:23 +00:00
|
|
|
|
2013-04-26 22:02:23 +00:00
|
|
|
For optional grub-emu features, you need:
|
2010-06-03 08:48:23 +00:00
|
|
|
|
|
|
|
* SDL (recommended)
|
2013-04-26 22:02:23 +00:00
|
|
|
* libpciaccess (optional)
|
|
|
|
* libusb (optional)
|
2010-06-03 08:48:23 +00:00
|
|
|
|
|
|
|
To build GRUB's graphical terminal (gfxterm), you need:
|
|
|
|
|
2018-01-30 21:59:09 +00:00
|
|
|
* FreeType 2.1.5 or later
|
2010-06-03 08:48:23 +00:00
|
|
|
* GNU Unifont
|
|
|
|
|
2009-11-04 08:20:53 +00:00
|
|
|
If you use a development snapshot or want to hack on GRUB you may
|
|
|
|
need the following.
|
|
|
|
|
2013-12-04 15:24:21 +00:00
|
|
|
* Python 2.6 or later
|
2019-02-27 10:03:55 +00:00
|
|
|
* Autoconf 2.63 or later
|
|
|
|
* Automake 1.11 or later
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2010-03-04 15:28:57 +00:00
|
|
|
Prerequisites for make-check:
|
|
|
|
|
|
|
|
* qemu, specifically the binary 'qemu-system-i386'
|
2013-04-14 15:10:55 +00:00
|
|
|
* xorriso 1.2.9 or later, for grub-mkrescue and grub-shell
|
2010-03-04 15:28:57 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
Configuring the GRUB
|
2002-12-27 08:53:07 +00:00
|
|
|
====================
|
|
|
|
|
|
|
|
The `configure' shell script attempts to guess correct values for
|
|
|
|
various system-dependent variables used during compilation. It uses
|
|
|
|
those values to create a `Makefile' in each directory of the package.
|
|
|
|
It may also create one or more `.h' files containing system-dependent
|
|
|
|
definitions. Finally, it creates a shell script `config.status' that
|
|
|
|
you can run in the future to recreate the current configuration, a
|
|
|
|
file `config.cache' that saves the results of its tests to speed up
|
|
|
|
reconfiguring, and a file `config.log' containing compiler output
|
|
|
|
(useful mainly for debugging `configure').
|
|
|
|
|
|
|
|
If you need to do unusual things to compile the package, please try to
|
|
|
|
figure out how `configure' could check whether to do them, and mail
|
|
|
|
diffs or instructions to the address given in the `README' so they can
|
|
|
|
be considered for the next release. If at some point `config.cache'
|
|
|
|
contains results you don't want to keep, you may remove or edit it.
|
|
|
|
|
|
|
|
The file `configure.ac' is used to create `configure' by a program
|
|
|
|
called `autoconf'. You only need `configure.in' if you want to change
|
|
|
|
it or regenerate `configure' using a newer version of `autoconf'.
|
|
|
|
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
Building the GRUB
|
2002-12-27 08:53:07 +00:00
|
|
|
=================
|
|
|
|
|
|
|
|
The simplest way to compile this package is:
|
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
1. `cd' to the directory containing the package's source code.
|
|
|
|
|
|
|
|
2. Skip this and following step if you use release tarball and proceed to
|
|
|
|
step 4. If you want translations type `./linguas.sh'.
|
|
|
|
|
2019-02-27 10:03:55 +00:00
|
|
|
3. Type `./bootstrap'.
|
2013-04-28 11:50:18 +00:00
|
|
|
|
2019-02-27 10:03:55 +00:00
|
|
|
* autogen.sh (called by bootstrap) uses python. By default the
|
|
|
|
invocation is "python", but it can be overridden by setting the
|
|
|
|
variable $PYTHON.
|
2015-03-05 23:33:41 +00:00
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
4. Type `./configure' to configure the package for your system.
|
2009-11-04 08:20:53 +00:00
|
|
|
If you're using `csh' on an old version of System V, you might
|
|
|
|
need to type `sh ./configure' instead to prevent `csh' from trying
|
|
|
|
to execute `configure' itself.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
Running `configure' takes awhile. While running, it prints some
|
|
|
|
messages telling which features it is checking for.
|
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
6. Type `make' to compile the package.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
7. Optionally, type `make check' to run any self-tests that come with
|
2002-12-27 08:53:07 +00:00
|
|
|
the package.
|
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
8. Type `make install' to install the programs and any data files and
|
2002-12-27 08:53:07 +00:00
|
|
|
documentation.
|
|
|
|
|
2013-04-28 11:50:18 +00:00
|
|
|
9. You can remove the program binaries and object files from the
|
2002-12-27 08:53:07 +00:00
|
|
|
source code directory by typing `make clean'. To also remove the
|
|
|
|
files that `configure' created (so you can compile the package for
|
|
|
|
a different kind of computer), type `make distclean'. There is
|
|
|
|
also a `make maintainer-clean' target, but that is intended mainly
|
|
|
|
for the package's developers. If you use it, you may have to get
|
|
|
|
all sorts of other programs in order to regenerate files that came
|
|
|
|
with the distribution.
|
|
|
|
|
2013-08-21 23:56:28 +00:00
|
|
|
Cross-compiling the GRUB
|
|
|
|
========================
|
|
|
|
|
|
|
|
GRUB defines 3 platforms:
|
|
|
|
|
|
|
|
- "Build" is the one which build systems runs on.
|
|
|
|
- "Host" is where you execute GRUB utils.
|
|
|
|
- "Target" is where GRUB itself runs.
|
|
|
|
|
|
|
|
For grub-emu host and target must be the same but may differ from build.
|
|
|
|
|
|
|
|
If build and host are different make check isn't available.
|
|
|
|
|
2013-08-22 14:08:53 +00:00
|
|
|
If build and host are different man pages are not generated.
|
|
|
|
|
2013-08-21 23:56:28 +00:00
|
|
|
As an example imagine you have a build system running on FreeBSD on sparc
|
2013-12-27 03:03:32 +00:00
|
|
|
which prepares packages for developers running amd64 GNU/Linux laptop and
|
2013-08-21 23:56:28 +00:00
|
|
|
they need to make images for ARM board running U-boot. In this case:
|
|
|
|
|
|
|
|
build=sparc64-freebsd
|
|
|
|
host=amd64-linux-gnu
|
|
|
|
target=arm-uboot
|
|
|
|
|
|
|
|
For this example the configure line might look like (more details below)
|
|
|
|
(some options are optional and included here for completeness but some rarely
|
2013-12-27 03:03:32 +00:00
|
|
|
used options are omitted):
|
2013-08-21 23:56:28 +00:00
|
|
|
|
2018-01-30 21:59:09 +00:00
|
|
|
./configure BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config --host=amd64-linux-gnu
|
|
|
|
CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" PKG_CONFIG=amd64-linux-gnu-pkg-config
|
2013-08-21 23:56:28 +00:00
|
|
|
--target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc
|
|
|
|
TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6"
|
|
|
|
TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip"
|
2013-09-23 10:55:18 +00:00
|
|
|
TARGET_NM=arm-elf-nm TARGET_RANLIB=arm-elf-ranlib LEX=gflex
|
2013-08-21 23:56:28 +00:00
|
|
|
|
|
|
|
You need to use following options to specify tools and platforms. For minimum
|
|
|
|
version look at prerequisites. All tools not mentioned in this section under
|
|
|
|
corresponding platform are not needed for the platform in question.
|
|
|
|
|
|
|
|
- For build
|
|
|
|
1. BUILD_CC= to gcc able to compile for build. This is used, for
|
|
|
|
example, to compile build-gentrigtables which is then run to
|
|
|
|
generate sin and cos tables.
|
|
|
|
2. BUILD_CFLAGS= for C options for build.
|
|
|
|
3. BUILD_CPPFLAGS= for C preprocessor options for build.
|
2014-01-18 15:50:54 +00:00
|
|
|
4. BUILD_LDFLAGS= for linker options for build.
|
2018-01-30 21:59:09 +00:00
|
|
|
5. BUILD_PKG_CONFIG= for pkg-config for build (optional).
|
2013-08-21 23:56:28 +00:00
|
|
|
|
|
|
|
- For host
|
|
|
|
1. --host= to autoconf name of host.
|
|
|
|
2. CC= for gcc able to compile for host
|
2015-02-21 15:03:11 +00:00
|
|
|
3. HOST_CFLAGS= for C options for host.
|
|
|
|
4. HOST_CPPFLAGS= for C preprocessor options for host.
|
|
|
|
5. HOST_LDFLAGS= for linker options for host.
|
2018-01-30 21:59:09 +00:00
|
|
|
6. PKG_CONFIG= for pkg-config for host (optional).
|
2013-08-21 23:56:28 +00:00
|
|
|
7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional).
|
|
|
|
8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
|
|
|
|
9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
|
|
|
|
10. Liblzma if any must be in standard linker folders (-llzma) (optional).
|
|
|
|
|
|
|
|
- For target
|
|
|
|
1. --target= to autoconf cpu name of target.
|
|
|
|
2. --with-platform to choose firmware.
|
|
|
|
3. TARGET_CC= for gcc able to compile for target
|
|
|
|
4. TARGET_CFLAGS= for C options for target.
|
|
|
|
5. TARGET_CPPFLAGS= for C preprocessor options for target.
|
|
|
|
6. TARGET_CCASFLAGS= for assembler options for target.
|
|
|
|
7. TARGET_LDFLAGS= for linker options for target.
|
|
|
|
8. TARGET_OBJCOPY= for objcopy for target.
|
|
|
|
9. TARGET_STRIP= for strip for target.
|
|
|
|
10. TARGET_NM= for nm for target.
|
2013-09-23 10:55:18 +00:00
|
|
|
11. TARGET_RANLIB= for ranlib for target.
|
2013-08-21 23:56:28 +00:00
|
|
|
|
|
|
|
- Additionally for emu, for host and target.
|
2013-12-27 03:03:32 +00:00
|
|
|
1. SDL is looked for in standard linker directories (-lSDL) (optional)
|
|
|
|
2. libpciaccess is looked for in standard linker directories (-lpciaccess) (optional)
|
|
|
|
3. libusb is looked for in standard linker directories (-lusb) (optional)
|
2013-08-21 23:56:28 +00:00
|
|
|
|
|
|
|
- Platform-agnostic tools and data.
|
|
|
|
1. make is the tool you execute after ./configure.
|
|
|
|
2. Bison is specified in YACC= variable
|
|
|
|
3. Flex is specified in LEX= variable
|
|
|
|
4. GNU unifont and Djvu sans are looked for in standard directories.
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
Compiling For Multiple Architectures
|
|
|
|
====================================
|
|
|
|
|
|
|
|
You can compile the package for more than one kind of computer at the
|
|
|
|
same time, by placing the object files for each architecture in their
|
|
|
|
own directory. `cd' to the directory where you want the object files
|
|
|
|
and executables to go and run the `configure' script. `configure'
|
|
|
|
automatically checks for the source code in the directory that
|
|
|
|
`configure' is in and in `..'.
|
|
|
|
|
|
|
|
|
|
|
|
Installation Names
|
|
|
|
==================
|
|
|
|
|
|
|
|
By default, `make install' will install the package's files in
|
|
|
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
|
|
|
installation prefix by giving `configure' the option `--prefix=PATH'.
|
|
|
|
|
|
|
|
You can specify separate installation prefixes for
|
|
|
|
architecture-specific files and architecture-independent files. If
|
|
|
|
you give `configure' the option `--exec-prefix=PATH', the package will
|
|
|
|
use PATH as the prefix for installing programs and libraries.
|
|
|
|
Documentation and other data files will still use the regular prefix.
|
|
|
|
|
|
|
|
In addition, if you use an unusual directory layout you can give
|
|
|
|
options like `--bindir=PATH' to specify different values for
|
|
|
|
particular kinds of files. Run `configure --help' for a list of the
|
|
|
|
directories you can set and what kinds of files go in them.
|
|
|
|
|
|
|
|
If the package supports it, you can cause programs to be installed
|
|
|
|
with an extra prefix or suffix on their names by giving `configure'
|
|
|
|
the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
Please note, however, that the GRUB knows where it is located in the
|
2002-12-27 08:53:07 +00:00
|
|
|
filesystem. If you have installed it in an unusual location, the
|
|
|
|
system might not work properly, or at all. The chief utility of these
|
2004-04-04 13:46:03 +00:00
|
|
|
options for the GRUB is to allow you to "install" in some alternate
|
2002-12-27 08:53:07 +00:00
|
|
|
location, and then copy these to the actual root filesystem later.
|
|
|
|
|
|
|
|
|
|
|
|
Sharing Defaults
|
|
|
|
================
|
|
|
|
|
|
|
|
If you want to set default values for `configure' scripts to share,
|
|
|
|
you can create a site shell script called `config.site' that gives
|
|
|
|
default values for variables like `CC', `cache_file', and `prefix'.
|
|
|
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
|
|
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
|
|
|
`CONFIG_SITE' environment variable to the location of the site script.
|
|
|
|
A warning: not all `configure' scripts look for a site script.
|
|
|
|
|
|
|
|
|
|
|
|
Operation Controls
|
|
|
|
==================
|
|
|
|
|
|
|
|
`configure' recognizes the following options to control how it
|
|
|
|
operates.
|
|
|
|
|
|
|
|
`--cache-file=FILE'
|
|
|
|
Use and save the results of the tests in FILE instead of
|
|
|
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
|
|
|
debugging `configure'.
|
|
|
|
|
|
|
|
`--help'
|
|
|
|
Print a summary of the options to `configure', and exit.
|
|
|
|
|
|
|
|
`--quiet'
|
|
|
|
`--silent'
|
|
|
|
`-q'
|
|
|
|
Do not print messages saying which checks are being made.
|
|
|
|
|
|
|
|
`--srcdir=DIR'
|
|
|
|
Look for the package's source code in directory DIR. Usually
|
|
|
|
`configure' can determine that directory automatically.
|
|
|
|
|
|
|
|
`--version'
|
|
|
|
Print the version of Autoconf used to generate the `configure'
|
|
|
|
script, and exit.
|