]> code.delx.au - refind/blob - BUILDING.txt
Added remaining main project files
[refind] / BUILDING.txt
1 From rEFIt to rEFInd
2 ====================
3
4 rEFInd is derived from rEFIt (http://refit.sourceforge.net), but the two
5 programs support different build environments. rEFIt was created with
6 Intel's EFI Application Toolkit
7 (http://www.intel.com/technology/efi/toolkit_overview.htm) or TianoCore's
8 EFI Toolkit (https://efi-toolkit.tianocore.org), along with Microsoft's
9 Visual C compiler.
10
11 Compiling the source code provided on the rEFIt site under Linux never
12 worked for me, although the documentation claimed it would. Apparently
13 other Linux developers have run into the same problem; Debian provides a
14 rEFIt package (http://packages.debian.org/sid/refit) that includes
15 extensive patches to enable the program to compile under Linux using the
16 GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). Although
17 GNU-EFI is less sophisticated than recent versions of TianoCore's toolkit,
18 GNU-EFI is my preferred environment because I prefer working in Linux and
19 because TianoCore's toolkit relies on obsolete versions of Microsoft's
20 Visual C++, and I had trouble tracking that down. For this reason, I used
21 Debian's patched version of rEFIt as a starting point in forking rEFInd.
22 The main down side to doing this is that a few rEFIt features got lost.
23 Most notable among these is the ability to load filesystem drivers. I've
24 also dropped ancillary programs, such as the ext2fs driver module and
25 gptsync program, from rEFInd. You can still use these tools with rEFInd,
26 but you'll need to install them separately; and in the case of filesystem
27 drivers, you'll need to configure your EFI to load them before you launch
28 rEFInd.
29
30
31 Requirements
32 ============
33
34 To compile rEFInd, you'll need the following:
35
36 * A Linux installation. Note that this installation does NOT need to be
37 EFI-based. It can be 32- or 64-bit, but unless you use a cross-compiler
38 (which I've not tested), it must be the appropriate bit width for your
39 EFI implementation. (Normally that means 64-bit.) If you don't normally
40 run Linux, you can run it in a VirtualBox or similar virtual machine.
41
42 * A standard set of Linux development tools, based on GCC.
43
44 * The GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). You
45 can usually install this from a package called "gnu-efi".
46
47 It's possible that you could use a non-Linux platform to compile rEFInd. To
48 the best of my knowledge, the rEFInd code doesn't rely on anything
49 Linux-specific in its build requirements, and GNU-EFI's Sourceforge page
50 indicates that it works under Windows and OS X, too. Thus, you may be able
51 to compile it on these platforms, but I've not tested it in this way. Under
52 Windows, you would need to either create a project or Makefile for your
53 non-GCC compiler or use a GCC port, such as MinGW (http://www.mingw.org).
54 You'd probably need to adjust the Makefile in the latter case.
55
56
57 Compiling rEFInd
58 ================
59
60 With your development system set up, you can compile rEFInd as follows:
61
62 1) Download and uncompress the rEFInd source code archive. (If you're
63 reading this file, you've probably already done this task.)
64
65 2) Open a Linux shell prompt
66
67 3) Change into the archive's main directory. You should see several files
68 including this BUILDING.txt file and several subdirectories such as
69 "refind", "libeg", and "include".
70
71 4) Type "make". With any luck, rEFInd will compile without error, leaving
72 the "refind.efi" file in the "refind" subdirectory.
73
74 If rEFInd doesn't compile correctly, you'll need to track down the source
75 of the problem. Double-check that you've got all the necessary development
76 tools installed, including GCC, make, and GNU-EFI. You may also need to
77 adjust the Makefile or Make.common file for your system. For instance, on
78 Fedora, you must change the following variables in Make.common as shown:
79
80 GNUEFILIB = /usr/lib64
81 EFILIB = /usr/lib64
82 EFICRT0 = /usr/lib64/gnuefi
83
84
85 Installing rEFInd
86 =================
87
88 With rEFInd compiled, you can install it. On a UEFI-based system, you'll
89 want to copy files on the ESP as follows:
90
91 * Create a directory for rEFInd, such as EFI/refind.
92 * Copy refind/refind.efi to the ESP's EFI/refind directory.
93 * Copy refind.conf-sample to the EFI/refind directory as refind.conf.
94 * Copy the icons subdirectory, including all its files, to EFI/refind.
95
96 You'll then need to activate rEFInd in your EFI. This can be done with
97 tools such as "efibootmgr" under Linux or "bless" under OS X. See the
98 docs/installing.html file for details.