]> code.delx.au - refind/blobdiff - refind/lib.c
Remove exFAT partitions from boot list under OS X unless they contain
[refind] / refind / lib.c
index 6d09f023872aa845daa69a946a24ac45c781e3d3..4989076e88bad395a9a4efaf8d4886eac82c390d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * refit/lib.c
+ * refind/lib.c
  * General library functions
  *
  * Copyright (c) 2006-2009 Christoph Pfisterer
@@ -201,6 +201,11 @@ EFI_STATUS InitRefitLib(IN EFI_HANDLE ImageHandle)
 // called before running external programs to close open file handles
 VOID UninitRefitLib(VOID)
 {
+    // This piece of code was made to correspond to weirdness in ReinitRefitLib().
+    // See the comment on it there.
+    if(SelfRootDir == SelfVolume->RootDir)
+        SelfRootDir=0;
+
     UninitVolumes();
 
     if (SelfDir != NULL) {
@@ -505,7 +510,7 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
     if (!EFI_ERROR(Status)) {
 
         Volume->FSType = IdentifyFilesystemType(Buffer, SAMPLE_SIZE);
-        if (*((UINT16 *)(Buffer + 510)) == 0xaa55 && Buffer[0] != 0) {
+        if ((*((UINT16 *)(Buffer + 510)) == 0xaa55 && Buffer[0] != 0) && (FindMem(Buffer, 512, "EXFAT", 5) == -1)) {
             *Bootable = TRUE;
             Volume->HasBootCode = TRUE;
         }