]> code.delx.au - refind/commitdiff
Added max_tags option; new shell filenames; new rEFIt icon
authorsrs5694 <srs5694@users.sourceforge.net>
Wed, 4 Apr 2012 04:05:06 +0000 (00:05 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Wed, 4 Apr 2012 04:05:06 +0000 (00:05 -0400)
NEWS.txt
docs/refind/windows8-on-mac-efi.txt
icons/os_refit.icns
mkcdimage
refind.conf-sample
refind/config.c
refind/global.h
refind/lib.c
refind/main.c
refind/menu.c

index abfad768ec8349ed8a8f8d7d5713d64f0c98e445..e6132fae6fcbb4efece288a8e787ac5736198eae 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,25 @@
+0.2.4 (?/??/2012):
+------------------
+
+- Added max_tags option to the refind.conf file, enabling users to reduce
+  the maximum number of OS loader tags that can be displayed at once.
+
+- Updated rEFIt icon, based on the 128x128 volume label from the rEFIt CD
+  image.
+
+- Added x86 and x86-64 EFI shells to the CD image version of the binary,
+  but NOT to the binary zip file. The logic is that the CD image is more
+  likely to be used directly as an emergency disc and so may need this
+  feature, even though the source isn't part of the rEFInd project. (The
+  source is readily available from the TianoCore project.)
+
+- EFI shells may now be stored at /shellx64.efi for x86-64 systems or at
+  /shellia32.efi for x86 systems. The /EFI/tools/shell.efi name is also
+  recognized; however, if both files are present, two EFI shell icons will
+  appear on the main menu. The /efi/{refind-path/apps/shell.efi filename,
+  which was never officially documented but worked as a carryover from
+  rEFIt, is no longer valid.
+
 0.2.3 (3/26/2012):
 ------------------
 
index 160919f80463ac0c03f55eaadd25419c0a9c27a3..099d1a4dd32d857df563a5154b57e9e2e575fafd 100644 (file)
@@ -4,3 +4,4 @@ http://forums.macrumors.com/showpost.php?p=13381781&postcount=82
 
 http://forums.macrumors.com/showpost.php?p=14026284&postcount=170
 
+http://forums.macrumors.com/showpost.php?p=14631912&postcount=459
index 16ec814b29c475149004ae0193d9d36a7b2cb938..652c8b2a513c9bd2525e63784d6600878b07867c 100644 (file)
Binary files a/icons/os_refit.icns and b/icons/os_refit.icns differ
index 613ab62dba39538973c773a44a517bf82ea6979c..d38bcd86fc41a7fbfd0fdaae8bf2603bbe43f45e 100755 (executable)
--- a/mkcdimage
+++ b/mkcdimage
@@ -23,11 +23,16 @@ rm -rf temp
 mkdir temp
 cd temp
 unzip ../refind-bin-$Version.zip
+cp $StartDir/SHELLS.txt ./refind-bin-$Version
 
-# Create hard links to the files so that they'll be suitable for an
-# EFI-boot CD...
+# Create a boot directory and (temporarily) copy the EFI shell
+# files to it....
 mkdir -p refind-bin-$Version/EFI/boot
 cd refind-bin-$Version/EFI/boot
+cp $StartDir/shell*.efi ./
+
+# Create hard links to the rEFInd files so that they'll be suitable for an
+# EFI-boot CD...
 ln ../../refind/refind_ia32.efi ./bootia32.efi
 ln ../../refind/refind_x64.efi ./bootx64.efi
 ln ../../refind/refind.conf-sample ./refind.conf
@@ -41,18 +46,30 @@ ToritoSize=`du -s EFI | cut -f 1`
 let ToritoSize=($ToritoSize)/28
 let ToritoSize=($ToritoSize)*32
 
+# Move the EFI shell files back to the root where they belong
+# (They were in EFI/boot just so they'd get counted in ToritoSize)
+mv EFI/boot/shell*.efi ./
+
 # Prepare a FAT filesystem image and populate it with the
 # EFI boot files....
 dd if=/dev/zero of=refind-bin-$Version.img bs=1024 count=$ToritoSize
 mkdosfs -n "rEFInd.ET" refind-bin-$Version.img
-mcopy -irefind-bin-$Version.img -s EFI ::/
+mcopy -irefind-bin-$Version.img -s EFI shell*.efi ::/
 
 # Make the ISO-9660 image file....
 mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
     -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
-    -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
     -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
     -no-emul-boot ./
+    
+# Below is like above, but also creates an El Torito entry for BIOS
+# booting. That's useless, but in case something flakes out without
+# it, I'll preserve this version for a while....
+#mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
+#    -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
+#    -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
+#    -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
+#    -no-emul-boot ./
 
 cd ../../
 rm -r temp/
index 06ecaa98bffaff3739e0c44331d0916b10562b3b..336a11c72c3b351776a94af7e9ef510383c09f6d 100644 (file)
@@ -76,6 +76,15 @@ timeout 20
 # Default is internal,external,optical
 scanfor internal,external,optical
 
+# Set the maximum number of tags that can be displayed on the screen at
+# any time. If more loaders are discovered than this value, rEFInd shows
+# a subset in a scrolling list. If this value is set too high for the
+# screen to handle, it's reduced to the value that the screen can manage.
+# If this value is set to 0 (the default), it's adjusted to the number
+# that the screen can handle.
+#
+#max_tags 0
+
 # Set the default menu selection.  The available arguments match the
 # keyboard accelerators available within rEFInd.  You may select the default
 # loader using a one-character abbreviation for the OS name ("M" = Mac OS X,
index 36026c01690716217c460807ed1d36fb3f893dc6..2100a91b2606ff3263b184628bde810189f709d8 100644 (file)
@@ -390,6 +390,8 @@ VOID ReadConfig(VOID)
         } else if ((StriCmp(TokenList[0], L"}") == 0) || (StriCmp(TokenList[0], L"loader") == 0) ||
                    (StriCmp(TokenList[0], L"icon") == 0) || (StriCmp(TokenList[0], L"options") == 0)) {
            // Do nothing; handled by ScanUserConfigured()
+        } else if ((StriCmp(TokenList[0], L"max_tags") == 0) && (TokenCount > 1)) {
+           GlobalConfig.MaxTags = Atoi(TokenList[1]);
         }
 
         FreeTokenLine(&TokenList, &TokenCount);
