]> code.delx.au - refind/blobdiff - BUILDING.txt
Changes related to new shim/MOK code.
[refind] / BUILDING.txt
index f41a6665942910673e6526dada3f59d745cebfac..fb93136fb6d6b52e51a1d201bcd940d93cffecfb 100644 (file)
@@ -15,9 +15,10 @@ rEFIt package (http://packages.debian.org/sid/refit) that includes
 extensive patches to enable the program to compile under Linux using the
 GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). Although
 GNU-EFI is less sophisticated than recent versions of TianoCore's toolkit,
-GNU-EFI is my preferred environment because it's provided with many Linux
-distributions and it was easy to get started with rEFInd development by
-using GNU-EFI and the Debian rEFIt package as a starting point.
+GNU-EFI was initially my preferred environment because it's provided with
+many Linux distributions and it was easy to get started with rEFInd
+development by using GNU-EFI and the Debian rEFIt package as a starting
+point.
 
 Over time, though, I've found that the recent TianoCore EDK2 toolkit has
 its advantages. Two features, in particular, require the TianoCore EDK2
@@ -73,13 +74,17 @@ To compile rEFInd, you'll need the following:
     install this from a package called "gnu-efi"; however, rEFInd relies on
     features that were added in (I think) 3.0l to provide driver-loading
     capabilities. The versions I've used and that work are 3.0p and 3.0q.
-    As of 5/2012, most Linux distributions seem to deliver rather elderly
-    versions of GNU-EFI, so you may need to download the latest source
-    code, compile it, and install it locally. Since rEFInd version 0.2.7,
-    the Makefiles assume this (see below). The legacy BIOS boot support on
-    UEFI-based PCs doesn't work when GNU-EFI is compiled under GNU-EFI, so
-    as of rEFInd 0.4.6, GNU-EFI is no longer the primary build environment,
-    although it's easier to set up on a Linux system.
+    Through mid-to-late 2012, most Linux distributions delivered rather
+    elderly versions of GNU-EFI, but many are catching up by late 2012. You
+    should check your GNU-EFI version number; you may need to download the
+    latest source code, compile it, and install it locally. Between rEFInd
+    version 0.2.7 and 0.6.1, the Makefiles assumed a locally-compiled
+    GNU-EFI package, but older and more recent versions assume GNU-EFI
+    installation in typical locations for distribution-provided packages.
+    The legacy BIOS boot support on UEFI-based PCs doesn't work when
+    GNU-EFI is compiled under GNU-EFI, so as of rEFInd 0.4.6, GNU-EFI is no
+    longer the primary build environment, although it's easier to set up on
+    a Linux system.
 
 It's possible to use a non-Linux platform to compile rEFInd. To the best of
 my knowledge, the rEFInd code doesn't rely on anything Linux-specific in
@@ -159,7 +164,8 @@ installed the toolkit:
    - ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
    - TARGET = RELEASE (DEBUG might work, but I've not tested it).
    - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86). If you plan
-     to build both architectures, you can set this to "IA32 X64".
+     to build both architectures on an x86-64 system, you can set this to
+     "IA32 X64".
    - TOOL_CHAIN_TAG = GCC46 (or other value depending on your GCC version;
      type "gcc -v" to learn your GCC version number). Note that GCC 4.7
      doesn't have its own entry, so use GCC46 for GCC 4.7.
@@ -212,13 +218,17 @@ With your development system set up, you can compile rEFInd as follows:
    want to build IA32 binaries on an x86-64 (X64) system, type "ARCH=ia32
    make". This works only if you're using the TianoCore build kit, and only
    if you set TARGET_ARCH to either "IA32" or "IA32 X64" in target.txt when
-   you set up the TianoCore.
+   you set up the TianoCore. If you plan to build both architectures, be
+   sure to copy the .efi file for the first build out of the refind
+   subdirectory before building the second architecture.
 
 5) The default build process does NOT build the filesystem drivers. If you
    want to build them, you must type "make fs" in the main rEFInd source
-   directory. The result is filesystem drivers in the filesystems
-   subdirectory, and also copies placed in the drivers subdirectory. You
-   must install the TianoCore EDK2 to build the drivers.
+   directory. (Typing "ARCH=ia32 make fs" builds IA32 filesystem drivers on
+   an x86-64 system, provided TianoCore is properly configured, as
+   described earlier.) The result is filesystem drivers in the filesystems
+   subdirectory, and also copies placed in the drivers_{arch} subdirectory.
+   You must install the TianoCore EDK2 to build the drivers.
 
 If rEFInd doesn't compile correctly, you'll need to track down the source
 of the problem. Double-check that you've got all the necessary development
