From a9871b0532ef974ab83c95a62ff70dcb979c99b4 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Tue, 9 Apr 2013 11:49:34 -0400 Subject: [PATCH] Fixed no timeout with keyboard disconnected; better duplicate loader detection. --- Make.common | 6 ++++++ NEWS.txt | 7 +++++++ docs/refind/configfile.html | 2 +- docs/refind/getting.html | 9 ++++++++- docs/refind/index.html | 2 ++ docs/refind/installing.html | 4 ++-- docs/refind/todo.html | 10 ++++++++++ mkdistrib | 12 ++++++++++++ refind/main.c | 11 +++++++++-- refind/menu.c | 2 +- 10 files changed, 58 insertions(+), 7 deletions(-) diff --git a/Make.common b/Make.common index e5d1cc4..0d994e5 100644 --- a/Make.common +++ b/Make.common @@ -8,6 +8,12 @@ GNUEFILIB = /usr/lib64 EFILIB = /usr/lib64 EFICRT0 = /usr/lib64 +# Comment out above and uncomment below if using locally-compiled GNU-EFI.... +#EFIINC = /usr/local/include/efi +#GNUEFILIB = /usr/local/lib +#EFILIB = /usr/local/lib +#EFICRT0 = /usr/local/lib + HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) ARCH := $(HOSTARCH) OS = $(shell uname -s) diff --git a/NEWS.txt b/NEWS.txt index 60935fc..3b5ad23 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,10 @@ +0.6.9 (?/??/2013): +------------------ + +- Changed timeout code so that the timeout continues if the keyboard is + disconnected. This can help in booting a headless server or a system with + a bluetooth or other keyboard that's not recognized by the EFI. + 0.6.8 (3/18/2013): ------------------ diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 6a49a25..587adba 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -216,7 +216,7 @@ timeout 20 textmode text mode number - Sets the text-mode video resolution to be used in conjunction with textonly or for the line editor and program-launch screens. This option takes a single-digit code. Mode 0 is guaranteed to be present and should be 80x25. Mode 1 is supposed to be either invalid or 80x50, but some systems use this number for something else. Higher values are system-specific. Mode 1024 is a rEFInd-specific code that means to not set any mode at all; rEFInd instead uses whatever mode was set when it launched. If you set this option to an invalid value, rEFInd pauses during startup to tell you of that fact. Note that setting textmode can sometimes force your graphics-mode resolution to a higher value than you specify in resolution. + Sets the text-mode video resolution to be used in conjunction with textonly or for the line editor and program-launch screens. This option takes a single-digit code. Mode 0 is guaranteed to be present and should be 80x25. Mode 1 is supposed to be either invalid or 80x50, but some systems use this number for something else. Higher values are system-specific. Mode 1024 is a rEFInd-specific code that means to not set any mode at all; rEFInd instead uses whatever mode was set when it launched. If you set this option to an invalid value, rEFInd pauses during startup to tell you of that fact. Note that setting textmode can sometimes force your graphics-mode resolution to a higher value than you specify in resolution. On Linux, the /sys/class/graphics/fb0/modes file holds available modes, but it may not be the same set of modes that EFI provides. resolution diff --git a/docs/refind/getting.html b/docs/refind/getting.html index bf8e718..0faf42f 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -114,7 +114,14 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