index dccac51b40e469bb0400554c29273c4f0a19a735..2c0d681d358eeb406fc81ff9ed038fe2bcc00492 100644 (file)
@@ -147,7 +147,7 @@ typedef struct {
    UINTN       Timeout;
    UINTN       DisableFlags;
    UINTN       HideUIFlags;
-   BOOLEAN     Quiet;
+   UINTN       MaxTags;     // max. number of entries to show simultaneously in graphics mode
    CHAR16      *BannerFileName;
    CHAR16      *SelectionSmallFileName;
    CHAR16      *SelectionBigFileName;
index 3feacbe93e44c90de1c9d091d50114a62d98ffb2..b0090c66c43a406065d286421b74699a38d4c7fe 100644 (file)
@@ -1048,7 +1048,7 @@ VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar) {
             NewString[Length1] = AddChar;
             NewString[Length1 + 1] = 0;
          } // if (AddChar)
-      } // if (First != NULL)
+      } // if (*First != NULL)
       if (First != NULL)
          StrCat(NewString, Second);
       FreePool(*First);
index 48f41fee46a2acf0fde9ebd1f6c3ebcb94acb3db..9612f4da2641f8bbbcedb139b1290e4398e9c8d2 100644 (file)
 // variables
 
 #define MACOSX_LOADER_PATH      L"\\System\\Library\\CoreServices\\boot.efi"
