]> code.delx.au - refind/commitdiff
Fixed bug that caused rEFInd to ignore manual boot stanzas in files
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 24 Jan 2013 03:36:20 +0000 (22:36 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 24 Jan 2013 03:36:20 +0000 (22:36 -0500)
included via the "include" token in refind.conf.

NEWS.txt
docs/refind/bootmode.html
refind/config.c
refind/config.h
refind/main.c

index d3c870c94653ec16694b3a115fbc3c70584a6e3f..a4b5d8b92501d8aecab89d145ab53cb613b4869c 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,9 @@
 0.6.6 (?/??/2013):
 ------------------
 
+- Fixed bug that caused rEFInd to ignore manual boot stanzas in files
+  included via the "include" token in refind.conf.
+
 - Fixed bug that caused ASSERT error on some systems (and conceivably a
   crash on startup on some) when default_selection line in refind.conf was
   commented out or empty.
index 09441d65abbe3b3b813a3cc61f2ec4e47fd4a762..cc2239de62129a77fa9fc714f584b8d270aacb63 100644 (file)
@@ -177,6 +177,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <h2>Identifying Your Windows Boot Mode</h2>\r
 </a>\r
 \r
+<!-- NOTE: I have serious doubts about this method's reliability, so I'm commenting it out for now....\r
+\r
 <p>The easiest way to determine your boot mode in Windows is probably to use the <tt>bcdedit</tt> program to examine your boot loader configuration. To do so, launch an administrative Command Prompt (by right-clicking a Command Prompt icon and selecting Run As Administrator from the context menu) and then type <tt class="userinput">bcdedit</tt> in the window. The result will include two blocks of information, on the boot manager and the boot loader. The latter is more diagnostic. On an EFI-booted system, it will resemble the following:</p>\r
 \r
 <pre class="listing">Windows Boot Loader\r
@@ -193,8 +195,9 @@ systemroot              \Windows
 resumeobject            {3aa4c728-9935-11e0-9f12-806e6f6e6963}</pre>\r
 \r
 <p>The important part is the value of the <tt>path</tt> line. Note that it identifies an EFI executable&mdash;<tt>\Windows\system32\winload.efi</tt>. On a BIOS-based computer, by contrast, this line refers to <tt>\Windows\system32\winload.exe</tt>&mdash;a standard Windows <tt>.exe</tt> file, not an EFI <tt>.efi</tt> file.</p>\r
+-->\r
 \r
-<p>Another way to identify your boot mode is to examine your partitions. Microsoft has tied use of the GUID Partition Table (GPT) to EFI booting. If you've booted from a GPT disk, then you <i>must</i> be using EFI, and if you've booted from a Master Boot Record (MBR) disk, you <i>must</i> have booted in BIOS mode. Therefore, you can check your partition table type as a proxy for your boot mode. To do this in Windows 7, follow these steps:</p>\r
+<p>The most reliable way I know of to identify your boot mode is to examine your partitions. Microsoft has tied use of the GUID Partition Table (GPT) to EFI booting. If you've booted from a GPT disk, then you <i>must</i> be using EFI, and if you've booted from a Master Boot Record (MBR) disk, you <i>must</i> have booted in BIOS mode. Therefore, you can check your partition table type as a proxy for your boot mode. To do this in Windows 7, follow these steps:</p>\r
 \r
 <ol>\r
 \r
index 8c18f41e45e79c6cd1f9b006d7531f7ff4ac9e76..ffe1970f562dc5b7a1858a9d14f1724f07dee382 100644 (file)
@@ -362,7 +362,7 @@ VOID ReadConfig(CHAR16 *FileName)
        GlobalConfig.DontScanDirs = SelfPath;
        MyFreePool(GlobalConfig.DontScanFiles);
        GlobalConfig.DontScanFiles = StrDuplicate(DONT_SCAN_FILES);
-    }
+    } // if
 
     if (!FileExists(SelfDir, FileName)) {
         Print(L"Configuration file '%s' missing!\n", FileName);
@@ -731,7 +731,7 @@ static LOADER_ENTRY * AddStanzaEntries(REFIT_FILE *File, REFIT_VOLUME *Volume, C
 
 // Read the user-configured menu entries from refind.conf and add or delete
 // entries based on the contents of that file....
-VOID ScanUserConfigured(VOID)
+VOID ScanUserConfigured(CHAR16 *FileName)
 {
    EFI_STATUS        Status;
    REFIT_FILE        File;
@@ -741,8 +741,8 @@ VOID ScanUserConfigured(VOID)
    UINTN             TokenCount, size;
    LOADER_ENTRY      *Entry;
 
-   if (FileExists(SelfDir, CONFIG_FILE_NAME)) {
-      Status = ReadFile(SelfDir, CONFIG_FILE_NAME, &File, &size);
+   if (FileExists(SelfDir, FileName)) {
+      Status = ReadFile(SelfDir, FileName, &File, &size);
       if (EFI_ERROR(Status))
          return;
 
@@ -760,7 +760,13 @@ VOID ScanUserConfigured(VOID)
                MyFreePool(Entry);
             } // if/else
             MyFreePool(Title);
-         } // if
+
+         } else if ((StriCmp(TokenList[0], L"include") == 0) && (TokenCount == 2) && (StriCmp(FileName, CONFIG_FILE_NAME) == 0)) {
+            if (StriCmp(TokenList[1], FileName) != 0) {
+               ScanUserConfigured(TokenList[1]);
+            }
+
+         } // if/else if...
          FreeTokenLine(&TokenList, &TokenCount);
       } // while()
    } // if()
index cafcb4f95ccd3643e451ae1f5c0ec02b8e95f351..79acf2122ee60b5c8b7b729ee701b7247a70a2a5 100644 (file)
@@ -84,7 +84,7 @@ typedef struct {
 
 EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size);
 VOID ReadConfig(CHAR16 *FileName);
-VOID ScanUserConfigured(VOID);
+VOID ScanUserConfigured(CHAR16 *FileName);
 UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList);
 VOID FreeTokenLine(IN OUT CHAR16 ***TokenList, IN OUT UINTN *TokenCount);
 REFIT_FILE * ReadLinuxOptionsFile(IN CHAR16 *LoaderPath, IN REFIT_VOLUME *Volume);
index 10349272587df1a6324e177cedfd9e130e367675..3e1061ac9d1f0da354c8ec9332e87d99999bb424 100644 (file)
@@ -128,7 +128,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5.4");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5.5");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -1828,7 +1828,7 @@ static VOID ScanForBootloaders(VOID) {
             ScanLegacyExternal();
             break;
          case 'm': case 'M':
-            ScanUserConfigured();
+            ScanUserConfigured(CONFIG_FILE_NAME);
             break;
          case 'e': case 'E':
             ScanExternal();