From: srs5694 Date: Sun, 6 Dec 2015 03:28:59 +0000 (-0500) Subject: Significant reworking of Makefile structure. Added Apple Core Storage X-Git-Url: https://code.delx.au/refind/commitdiff_plain/32fb076b277cc9e421d4a0c1cbcaab9cfee8c060 Significant reworking of Makefile structure. Added Apple Core Storage to type codes recognized by gptsync. --- diff --git a/BUILDING.txt b/BUILDING.txt index 4f65193..890e178 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -4,11 +4,12 @@ Requirements To compile rEFInd, you'll need the following: * A Linux installation. Note that this installation does NOT need to be - EFI-based. It can be 32- or 64-bit, but unless you use a cross-compiler - (which I've not tested), it must be the appropriate bit width for your - EFI implementation. (Normally that means 64-bit.) If you don't normally - run Linux, you can run it in a VirtualBox or similar virtual machine. (I - describe some unsupported non-Linux build options shortly.) + EFI-based. It can use IA32 (aka x86, i386, or other things), X64 (aka + x86-64, AMD64, or EM64T), or AA64 (aka AARCH64 or ARM64), but unless you + use a cross-compiler, it must use the same CPU type and bit depth as your + EFI implementation. (Normally that means 64-bit X64.) If you don't + normally run Linux, you can run it in a VirtualBox or similar virtual + machine. (I describe some unsupported non-Linux build options shortly.) * A standard set of Linux development tools, based on GCC. @@ -19,9 +20,9 @@ To compile rEFInd, you'll need the following: UDK2010 package and others in that series, but beginning with rEFInd 0.8.2, I've been using UDK2014 (http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UDK2014). - All of the UDK release are "frozen," rather than the main EDK2 - development branch, which is changing as the developers add features, - fix bugs, and so on. See below for TianoCore setup instructions. + All of the UDK are "frozen," rather than the main EDK2 development + branch, which is changing as the developers add features, fix bugs, and + so on. See below for TianoCore setup instructions. * The GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). You can install this from a package called "gnu-efi"; however, rEFInd relies on @@ -33,15 +34,15 @@ To compile rEFInd, you'll need the following: source code, you may need to adjust those Makefiles' paths. Of the two toolkits, I prefer to use TianoCore because it produces binaries -that are about 20-30KiB smaller than those made by GNU-EFI, and I can -easily build 32-bit binaries on my 64-bit Linux installations. Also, I've -had problems on a 32-bit Mac Mini with the drivers produced by GNU-EFI -hanging the system if I try to load more than one of them. (I haven't -encountered this problem on UEFI-based PCs.) That said, the TianoCore EDK2 -package is much harder to install, so you may prefer to use GNU-EFI unless -you have a specific need for the TianoCore toolkit. Automated build tools -like the OpenSUSE Build Service (OBS) and the Ubuntu Personal Package -Archive (PPA) mechanism don't yet support TianoCore. +that are about 5-30KiB smaller than those made by GNU-EFI, and I can easily +build 32-bit binaries on my 64-bit Linux installations. Also, I've had +problems on a 32-bit Mac Mini with the drivers produced by GNU-EFI hanging +the system. (I haven't encountered this problem on UEFI-based PCs.) That +said, the TianoCore EDK2 package is much harder to install, so you may +prefer to use GNU-EFI unless you have a specific need for the TianoCore +toolkit. Automated build tools like the OpenSUSE Build Service (OBS) and +the Ubuntu Personal Package Archive (PPA) mechanism don't yet support +TianoCore. 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 @@ -73,7 +74,7 @@ process is fairly typical of Linux packages. Read the GNU-EFI documentation if you need help. If you're using GNU-EFI, you can skip the rest of this section. -You might also want to use the TianoCore toolkit if you have problems with +You might want to use the TianoCore toolkit if you have problems with GNU-EFI or if you want to build rEFInd on a non-Linux platform. Unfortunately, the TianoCore toolkit is weird by Linux programming standards. It's also quite large -- it's intended as a means to develop a @@ -86,11 +87,13 @@ is a bit unclear about others. Here's how I installed the toolkit: 1) Download UDK2014.SR1.UP1.P1 from https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UDK2014. + Note that UDK2015 is now available, but I have not yet adapted rEFInd to + build with it. (UDK2015 has made changes that require matching changes + to rEFInd.) 2) Type "mkdir /usr/local/UDK2014". You can use another directory, but the - Makefile for rEFInd's EFI drivers assumes this location. You'll need to - edit the EDK2BASE line in the Make.tiano file if you install somewhere - else. + rEFInd Makefile assumes this location. You'll need to edit the EDK2BASE + variable in the top-level Makefile if you install somewhere else. 3) Type "cd /usr/local/UDK2014". @@ -111,18 +114,21 @@ is a bit unclear about others. Here's how I installed the toolkit: however, a few changes are required, as detailed below.... 9) Type "source edksetup.sh BaseTools". This sets up some environment - variables, so subsequent steps (NOT including compiling the rEFInd EFI + variables, so subsequent steps (NOT including compiling rEFInd or its drivers) must be typed in the shell you use for this step. 10) Edit Conf/target.txt and change the following: - 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 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 - and 4.8 don't have their own entries, so use GCC46 for them. + - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86 or change it + to AARCH64 on ARM64). If you plan to build multiple architectures, + you can set this to "IA32 X64" or some other combination. + - TOOL_CHAIN_TAG = GCC48 (or other value depending on your GCC version; + type "gcc -v" to learn your GCC version number). Note that support + for the latest GCC version takes a while to make it into the + TianoCore toolkit, so if you're using a very recent GCC, you may need + to specify an earlier version and hope for the best or modify + Conf/target.txt, as described shortly. The TianoCore Makefiles read some of these variables from this file and use them when accessing directories, so be sure to type these entries in the case specified. @@ -130,13 +136,15 @@ is a bit unclear about others. Here's how I installed the toolkit: 11) The documentation refers to editing Conf/tools_def.txt in addition to Conf/target.txt, but doesn't specify what to change in Conf/tools_def.txt. I haven't found it necessary to make any changes in - Conf/tools_def.txt EXCEPT when using GCC 4.7 on a Fedora 17 system. - (I haven't used GCC 4.7 on other platforms, so this may well be - necessary on other systems, too.) With that setup, I found it - necessary to change the following line: - *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64 - to: - *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 + Conf/tools_def.txt EXCEPT when using GCC 4.7 on a Fedora 17 system with + the original UDK2014. With this setup, GCC 4.7 was newer than the most + recent GCC that TianoCore supported at that time. With that setup, I + found it necessary to change the following line: + *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64 + to: + *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 + Something similar may be necessary if you're using a very recent + GCC or some other compiler. 12) Type "make -C /usr/local/UDK2014/MyWorkSpace/BaseTools/Source/C". (This step is not documented on the EDK Web page.) Note that this @@ -149,9 +157,9 @@ is a bit unclear about others. Here's how I installed the toolkit: Gentoo). If you installed in a location other than the one I've specified, you must -edit the EDK2BASE variable in the Make.tiano and filesystems/Make.tiano -files in the rEFInd source package. Once the toolkit is installed, you can -build the filesystem drivers or rEFInd, as described below. +edit the EDK2BASE variable in the top-level Makefile in the rEFInd source +package. Once the toolkit is installed, you can build the filesystem +drivers or rEFInd, as described below. Compiling rEFInd @@ -168,36 +176,45 @@ With your development system set up, you can compile rEFInd as follows: including this BUILDING.txt file and several subdirectories such as "refind", "libeg", "mok", "filesystems", and "include". -4) Type "make gnuefi" to build with GNU-EFI, or either "make" alone or - "make tiano" to build with TianoCore EDK2. With any luck, rEFInd will - compile without error, leaving the "refind_ia32.efi" or "refind_x64.efi" - file, depending on your platform, in the "refind" subdirectory. This same - step builds the "gptsync_x64.efi" or "gptsync_ia32.efi" program file, in - the "gptsync" subdirectory. If you 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 toolkit. - 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. +4) Type "make" to build rEFInd. The Makefile checks for the TianoCore + toolkit and tries to use it if it's present. If both toolkits are + installed, you can specify the toolkit name -- "make gnuefi" to build + with GNU-EFI, or either "make tiano" to build with TianoCore. With any + luck, rEFInd will compile without error, leaving the "refind_ia32.efi", + "refind_x64.efi", or "refind_aa64.efi" file, depending on your platform, + in the "refind" subdirectory. This same step builds the + "gptsync_ia32.efi", "gptsync_x64.efi", or "gptsync_aa64.efi" program + file, in the "gptsync" subdirectory. (When cross-compiling with + TianoCore, "gptsync_aa64.efi" is not built because the cross-compiler + failed for me. Since gptsync is likely to be useless on ARM64, this is + no great loss.) If you want to build IA32 binaries on an x86-64 (X64) + system, type "ARCH=ia32 make". Similarly, you can specify "ARCH=aarch64" + to cross-compile for ARM64. This works only if you're using the + TianoCore build kit, and only if you set TARGET_ARCH to the appropriate + value in target.txt when you set up the TianoCore toolkit. If you plan + to build multiple 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 to build with the TianoCore EDK2, or "make fs_gnuefi" to build - with GNU-EFI. (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 + directory. This command builds with the TianoCore toolkit if it's + available and with GNU-EFI if it's not. Alternatively, you can type + "make fs_gnuefi" to build with GNU-EFI or "make fs_tiano" to build with + TianoCore. (You can prepend "ARCH=ia32" or "ARCH=aarch64" to + cross-compile for those architectures, as when building the main rEFInd + binary.) The result is filesystem drivers in the filesystems subdirectory, and also copies placed in the drivers_{arch} subdirectory. 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 tools installed, including GCC, make, and either GNU-EFI or TianoCore EDK2. -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.6.2, the -default Make.common file includes the following definitions: +You may also need to adjust the Makefile or Make.common file; or possibly +Make* files in code subdirectories. (The main Makefile controls the process +for both toolkits, while Make.common holds most common 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.6.2, the default Make.common +file includes the following definitions: EFIINC = /usr/include/efi GNUEFILIB = /usr/lib @@ -211,7 +228,7 @@ 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. +the EDK2BASE variable in Makefile. When I tried to compile rEFInd under Ubuntu 12.04 (i386) using GNU-EFI, even with a locally-compiled GNU-EFI 3.0p or 3.0q, I got errors like this: @@ -234,8 +251,9 @@ with the refind-install script, which works on both Linux and Mac OS X. Alternatively, you can type "make install" to install using this script. 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. +list. The docs/man/refind-install.8 file (and its HTML conversion, +docs/refind/refind-install.html) provides more details on this script and +its use. If refind-install doesn't work for you or if you prefer to do the job manually, you may. On a UEFI-based system, you'll want to copy files on the @@ -270,14 +288,9 @@ way to go, but this assumes that the ESP is mounted at /boot/efi. Compiling the EFI Filesystem Drivers ==================================== -To build all the drivers, you can type "make fs" or "make fs_gnuefi" from -the main directory, which builds the drivers and places copies in both the -filesystems and drivers_{arch} subdirectories. If you want to build just -one driver, you can change into the "filesystems" directory and type "make -{fsname}" or "make {fsname}_gnuefi", where {fsname} is a filesystem name -- -"ext2", "ext4", "reiserfs", "iso9660", or "hfs". In all cases, the build -target that appends "_gnuefi" builds with GNU-EFI and the one that doesn't -builds with TianoCore. +To build all the drivers, you can type "make fs", "make fs_tiano", or "make +fs_gnuefi" from the main directory, which builds the drivers and places +copies in both the filesystems and drivers_{arch} subdirectories. To install drivers, you can type "make install" in the "filesystems" directory. This copies all the drivers to the diff --git a/EfiLib/Make.tiano b/EfiLib/Make.tiano index 3be7522..6b0a3b0 100644 --- a/EfiLib/Make.tiano +++ b/EfiLib/Make.tiano @@ -8,12 +8,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -include ../Make.tiano +include ../Make.common SOURCE_NAMES = legacy BmLib BdsConnect DevicePath BdsHelper BdsTianoCore OBJS = $(SOURCE_NAMES:=.obj) -#DRIVERNAME = ext2 -#BUILDME = $(DRIVERNAME)_$(FILENAME_CODE).efi all: $(AR_TARGET) diff --git a/EfiLib/Makefile b/EfiLib/Makefile index 00e6f58..39d6be6 100644 --- a/EfiLib/Makefile +++ b/EfiLib/Makefile @@ -11,7 +11,7 @@ SRCDIR = . VPATH = $(SRCDIR) -LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include +LOCAL_GNUEFI_CFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include OBJS = gnuefi-helper.o legacy.o BdsHelper.o BdsTianoCore.o TARGET = libEfiLib.a diff --git a/Make.common b/Make.common index cb5d181..563cdbf 100644 --- a/Make.common +++ b/Make.common @@ -8,6 +8,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This file contains make definitions common to several (or all) of the make +# files in the rEFInd code subdirectories. Some options are specific to +# particular architectures or build systems and others are more universal. + +# +# Environment definitions -- where stuff is and what sort of system is being +# used to compile rEFInd.... +# + EFIINC = /usr/include/efi GNUEFILIB = /usr/lib EFILIB = /usr/lib @@ -20,93 +29,179 @@ EFICRT0 = /usr/lib #EFICRT0 = /usr/local/lib HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH := $(HOSTARCH) -OS = $(shell uname -s) -CPPFLAGS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -DCONFIG_$(ARCH) -D__MAKEWITH_GNUEFI - -OPTIMFLAGS = -O2 -fno-strict-aliasing -DEBUGFLAGS = -Wall -#CFLAGS = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS) -CFLAGS = $(ARCH3264) $(OPTIMFLAGS) -fno-stack-protector -fpic -fshort-wchar $(DEBUGFLAGS) -ASFLAGS = $(ARCH3264) -LDFLAGS = -nostdlib -DRV_LDFLAGS = +ARCH ?= $(HOSTARCH) +# Note: EDK2BASE is definted in master Makefile and exported +#EDK2BASE = /usr/local/UDK2014/MyWorkSpace +GENFW = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw prefix = /usr/bin/ -CC = $(prefix)gcc -AS = $(prefix)as -LD = $(prefix)ld -AR = $(prefix)ar -RANLIB = $(prefix)ranlib -OBJCOPY = $(prefix)objcopy - -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - CFLAGS += -frename-registers -mfixed-range=f32-f127 +ifeq ($(ARCH),aarch64) + CC = $(prefix)aarch64-linux-gnu-gcc + AS = $(prefix)aarch64-linux-gnu-as + LD = $(prefix)aarch64-linux-gnu-ld + AR = $(prefix)aarch64-linux-gnu-ar + RANLIB = $(prefix)aarch64-linux-gnu-ranlib + OBJCOPY = $(prefix)aarch64-linux-gnu-objcopy +else + CC = $(prefix)gcc + AS = $(prefix)as + LD = $(prefix)ld + AR = $(prefix)ar + RANLIB = $(prefix)ranlib + OBJCOPY = $(prefix)objcopy endif +ifeq ($(MAKEWITH),TIANO) +# Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47) +include $(EDK2BASE)/Conf/target.txt +endif + +# +# C compiler flags +# + +# ...for both GNU-EFI and TianoCore.... +OPTIMFLAGS = -Os -fno-strict-aliasing +CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall + +# ...for GNU-EFI.... +GNUEFI_CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -I../mok +#GNUEFI_CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I. -I./../include -I./../libeg -I./../mok -I../include -I../refind -I../libeg + +# ...and for TianoCore.... +TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ + -I $(EDK2BASE)/MdePkg/Include \ + -I $(EDK2BASE)/MdeModulePkg/ \ + -I $(EDK2BASE)/MdeModulePkg/Include \ + -I $(EDK2BASE)/IntelFrameworkPkg/Include \ + -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ + -I .. \ + -I ../refind \ + -I ../libeg \ + -I ../include \ + -I ../mok +# +# Linker flags +# + +# for GNU-EFI.... +SUBSYSTEM_LDFLAG = +GNUEFI_LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds +CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o +GNUEFI_LDFLAGS = -T $(GNUEFI_LDSCRIPT) -shared -Bsymbolic -nostdlib -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS) +GNUEFI_LIBS = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name) +#LIBS = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) + +# ...and for TianoCore.... +ENTRYPOINT=efi_main +TIANO_LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script +TIANO_LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \ + --entry $(ENTRYPOINT) -u $(ENTRYPOINT) -m $(LD_CODE) + + + +# +# objcopy flags for GNU-EFI +# + FORMAT = --target=efi-app-$(ARCH) FORMAT_DRIVER = --target=efi-bsdrv-$(ARCH) -ifeq ($(ARCH),x86_64) - CFLAGS += -DEFI_FUNCTION_WRAPPER -mno-red-zone - CPPFLAGS += -DEFIX64 - LDFLAGS += -znocombreloc -zdefs - DRV_LDFLAGS += -znocombreloc -zdefs - ifeq ($(HOSTARCH),ia32) - ARCH3264 = -m64 +# +# Modifications on a per-architecture basis.... +# - GNUEFILIB := $(GNUEFILIB)64 - EFILIB := $(EFILIB)64 - EFICRT0 := $(EFICRT0)64 - endif +ifeq ($(ARCH),x86_64) +# CFLAGS += -DEFI_FUNCTION_WRAPPER +# GNUEFI_CFLAGS += -DEFIX64 + GNUEFI_LDFLAGS += -znocombreloc -zdefs + + ARCH_CFLAGS = -DEFIX64 -DEFI_FUNCTION_WRAPPER -m64 -mno-red-zone +ifeq ($(MAKEWITH),TIANO) + ARCH_CFLAGS += -mcmodel=large "-DEFIAPI=__attribute__((ms_abi))" +endif +ifeq ($(MAKEWITH),GNUEFI) + ARCH_CFLAGS += -fpic +endif + ARCHDIR = X64 + UC_ARCH = X64 + FILENAME_CODE = x64 + LD_CODE = elf_x86_64 + +# ifeq ($(HOSTARCH),ia32) +# ARCH3264 = -m64 +# +# GNUEFILIB := $(GNUEFILIB)64 +# EFILIB := $(EFILIB)64 +# EFICRT0 := $(EFICRT0)64 +# endif endif ifeq ($(ARCH),ia32) - CPPFLAGS += -DEFI32 -malign-double - LDFLAGS += -znocombreloc -zdefs - DRV_LDFLAGS += -znocombreloc -zdefs +# GNUEFI_CFLAGS += -DEFI32 -malign-double + GNUEFI_LDFLAGS += -znocombreloc -zdefs ifeq ($(HOSTARCH),x86_64) - ARCH3264 = -m32 +# ARCH3264 = -m32 GNUEFILIB := $(GNUEFILIB)32 EFILIB := $(EFILIB)32 EFICRT0 := $(EFICRT0)32 endif + + ARCH_CFLAGS = -m32 -DEFI32 -malign-double +ifeq ($(MAKEWITH),GNUEFI) + ARCH_CFLAGS += -fpic +endif + ARCHDIR = Ia32 + UC_ARCH = IA32 + FILENAME_CODE = ia32 + LD_CODE = elf_i386 endif ifeq ($(ARCH), aarch64) - CFLAGS += -fno-stack-check -g -fno-merge-constants -ffreestanding -fno-stack-check - CPPFLAGS += -DEFIAARCH64 +# CFLAGS += -fno-stack-check + GNUEFI_CFLAGS += -DEFIAARCH64 FORMAT = -O binary FORMAT_DRIVER = -O binary - LDFLAGS += --defsym=EFI_SUBSYSTEM=0xa --warn-common --no-undefined --fatal-warnings - DRV_LDFLAGS += --defsym=EFI_SUBSYSTEM=0xb --warn-common --no-undefined --fatal-warnings -endif - -CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o + SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xa + LDFLAGS += --warn-common --no-undefined --fatal-warnings -ifneq (,$(findstring FreeBSD,$(OS))) - ifeq ($(ARCH),x86_64) - LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_fbsd_efi.lds - else - LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds - endif -else - LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds + ARCH_CFLAGS = -fno-merge-constants -ffreestanding -DEFIAARCH64 + ifeq ($(MAKEWITH),TIANO) + ARCH_CFLAGS += -mcmodel=large -Wno-address -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections + endif + ifeq ($(MAKEWITH),GNUEFI) + ARCH_CFLAGS += -fno-stack-check + endif + ARCHDIR = AArch64 + UC_ARCH = AARCH64 + FILENAME_CODE = aa64 + LD_CODE = aarch64elf endif -LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS) -DRV_LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS) -LIBS = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) - +# ifneq (,$(findstring FreeBSD,$(OS))) +# ifeq ($(ARCH),x86_64) +# LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_fbsd_efi.lds +# else +# LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds +# endif +# else +# LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds +# endif +# # general rules +# -%.o: %.c - $(CC) $(LOCAL_CPPFLAGS) $(CPPFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@ +%.o: %.c + $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(GNUEFI_CFLAGS) $(LOCAL_GNUEFI_CFLAGS) \ + -D__MAKEWITH_GNUEFI -DREFIND_VERSION=$(REFIND_VERSION) -c $< -o $@ + +%.obj: %.c + $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(TIANO_INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS \ + -D__MAKEWITH_TIANO -DREFIND_VERSION=$(REFIND_VERSION) -c $< -o $@ # rules for EFI applications @@ -116,6 +211,7 @@ SHLIB_TARGET = $(subst .efi,.so,$(TARGET)) endif + # rules for libraries ifneq (,$(filter %.a,$(TARGET))) @@ -127,7 +223,7 @@ endif # utility rules -clean: - rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib +#clean: +# rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib # EOF diff --git a/Make.tiano b/Make.tiano deleted file mode 100644 index 84fba95..0000000 --- a/Make.tiano +++ /dev/null @@ -1,77 +0,0 @@ -# -# Make.tiano -# Common Makefile options for rEFInd using TianoCore EDK2 -# - -# This program is licensed under the terms of the GNU GPL, version 3, -# or (at your option) any later version. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH ?= $(HOSTARCH) - -# Note: IA64 options are untested; taken from Debian's rEFIt package. -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 - # TODO: Add ARCHDIR and FILENAME_CODE as appropriate -endif - -ifeq ($(ARCH),ia32) - ARCH_C_FLAGS = -m32 -DEFI32 -malign-double - ARCHDIR = Ia32 - UC_ARCH = IA32 - FILENAME_CODE = ia32 - LD_CODE = elf_i386 -endif - -ifeq ($(ARCH),x86_64) - ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -DEFIX64 -mcmodel=large -m64 -mno-red-zone - ARCHDIR = X64 - UC_ARCH = X64 - FILENAME_CODE = x64 - LD_CODE = elf_x86_64 -endif - -ifeq ($(ARCH),aarch64) - ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large - ARCHDIR = AArch64 - UC_ARCH = AARCH64 - FILENAME_CODE = aa64 - LD_CODE = aarch64elf -endif - -#EDK2BASE = /usr/local/UDK2014/MyWorkSpace -#EDK2BASE = /usr/local/EDK2/tianocore-edk2 -#ENTRYPOINT=_ModuleEntryPoint -ENTRYPOINT=efi_main - -# Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47) -include $(EDK2BASE)/Conf/target.txt - -INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ - -I $(EDK2BASE)/MdePkg/Include \ - -I $(EDK2BASE)/MdeModulePkg/ \ - -I $(EDK2BASE)/MdeModulePkg/Include \ - -I $(EDK2BASE)/IntelFrameworkPkg/Include \ - -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ - -I .. \ - -I ../refind \ - -I ../libeg \ - -I ../include \ - -I ../mok - -OPTIMFLAGS += -fno-strict-aliasing -Wno-address -Os -DEBUGFLAGS = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -CFLAGS = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c - -LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script - -LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \ - --entry $(ENTRYPOINT) -u $(ENTRYPOINT) -m $(LD_CODE) - -%.obj: %.c - $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS -D__MAKEWITH_TIANO -c $< -o $@ - - diff --git a/Makefile b/Makefile index 2292c51..6426e8d 100644 --- a/Makefile +++ b/Makefile @@ -5,69 +5,80 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -CXXFLAGS=-O2 -fpic -D_REENTRANT -D_GNU_SOURCE -Wall -g -NAMES=refind -SRCS=$(NAMES:=.c) -OBJS=$(NAMES:=.o) -HEADERS=$(NAMES:=.h) LOADER_DIR=refind FS_DIR=filesystems LIBEG_DIR=libeg MOK_DIR=mok GPTSYNC_DIR=gptsync EFILIB_DIR=EfiLib +export EDK2BASE=/usr/local/UDK2014/MyWorkSpace +export REFIND_VERSION='L"0.10.0.10"' -export EDK2BASE = /usr/local/UDK2014/MyWorkSpace -export GENFW = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw -export prefix = /usr/bin/ -ifeq ($(ARCH),aarch64) - export CC = $(prefix)aarch64-linux-gnu-gcc - export AS = $(prefix)aarch64-linux-gnu-as - export LD = $(prefix)aarch64-linux-gnu-ld - export AR = $(prefix)aarch64-linux-gnu-ar - export RANLIB = $(prefix)aarch64-linux-gnu-ranlib - export OBJCOPY = $(prefix)aarch64-linux-gnu-objcopy +# The "all" target builds with the TianoCore library if possible, but falls +# back on the more easily-installed GNU-EFI library if TianoCore isn't +# installed at $(EDK2BASE) +all: +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make tiano else - export CC = $(prefix)gcc - export AS = $(prefix)as - export LD = $(prefix)ld - export AR = $(prefix)ar - export RANLIB = $(prefix)ranlib - export OBJCOPY = $(prefix)objcopy + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make gnuefi endif -# Build rEFInd, including libeg -all: tiano - -gnuefi: - +make -C $(LIBEG_DIR) - +make -C $(MOK_DIR) - +make -C $(EFILIB_DIR) - +make -C $(LOADER_DIR) - +make -C $(GPTSYNC_DIR) gnuefi -# +make -C $(FS_DIR) all_gnuefi - +# The "fs" target, like "all," attempts to build with TianoCore but falls +# back to GNU-EFI. fs: - +make -C $(FS_DIR) +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make fs_tiano +else + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make fs_gnuefi +endif -fs_gnuefi: - +make -C $(FS_DIR) all_gnuefi +# Likewise for GPTsync.... +GPTsync: +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make gptsync_tiano +else + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make gptsync_gnuefi +endif +# Don't build gptsync under TianoCore by default because it errors out when +# using a cross-compiler on an x86-64 system. Because gptsync is pretty +# useless on ARM64, skipping it is no big deal.... tiano: - +make AR_TARGET=EfiLib -C $(EFILIB_DIR) -f Make.tiano - +make AR_TARGET=libeg -C $(LIBEG_DIR) -f Make.tiano - +make AR_TARGET=mok -C $(MOK_DIR) -f Make.tiano - +make BUILDME=refind DLL_TARGET=refind -C $(LOADER_DIR) -f Make.tiano + +make MAKEWITH=TIANO AR_TARGET=EfiLib -C $(EFILIB_DIR) -f Make.tiano + +make MAKEWITH=TIANO AR_TARGET=libeg -C $(LIBEG_DIR) -f Make.tiano + +make MAKEWITH=TIANO AR_TARGET=mok -C $(MOK_DIR) -f Make.tiano + +make MAKEWITH=TIANO BUILDME=refind DLL_TARGET=refind -C $(LOADER_DIR) -f Make.tiano ifneq ($(ARCH),aarch64) - +make -C $(GPTSYNC_DIR) -f Make.tiano + +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano endif -# +make -C $(FS_DIR) +# +make MAKEWITH=TIANO -C $(FS_DIR) + +gnuefi: + +make MAKEWITH=GNUEFI -C $(LIBEG_DIR) + +make MAKEWITH=GNUEFI -C $(MOK_DIR) + +make MAKEWITH=GNUEFI -C $(EFILIB_DIR) + +make MAKEWITH=GNUEFI -C $(LOADER_DIR) + +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi +# +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi + +fs_tiano: + +make MAKEWITH=TIANO -C $(FS_DIR) + +fs_gnuefi: + +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi -gptsync: - +make -C $(GPTSYNC_DIR) -f Make.tiano +gptsync_tiano: + +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano gptsync_gnuefi: - +make -C $(GPTSYNC_DIR) gnuefi + +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi clean: make -C $(LIBEG_DIR) clean diff --git a/NEWS.txt b/NEWS.txt index 73ecbce..d39db5f 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,14 @@ 0.10.1 (??/??/201?): -------------------- +- Significantly reworked the project's Makefiles. This should have no + impact on ordinary users, and even most developers should barely notice + it; but it should make future extensions to additional platforms or + building in different environments easier. + +- Added type code 53746F72-6167-11AA-AA11-00306543ECAC (Apple Core Storage, + gdisk type AF05) to list of partition types recognized by gptsync. + - Removed Luxi Sans Mono font, since I discovered it was not open source; and changed the default font from Nimbus Mono to Liberation Mono. diff --git a/debian/copyright b/debian/copyright index 3efb35b..7ac2912 100644 --- a/debian/copyright +++ b/debian/copyright @@ -16,7 +16,7 @@ License: GPL-3+ Files: */Make* Copyright: 2012-2015 Roderick W. Smith License: GPL-3+ -Comment: Except for gptsync/Make* and net/Makefile; see below +Comment: Except for gptsync/Make.unix and net/Makefile; see below Files: */AutoGen.[ch] Copyright: 2004-2011 Intel Corporation @@ -138,6 +138,7 @@ License: Apple-BSD POSSIBILITY OF SUCH DAMAGE. Files: gptsync/* + gptsync/Make.unix Copyright: 2006 Christoph Pfisterer License: BSD-2-clause diff --git a/filesystems/Make.gnuefi b/filesystems/Make.gnuefi index 6eab253..cfa6695 100644 --- a/filesystems/Make.gnuefi +++ b/filesystems/Make.gnuefi @@ -11,50 +11,29 @@ SRCDIR = . VPATH = $(SRCDIR) - HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH ?= $(HOSTARCH) # Note: IA64 options are untested; taken from Debian's rEFIt package. -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 - # TODO: Add FILENAME_CODE as appropriate -endif - -ifeq ($(ARCH),ia32) - LIBEG = build32 - ARCH_C_FLAGS = -m32 - FILENAME_CODE = ia32 - LD_CODE = elf_i386 -endif - -ifeq ($(ARCH),x86_64) - LIBEG = build64 - ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -m64 - FILENAME_CODE = x64 - LD_CODE = elf_x86_64 -endif -ifeq ($(ARCH),aarch64) - LIBEG = build64 - ARCH_C_FLAGS = - FILENAME_CODE = aa64 - LD_CODE = elf_aarch64 - FORMAT_DRIVER = -O binary +LOCAL_GNUEFI_CFLAGS = -DFSTYPE=$(DRIVERNAME) -I$(SRCDIR) +ifeq ($(HOSTARCH),x86_64) + LOCAL_GNUEFI_CFLAGS += "-DEFIAPI=__attribute__((ms_abi))" endif -LOCAL_CPPFLAGS = -DFSTYPE=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg - OBJS = fsw_core.o fsw_efi.o fsw_efi_lib.o fsw_lib.o fsw_$(DRIVERNAME).o TARGET = $(DRIVERNAME)_$(FILENAME_CODE).efi +include $(SRCDIR)/../Make.common + all: $(TARGET) -include $(SRCDIR)/../Make.common +ifeq ($(HOSTARCH),aarch64) + # Set symbol for driver + SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xb +endif $(SHLIB_TARGET): $(OBJS) - $(LD) $(LOCAL_LDFLAGS) $(DRV_LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS) + $(LD) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS) $(TARGET): $(SHLIB_TARGET) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ diff --git a/filesystems/Make.tiano b/filesystems/Make.tiano index b435c9d..2c30d54 100644 --- a/filesystems/Make.tiano +++ b/filesystems/Make.tiano @@ -8,45 +8,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH ?= $(HOSTARCH) - -# Note: IA64 options are untested; taken from Debian's rEFIt package. -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 - # TODO: Add ARCHDIR and FILENAME_CODE as appropriate -endif - -ifeq ($(ARCH),ia32) - ARCH_C_FLAGS = -m32 -malign-double -g - ARCHDIR = Ia32 - UC_ARCH = IA32 - FILENAME_CODE = ia32 - LD_CODE = elf_i386 -endif - -ifeq ($(ARCH),x86_64) - ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone - ARCHDIR = X64 - UC_ARCH = X64 - FILENAME_CODE = x64 - LD_CODE = elf_x86_64 -endif - -ifeq ($(ARCH),aarch64) - ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large - ARCHDIR = AArch64 - UC_ARCH = AARCH64 - FILENAME_CODE = aa64 - LD_CODE = aarch64elf -endif - -EDK2BASE = /usr/local/UDK2014/MyWorkSpace -#EDK2BASE = /usr/local/edk2 +include ../Make.common # Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46) -include $(EDK2BASE)/Conf/target.txt +#include $(EDK2BASE)/Conf/target.txt EFILIB = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library ALL_EFILIBS = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \ @@ -66,38 +31,21 @@ ifeq ($(ARCH),aarch64) ALL_EFILIBS += $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib endif -INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ - -I $(EDK2BASE)/MdePkg/Include \ - -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ - -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \ - -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include +TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ + -I $(EDK2BASE)/MdePkg/Include \ + -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ + -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \ + -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include FSW_NAMES = fsw_efi fsw_core fsw_efi_lib fsw_lib AutoGen OBJS = $(FSW_NAMES:=.obj) #DRIVERNAME = ext2 BUILDME = $(DRIVERNAME)_$(FILENAME_CODE).efi -OPTIMFLAGS = -fno-strict-aliasing -Wno-address -Os -DEBUGFLAGS = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -CFLAGS = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2 - -prefix ?= /usr/bin/ -CC ?= $(prefix)gcc -AS ?= $(prefix)as -LD ?= $(prefix)ld -AR ?= $(prefix)ar -RANLIB ?= $(prefix)ranlib -OBJCOPY ?= $(prefix)objcopy -GENFW ?= $(EDK2BASE)/BaseTools/Source/C/bin/GenFw - - -LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script - -LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \ - --entry _ModuleEntryPoint -u _ModuleEntryPoint -m $(LD_CODE) +ENTRYPOINT = _ModuleEntryPoint %.obj: %.c - $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -c $< -o $@ + $(CC) $(ARCH_CFLAGS) $(CFLAGS) $(TIANO_INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -D__MAKEWITH_TIANO -c $< -o $@ ifneq (,$(filter %.efi,$(BUILDME))) @@ -106,13 +54,11 @@ DLL_TARGET = $(subst .efi,.dll,$(BUILDME)) all: $(BUILDME) $(DLL_TARGET): $(OBJS) fsw_$(DRIVERNAME).obj - $(LD) -o $(DRIVERNAME)_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) fsw_$(DRIVERNAME).obj --end-group + $(LD) -o $(DRIVERNAME)_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) fsw_$(DRIVERNAME).obj --end-group $(BUILDME): $(DLL_TARGET) $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET) $(GENFW) -e UEFI_DRIVER -o $(BUILDME) $(DLL_TARGET) -# $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ -# -j .rela -j .reloc --rename-section .data=.hii --target=efi-bsdrv-$(ARCH) $< $@ mkdir -p ../drivers_$(FILENAME_CODE) cp $(BUILDME) ../drivers_$(FILENAME_CODE) diff --git a/filesystems/fsw_base.h b/filesystems/fsw_base.h index 2f6dc5f..aab5b39 100644 --- a/filesystems/fsw_base.h +++ b/filesystems/fsw_base.h @@ -40,11 +40,7 @@ #ifndef _FSW_BASE_H_ #define _FSW_BASE_H_ -#ifdef HOST_EFI_EDK2 -#define HOST_EFI -#endif - -#ifdef HOST_EFI +#ifdef __MAKEWITH_TIANO #include "fsw_efi_base.h" #endif diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c index 878d106..897ddde 100644 --- a/filesystems/fsw_efi.c +++ b/filesystems/fsw_efi.c @@ -78,7 +78,7 @@ EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO /** Helper macro for stringification. */ #define FSW_EFI_STRINGIFY(x) #x /** Expands to the EFI driver name given the file system type name. */ -#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.9.1 " FSW_EFI_STRINGIFY(t) L" File System Driver" +#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.10.1 " FSW_EFI_STRINGIFY(t) L" File System Driver" // function prototypes @@ -221,7 +221,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE ImageHandle, { EFI_STATUS Status; -#ifndef HOST_EFI_EDK2 +#ifndef __MAKEWITH_TIANO // Not available in EDK2 toolkit InitializeLib(ImageHandle, SystemTable); #endif diff --git a/filesystems/fsw_efi_base.h b/filesystems/fsw_efi_base.h index f9d732d..44daebb 100644 --- a/filesystems/fsw_efi_base.h +++ b/filesystems/fsw_efi_base.h @@ -39,7 +39,7 @@ #define _FSW_EFI_BASE_H_ // If its EDK2 EFI Toolkit -#ifdef HOST_EFI_EDK2 +#ifdef __MAKEWITH_TIANO #include "fsw_efi_edk2_base.h" #else // Intel EFI Toolkit diff --git a/filesystems/hfs_format.h b/filesystems/hfs_format.h index c36272f..edc5913 100644 --- a/filesystems/hfs_format.h +++ b/filesystems/hfs_format.h @@ -47,7 +47,7 @@ #ifndef __HFS_FORMAT__ #define __HFS_FORMAT__ -// #if !defined(HOST_EFI_EDK2) && !defined(HOST_POSIX) +// #if !defined(__MAKEWITH_TIANO) && !defined(HOST_POSIX) // // Only available on Mac? and Intel EFI Toolkit? // #include // #include diff --git a/gptsync/Make.gnuefi b/gptsync/Make.gnuefi index ad92564..30f4ed2 100644 --- a/gptsync/Make.gnuefi +++ b/gptsync/Make.gnuefi @@ -3,40 +3,38 @@ # Build control file for the gptsync tool, built with GNU-EFI # -LOCAL_CPPFLAGS = -I. -I../include -LOCAL_LDFLAGS = +#LOCAL_GNUEFI_CFLAGS = -I. -I../include LOCAL_LIBS = OBJS = gptsync.o lib.o os_efi.o -TARGET = gptsync.efi +#TARGET = gptsync.efi include ../Make.common ifeq ($(ARCH),ia32) - ARCHNAME = gptsync_ia32.efi + TARGET = gptsync_ia32.efi endif ifeq ($(ARCH),x86_64) - ARCHNAME = gptsync_x64.efi + TARGET = gptsync_x64.efi endif ifeq ($(ARCH),aarch64) - ARCHNAME = gptsync_aa64.efi + TARGET = gptsync_aa64.efi endif all: $(TARGET) -#SHLIB_TARGET = $(subst .efi,.so,$(TARGET)) +SHLIB_TARGET = $(subst .efi,.so,$(TARGET)) $(SHLIB_TARGET): $(OBJS) - $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS) + $(LD) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS) $(TARGET): $(SHLIB_TARGET) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \ -j .reloc $(FORMAT) $< $@ chmod a-x $(TARGET) - mv $(TARGET) $(ARCHNAME) # EOF diff --git a/gptsync/Make.tiano b/gptsync/Make.tiano index 49e7787..b67c170 100644 --- a/gptsync/Make.tiano +++ b/gptsync/Make.tiano @@ -3,45 +3,10 @@ # Build control file for gptsync utility, built with TianoCore EDK2 # -HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH ?= $(HOSTARCH) - -# Note: IA64 options are untested; taken from Debian's rEFIt package. -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 - # TODO: Add ARCHDIR and FILENAME_CODE as appropriate -endif - -ifeq ($(ARCH),ia32) - ARCH_C_FLAGS = -m32 -malign-double -DEFI32 - ARCHDIR = Ia32 - UC_ARCH = IA32 - FILENAME_CODE = ia32 - LD_CODE = elf_i386 -endif - -ifeq ($(ARCH),x86_64) - ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone -DEFIX64 - ARCHDIR = X64 - UC_ARCH = X64 - FILENAME_CODE = x64 - LD_CODE = elf_x86_64 -endif - -ifeq ($(ARCH),aarch64) - ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large - ARCHDIR = AArch64 - UC_ARCH = AARCH64 - FILENAME_CODE = aa64 - LD_CODE = aarch64elf -endif - -export EDK2BASE = /usr/local/UDK2014/MyWorkSpace -#EDK2BASE = /usr/local/edk2 +include ../Make.common # Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46) -include $(EDK2BASE)/Conf/target.txt +#include $(EDK2BASE)/Conf/target.txt EFILIB = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library ALL_EFILIBS = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \ @@ -61,47 +26,23 @@ ifeq ($(ARCH),aarch64) ALL_EFILIBS += $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib endif -INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ - -I $(EDK2BASE)/MdePkg/Include \ - -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ - -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \ - -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include \ - -I $(EDK2BASE)/MdeModulePkg/ \ - -I $(EDK2BASE)/MdeModulePkg/Include \ - -I $(EDK2BASE)/IntelFrameworkPkg/Include \ - -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ - -I ../libeg \ - -I ../include \ - -I .. +TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ + -I $(EDK2BASE)/MdePkg/Include \ + -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ + -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \ + -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include \ + -I $(EDK2BASE)/MdeModulePkg/ \ + -I $(EDK2BASE)/MdeModulePkg/Include \ + -I $(EDK2BASE)/IntelFrameworkPkg/Include \ + -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \ + -I ../libeg \ + -I ../include \ + -I .. GPTSYNC_NAMES = gptsync lib os_efi AutoGen ../EfiLib/BmLib OBJS = $(GPTSYNC_NAMES:=.obj) BUILDME = gptsync_$(FILENAME_CODE).efi -OPTIMFLAGS = -fno-strict-aliasing -Wno-address -Os -DEBUGFLAGS = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -CFLAGS = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -DHOST_EFI_EDK2 -D__MAKEWITH_TIANO -#CFLAGS = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2 - -prefix ?= /usr/bin/ -CC ?= $(prefix)gcc -AS ?= $(prefix)as -LD ?= $(prefix)ld -AR ?= $(prefix)ar -RANLIB ?= $(prefix)ranlib -OBJCOPY ?= $(prefix)objcopy -GENFW ?= $(EDK2BASE)/BaseTools/Source/C/bin/GenFw - - -LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script - -LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \ - --entry efi_main -u efi_main -m $(LD_CODE) - -%.obj: %.c - $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS -c $< -o $@ - +make -C ../EfiLib -f Make.tiano - ifneq (,$(filter %.efi,$(BUILDME))) DLL_TARGET = $(subst .efi,.dll,$(BUILDME)) @@ -109,7 +50,7 @@ DLL_TARGET = $(subst .efi,.dll,$(BUILDME)) all: $(BUILDME) $(DLL_TARGET): $(OBJS) - $(LD) -o gptsync_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) --end-group + $(LD) -o gptsync_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) --end-group $(BUILDME): $(DLL_TARGET) $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET) diff --git a/gptsync/Makefile b/gptsync/Makefile index 8987534..9e2b05f 100644 --- a/gptsync/Makefile +++ b/gptsync/Makefile @@ -12,11 +12,12 @@ TARGET = tiano all: $(TARGET) gnuefi: - +make -f Make.gnuefi gptsync.efi + +make -f Make.gnuefi tiano: +make -f Make.tiano +# TODO: Fix Make.unix; currently broken.... unix: +make -f Make.unix diff --git a/gptsync/gptsync.c b/gptsync/gptsync.c index 2696e66..c711186 100644 --- a/gptsync/gptsync.c +++ b/gptsync/gptsync.c @@ -494,7 +494,7 @@ UINTN gptsync(VOID) UINTN status_gpt, status_mbr; BOOLEAN proceed = FALSE; - Print(L"gptsync version %s\ncopyright (c) 2006-2007 Christoph Pfisterer & 2013 Roderick W. Smith\n", VERSION); + Print(L"gptsync version %s\ncopyright (c) 2006-2007 Christoph Pfisterer & 2013 Roderick W. Smith\n", REFIND_VERSION); // get full information from disk status_gpt = read_gpt(); diff --git a/gptsync/gptsync.h b/gptsync/gptsync.h index 1171472..54576fa 100644 --- a/gptsync/gptsync.h +++ b/gptsync/gptsync.h @@ -35,7 +35,7 @@ */ /* Changes copyright (c) 2013 Roderick W. Smith */ -#define VERSION L"0.9.1" +//#define VERSION L"0.9.1" // // config diff --git a/gptsync/lib.c b/gptsync/lib.c index 9a3ad45..7e64290 100644 --- a/gptsync/lib.c +++ b/gptsync/lib.c @@ -130,6 +130,7 @@ GPT_PARTTYPE gpt_types[] = { // From http://developer.apple.com/mac/library/technotes/tn2006/tn2166.html // { "\x00\x53\x46\x48\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0x00, STR("Mac OS X HFS+"), GPT_KIND_SYSTEM }, { "\x00\x53\x46\x48\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xaf, STR("Mac OS X HFS+"), GPT_KIND_DATA }, + { "\x72\x6F\x74\x53\x67\x61\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xaf, STR("Mac OS X Core Storage"), GPT_KIND_DATA }, { "\x00\x53\x46\x55\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xa8, STR("Mac OS X UFS"), GPT_KIND_DATA }, { "\x74\x6F\x6F\x42\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xab, STR("Mac OS X Boot"), GPT_KIND_DATA }, { "\x44\x49\x41\x52\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xac, STR("Apple RAID"), GPT_KIND_DATA }, diff --git a/gptsync/os_efi.c b/gptsync/os_efi.c index 9559014..51293d8 100644 --- a/gptsync/os_efi.c +++ b/gptsync/os_efi.c @@ -191,7 +191,7 @@ static BOOLEAN VerifyGoOn(VOID) { BOOLEAN GoOn = TRUE; UINTN invalid; - if (MyStriCmp(L"Apple", ST->FirmwareVendor)) { + if (!MyStriCmp(L"Apple", ST->FirmwareVendor)) { Print(L"Your firmware is made by %s.\n", ST->FirmwareVendor); Print(L"Ordinarily, a hybrid MBR (which this program creates) should be used ONLY on\n"); Print(L"Apple Macs that dual-boot with Windows or some other BIOS-mode OS. Are you\n"); diff --git a/libeg/Make.tiano b/libeg/Make.tiano index 21dc026..3553b6c 100644 --- a/libeg/Make.tiano +++ b/libeg/Make.tiano @@ -8,12 +8,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -include ../Make.tiano +include ../Make.common SOURCE_NAMES = image load_bmp load_icns lodepng lodepng_xtra screen text OBJS = $(SOURCE_NAMES:=.obj) -#DRIVERNAME = ext2 -#BUILDME = $(DRIVERNAME)_$(FILENAME_CODE).efi all: $(AR_TARGET) diff --git a/libeg/Makefile b/libeg/Makefile index 6b564d4..e0ca107 100644 --- a/libeg/Makefile +++ b/libeg/Makefile @@ -12,7 +12,7 @@ SRCDIR = . VPATH = $(SRCDIR) -LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include +LOCAL_GNUEFI_CFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include OBJS = screen.o image.o text.o load_bmp.o load_icns.o lodepng.o lodepng_xtra.o TARGET = libeg.a @@ -21,4 +21,7 @@ all: $(TARGET) include $(SRCDIR)/../Make.common +clean: + rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib + # EOF diff --git a/mok/Make.tiano b/mok/Make.tiano index ee2c52c..b595b49 100644 --- a/mok/Make.tiano +++ b/mok/Make.tiano @@ -7,7 +7,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -include ../Make.tiano +include ../Make.common SOURCE_NAMES = guid mok security_policy simple_file OBJS = $(SOURCE_NAMES:=.obj) diff --git a/mok/Makefile b/mok/Makefile index a30b0e1..1d01cf5 100644 --- a/mok/Makefile +++ b/mok/Makefile @@ -12,7 +12,7 @@ SRCDIR = . VPATH = $(SRCDIR) -LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include +LOCAL_GNUEFI_CFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include OBJS = guid.o mok.o security_policy.o simple_file.o TARGET = libmok.a @@ -21,4 +21,7 @@ all: $(TARGET) include $(SRCDIR)/../Make.common +clean: + rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib + # EOF diff --git a/refind/Make.tiano b/refind/Make.tiano index 075c4a7..6120c2f 100644 --- a/refind/Make.tiano +++ b/refind/Make.tiano @@ -10,7 +10,7 @@ # along with this program. If not, see . -include ../Make.tiano +include ../Make.common EFILIB = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library ALL_EFILIBS = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \ @@ -30,19 +30,13 @@ ALL_EFILIBS = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel $(EFILIB)/DxeServicesTableLib/DxeServicesTableLib/OUTPUT/DxeServicesTableLib.lib \ $(EFILIB)/DxeHobLib/DxeHobLib/OUTPUT/DxeHobLib.lib \ $(EFILIB)/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib -# $(EFILIB)/BasePerformanceLibNull/BasePerformanceLibNull/OUTPUT/BasePerformanceLibNull.lib \ -# /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu/OUTPUT/SecPeiDxeTimerLibCpu.lib \ -# /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeCore.lib \ -# /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib/OUTPUT/BaseCacheMaintenanceLib.lib \ -# /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull/OUTPUT/BasePerformanceLibNull.lib -# $(EFILIB)/../../MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeCore.lib -# /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeMain/DxeMain.obj ifeq ($(ARCH),aarch64) ALL_EFILIBS += $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib endif -SOURCE_NAMES = apple config mystrings line_edit driver_support icns lib main menu screen gpt crc32 legacy AutoGen +SOURCE_NAMES = apple config mystrings line_edit driver_support icns \ + lib main menu screen gpt crc32 legacy AutoGen OBJS = $(SOURCE_NAMES:=.obj) all: $(BUILDME) @@ -51,11 +45,14 @@ $(AR_TARGET): $(OBJS) $(AR) -cr $(AR_TARGET).lib $(OBJS) $(DLL_TARGET)_$(FILENAME_CODE).dll: $(OBJS) ../libeg/libeg.lib ../EfiLib/EfiLib.lib ../mok/mok.lib - $(LD) -o $(DLL_TARGET)_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) ../libeg/libeg.lib ../EfiLib/EfiLib.lib ../mok/mok.lib --end-group + $(LD) -o $(DLL_TARGET)_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) \ + --start-group $(ALL_EFILIBS) $(OBJS) ../libeg/libeg.lib \ + ../EfiLib/EfiLib.lib ../mok/mok.lib --end-group $(BUILDME): $(DLL_TARGET)_$(FILENAME_CODE).dll $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET)_$(FILENAME_CODE).dll - $(GENFW) -e UEFI_APPLICATION -o $(BUILDME)_$(FILENAME_CODE).efi $(DLL_TARGET)_$(FILENAME_CODE).dll + $(GENFW) -e UEFI_APPLICATION -o $(BUILDME)_$(FILENAME_CODE).efi \ + $(DLL_TARGET)_$(FILENAME_CODE).dll clean: make clean diff --git a/refind/Makefile b/refind/Makefile index 6fe0b5b..afda38a 100644 --- a/refind/Makefile +++ b/refind/Makefile @@ -30,18 +30,18 @@ ifeq ($(ARCH),aarch64) TARGET = refind_aa64.efi endif -LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok +LOCAL_GNUEFI_CFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/ LOCAL_LIBS = -leg -lmok -lEfiLib OBJS = main.o mystrings.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o -all: $(TARGET) - include $(SRCDIR)/../Make.common +all: $(TARGET) + $(SHLIB_TARGET): $(OBJS) - $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS) + $(LD) $(LOCAL_LDFLAGS) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS) $(TARGET): $(SHLIB_TARGET) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ @@ -49,5 +49,8 @@ $(TARGET): $(SHLIB_TARGET) -j .reloc $(FORMAT) $< $@ chmod a-x $(TARGET) +clean: + rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib + # EOF # DO NOT DELETE diff --git a/refind/driver_support.h b/refind/driver_support.h index 08405eb..bf4c0e7 100644 --- a/refind/driver_support.h +++ b/refind/driver_support.h @@ -19,7 +19,7 @@ #ifdef __MAKEWITH_GNUEFI #include -#include +//#include #else #include "../include/tiano_includes.h" #endif diff --git a/refind/legacy.c b/refind/legacy.c index 9ac7ce2..aead421 100644 --- a/refind/legacy.c +++ b/refind/legacy.c @@ -173,7 +173,7 @@ static EFI_STATUS ActivateMbrPartition(IN EFI_BLOCK_IO *BlockIO, IN UINTN Partit return EFI_SUCCESS; } /* static EFI_STATUS ActivateMbrPartition() */ -static EFI_GUID AppleVariableVendorID = { 0x7C436110, 0xAB2A, 0x4BBB, 0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82 }; +static EFI_GUID AppleVariableVendorID = { 0x7C436110, 0xAB2A, 0x4BBB, { 0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82 } }; static EFI_STATUS WriteBootDiskHint(IN EFI_DEVICE_PATH *WholeDiskDevicePath) { diff --git a/refind/main.c b/refind/main.c index e96f35b..6b574ed 100644 --- a/refind/main.c +++ b/refind/main.c @@ -204,7 +204,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.6"); + AddMenuInfoLine(&AboutMenu, PoolPrint(L"rEFInd Version %s", REFIND_VERSION)); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");