optical disc. This zip file package includes both x86 (aka IA32) and x86-64 (aka x64, AMD64, or EM64T) versions of rEFInd. Which you install depends on your architecture, as described on the Installing rEFInd page. + href="installing.html">Installing rEFInd page. Some users of Arch + Linux have reported problems booting some specific Arch Linux kernels + with rEFInd and some other tools. For them, a variant + package exists in which the x86-64 binary was compiled with + GNU-EFI rather than the usual TianoCore EDK2. This change helps some + users with this problem; but using GNU-EFI also means that this version + can't launch BIOS-mode OSes.
  • A diff --git a/docs/refind/index.html b/docs/refind/index.html index a89b34a..95c8f72 100644 --- a/docs/refind/index.html +++ b/docs/refind/index.html @@ -168,6 +168,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • J. A. Watson has a review of rEFInd on an HP laptop on ZDNet. He had serious problems because of the HP's UEFI bugs, but finally got it to work.
  • +
  • James Jesudason has a tutorial on installing Ubuntu 13.04 beta on a Macbook Retina Pro on this blog page. I'd recommend using a Linux filesystem driver to read the kernel directly from a Linux filesystem rather than copy the kernel to the OS X partition as in the tutorial, but either method will work.
  • +
  • Additional programs diff --git a/docs/refind/installing.html b/docs/refind/installing.html index bf62d5b..a34ca1d 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -166,11 +166,11 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Beginning with version 0.6.2, I've included RPM and Debian package files for rEFInd. If you have a working RPM-based or Debian-based Linux installation that boots in EFI mode, using one of these files is likely to be the easiest way to install rEFInd: You need only download the file and issue an appropriate installation command. In some cases, double-clicking the package in your file manager will install it. If that doesn't work, a command like the following will install the RPM on an RPM-based system:

    -
    # rpm -Uvh refind-0.6.7-1.x86_64.rpm
    +
    # rpm -Uvh refind-0.6.8-1.x86_64.rpm

    On a Debian-based system, the equivalent command is:

    -
    # dpkg -i refind_0.6.7-1_amd64.deb
    +
    # dpkg -i refind_0.6.8-1_amd64.deb

    Either command produces output similar to that described for using the install.sh script, so you can check it for error messages and other signs of trouble. The package file installs rEFInd and registers it with the EFI to be the default boot loader. The script that runs as part of the installation process tries to determine if you're using Secure Boot, and if so it will try to configure rEFInd to launch using shim; however, this won't work correctly on all systems. Ubuntu 12.10 users who are booting with Secure Boot active should be wary, since the resulting installation will probably try to use Ubuntu's version of shim, which won't work correctly with rEFInd.

    diff --git a/docs/refind/todo.html b/docs/refind/todo.html index cea9202..15d4228 100644 --- a/docs/refind/todo.html +++ b/docs/refind/todo.html @@ -220,6 +220,16 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Apple-specific EFI extension, and I know of no standard EFI way to do it.
  • +
  • A couple of Mac users have reported that the brightness-adjustment + features in Windows don't work when Windows is booted via rEFInd, + but that these features do work when Windows is booted via the + Mac's built-in boot manager. Unfortunately, I have no idea what + causes this problem, I have no Windows installation on my one + (elderly) Mac, and I have no way to debug it. Therefore, it's + unlikely that I'll be able to fix this problem myself; but if you + have the equipment and skill to do so, I'd be interested in + receiving a patch.
  • +
  • The re-scan feature occasionally produces odd results, such as ignoring new media or keeping old media that have been ejected. This should be investigated and fixed.
  • diff --git a/mkdistrib b/mkdistrib index 6d2a101..261e5a6 100755 --- a/mkdistrib +++ b/mkdistrib @@ -88,6 +88,18 @@ cp -a docs keys banners fonts COPYING.txt LICENSE.txt README.txt CREDITS.txt NEW # Prepare the final .zip file zip -9r ../refind-bin-$1.zip refind-bin-$1 + +# Prepare a variant with the x86-64 version built with GNU-EFI.... +make clean +make -j4 gnuefi +if [[ $SignIt == 1 ]] ; then + $SBSign --key $KeysDir/refind.key --cert $KeysDir/refind.crt --output refind-bin-$1/refind/refind_x64.efi refind/refind_x64.efi +else + cp refind/refind_x64.efi refind-bin-$1/refind/refind_x64.efi +fi +zip -9r ../refind-bin-gnuefi-$1.zip refind-bin-$1 + +# Clean up.... cd .. rm -r refind-$1 diff --git a/refind/main.c b/refind/main.c index ba1d850..1bae405 100644 --- a/refind/main.c +++ b/refind/main.c @@ -132,7 +132,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.8"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.8.1"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -985,6 +985,7 @@ static BOOLEAN DuplicatesFallback(IN REFIT_VOLUME *Volume, IN CHAR16 *FileName) FileInfo = LibFileInfo(FileHandle); FileSize = FileInfo->FileSize; } else { + refit_call1_wrapper(FileHandle->Close, FileHandle); return FALSE; } @@ -1093,7 +1094,7 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) { EFI_STATUS Status; REFIT_DIR_ITER EfiDirIter; EFI_FILE_INFO *EfiDirEntry; - CHAR16 FileName[256], *Directory, *MatchPatterns, *VolName = NULL; + CHAR16 FileName[256], *Directory, *MatchPatterns, *VolName = NULL, *SelfPath; UINTN i, Length; BOOLEAN ScanFallbackLoader = TRUE; @@ -1158,6 +1159,12 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) { MyFreePool(VolName); } // while + // Don't scan the fallback loader if it's on the same volume and a duplicate of rEFInd itself.... + SelfPath = DevicePathToStr(SelfLoadedImage->FilePath); + CleanUpPathNameSlashes(SelfPath); + if ((Volume->DeviceHandle == SelfLoadedImage->DeviceHandle) && DuplicatesFallback(Volume, SelfPath)) + ScanFallbackLoader = FALSE; + // If not a duplicate & if it exists & if it's not us, create an entry // for the fallback boot loader if (ScanFallbackLoader && FileExists(Volume->RootDir, FALLBACK_FULLNAME) && ShouldScan(Volume, L"EFI\\BOOT")) { diff --git a/refind/menu.c b/refind/menu.c index ff8f1a6..8cf1cc8 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -404,7 +404,7 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty // read key press (and wait for it if applicable) Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &key); - if (Status == EFI_NOT_READY) { + if (Status != EFI_SUCCESS) { if (HaveTimeout && TimeoutCountdown == 0) { // timeout expired MenuExit = MENU_EXIT_TIMEOUT; -- 2.39.2