]> code.delx.au - refind/commitdiff
Small menu improvements; bug fixes & improvements to install.sh
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 8 May 2012 02:35:21 +0000 (22:35 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 8 May 2012 02:35:21 +0000 (22:35 -0400)
BUILDING.txt
Makefile
NEWS.txt
install.sh
refind/Makefile
refind/main.c
refind/menu.c

index a3d2dc816ea6a0ebe80822894d3bf8d620174e66..7c14bf69e4503dcc53d485c6e9ea8a86d76d0ce3 100644 (file)
@@ -48,14 +48,14 @@ To compile rEFInd, you'll need the following:
 
 * 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
@@ -99,12 +99,12 @@ EFICRT0         = /usr/local/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 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'
@@ -112,8 +112,8 @@ lib.o: In function `ScanVolumeBootcode.part.3':
 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
 =================
index 2b7a5499f01ac738eae3d86e69c491fc0c8da1ea..704334ffdcbcc17111b94ae23501ea5dc4ced7f5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,4 +17,7 @@ all:
 clean:
        make -C $(LIB_DIR) clean
        make -C $(LOADER_DIR) clean
+
+install:
+       ./install.sh
 # DO NOT DELETE
index a8fed26603c1ffe8452ec0a68d35d823839e6491..13c810726324d45f6453611be6baaa6cc923d9bc 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,9 @@
+0.3.4 (?/??/2012):
+------------------
+
+- Improved screen redraws to produce less flicker when moving among the
+  second-row tags.
+
 0.3.3 (5/6/2012):
 -----------------
 
index 479cef7c85b8ee7f988cce448acbe99c15caaa1c..52fab3dd8102fdc12f94621608e2590271361723 100755 (executable)
@@ -17,6 +17,7 @@
 #
 # 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
 #
@@ -30,11 +31,35 @@ TargetDir=/EFI/refind
 #
 
 # 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.
@@ -42,13 +67,13 @@ CheckForFiles() {
 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
@@ -64,7 +89,7 @@ CopyRefindFiles() {
       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
@@ -72,7 +97,7 @@ CopyRefindFiles() {
       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
@@ -80,7 +105,7 @@ CopyRefindFiles() {
       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
@@ -239,9 +264,10 @@ InstallOnLinux() {
 # 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...."
index 50a131b757728a6d3ee0c32c38dc49fc023a0bf6..221016a9477184278b85b5d2f8603787dc91f681 100644 (file)
@@ -7,20 +7,26 @@ SRCDIR = .
 
 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)
 
index b53190589ecfb495d7b9b3afb7dfcd03d2255ed6..8c4a78e683479c775266bb3516d1057e8b7da409 100644 (file)
@@ -104,7 +104,7 @@ static VOID AboutrEFInd(VOID)
 {
     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");
index 2b63d05a719e8a55ea16c7004c5c649fb4b04fa3..ad8d39c05926ac21ba58d1befe5ccaaa219ef051 100644 (file)
@@ -770,24 +770,30 @@ static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN
 // 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)