+#if defined (EFIX64)
+#define SHELL_NAMES             L"\\EFI\\tools\\shell.efi,\\shellx64.efi"
+#elif defined (EFI32)
+#define SHELL_NAMES             L"\\EFI\\tools\\shell.efi,\\shellia32.efi"
+#else
+#define SHELL_NAMES             L"\\EFI\\tools\\shell.efi"
+#endif
 
 static REFIT_MENU_ENTRY MenuEntryAbout    = { L"About rEFInd", TAG_ABOUT, 1, 0, 'A', NULL, NULL, NULL };
 static REFIT_MENU_ENTRY MenuEntryReset    = { L"Restart Computer", TAG_RESET, 1, 0, 'R', NULL, NULL, NULL };
@@ -64,7 +71,7 @@ static REFIT_MENU_ENTRY MenuEntryReturn   = { L"Return to Main Menu", TAG_RETURN
 static REFIT_MENU_SCREEN MainMenu       = { L"Main Menu", NULL, 0, NULL, 0, NULL, 0, L"Automatic boot" };
 static REFIT_MENU_SCREEN AboutMenu      = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL };
 
-REFIT_CONFIG        GlobalConfig = { FALSE, 20, 0, 0, FALSE, NULL, NULL, NULL, NULL };
+REFIT_CONFIG        GlobalConfig = { FALSE, 20, 0, 0, 0, NULL, NULL, NULL, NULL };
 
 //
 // misc functions
@@ -74,11 +81,12 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.3");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.3.3");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
         AddMenuInfoLine(&AboutMenu, L"Portions Copyright (c) Intel Corporation and others");
+        AddMenuInfoLine(&AboutMenu, L"Distributed under the terms of the GNU GPLv3 license");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Running on:");
         AddMenuInfoLine(&AboutMenu, PoolPrint(L" EFI Revision %d.%02d",
@@ -614,7 +622,8 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path)
           if (DirEntry->FileName[0] == '.' ||
               StriCmp(DirEntry->FileName, L"TextMode.efi") == 0 ||
               StriCmp(DirEntry->FileName, L"ebounce.efi") == 0 ||
-              StriCmp(DirEntry->FileName, L"GraphicsConsole.efi") == 0)
+              StriCmp(DirEntry->FileName, L"GraphicsConsole.efi") == 0 ||
+              StriSubCmp(L"shell", DirEntry->FileName))
                 continue;   // skip this
 
           if (Path)
