From 9ddca21dde439f353f85362e7a084fa999764497 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 22 Jun 2012 23:56:45 -0400 Subject: [PATCH] Fixed compilation bug for 32-bit systems that caused filesystem name issues. --- Make.tiano | 2 +- NEWS.txt | 15 +++++++++++++++ filesystems/Make.tiano | 5 +++-- install.sh | 2 +- refind/lib.c | 1 - refind/main.c | 38 ++++++++++++++++---------------------- 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/Make.tiano b/Make.tiano index 5eb99fc..4b4ee92 100644 --- a/Make.tiano +++ b/Make.tiano @@ -14,7 +14,7 @@ ifeq ($(ARCH),ia64) endif ifeq ($(ARCH),ia32) - ARCH_C_FLAGS = -m32 -DEFI32 + ARCH_C_FLAGS = -m32 -DEFI32 -malign-double ARCHDIR = Ia32 FILENAME_CODE = ia32 endif diff --git a/NEWS.txt b/NEWS.txt index 6b87aea..30b57fe 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,18 @@ +0.4.4 (6/??/2012): +------------------ + +- Fixed bug that caused filesystem labels to be corrupted by rEFInd on + 32-bit systems. + +- Fixed bug that caused filesystem labels to be truncated in the drivers + on 32-bit systems. + +- Fixed bug in use_graphics_for option parsing that caused most options + to set graphics mode for OS X and/or Linux but not other boot + loaders/OSes. + +- Tweaked install script to better isolate the ESP under OS X. + 0.4.3 (6/21/2012): ------------------ diff --git a/filesystems/Make.tiano b/filesystems/Make.tiano index 7a5de97..138afb8 100644 --- a/filesystems/Make.tiano +++ b/filesystems/Make.tiano @@ -14,7 +14,7 @@ ifeq ($(ARCH),ia64) endif ifeq ($(ARCH),ia32) - ARCH_C_FLAGS = -m32 + ARCH_C_FLAGS = -m32 -malign-double ARCHDIR = Ia32 FILENAME_CODE = ia32 endif @@ -25,7 +25,8 @@ ifeq ($(ARCH),x86_64) FILENAME_CODE = x64 endif -EDK2BASE = /usr/local/UDK2010/MyWorkSpace +#EDK2BASE = /usr/local/UDK2010/MyWorkSpace +EDK2BASE = /usr/local/edk2 # Below file defines TARGET (RELEASE or DEBUG), TARGET_ARCH (X64 or IA32), and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46) include $(EDK2BASE)/Conf/target.txt diff --git a/install.sh b/install.sh index 961c90c..9d612a8 100644 --- a/install.sh +++ b/install.sh @@ -125,7 +125,7 @@ CopyRefindFiles() { MountOSXESP() { # Identify the ESP. Note: This returns the FIRST ESP found; # if the system has multiple disks, this could be wrong! - Temp=`diskutil list | grep EFI` + Temp=`diskutil list | grep " EFI "` Esp=/dev/`echo $Temp | cut -f 5 -d ' '` # If the ESP is mounted, use its current mount point.... Temp=`df | grep $Esp` diff --git a/refind/lib.c b/refind/lib.c index 85a1de2..455a3ef 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -702,7 +702,6 @@ static VOID ScanExtendedPartition(REFIT_VOLUME *WholeDiskVolume, MBR_PARTITION_I Volume->MbrPartitionIndex = LogicalPartitionIndex++; Volume->VolName = AllocateZeroPool(256 * sizeof(UINT16)); SPrint(Volume->VolName, 255, L"Partition %d", Volume->MbrPartitionIndex + 1); -// Volume->VolName = PoolPrint(L"Partition %d", Volume->MbrPartitionIndex + 1); Volume->BlockIO = WholeDiskVolume->BlockIO; Volume->BlockIOOffset = ExtCurrent + EMbrTable[i].StartLBA; Volume->WholeDiskBlockIO = WholeDiskVolume->BlockIO; diff --git a/refind/main.c b/refind/main.c index 9558655..6e79bc1 100644 --- a/refind/main.c +++ b/refind/main.c @@ -110,7 +110,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.3.1"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.3.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -118,7 +118,7 @@ static VOID AboutrEFInd(VOID) AddMenuInfoLine(&AboutMenu, L"Distributed under the terms of the GNU GPLv3 license"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Running on:"); - TempStr = AllocateZeroPool(255 * sizeof(CHAR16)); + TempStr = AllocateZeroPool(256 * sizeof(CHAR16)); SPrint(TempStr, 255, L" EFI Revision %d.%02d", ST->Hdr.Revision >> 16, ST->Hdr.Revision & ((1 << 16) - 1)); AddMenuInfoLine(&AboutMenu, TempStr); #if defined(EFI32) @@ -128,11 +128,11 @@ static VOID AboutrEFInd(VOID) #else AddMenuInfoLine(&AboutMenu, L" Platform: unknown"); #endif - TempStr = AllocateZeroPool(255 * sizeof(CHAR16)); + TempStr = AllocateZeroPool(256 * sizeof(CHAR16)); SPrint(TempStr, 255, L" Firmware: %s %d.%02d", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & ((1 << 16) - 1)); AddMenuInfoLine(&AboutMenu, TempStr); - TempStr = AllocateZeroPool(255 * sizeof(CHAR16)); + TempStr = AllocateZeroPool(256 * sizeof(CHAR16)); SPrint(TempStr, 255, L" Screen Output: %s", egScreenDescription()); AddMenuInfoLine(&AboutMenu, TempStr); AddMenuInfoLine(&AboutMenu, L""); @@ -411,7 +411,7 @@ LOADER_ENTRY *InitializeLoaderEntry(IN LOADER_ENTRY *Entry) { // Returns a pointer to the new subscreen data structure, or NULL if there // were problems allocating memory. REFIT_MENU_SCREEN *InitializeSubScreen(IN LOADER_ENTRY *Entry) { - CHAR16 *FileName, *Temp = NULL, *TitleStr; + CHAR16 *FileName, *Temp = NULL; REFIT_MENU_SCREEN *SubScreen = NULL; LOADER_ENTRY *SubEntry; @@ -419,9 +419,9 @@ REFIT_MENU_SCREEN *InitializeSubScreen(IN LOADER_ENTRY *Entry) { if (Entry->me.SubScreen == NULL) { // No subscreen yet; initialize default entry.... SubScreen = AllocateZeroPool(sizeof(REFIT_MENU_SCREEN)); if (SubScreen != NULL) { - TitleStr = AllocateZeroPool(sizeof(CHAR16) * 256); - SPrint(TitleStr, 255, L"Boot Options for %s on %s", (Entry->Title != NULL) ? Entry->Title : FileName, Entry->VolName); - SubScreen->Title = TitleStr; + SubScreen->Title = AllocateZeroPool(sizeof(CHAR16) * 256); + SPrint(SubScreen->Title, 255, L"Boot Options for %s on %s", + (Entry->Title != NULL) ? Entry->Title : FileName, Entry->VolName); SubScreen->TitleImage = Entry->me.Image; // default entry SubEntry = InitializeLoaderEntry(Entry); @@ -734,15 +734,13 @@ VOID SetLoaderDefaults(LOADER_ENTRY *Entry, CHAR16 *LoaderPath, IN REFIT_VOLUME // for icons, options, etc. LOADER_ENTRY * AddLoaderEntry(IN CHAR16 *LoaderPath, IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume) { LOADER_ENTRY *Entry; - CHAR16 *PoolStr; CleanUpPathNameSlashes(LoaderPath); Entry = InitializeLoaderEntry(NULL); if (Entry != NULL) { Entry->Title = StrDuplicate((LoaderTitle != NULL) ? LoaderTitle : LoaderPath); - PoolStr = AllocateZeroPool(sizeof(CHAR16) * 256); - SPrint(PoolStr, 255, L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : LoaderPath, Volume->VolName); - Entry->me.Title = PoolStr; + Entry->me.Title = AllocateZeroPool(sizeof(CHAR16) * 256); + SPrint(Entry->me.Title, 255, L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : LoaderPath, Volume->VolName); Entry->me.Row = 0; Entry->me.BadgeImage = Volume->VolBadgeImage; if ((LoaderPath != NULL) && (LoaderPath[0] != L'\\')) { @@ -1162,7 +1160,6 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Vo REFIT_MENU_SCREEN *SubScreen; CHAR16 *VolDesc; CHAR16 ShortcutLetter = 0; - CHAR16 *PoolStr; if (LoaderTitle == NULL) { if (Volume->OSName != NULL) { @@ -1179,9 +1176,8 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Vo // prepare the menu entry Entry = AllocateZeroPool(sizeof(LEGACY_ENTRY)); - PoolStr = AllocateZeroPool(256 * sizeof(CHAR16)); - SPrint(PoolStr, 255, L"Boot %s from %s", LoaderTitle, VolDesc); - Entry->me.Title = PoolStr; + Entry->me.Title = AllocateZeroPool(256 * sizeof(CHAR16)); + SPrint(Entry->me.Title, 255, L"Boot %s from %s", LoaderTitle, VolDesc); Entry->me.Tag = TAG_LEGACY; Entry->me.Row = 0; Entry->me.ShortcutLetter = ShortcutLetter; @@ -1194,16 +1190,14 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Vo // create the submenu SubScreen = AllocateZeroPool(sizeof(REFIT_MENU_SCREEN)); - PoolStr = AllocateZeroPool(256 * sizeof(CHAR16)); - SPrint(PoolStr, 255, L"Boot Options for %s on %s", LoaderTitle, VolDesc); - SubScreen->Title = PoolStr; + SubScreen->Title = AllocateZeroPool(256 * sizeof(CHAR16)); + SPrint(SubScreen->Title, 255, L"Boot Options for %s on %s", LoaderTitle, VolDesc); SubScreen->TitleImage = Entry->me.Image; // default entry SubEntry = AllocateZeroPool(sizeof(LEGACY_ENTRY)); - PoolStr = AllocateZeroPool(256 * sizeof(CHAR16)); - SPrint(PoolStr, 255, L"Boot %s", LoaderTitle); - SubEntry->me.Title = PoolStr; + SubEntry->me.Title = AllocateZeroPool(256 * sizeof(CHAR16)); + SPrint(SubEntry->me.Title, 255, L"Boot %s", LoaderTitle); SubEntry->me.Tag = TAG_LEGACY; SubEntry->Volume = Entry->Volume; SubEntry->LoadOptions = Entry->LoadOptions; -- 2.39.2