(Gentoo could use it in an ebuild, though....) You COULD, however, copy the
files to a directory somewhere (/usr/share/refind or whatever) and then
call install.sh as part of the binary package installation process.
+Placing the files in /boot/efi/EFI/{distname}/refind and then having a
+post-install script call efibootmgr is probably the better way to go,
+though.
-0.3.4 (?/??/2012):
-------------------
+0.3.4 (5/9/2012):
+-----------------
- Added new configuration file option: "icons_dir", which sets the name
of the subdirectory in which icons are found. See the documentation or
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
\r
<p>Originally written: 3/14/2012; last Web page update:\r
-5/6/2012, referencing rEFInd 0.3.3</p>\r
+5/9/2012, referencing rEFInd 0.3.4</p>\r
\r
\r
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>\r
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<tr>
<td><tt>icons_dir</tt></td>
<td>directory name</td>
- <td>Specifies a directory in which custom icons may be found. This directory should contain files with the same names as the files in the standard <tt>icons</tt> directory. The directory name is specified relative to the directory in which the rEFInd binary resides.</td>
+ <td>Specifies a directory in which custom icons may be found. This directory should contain files with the same names as the files in the standard <tt>icons</tt> directory. The directory name is specified relative to the directory in which the rEFInd binary resides. The standard <tt>icons</tt> directory is searched if an icon can't be found in the one specified by <tt>icons_dir</tt>, so you can use this location to redefine just some icons.</td>
</tr>
<tr>
<td><tt>banner</tt></td>
<tr>
<td><tt>icon</tt></td>
<td>filename</td>
- <td>Sets the filename for an icon for the menu. If you omit this item, a default icon will be used, based on rEFInd's auto-detection algorithms.</td>
+ <td>Sets the filename for an icon for the menu. If you omit this item, a default icon will be used, based on rEFInd's auto-detection algorithms. The filename should be a complete path from the root of the current directory, not relative to the default icons subdirectory or the one set via <tt>icons_dir</tt>.</td>
</tr>
<tr>
<td><tt>ostype</tt></td>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 4/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<li>The ability to specify additional directories to scan for boot loaders and drivers (as of version 0.2.7).</li>
+<li>The ability to specify an additional icon storage directory, to assist in efforts to customize rEFInd's appearance (as of version 0.3.4).</li>
+
<li>The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).</li>
<li>Proper handling of more OS options than can fit on the screen. (rEFIt displays an empty list in graphical mode when it detects too many OSes.)</li>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<ul>
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.3/refind-src-0.3.3.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.4/refind-src-0.3.4.zip/download">A
source code zip file</a></b>—This is useful if you want to
compile the software locally. Note that I use Linux with the <a
href="http://sourceforge.net/projects/gnu-efi">GNU-EFI</a> development
it.</li>
<li><b><a
- href="http://sourceforge.net/projects/refind/files/0.3.3/refind-bin-0.3.3.zip/download">A
+ href="http://sourceforge.net/projects/refind/files/0.3.4/refind-bin-0.3.4.zip/download">A
binary zip file</a></b>—Download this if you want to install
rEFInd on an <i>x</i>86 or <i>x</i>86-64 computer and have no need to
test rEFInd first by booting it on an optical disc. This zip file
href="installing.html">Installing rEFInd</a> page.</li>
<li><b><a
- href="http://sourceforge.net/projects/refind/files/0.3.3/refind-cd-0.3.3.zip/download">A
+ href="http://sourceforge.net/projects/refind/files/0.3.4/refind-cd-0.3.4.zip/download">A
CD-R image file</a></b>—This download contains the same files as
the zip file, but you can burn it to a CD-R to test rEFInd without
installing it first. (It boots on UEFI PCs, but fails on some older
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<p class="subhead">by Roderick W. Smith, <a
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
-<p>Last Web page update: 5/6/2012</p>
+<p>Last Web page update: 5/9/2012</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<ul>
+<li><b>0.3.4 (5/9/2012)</b>—The biggest change to this version is the addition of the <tt>icons_dir</tt> configuration file token, which enables you to specify a directory that holds icons that override those in the default <tt>icons</tt> subdirectory. See the <a href="themes.html">Theming rEFInd</a> and <a href="configfile.html">Configuring the Boot Manager</a> pages for details. This version also reduces flicker when moving your selection around the screen and modifies the <tt>install.sh</tt> script so that it can be used directly after building rEFInd from source code. Related to this, building from source now creates a binary that includes an architecture code—<tt>refind_ia32.efi</tt> or <tt>refind_x64.efi</tt> rather than <tt>refind.efi</tt>.</li>
+
<li><b>0.3.3 (5/6/2012)</b>—I've focused on user interface improvements for this release. The biggest improvement is in the text-mode interface, which suffered from assorted display glitches in previous releases. These have now been fixed, so the text-mode interface should be more usable. I've also fine-tuned the use of keyboard keys, particularly in graphical mode. The up and down arrow keys now move between the two rows of the display, and Page Up and Page Down scroll the first row if it's too big for the display. (They'll also move between rows, but only when at the end of the first row or the start of the second.) Returning from a failed loader or a tool or built-in function now renders that tag as the currently-selected item, rather than setting the default loader as active, as happened with previous versions.</li>
<li><b>0.3.2 (5/4/2012)</b>—rEFInd's core functionality changes very little with this version; I've tweaked the detection of BIOS-mode boot loaders to keep unbootable FAT partitions created under Linux and Windows out of the boot list, while adding detection of GRUB BIOS Boot Partitions to the list. I've also made a change that improves screen-clearing when launching EFI utilities and OSes in text mode. The major change to this version is the addition of a new Linux/OS X installation script, <tt>install.sh</tt>. In most cases, this makes it possible to install rEFInd simply by typing <tt class="userinput">./install.sh</tt> from the rEFInd package directory; however, you should see the <a href="installing.html">Installing rEFInd</a> page for details. In some cases, manual installation may still be required. Also, you may prefer to copy over the old rEFInd program file with the new one when upgrading.</li>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 4/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.4</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<ul>
-<li>You can create new icons, place them in a subdirectory rEFInd's main directory, and tell the program to use the new icons by setting the <tt>icons_dir</tt> token in <tt>refind.conf</tt>. This will affect the appearance of the OS tags, the utility tags, and so on. The names of these icons should match those in the <tt>icons</tt> subdirectory, and are fairly self-explanatory. Be aware that rEFInd expects its icons to be in Apple's <a href="http://en.wikipedia.org/wiki/Icns">icon image format (ICNS).</a> You can generate such files easily in various Apple programs, or by using the <a href="http://icns.sourceforge.net/">libicns</a> library (and in particular its <tt>png2icns</tt> program) in Linux.</li>
+<li>You can create new icons, place them in a subdirectory of rEFInd's main directory, and tell the program to use the new icons by setting the <tt>icons_dir</tt> token in <tt>refind.conf</tt>. This will affect the appearance of the OS tags, the utility tags, and so on. The names of these icons should match those in the <tt>icons</tt> subdirectory, and are fairly self-explanatory. If an icon is missing from the directory specified by <tt>icons_dir</tt>, rEFInd falls back to the icon from the standard <tt>icons</tt> subdirectory; thus, you can replace just a subset of the standard icons. Be aware that rEFInd expects its icons to be in Apple's <a href="http://en.wikipedia.org/wiki/Icns">icon image format (ICNS).</a> You can generate such files easily in various Apple programs, or by using the <a href="http://icns.sourceforge.net/">libicns</a> library (and in particular its <tt>png2icns</tt> program) in Linux.</li>
<li>You can do as above, but place your new icons in the default <tt>icons</tt> subdirectory. This method is discouraged because using the <tt>install.sh</tt> script to upgrade rEFInd will replace your customized icons.</li>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
themes for rEFInd, see the <a href="themes.html">Theming rEFInd</a>
page.</li>
-<li>If the <tt>icons_dir</tt> option points to a non-existent directory,
- the program displays ugly "icon-missing" icons. It would be better to
- drop back to the default icon set.</li>
-
<li>The code could be more flexible in its handling of the sizes of various
graphical elements, and particularly drawn text. Prior to version
0.2.2, submenu text was invisible on UEFI-based PCs with 800x600 and
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
*/
#include "libegint.h"
+#include "../refind/global.h"
+#include "../refind/lib.h"
#include "refit_call_wrapper.h"
#define MAX_FILE_SIZE (1024*1024*1024)
EG_IMAGE * egCreateImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha)
{
EG_IMAGE *NewImage;
-
+
NewImage = (EG_IMAGE *) AllocatePool(sizeof(EG_IMAGE));
if (NewImage == NULL)
return NULL;
FreePool(NewImage);
return NULL;
}
-
+
NewImage->Width = Width;
NewImage->Height = Height;
NewImage->HasAlpha = HasAlpha;
EG_IMAGE * egCreateFilledImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha, IN EG_PIXEL *Color)
{
EG_IMAGE *NewImage;
-
+
NewImage = egCreateImage(Width, Height, HasAlpha);
if (NewImage == NULL)
return NULL;
-
+
egFillImage(NewImage, Color);
return NewImage;
}
Status = refit_call5_wrapper(BaseDir->Open, BaseDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) {
-// Print(L"Returning %d from egLoadFile() because of an error on open!\n", Status);
return Status;
}
FileInfo = LibFileInfo(FileHandle);
if (FileInfo == NULL) {
refit_call1_wrapper(FileHandle->Close, FileHandle);
-// Print(L"LibFileInfo() returned NULL!\n");
return EFI_NOT_FOUND;
}
ReadSize = FileInfo->FileSize;
refit_call1_wrapper(FileHandle->Close, FileHandle);
return EFI_OUT_OF_RESOURCES;
}
-
+
Status = refit_call3_wrapper(FileHandle->Read, FileHandle, &BufferSize, Buffer);
refit_call1_wrapper(FileHandle->Close, FileHandle);
if (EFI_ERROR(Status)) {
*FileData = Buffer;
*FileDataLength = BufferSize;
-// Print(L"In egLoadFile(), Returning EFI_SUCCESS\n");
return EFI_SUCCESS;
}
return NewImage;
}
-EG_IMAGE * egLoadIcon(IN EFI_FILE* BaseDir, IN CHAR16 *FileName, IN UINTN IconSize)
+// Load an icon from (BaseDir)/Path, extracting the icon of size IconSize x IconSize.
+// If the initial attempt is unsuccessful, try again, replacing the directory
+// component of Path with DEFAULT_ICONS_DIR.
+// Note: The assumption is that BaseDir points to rEFInd's home directory and Path
+// includes one subdirectory level. If this changes in future revisions, it may be
+// necessary to alter the code that tries again with DEFAULT_ICONS_DIR.
+// Returns a pointer to the image data, or NULL if the icon could not be loaded.
+EG_IMAGE * egLoadIcon(IN EFI_FILE* BaseDir, IN CHAR16 *Path, IN UINTN IconSize)
{
EFI_STATUS Status;
UINT8 *FileData;
UINTN FileDataLength;
+ CHAR16 *FileName, FileName2[256];
EG_IMAGE *NewImage;
- if (BaseDir == NULL || FileName == NULL)
+ if (BaseDir == NULL || Path == NULL)
return NULL;
// load file
- Status = egLoadFile(BaseDir, FileName, &FileData, &FileDataLength);
+ Status = egLoadFile(BaseDir, Path, &FileData, &FileDataLength);
if (EFI_ERROR(Status)) {
-// Print(L"In egLoadIcon(), Status = %d after egLoadFile(); aborting load!\n", Status);
- return NULL;
+ FileName = Basename(Path); // Note: FileName is a pointer within Path; DON'T FREE IT!
+ SPrint(FileName2, 255, L"%s\\%s", DEFAULT_ICONS_DIR, FileName);
+ Status = egLoadFile(BaseDir, FileName2, &FileData, &FileDataLength);
+ if (EFI_ERROR(Status))
+ return NULL;
}
// decode it
- NewImage = egDecodeAny(FileData, FileDataLength, egFindExtension(FileName), IconSize, TRUE);
-// Print(L"Done with egDecodeAny(), used extension '%s'\n", egFindExtension(FileName));
-// if (NewImage == NULL)
-// Print(L"Returning NULL from egLoadIcon()\n");
+ NewImage = egDecodeAny(FileData, FileDataLength, egFindExtension(Path), IconSize, TRUE);
FreePool(FileData);
return NewImage;
-}
+} // EG_IMAGE *egLoadIcon()
EG_IMAGE * egDecodeImage(IN UINT8 *FileData, IN UINTN FileDataLength, IN CHAR16 *Format, IN BOOLEAN WantAlpha)
{
UINT8 *CompData;
UINTN CompLen;
UINTN PixelCount;
-
+
// sanity check
if (EmbeddedImage->PixelMode > EG_MAX_EIPIXELMODE ||
(EmbeddedImage->CompressMode != EG_EICOMPMODE_NONE && EmbeddedImage->CompressMode != EG_EICOMPMODE_RLE))
return NULL;
-
+
// allocate image structure and pixel buffer
NewImage = egCreateImage(EmbeddedImage->Width, EmbeddedImage->Height, WantAlpha);
if (NewImage == NULL)
return NULL;
-
+
CompData = (UINT8 *)EmbeddedImage->Data; // drop const
CompLen = EmbeddedImage->DataLength;
PixelCount = EmbeddedImage->Width * EmbeddedImage->Height;
-
+
// FUTURE: for EG_EICOMPMODE_EFICOMPRESS, decompress whole data block here
-
+
if (EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY ||
EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY_ALPHA) {
-
+
// copy grayscale plane and expand
if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, r), PixelCount);
}
egCopyPlane(PLPTR(NewImage, r), PLPTR(NewImage, g), PixelCount);
egCopyPlane(PLPTR(NewImage, r), PLPTR(NewImage, b), PixelCount);
-
+
} else if (EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR ||
EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR_ALPHA) {
-
+
// copy color planes
if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, r), PixelCount);
egInsertPlane(CompData, PLPTR(NewImage, b), PixelCount);
CompData += PixelCount;
}
-
+
} else {
-
+
// set color planes to black
egSetPlane(PLPTR(NewImage, r), 0, PixelCount);
egSetPlane(PLPTR(NewImage, g), 0, PixelCount);
egSetPlane(PLPTR(NewImage, b), 0, PixelCount);
-
+
}
-
+
if (WantAlpha && (EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY_ALPHA ||
EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR_ALPHA ||
EmbeddedImage->PixelMode == EG_EIPIXELMODE_ALPHA)) {
-
+
// copy alpha plane
if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, a), PixelCount);
egInsertPlane(CompData, PLPTR(NewImage, a), PixelCount);
CompData += PixelCount;
}
-
+
} else {
egSetPlane(PLPTR(NewImage, a), WantAlpha ? 255 : 0, PixelCount);
}
-
+
return NewImage;
}
# Set the name of a subdirectory in which icons are stored. Icons must
# have the same names they have in the standard directory. The directory
-# name is specified relative to the main rEFInd binary's directory.
+# name is specified relative to the main rEFInd binary's directory. If
+# an icon can't be found in the specified directory, an attempt is made
+# to load it from the default directory; thus, you can replace just some
+# icons in your own directory and rely on the default for others.
# Default is "icons".
#
#icons_dir myicons
}
YPtr += LineOffset;
}
-
+
return Image;
}
{
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.3.2");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.4");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");