@@ -227,19 +237,19 @@ You may also need to adjust the Makefile, Make.common file, or Make.tiano
 file for your system. (The main Makefile controls the process for both
 toolkits, while Make.common holds GNU-EFI options and Make.tiano holds
 TianoCore options.) The most likely thing you'll need to change is the path
-to the various GNU-EFI include files and libraries. Since rEFInd 0.2.7, the
+to the various GNU-EFI include files and libraries. Since rEFInd 0.6.2, the
 default Make.common file includes the following definitions:
 
-EFIINC          = /usr/local/include/efi
-GNUEFILIB       = /usr/local/lib
-EFILIB          = /usr/local/lib
-EFICRT0         = /usr/local/lib
+EFIINC          = /usr/include/efi
+GNUEFILIB       = /usr/lib
+EFILIB          = /usr/lib
+EFICRT0         = /usr/lib
 
-If you've installed GNU-EFI from a distribution's package, you may need to
-remove "local" from those paths, and perhaps change references to "lib" to
-"lib64". As noted earlier, though, as of 5/2012, most distributions provide
-out-of-date GNU-EFI implementations that will not work with rEFInd 0.2.7
-and later.
+If you've installed GNU-EFI from source code, you may need to add "local"
+to those paths, as in "/usr/local/include/efi". You might need to change
+references to "lib" to "lib64" on some systems. Recall that you need at
+least GNU-EFI version 3.0l to build rEFInd, and until very recently, most
+distributions provided out-of-date versions of this package.
 
 If you're using TianoCore's EDK2, as noted earlier, you may need to adjust
 the EDK2BASE variable in Make.tiano and filesystems/Make.tiano.
@@ -263,8 +273,8 @@ Installing rEFInd
 With rEFInd compiled, you can install it. The easiest way to do this is
 with the install.sh script, which works on both Linux and Mac OS X.
 Alternatively, you can type "make install" to install using this script.
-Note that this installation copies files to the ESP and uses "efibootmgr"
-(on Linux) or "bless" (on OS X) to add rEFInd to the firmware's boot loader
+Note that this script copies files to the ESP and uses "efibootmgr" (on
+Linux) or "bless" (on OS X) to add rEFInd to the firmware's boot loader
 list. The docs/refind/installing.html file provides more details on this
 script and its use.
 
@@ -303,21 +313,26 @@ Compiling the EFI Filesystem Drivers
 
 To build all the drivers, you can type "make fs" from the main directory,
 which builds the drivers and places copies in both the filesystems and
-drivers subdirectories. If you want to build just one driver, you can
-change into the "filesystems" directory and type "make {fsname}", where
-{fsname} is a filesystem name -- "ext2", "reiserfs", "iso9660", or "hfs".
+drivers_{arch} subdirectories. If you want to build just one driver, you
+can change into the "filesystems" directory and type "make {fsname}", where
+{fsname} is a filesystem name -- "ext2", "ext4", "reiserfs", "iso9660",
+or "hfs".
 
 To install drivers, you can type "make install" in the "filesystems"
 directory. This copies all the drivers to the
 "/boot/efi/EFI/refind/drivers" directory. Alternatively, you can copy the
-files you want manually.
+files you want manually. As of version 0.4.8, the install.sh script
+includes an optional "--drivers" option that will install the drivers along
+with the main rEFInd program, but to the drivers_{arch} subdirectory of the
+main rEFInd installation directory.
 
 *CAUTION:* Install drivers for your system's architecture *ONLY*.
 Installing drivers for the wrong architecture causes some systems to hang
-at boot time.
+at boot time. This risk can be minimized by including the architecture code
+in the drivers subdirectory name (drivers_x64 or drivers_ia32).
 
 The drivers all rely on filesystem wrapper code created by rEFIt's author,
-Christoph Phisterer. Most of the drivers seem to have passed through
+Christoph Pfisterer. Most of the drivers seem to have passed through
 Oracle's VirtualBox project (https://www.virtualbox.org) and the Clover
 boot loader project (https://sourceforge.net/projects/cloverefiboot/),
 which I used as the source for this build.