From: srs5694 by Roderick W. Smith, rodsmith@rodsbooks.com Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0 Originally written: 3/14/2012; last Web page update:
+4/27/2012, referencing rEFInd 0.3.1 I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks! by Roderick W. Smith, rodsmith@rodsbooks.com Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0 Originally written: 3/14/2012; last Web page update:
+4/27/2012, referencing rEFInd 0.3.1 I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 4/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 4/19/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/docs/refind/features.html b/docs/refind/features.html index 3d3fb05..0896f20 100644 --- a/docs/refind/features.html +++ b/docs/refind/features.html @@ -14,7 +14,8 @@by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/docs/refind/getting.html b/docs/refind/getting.html index da91a3f..a7212cf 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -14,7 +14,8 @@by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
@@ -96,7 +97,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.comby Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: 4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/docs/refind/installing.html b/docs/refind/installing.html index ee18e52..1ac51b7 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -11,10 +11,11 @@by Roderick W. Smith, by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/24/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/docs/refind/linux.html b/docs/refind/linux.html index a0e985c..7680101 100644 --- a/docs/refind/linux.html +++ b/docs/refind/linux.html @@ -14,7 +14,8 @@by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/19/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
@@ -227,7 +228,7 @@ total 17943Ordinarily, a kernel booted in this way must reside on the ESP, or at least on another FAT partition. On a Macintosh, though, you can use HFS+ to house your kernel files. In fact, that may be necessary; my Mac Mini hangs when I try to boot a Linux kernel via an EFI stub loader from the computer's ESP, but it works fine when booting from an HFS+ partition. If you use EFI drivers, though, you can place your kernel on any filesystem for which an EFI driver exists. This list is currently rather limited (ext2fs/ext3fs, ReiserFS, ISO-9660, and HFS+), but even just one or two options might help a lot if you've got an undersized ESP or if copying your kernel file to the ESP is a hassle you'd rather avoid.
-Beginning with version 0.3.1, rEFInd sorts boot loader entries within each directory by time stamp, so that the most recent entry comes first. Thus, if you specify a directory name (or a volume label, for loaders stored in a volume's root directory) as the default_selection, rEFInd will make the most recent loader in the directory the default. This can obviate the need to adjust this configuration parameter when you add a new kernel; chances are you want the most recently-added kernel to be the default, and rEFInd makes it so when you set the default_selection in this way. If you don't want the latest kernel to become the default, you can use touch to give the desired kernel (or other boot loader) in the directory a more recent time stamp, or you can set default_selection to a value that uniquely identifies your desired default loader.
+Beginning with version 0.3.1, rEFInd sorts boot loader entries within each directory by time stamp, so that the most recent entry comes first. Thus, if you specify a directory name (or a volume label, for loaders stored in a volume's root directory) as the default_selection, rEFInd will make the most recent loader in the directory the default. This can obviate the need to adjust this configuration parameter when you add a new kernel; chances are you want the most recently-added kernel to be the default, and rEFInd makes it so when you set the default_selection in this way. If you don't want the latest kernel to become the default, you can use touch to give the desired kernel (or other boot loader) in the directory a more recent time stamp, or you can set default_selection to a value that uniquely identifies your desired default loader. One caveat you should keep in mind is that the EFI and Windows interpret the hardware clock as local time, whereas Mac OS X uses Coordinated Universal Time (UTC). Linux can work either way. Thus, time stamps for boot loaders can be skewed by several hours depending on the environment in which they were created or last modified.
diff --git a/docs/refind/revisions.html b/docs/refind/revisions.html index 8b53c10..943f0e1 100644 --- a/docs/refind/revisions.html +++ b/docs/refind/revisions.html @@ -14,7 +14,7 @@by Roderick W. Smith, rodsmith@rodsbooks.com
-Last Web page update: 4/22/2012
+Last Web page update: 4/27/2012
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.comby Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 4/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 4/19/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/docs/refind/todo.html b/docs/refind/todo.html index a6e06bf..2e92da5 100644 --- a/docs/refind/todo.html +++ b/docs/refind/todo.html @@ -14,7 +14,8 @@by Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
@@ -218,6 +219,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.comby Roderick W. Smith, rodsmith@rodsbooks.com
-Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0
+Originally written: 3/14/2012; last Web page update: +4/27/2012, referencing rEFInd 0.3.1
I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
diff --git a/refind/lib.c b/refind/lib.c index 333e0c1..fde385f 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -232,7 +232,7 @@ VOID AddListElement(IN OUT VOID ***ListPtr, IN OUT UINTN *ElementCount, IN VOID VOID FreeList(IN OUT VOID ***ListPtr, IN OUT UINTN *ElementCount) { UINTN i; - + if (*ElementCount > 0) { for (i = 0; i < *ElementCount; i++) { // TODO: call a user-provided routine for each element here @@ -265,9 +265,9 @@ VOID ExtractLegacyLoaderPaths(EFI_DEVICE_PATH **PathList, UINTN MaxPaths, EFI_DE EFI_LOADED_IMAGE *LoadedImage; EFI_DEVICE_PATH *DevicePath; BOOLEAN Seen; - + MaxPaths--; // leave space for the terminating NULL pointer - + // get all LoadedImage handles Status = LibLocateHandle(ByProtocol, &LoadedImageProtocol, NULL, &HandleCount, &Handles); @@ -281,19 +281,19 @@ VOID ExtractLegacyLoaderPaths(EFI_DEVICE_PATH **PathList, UINTN MaxPaths, EFI_DE } for (HandleIndex = 0; HandleIndex < HandleCount && PathCount < MaxPaths; HandleIndex++) { Handle = Handles[HandleIndex]; - + Status = refit_call3_wrapper(BS->HandleProtocol, Handle, &LoadedImageProtocol, (VOID **) &LoadedImage); if (EFI_ERROR(Status)) continue; // This can only happen if the firmware scewed up, ignore it. - + Status = refit_call3_wrapper(BS->HandleProtocol, LoadedImage->DeviceHandle, &DevicePathProtocol, (VOID **) &DevicePath); if (EFI_ERROR(Status)) continue; // This happens, ignore it. - + // Only grab memory range nodes if (DevicePathType(DevicePath) != HARDWARE_DEVICE_PATH || DevicePathSubType(DevicePath) != HW_MEMMAP_DP) continue; - + // Check if we have this device path in the list already // WARNING: This assumes the first node in the device path is unique! Seen = FALSE; @@ -346,12 +346,12 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->BlockIO, Volume->BlockIO->Media->MediaId, Volume->BlockIOOffset, SECTOR_SIZE, SectorBuffer); if (!EFI_ERROR(Status)) { - + if (*((UINT16 *)(SectorBuffer + 510)) == 0xaa55 && SectorBuffer[0] != 0) { *Bootable = TRUE; Volume->HasBootCode = TRUE; } - + // detect specific boot codes if (CompareMem(SectorBuffer + 2, "LILO", 4) == 0 || CompareMem(SectorBuffer + 6, "LILO", 4) == 0 || @@ -360,12 +360,12 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->HasBootCode = TRUE; Volume->OSIconName = L"linux"; Volume->OSName = L"Linux"; - + } else if (FindMem(SectorBuffer, 512, "Geom\0Hard Disk\0Read\0 Error", 26) >= 0) { // GRUB Volume->HasBootCode = TRUE; Volume->OSIconName = L"grub,linux"; Volume->OSName = L"Linux"; - + } else if ((*((UINT32 *)(SectorBuffer + 502)) == 0 && *((UINT32 *)(SectorBuffer + 506)) == 50000 && *((UINT16 *)(SectorBuffer + 510)) == 0xaa55) || @@ -373,51 +373,51 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->HasBootCode = TRUE; Volume->OSIconName = L"freebsd"; Volume->OSName = L"FreeBSD"; - + } else if (FindMem(SectorBuffer, 512, "!Loading", 8) >= 0 || FindMem(SectorBuffer, SECTOR_SIZE, "/cdboot\0/CDBOOT\0", 16) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"openbsd"; Volume->OSName = L"OpenBSD"; - + } else if (FindMem(SectorBuffer, 512, "Not a bootxx image", 18) >= 0 || *((UINT32 *)(SectorBuffer + 1028)) == 0x7886b6d1) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"netbsd"; Volume->OSName = L"NetBSD"; - + } else if (FindMem(SectorBuffer, SECTOR_SIZE, "NTLDR", 5) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"win"; Volume->OSName = L"Windows"; - + } else if (FindMem(SectorBuffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"winvista,win"; Volume->OSName = L"Windows"; - + } else if (FindMem(SectorBuffer, 512, "CPUBOOT SYS", 11) >= 0 || FindMem(SectorBuffer, 512, "KERNEL SYS", 11) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"freedos"; Volume->OSName = L"FreeDOS"; - + } else if (FindMem(SectorBuffer, 512, "OS2LDR", 6) >= 0 || FindMem(SectorBuffer, 512, "OS2BOOT", 7) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"ecomstation"; Volume->OSName = L"eComStation"; - + } else if (FindMem(SectorBuffer, 512, "Be Boot Loader", 14) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"beos"; Volume->OSName = L"BeOS"; - + } else if (FindMem(SectorBuffer, 512, "yT Boot Loader", 14) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"zeta,beos"; Volume->OSName = L"ZETA"; - + } else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 || FindMem(SectorBuffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) { Volume->HasBootCode = TRUE; @@ -425,19 +425,19 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->OSName = L"Haiku"; } - + // NOTE: If you add an operating system with a name that starts with 'W' or 'L', you // need to fix AddLegacyEntry in main.c. - + #if REFIT_DEBUG > 0 Print(L" Result of bootcode detection: %s %s (%s)\n", Volume->HasBootCode ? L"bootable" : L"non-bootable", Volume->OSName, Volume->OSIconName); #endif - + if (FindMem(SectorBuffer, 512, "Non-system disk", 15) >= 0) // dummy FAT boot sector Volume->HasBootCode = FALSE; - + // check for MBR partition table if (*((UINT16 *)(SectorBuffer + 510)) == 0xaa55) { MbrTableFound = FALSE; @@ -968,7 +968,7 @@ BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CHAR do { DirIter->LastStatus = DirNextEntry(DirIter->DirHandle, &(DirIter->LastFileInfo), FilterMode); if (EFI_ERROR(DirIter->LastStatus)) - return FALSE; + return FALSE; if (DirIter->LastFileInfo == NULL) // end of listing return FALSE; if (FilePattern != NULL) { @@ -982,7 +982,7 @@ BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CHAR // else continue loop } else break; - } while (KeepGoing); + } while (KeepGoing); *DirEntry = DirIter->LastFileInfo; return TRUE; diff --git a/refind/main.c b/refind/main.c index 21d8aa8..572f36a 100644 --- a/refind/main.c +++ b/refind/main.c @@ -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.0.2"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.1"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -736,6 +736,7 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *P SPrint(FileName, 255, L"\\%s\\%s", Path, DirEntry->FileName); else SPrint(FileName, 255, L"\\%s", DirEntry->FileName); + CleanUpPathNameSlashes(FileName); NewLoader = AllocateZeroPool(sizeof(struct LOADER_LIST)); if (NewLoader != NULL) { NewLoader->FileName = StrDuplicate(FileName); @@ -792,7 +793,7 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) { } // scan the root directory for EFI executables - ScanLoaderDir(Volume, NULL, MatchPatterns); + ScanLoaderDir(Volume, L"\\", MatchPatterns); // scan subdirectories of the EFI directory (as per the standard) DirIterOpen(Volume->RootDir, L"EFI", &EfiDirIter);