]> code.delx.au - refind/commitdiff
Added OS check to mkrlconf.sh. Bypass checks for BIOS-mode boot
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 21 Mar 2015 18:08:28 +0000 (14:08 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 21 Mar 2015 18:08:28 +0000 (14:08 -0400)
loaders when run on a UEFI-based PC, since these checks are useful
only on Macs.

NEWS.txt
mkrlconf.sh
refind/lib.c
refind/main.c

index 39316dca324eabfa51782503c4ebcec78a913001..71d48ad3f1db5af144ec35d25c0a114e3fab287c 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,14 @@
 0.8.8 (3/??/2015):
 ------------------
 
+- The mkrlconf.sh script now checks the OS on which it's running, which
+  should help avoid confusion or problems by users who mistakenly run it
+  under OS X.
+
+- rEFInd now skips checking for various BIOS-mode boot sector signatures
+  when running on a UEFI-based PC; these checks are run only on Macs. This
+  may reduce startup time on systems with many partitions.
+
 - Fixed Debian debinstall script to work correctly on IA32 systems. It had
   a bug that caused filesystem drivers and gptsync to not be packaged for
   IA32.
index 0a5d307e987a02e763146a1661624d60f84613fc..9028ef048a6f88bfb9af669cc176c2be9fe31d76 100755 (executable)
@@ -18,6 +18,7 @@
 
 # Revision history:
 #
+#  0.8.8 -- Added check for OS type, to keep from running pointlessly on OS X
 #  0.7.7 -- Fixed bug that caused stray PARTUUID= and line breaks in generated file
 #  0.5.1 -- Initial release
 #
 
 RLConfFile="/boot/refind_linux.conf"
 
+if [[ `uname -s` != "Linux" ]] ; then
+   echo "This script is intended to be run from Linux. Aborting!"
+   echo ""
+   exit 1
+fi
+
 if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then
    if [[ -f /etc/default/grub ]] ; then
       # We want the default options used by the distribution, stored here....
index 492541a7846f8d327ffc7ac1418c4e16bb29c6eb..7075630316754b27c8095b008e9415626766c9fe 100644 (file)
@@ -576,6 +576,13 @@ static VOID SetFilesystemData(IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT REFI
          } // if
       } // search for FAT and NTFS magic
 
+      // If no other filesystem is identified and block size is right, assume
+      // it's ISO-9660....
+      if (Volume->BlockIO->Media->BlockSize == 2048) {
+          Volume->FSType = FS_TYPE_ISO9660;
+          return;
+      }
+
    } // if ((Buffer != NULL) && (Volume != NULL))
 
 } // UINT32 SetFilesystemData()
@@ -603,8 +610,9 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
                                  Volume->BlockIO, Volume->BlockIO->Media->MediaId,
                                  Volume->BlockIOOffset, SAMPLE_SIZE, Buffer);
     if (!EFI_ERROR(Status)) {
-
         SetFilesystemData(Buffer, SAMPLE_SIZE, Volume);
+    }
+    if ((Status == EFI_SUCCESS) && (GlobalConfig.LegacyType == LEGACY_TYPE_MAC)) {
         if ((*((UINT16 *)(Buffer + 510)) == 0xaa55 && Buffer[0] != 0) && (FindMem(Buffer, 512, "EXFAT", 5) == -1)) {
             *Bootable = TRUE;
             Volume->HasBootCode = TRUE;
@@ -624,15 +632,6 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
             Volume->OSIconName = L"grub,linux";
             Volume->OSName = L"Linux";
 
-//         // Below doesn't produce a bootable entry, so commented out for the moment....
-//         // GRUB in BIOS boot partition:
-//         } else if (FindMem(Buffer, 512, "Geom\0Read\0 Error", 16) >= 0) {
-//             Volume->HasBootCode = TRUE;
-//             Volume->OSIconName = L"grub,linux";
-//             Volume->OSName = L"Linux";
-//             Volume->VolName = L"BIOS Boot Partition";
-//             *Bootable = TRUE;
-
         } else if ((*((UINT32 *)(Buffer + 502)) == 0 &&
                     *((UINT32 *)(Buffer + 506)) == 50000 &&
                     *((UINT16 *)(Buffer + 510)) == 0xaa55) ||
index 4c8bce1cf0a0061568f34419fbc0b776758cd198..3f40c1282b6d37cf7159169cc372d43df33fba02 100644 (file)
@@ -166,7 +166,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7.3");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");