]> code.delx.au - refind/commitdiff
Further tweaks to new NTFS Windows boot partition filtering.
authorsrs5694 <srs5694@users.sourceforge.net>
Wed, 4 Feb 2015 21:09:38 +0000 (16:09 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Wed, 4 Feb 2015 21:09:38 +0000 (16:09 -0500)
CREDITS.txt
NEWS.txt
docs/refind/drivers.html
docs/refind/todo.html
icons/os_win8.png
refind/lib.c
refind/main.c

index 051d523b7460a741394b11c0c40e10e31eef79e3..887e8924197d81a179d4365702a4bf4f55c1ff58 100644 (file)
@@ -115,6 +115,12 @@ Icons and graphics:
   (http://en.wikipedia.org/wiki/File:Google_Chrome_icon_and_wordmark_%282011%29.svg),
   which in turn is Google's original work.
 
   (http://en.wikipedia.org/wiki/File:Google_Chrome_icon_and_wordmark_%282011%29.svg),
   which in turn is Google's original work.
 
+* The Windows 8 icon (icons/os_win8.png) is taken from Martz90's Cicle
+  Icons icon set
+  (http://www.iconarchive.com/show/circle-icons-by-martz90.html), which is
+  licensed under the CC Attribution-Noncommercial-No Derivate 4.0 license
+  (http://creativecommons.org/licenses/by-nc-nd/4.0/).
+
 * The icon used (at different sizes) for both the generic network OS and
   for the network-boot badge is from
   https://www.iconfinder.com/icons/37048/intranet_network_icon.
 * The icon used (at different sizes) for both the generic network OS and
   for the network-boot badge is from
   https://www.iconfinder.com/icons/37048/intranet_network_icon.
index 5d8a5ae8e08594bd7582806863a317bd4776951e..071b2ce1c989f9905fc502ee5ffa0ec300d70f13 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,16 @@
 0.8.6 (?/??/2016):
 ------------------
 
 0.8.6 (?/??/2016):
 ------------------
 
+- Addition of new Windows 8 OS icon. On Macs and for BIOS/legacy boots, the
+  new icon is now used for Windows Vista, 7, and 8, while the old one is
+  used for earlier versions of Windows. For EFI-mode boots, the new icon is
+  used universally.
+
+- If the NTFS driver is loaded, rEFInd now scans NTFS volumes on Macs for
+  the presence of Windows boot files, and removes any NTFS volume that
+  lacks such files from the BIOS/legacy boot list. This should help
+  unclutter the display on systems that contain NTFS data partitions.
+
 - Fixed bug that caused misidentification of both whole disks and NTFS
   volumes as being FAT. (This bug affected the identification of devices
   and locations in the rEFInd menu, not actual access to devices.)
 - Fixed bug that caused misidentification of both whole disks and NTFS
   volumes as being FAT. (This bug affected the identification of devices
   and locations in the rEFInd menu, not actual access to devices.)
index 36e800f297f81e0c32109af857d96c7fab7f0716..037763fc3f81abcaee7258951f929d301485f666 100644 (file)
@@ -261,9 +261,15 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <li><b>NTFS</b>&mdash;Samuel Liao contributed this driver, which uses the
     rEFIt/rEFInd driver framework. My own testing of it is limited, but it
     does work for me. Note that this driver is <i><b>not</b></i> required
 <li><b>NTFS</b>&mdash;Samuel Liao contributed this driver, which uses the
     rEFIt/rEFInd driver framework. My own testing of it is limited, but it
     does work for me. Note that this driver is <i><b>not</b></i> required
-    to boot Windows with rEFInd, since Windows stores its boot loader on
-    the (FAT) ESP. You might use this driver if you want to store large
-    boot files, such as EFI-accessible RAM disk images, from Windows.</li>
+    to boot Windows with rEFInd, since Windows stores its EFI boot loader
+    on the (FAT) ESP, and the BIOS boot process (generally used when
+    dual-booting on a Mac) relies only on the partition's boot sector,
+    which is read without the benefit of this driver. You might use this
+    driver if you want to store large boot files, such as EFI-accessible
+    RAM disk images, from Windows. Also, if you have NTFS data partitions
+    on a Mac, loading this driver should exclude them from the boot menu;
+    and you should see NTFS volume names in the boot menu on a Mac if you
+    load this driver.</li>
 
 </ul>
 
 
 </ul>
 
index 33f56136d963cc4858dd517a734e5427037678c4..b8930a184f0a179b7e60b2306c267f40ab2559f4 100644 (file)
@@ -209,6 +209,14 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        single file, so rEFInd is divorced from its configuration and
        support files.</li>
 
        single file, so rEFInd is divorced from its configuration and
        support files.</li>
 
+    <li>A way to identify specific Windows versions and present unique
+       icons or change the text is desirable. Currently, a crude
+       distinction of XP and earlier vs. Vista and later is possible for
+       BIOS-booting on Macs, but no such distinction is made for EFI-mode
+       booting, and nothing finer-grained is attempted. Improvements will
+       probably require identifying unique features of each version's boot
+       loader files or boot sector code.</li>
+
 </ul></li> <!-- Improvements -->
 
 <li><b>Known bugs that need squashing:</b>
 </ul></li> <!-- Improvements -->
 
 <li><b>Known bugs that need squashing:</b>
@@ -260,6 +268,14 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        have the equipment and skill to do so, I'd be interested in
        receiving a patch.</li>
 
        have the equipment and skill to do so, I'd be interested in
        receiving a patch.</li>
 
+    <li>If you use a true MBR disk on a Mac to boot Windows or some other
+       BIOS-only OS, and if that disk has an extended partition, that
+       partition may show up in rEFInd as a bootable FAT partition. The
+       reason is twofold: FAT doesn't contain a simple "magic" signature
+       like most filesystems, so it's easy to misidentify something else
+       as FAT; and it's hard to positively identify boot code vs. other
+       random data.</li>
+
     <li>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.</li>
     <li>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.</li>
index 1bbd727c8ead7f0c94537466f5c8fc21aac526ff..d1cdfaedfc95bdddfcfa4b3eb5bae6df363de5a7 100644 (file)
Binary files a/icons/os_win8.png and b/icons/os_win8.png differ
index 08550e26b2964f6d0df1cdd5d16d59ec18171267..48da11d0291ddd0e88f9ce9dc0dac62cdbff14fd 100644 (file)
@@ -630,14 +630,16 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
             Volume->OSIconName = L"netbsd";
             Volume->OSName = L"NetBSD";
 
             Volume->OSIconName = L"netbsd";
             Volume->OSName = L"NetBSD";
 
+        // Windows NT/200x/XP
         } else if (FindMem(Buffer, SECTOR_SIZE, "NTLDR", 5) >= 0) {
             Volume->HasBootCode = TRUE;
             Volume->OSIconName = L"win";
             Volume->OSName = L"Windows";
 
         } else if (FindMem(Buffer, SECTOR_SIZE, "NTLDR", 5) >= 0) {
             Volume->HasBootCode = TRUE;
             Volume->OSIconName = L"win";
             Volume->OSName = L"Windows";
 
+        // Windows Vista/7/8
         } else if (FindMem(Buffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) {
             Volume->HasBootCode = TRUE;
         } else if (FindMem(Buffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) {
             Volume->HasBootCode = TRUE;
-            Volume->OSIconName = L"winvista,win";
+            Volume->OSIconName = L"win8,win";
             Volume->OSName = L"Windows";
 
         } else if (FindMem(Buffer, 512, "CPUBOOT SYS", 11) >= 0 ||
             Volume->OSName = L"Windows";
 
         } else if (FindMem(Buffer, 512, "CPUBOOT SYS", 11) >= 0 ||
@@ -835,7 +837,7 @@ static CHAR16 *GetVolumeName(REFIT_VOLUME *Volume) {
    return FoundName;
 } // static CHAR16 *GetVolumeName()
 
    return FoundName;
 } // static CHAR16 *GetVolumeName()
 
-// Determine the unique GUID of the volume and store it.
+// Determine the unique GUID and name of the volume and store them.
 static VOID SetPartGuidAndName(REFIT_VOLUME *Volume, EFI_DEVICE_PATH_PROTOCOL *DevicePath) {
    HARDDRIVE_DEVICE_PATH    *HdDevicePath;
 
 static VOID SetPartGuidAndName(REFIT_VOLUME *Volume, EFI_DEVICE_PATH_PROTOCOL *DevicePath) {
    HARDDRIVE_DEVICE_PATH    *HdDevicePath;
 
@@ -851,16 +853,17 @@ static VOID SetPartGuidAndName(REFIT_VOLUME *Volume, EFI_DEVICE_PATH_PROTOCOL *D
    } // if
 } // VOID SetPartGuid()
 
    } // if
 } // VOID SetPartGuid()
 
-// Return TRUE if NTFS boot files are found, FALSE otherwise.
-// Assumes Volume is already mounted.
+// Return TRUE if NTFS boot files are found or if Volume is unreadable,
+// FALSE otherwise. The idea is to weed out non-boot NTFS volumes from
+// BIOS/legacy boot list on Macs. We can't assume NTFS will be readable,
+// so return TRUE if it's unreadable; but if it IS readable, return
+// TRUE only if Windows boot files are found.
 static BOOLEAN HasWindowsBiosBootFiles(REFIT_VOLUME *Volume) {
    BOOLEAN FilesFound = TRUE;
 
    if (Volume->RootDir != NULL) {
 static BOOLEAN HasWindowsBiosBootFiles(REFIT_VOLUME *Volume) {
    BOOLEAN FilesFound = TRUE;
 
    if (Volume->RootDir != NULL) {
-      FilesFound = (FileExists(Volume->RootDir, L"NTLDR") &&          // Windows XP boot files
-                    FileExists(Volume->RootDir, L"ntdetect.com") &&
-                    FileExists(Volume->RootDir, L"boot.ini")) ||
-                   FileExists(Volume->RootDir, L"Windows");           // Windows 7 ID (imperfect; TODO: Improve)
+      FilesFound = FileExists(Volume->RootDir, L"NTLDR") ||  // Windows NT/200x/XP boot file
+                   FileExists(Volume->RootDir, L"bootmgr");  // Windows Vista/7/8 boot file
    } // if
    return FilesFound;
 } // static VOID HasWindowsBiosBootFiles()
    } // if
    return FilesFound;
 } // static VOID HasWindowsBiosBootFiles()
@@ -991,7 +994,7 @@ VOID ScanVolume(REFIT_VOLUME *Volume)
       return;
    } else {
       Volume->IsReadable = TRUE;
       return;
    } else {
       Volume->IsReadable = TRUE;
-      if ((Volume->FSType == FS_TYPE_NTFS) && Volume->HasBootCode)
+      if ((GlobalConfig.LegacyType == LEGACY_TYPE_MAC) && (Volume->FSType == FS_TYPE_NTFS) && Volume->HasBootCode)
          Volume->HasBootCode = HasWindowsBiosBootFiles(Volume);
    } // if/else
 
          Volume->HasBootCode = HasWindowsBiosBootFiles(Volume);
    } // if/else
 
index f474a3740f5e7712dda4819b4fd73fb50adc8758..7fb2b73394c31ecca1a194ff0176e5d53d366b0a 100644 (file)
@@ -166,7 +166,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.5.6");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.5.7");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
@@ -1001,12 +1001,12 @@ VOID SetLoaderDefaults(LOADER_ENTRY *Entry, CHAR16 *LoaderPath, REFIT_VOLUME *Vo
               StriCmp(NameClues, L"bootmgr.efi") == 0 ||
               StriCmp(NameClues, L"bootmgfw.efi") == 0 ||
               StriCmp(NameClues, L"bkpbootmgfw.efi") == 0) {
               StriCmp(NameClues, L"bootmgr.efi") == 0 ||
               StriCmp(NameClues, L"bootmgfw.efi") == 0 ||
               StriCmp(NameClues, L"bkpbootmgfw.efi") == 0) {
-      MergeStrings(&OSIconName, L"win", L',');
+      MergeStrings(&OSIconName, L"win8", L',');
       Entry->OSType = 'W';
       ShortcutLetter = 'W';
       Entry->UseGraphicsMode = GlobalConfig.GraphicsFor & GRAPHICS_FOR_WINDOWS;
    } else if (StriCmp(NameClues, L"xom.efi") == 0) {
       Entry->OSType = 'W';
       ShortcutLetter = 'W';
       Entry->UseGraphicsMode = GlobalConfig.GraphicsFor & GRAPHICS_FOR_WINDOWS;
    } else if (StriCmp(NameClues, L"xom.efi") == 0) {
-      MergeStrings(&OSIconName, L"xom,win", L',');
+      MergeStrings(&OSIconName, L"xom,win,win8", L',');
       Entry->UseGraphicsMode = TRUE;
       Entry->OSType = 'X';
       ShortcutLetter = 'W';
       Entry->UseGraphicsMode = TRUE;
       Entry->OSType = 'X';
       ShortcutLetter = 'W';