@@ -639,7 +648,6 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) {
    REFIT_DIR_ITER          EfiDirIter;
    EFI_FILE_INFO           *EfiDirEntry;
    CHAR16                  FileName[256];
-//   LOADER_ENTRY            *Entry;
 
    if ((Volume->RootDir != NULL) && (Volume->VolName != NULL)) {
       // check for Mac OS X boot loader
@@ -670,7 +678,7 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) {
       // scan subdirectories of the EFI directory (as per the standard)
       DirIterOpen(Volume->RootDir, L"EFI", &EfiDirIter);
       while (DirIterNext(&EfiDirIter, 1, NULL, &EfiDirEntry)) {
-         if (StriCmp(EfiDirEntry->FileName, L"TOOLS") == 0 || EfiDirEntry->FileName[0] == '.')
+         if (StriCmp(EfiDirEntry->FileName, L"tools") == 0 || EfiDirEntry->FileName[0] == '.')
             continue;   // skip this, doesn't contain boot loaders
          SPrint(FileName, 255, L"EFI\\%s", EfiDirEntry->FileName);
          ScanLoaderDir(Volume, FileName);
@@ -1061,35 +1069,36 @@ static LOADER_ENTRY * AddToolEntry(IN CHAR16 *LoaderPath, IN CHAR16 *LoaderTitle
     return Entry;
 } /* static LOADER_ENTRY * AddToolEntry() */
 
+// Check the disk for add-on tools -- an EFI shell, the dangerous gptsync.efi, and a rescue Linux
+// installation.
 static VOID ScanTool(VOID)
 {
-    CHAR16                  FileName[256];
+    CHAR16                  *FileName;
     LOADER_ENTRY            *Entry;
+    UINTN                   i = 0;
 
     if (GlobalConfig.DisableFlags & DISABLE_FLAG_TOOLS)
         return;
 
     // look for the EFI shell
-    if (!(GlobalConfig.DisableFlags & DISABLE_FLAG_SHELL)) {
-        SPrint(FileName, 255, L"%s\\apps\\shell.efi", SelfDirPath);
-        if (FileExists(SelfRootDir, FileName)) {
-            AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
-        } else {
-            StrCpy(FileName, L"\\efi\\tools\\shell.efi");
-            if (FileExists(SelfRootDir, FileName)) {
-                AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
-            }
-        }
-    }
+    while (((FileName = FindCommaDelimited(SHELL_NAMES, i++)) != NULL) && (!(GlobalConfig.DisableFlags & DISABLE_FLAG_SHELL))) {
+       if (FileExists(SelfRootDir, FileName)) {
+          AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
+       }
+       FreePool(FileName);
+       FileName = NULL;
+    } // while
 
     // look for the GPT/MBR sync tool
-    StrCpy(FileName, L"\\efi\\tools\\gptsync.efi");
+    MergeStrings(&FileName, L"\\efi\\tools\\gptsync.efi", 0);
     if (FileExists(SelfRootDir, FileName)) {
         AddToolEntry(FileName, L"Make Hybrid MBR", BuiltinIcon(BUILTIN_ICON_TOOL_PART), 'P', FALSE);
     }
+    FreePool(FileName);
+    FileName = NULL;
 
     // look for rescue Linux
-    StrCpy(FileName, L"\\efi\\rescue\\elilo.efi");
+    MergeStrings(&FileName, L"\\efi\\rescue\\elilo.efi", 0);
     if (SelfVolume != NULL && FileExists(SelfRootDir, FileName)) {
         Entry = AddToolEntry(FileName, L"Rescue Linux", BuiltinIcon(BUILTIN_ICON_TOOL_RESCUE), '0', FALSE);
         
@@ -1100,7 +1109,8 @@ static VOID ScanTool(VOID)
         else
             Entry->LoadOptions = L"-d 0 mini";
     }
-}
+    FreePool(FileName);
+} /* VOID ScanTool() */
 
 
 #ifdef DEBIAN_ENABLE_EFI110
index aedeb22f699c47c675d39cc453862e337b2f539c..a1120ba289f5d67ec41738113ca40129029ab5d4 100644 (file)
@@ -166,9 +166,8 @@ static VOID InitScroll(OUT SCROLL_STATE *State, IN UINTN ItemCount, IN UINTN Vis
     State->LastSelection = State->CurrentSelection = 0;
     State->MaxIndex = (INTN)ItemCount - 1;
     State->FirstVisible = 0;
-    if (VisibleSpace == 0)
-       State->MaxVisible = UGAWidth / (ROW0_TILESIZE + TILE_XSPACING) - 1;
-    else
+    State->MaxVisible = UGAWidth / (ROW0_TILESIZE + TILE_XSPACING) - 1;
+    if ((VisibleSpace > 0) && (VisibleSpace < State->MaxVisible))
         State->MaxVisible = (INTN)VisibleSpace;
     State->PaintAll = TRUE;
     State->PaintSelection = FALSE;
@@ -729,7 +728,7 @@ VOID MainMenuStyle(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, IN UINT
     switch (Function) {
         
         case MENU_FUNCTION_INIT:
-            InitScroll(State, Screen->EntryCount, 0);
+            InitScroll(State, Screen->EntryCount, GlobalConfig.MaxTags);
             
             // layout
             row0Count = 0;