* A standard set of Linux development tools, based on GCC.
-* The GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). You
- can install this from a package called "gnu-efi"; however, rEFInd relies
- on features that were added somewhere between GNU-EFI 3.0i and 3.0p to
- provide driver-loading capabilities. As of 4/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 GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). You can
+ 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).
It's possible that you could use a non-Linux platform to compile rEFInd. To
the best of my knowledge, the rEFInd code doesn't rely on anything
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 4/2012, most distributions provide
+"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.
When I tried to compile rEFInd under Ubuntu 12.04 (i386), even with a
-locally-compiled GNU-EFI 3.0p, I got errors like this:
+locally-compiled GNU-EFI 3.0p or 3.0q, I got errors like this:
main.o: In function `StartLegacy.isra.0':
main.c:(.text+0x8b1): undefined reference to `__stack_chk_fail_local'
lib.c:(.text+0xf2f): undefined reference to `__stack_chk_fail_local'
lib.o: In function `ScanExtendedPartition.isra.4':
-The solution was to recompile GNU-EFI 3.0p with the -fno-stack-protector
-GCC flag. In GNU-EFI, this can be added to the CFLAGS line in Make.common.
+The solution was to recompile GNU-EFI with the -fno-stack-protector GCC
+flag. In GNU-EFI, this can be added to the CFLAGS line in Make.defaults.
Installing rEFInd
=================
clean:
make -C $(LIB_DIR) clean
make -C $(LOADER_DIR) clean
+
+install:
+ ./install.sh
# DO NOT DELETE
+0.3.4 (?/??/2012):
+------------------
+
+- Improved screen redraws to produce less flicker when moving among the
+ second-row tags.
+
0.3.3 (5/6/2012):
-----------------
#
# Revision history:
#
+# 0.3.3.1 -- Fixed OS X 10.7 bug; also works as make target
# 0.3.2.1 -- Check for presence of source files; aborts if not present
# 0.3.2 -- Initial version
#
#
# Abort if the rEFInd files can't be found.
+# Also sets $ConfFile to point to the configuration file, and
+# $IconsDir to point to the icons directory
CheckForFiles() {
- if [[ ! -f $SourceDir/refind_ia32.efi || ! -f $SourceDir/refind_x64.efi || ! -f $SourceDir/refind.conf-sample || ! -d $SourceDir/icons ]] ; then
- echo "One or more files missing! Aborting installation!"
+ # Note: This check is satisfied if EITHER the 32- or the 64-bit version
+ # is found, even on the wrong platform. This is because the platform
+ # hasn't yet been determined. This could obviously be improved, but it
+ # would mean restructuring lots more code....
+ if [[ ! -f $RefindDir/refind_ia32.efi && ! -f $RefindDir/refind_x64.efi ]] ; then
+ echo "The rEFInd binary file is missing! Aborting installation!"
exit 1
fi
+
+ if [[ -f $RefindDir/refind.conf-sample ]] ; then
+ ConfFile=$RefindDir/refind.conf-sample
+ elif [[ -f $ThisDir/refind.conf-sample ]] ; then
+ ConfFile=$ThisDir/refind.conf-sample
+ else
+ echo "The sample configuration file is missing! Aborting installation!"
+ exit 1
+ fi
+
+ if [[ -d $RefindDir/icons ]] ; then
+ IconsDir=$RefindDir/icons
+ elif [[ -d $ThisDir/icons ]] ; then
+ IconsDir=$ThisDir/icons
+ else
+ echo "The icons directory is missing! Aborting installation!"
+ fi
+#|| ! -f $RefindDir/refind.conf-sample || ! -d $RefindDir/icons
} # CheckForFiles()
# Copy the rEFInd files to the ESP or OS X root partition.
CopyRefindFiles() {
mkdir -p $InstallPart/$TargetDir &> /dev/null
if [[ $Platform == 'EFI32' ]] ; then
- cp $SourceDir/refind_ia32.efi $InstallPart/$TargetDir
+ cp $RefindDir/refind_ia32.efi $InstallPart/$TargetDir
if [[ $? != 0 ]] ; then
Problems=1
fi
Refind="refind_ia32.efi"
elif [[ $Platform == 'EFI64' ]] ; then
- cp $SourceDir/refind_x64.efi $InstallPart/$TargetDir
+ cp $RefindDir/refind_x64.efi $InstallPart/$TargetDir
if [[ $? != 0 ]] ; then
Problems=1
fi
mv -f $InstallPart/$TargetDir/icons $InstallPart/$TargetDir/icons-backup
echo "Notice: Backed up existing icons directory as icons-backup."
fi
- cp -r $SourceDir/icons $InstallPart/$TargetDir
+ cp -r $IconsDir $InstallPart/$TargetDir
if [[ $? != 0 ]] ; then
Problems=1
fi
echo "Existing refind.conf file found; copying sample file as refind.conf-sample"
echo "to avoid collision."
echo ""
- cp -f $SourceDir/refind.conf-sample $InstallPart/$TargetDir
+ cp -f $ConfFile $InstallPart/$TargetDir
if [[ $? != 0 ]] ; then
Problems=1
fi
echo "Copying sample configuration file as refind.conf; edit this file to configure"
echo "rEFInd."
echo ""
- cp -f $SourceDir/refind.conf-sample $InstallPart/$TargetDir/refind.conf
+ cp -f $ConfFile $InstallPart/$TargetDir/refind.conf
if [[ $? != 0 ]] ; then
Problems=1
fi
# install under OS X or Linux, depending on the detected platform.
#
-ThisScript=`readlink -f $0`
OSName=`uname -s`
-SourceDir=`dirname $ThisScript`/refind
+ThisDir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+RefindDir="$ThisDir/refind"
+ThisScript="$ThisDir/`basename $0`"
CheckForFiles
if [[ `whoami` != "root" ]] ; then
echo "Not running as root; attempting to elevate privileges via sudo...."
VPATH = $(SRCDIR)
+ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
+
+TARGET = refind.efi
+
ifeq ($(ARCH),ia32)
LIBEG = build32
+ TARGET = refind_ia32.efi
endif
ifeq ($(ARCH),x86_64)
LIBEG = build64
+ TARGET = refind_x64.efi
endif
LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg
-LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/$(LIBEG)
+#LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/$(LIBEG)
+LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/
LOCAL_LIBS = -leg
OBJS = main.o config.o menu.o screen.o icns.o lib.o driver_support.o
-TARGET = refind.efi
all: $(TARGET)
{
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.3");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.3.1");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
// Move the selection to State->CurrentSelection, adjusting icon row if necessary...
static VOID PaintSelection(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN *itemPosX,
UINTN row0PosY, UINTN row1PosY, UINTN textPosY) {
- UINTN XSelect, YPos;
+ UINTN XSelectPrev, XSelectCur, YPosPrev, YPosCur;
- if ((State->CurrentSelection < State->LastVisible) && (State->CurrentSelection >= State->FirstVisible)) {
+ if (((State->CurrentSelection < State->LastVisible) && (State->CurrentSelection >= State->FirstVisible)) ||
+ (State->CurrentSelection >= State->InitialRow1) ) {
if (Screen->Entries[State->PreviousSelection]->Row == 0) {
- XSelect = State->PreviousSelection - State->FirstVisible;
- YPos = row0PosY;
+ XSelectPrev = State->PreviousSelection - State->FirstVisible;
+ YPosPrev = row0PosY;
} else {
- XSelect = State->PreviousSelection;
- YPos = row1PosY;
+ XSelectPrev = State->PreviousSelection;
+ YPosPrev = row1PosY;
} // if/else
- DrawMainMenuEntry(Screen->Entries[State->PreviousSelection], FALSE, itemPosX[XSelect], YPos);
- DrawMainMenuEntry(Screen->Entries[State->CurrentSelection], TRUE,
- itemPosX[State->CurrentSelection - State->FirstVisible],
- (Screen->Entries[State->CurrentSelection]->Row == 0) ? row0PosY : row1PosY);
+ if (Screen->Entries[State->CurrentSelection]->Row == 0) {
+ XSelectCur = State->CurrentSelection - State->FirstVisible;
+ YPosCur = row0PosY;
+ } else {
+ XSelectCur = State->CurrentSelection;
+ YPosCur = row1PosY;
+ } // if/else
+ DrawMainMenuEntry(Screen->Entries[State->PreviousSelection], FALSE, itemPosX[XSelectPrev], YPosPrev);
+ DrawMainMenuEntry(Screen->Entries[State->CurrentSelection], TRUE, itemPosX[XSelectCur], YPosCur);
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL))
DrawMainMenuText(Screen->Entries[State->CurrentSelection]->Title,
(UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY);
- } else {
+ } else { // Current selection not visible; must redraw the menu....
MainMenuStyle(Screen, State, MENU_FUNCTION_PAINT_ALL, NULL);
}
} // static VOID MoveSelection(VOID)