From: srs5694 Date: Sat, 3 Nov 2012 04:34:49 +0000 (-0400) Subject: Removed space_after_boot_options token in favor of adding a space X-Git-Url: https://code.delx.au/refind/commitdiff_plain/101270c24ce2125295280b39c5e4920a4147c68a Removed space_after_boot_options token in favor of adding a space after boot options only when booting Mac OS X. --- diff --git a/NEWS.txt b/NEWS.txt index dc09c2b..c0c4b42 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,7 +1,10 @@ 0.4.7 (??/?/2012): ------------------ -- Added new "space_after_boot_options" token to refind.conf. +- Modified rEFInd to add a space after the command-line options only when + launching Mac OS X. On some early Macs, the extra space (which had been + present by default, as a carryover from rEFIt) causes problems when + booting Linux kernels from FAT partitions. 0.4.6 (10/6/2012): ------------------ diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 6dd8550..4f45ba2 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -327,6 +327,12 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi unless you're certain you do not have an Advanced Format hard disk. +
  • If you don't want to reboot immediately after installing rEFInd, you + may optionally unmount the ESP by typing sudo + umount /dev/disk0s1 or sudo umount + /Volumes/esp. This step isn't strictly required, but if you want + to keep the ESP out of your directory tree, it can be useful.
  • +

    When you reboot, your Mac should bring up the rEFInd menu, and should continue to do so thereafter. If you make changes that break this association, you can re-run the bless command (if necessary, restoring the rEFInd files first). This might be necessary after installing system updates from Apple or if you upgrade rEFInd to a newer version.

    diff --git a/refind/config.c b/refind/config.c index 9a6996b..a2c36fe 100644 --- a/refind/config.c +++ b/refind/config.c @@ -429,9 +429,6 @@ VOID ReadConfig(VOID) } else if (StriCmp(TokenList[0], L"max_tags") == 0) { HandleInt(TokenList, TokenCount, &(GlobalConfig.MaxTags)); - } else if ((StriCmp(TokenList[0], L"space_after_boot_options") == 0) && (TokenCount == 2)) { - GlobalConfig.SpaceAfterBootOptions = (StriCmp(TokenList[1], L"true") == 0); - } FreeTokenLine(&TokenList, &TokenCount); diff --git a/refind/driver_support.c b/refind/driver_support.c index b8cb8b0..a547d65 100644 --- a/refind/driver_support.c +++ b/refind/driver_support.c @@ -19,6 +19,7 @@ */ #include "driver_support.h" +#include "lib.h" #include "../include/refit_call_wrapper.h" #ifdef __MAKEWITH_GNUEFI diff --git a/refind/global.h b/refind/global.h index 2535b40..101b597 100644 --- a/refind/global.h +++ b/refind/global.h @@ -200,7 +200,6 @@ typedef struct { typedef struct { BOOLEAN TextOnly; BOOLEAN ScanAllLinux; - BOOLEAN SpaceAfterBootOptions; UINTN RequestedScreenWidth; UINTN RequestedScreenHeight; UINTN Timeout; diff --git a/refind/main.c b/refind/main.c index 43bff03..a8ecdf3 100644 --- a/refind/main.c +++ b/refind/main.c @@ -93,7 +93,7 @@ static REFIT_MENU_ENTRY MenuEntryExit = { L"Exit rEFInd", TAG_EXIT, 1, 0, 0, static REFIT_MENU_SCREEN MainMenu = { L"Main Menu", NULL, 0, NULL, 0, NULL, 0, L"Automatic boot" }; static REFIT_MENU_SCREEN AboutMenu = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL }; -REFIT_CONFIG GlobalConfig = { FALSE, FALSE, TRUE, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, +REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, {TAG_SHELL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }}; @@ -115,7 +115,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.6.1"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.6.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -157,7 +157,7 @@ static VOID AboutrEFInd(VOID) static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, IN CHAR16 *LoadOptions, IN CHAR16 *LoadOptionsPrefix, - IN CHAR16 *ImageTitle, + IN CHAR16 *ImageTitle, IN CHAR8 OSType, OUT UINTN *ErrorInStep, IN BOOLEAN Verbose) { @@ -200,7 +200,7 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, if (LoadOptionsPrefix != NULL) { MergeStrings(&FullLoadOptions, LoadOptionsPrefix, 0); MergeStrings(&FullLoadOptions, LoadOptions, L' '); - if (GlobalConfig.SpaceAfterBootOptions) { + if (OSType == 'M') { MergeStrings(&FullLoadOptions, L" ", 0); // NOTE: That last space is also added by the EFI shell and seems to be significant // when passing options to Apple's boot.efi... @@ -241,7 +241,7 @@ bailout: static EFI_STATUS StartEFIImage(IN EFI_DEVICE_PATH *DevicePath, IN CHAR16 *LoadOptions, IN CHAR16 *LoadOptionsPrefix, - IN CHAR16 *ImageTitle, + IN CHAR16 *ImageTitle, IN CHAR8 OSType, OUT UINTN *ErrorInStep, IN BOOLEAN Verbose) { @@ -249,7 +249,7 @@ static EFI_STATUS StartEFIImage(IN EFI_DEVICE_PATH *DevicePath, DevicePaths[0] = DevicePath; DevicePaths[1] = NULL; - return StartEFIImageList(DevicePaths, LoadOptions, LoadOptionsPrefix, ImageTitle, ErrorInStep, Verbose); + return StartEFIImageList(DevicePaths, LoadOptions, LoadOptionsPrefix, ImageTitle, OSType, ErrorInStep, Verbose); } /* static EFI_STATUS StartEFIImage() */ // @@ -261,8 +261,8 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) UINTN ErrorInStep = 0; BeginExternalScreen(Entry->UseGraphicsMode, L"Booting OS"); - StartEFIImage(Entry->DevicePath, Entry->LoadOptions, - Basename(Entry->LoaderPath), Basename(Entry->LoaderPath), &ErrorInStep, !Entry->UseGraphicsMode); + StartEFIImage(Entry->DevicePath, Entry->LoadOptions, Basename(Entry->LoaderPath), + Basename(Entry->LoaderPath), Entry->OSType, &ErrorInStep, !Entry->UseGraphicsMode); FinishExternalScreen(); } @@ -1144,7 +1144,7 @@ static VOID StartLegacy(IN LEGACY_ENTRY *Entry) ExtractLegacyLoaderPaths(DiscoveredPathList, MAX_DISCOVERED_PATHS, LegacyLoaderList); - Status = StartEFIImageList(DiscoveredPathList, Entry->LoadOptions, NULL, L"legacy loader", &ErrorInStep, TRUE); + Status = StartEFIImageList(DiscoveredPathList, Entry->LoadOptions, NULL, L"legacy loader", 0, &ErrorInStep, TRUE); if (Status == EFI_NOT_FOUND) { if (ErrorInStep == 1) { Print(L"\nPlease make sure that you have the latest firmware update installed.\n"); @@ -1448,7 +1448,7 @@ static VOID StartTool(IN LOADER_ENTRY *Entry) { BeginExternalScreen(Entry->UseGraphicsMode, Entry->me.Title + 6); // assumes "Start " as assigned below StartEFIImage(Entry->DevicePath, Entry->LoadOptions, Basename(Entry->LoaderPath), - Basename(Entry->LoaderPath), NULL, TRUE); + Basename(Entry->LoaderPath), Entry->OSType, NULL, TRUE); FinishExternalScreen(); } /* static VOID StartTool() */ @@ -1497,7 +1497,7 @@ static UINTN ScanDriverDir(IN CHAR16 *Path) SPrint(FileName, 255, L"%s\\%s", Path, DirEntry->FileName); NumFound++; Status = StartEFIImage(FileDevicePath(SelfLoadedImage->DeviceHandle, FileName), - L"", DirEntry->FileName, DirEntry->FileName, NULL, FALSE); + L"", DirEntry->FileName, DirEntry->FileName, 0, NULL, FALSE); } Status = DirIterClose(&DirIter); if (Status != EFI_NOT_FOUND) {