LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
LIBS = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
FORMAT = efi-app-$(ARCH)
+FORMAT_DRIVER = efi-bsdrv-$ARCH)
# general rules
OBJS=$(NAMES:=.o)
HEADERS=$(NAMES:=.h)
LOADER_DIR=refind
+FS_DIR=filesystems
LIB_DIR=libeg
# Build the Symbiote library itself.
all:
make -C $(LIB_DIR)
make -C $(LOADER_DIR)
+# make -C $(FS_DIR)
+
+filesystems:
+ make -C $(FS_DIR)
clean:
make -C $(LIB_DIR) clean
make -C $(LOADER_DIR) clean
+# make -C $(FS_DIR) clean
# NOTE TO DISTRIBUTION MAINTAINERS:
# The "install" target installs the program directly to the ESP
+0.3.6 (?/??/2012):
+------------------
+
+- Added new feature to eject CDs (and other removable media): Press F12
+ to eject all such media.
+
+- Fixed a problem that could cause GRUB 2 to fail to read its configuration
+ file when launched from rEFInd.
+
0.3.5 (5/15/2012):
------------------
#include "icns.h"
#include "screen.h"
#include "refit_call_wrapper.h"
+#include "RemovableMedia.h"
// variables
} // if
return (FoundString);
} // CHAR16 *FindCommaDelimited()
+
+
+static EFI_GUID AppleRemovableMediaGuid = APPLE_REMOVABLE_MEDIA_PROTOCOL_GUID;
+
+// Eject all removable media
+VOID EjectMedia(VOID) {
+ EFI_STATUS Status;
+ UINTN HandleIndex, HandleCount = 0;
+ EFI_HANDLE *Handles, Handle;
+ APPLE_REMOVABLE_MEDIA_PROTOCOL *Ejectable;
+
+ Status = LibLocateHandle(ByProtocol, &AppleRemovableMediaGuid, NULL, &HandleCount, &Handles);
+ if (EFI_ERROR(Status) || HandleCount == 0)
+ return; // probably not an Apple system
+
+ for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
+ Handle = Handles[HandleIndex];
+ Status = refit_call3_wrapper(BS->HandleProtocol, Handle, &AppleRemovableMediaGuid, (VOID **) &Ejectable);
+ if (EFI_ERROR(Status))
+ continue;
+ Status = refit_call1_wrapper(Ejectable->Eject, Ejectable);
+ }
+ FreePool(Handles);
+} // VOID EjectMedia()
CHAR16 *FindNumbers(IN CHAR16 *InString);
CHAR16 *FindCommaDelimited(IN CHAR16 *InString, IN UINTN Index);
+VOID EjectMedia(VOID);
+
#endif
\ No newline at end of file
{
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.5");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.5.1");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
Entry->me.Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : LoaderPath, Volume->VolName);
Entry->me.Row = 0;
Entry->me.BadgeImage = Volume->VolBadgeImage;
- Entry->LoaderPath = StrDuplicate(LoaderPath);
+ if ((LoaderPath != NULL) && (LoaderPath[0] != L'\\')) {
+ Entry->LoaderPath = StrDuplicate(L"\\");
+ } else {
+ Entry->LoaderPath = NULL;
+ }
+ MergeStrings(&(Entry->LoaderPath), LoaderPath, 0);
+// Entry->LoaderPath = StrDuplicate(LoaderPath);
Entry->VolName = Volume->VolName;
Entry->DevicePath = FileDevicePath(Volume->DeviceHandle, Entry->LoaderPath);
SetLoaderDefaults(Entry, LoaderPath, Volume);
UINTN i;
ScanVolumes();
- // Commented-out below: Was part of an attempt to get rEFInd to
- // re-scan disk devices on pressing Esc; but doesn't work (yet), so
- // removed....
-// MainMenu.Title = StrDuplicate(L"Main Menu 2");
-// MainMenu.TitleImage = NULL;
-// MainMenu.InfoLineCount = 0;
-// MainMenu.InfoLines = NULL;
-// MainMenu.EntryCount = 0;
-// MainMenu.Entries = NULL;
-// MainMenu.TimeoutSeconds = 20;
-// MainMenu.TimeoutText = StrDuplicate(L"Automatic boot");
- // DebugPause();
// scan for loaders and tools, add them to the menu
for (i = 0; i < NUM_SCAN_OPTIONS; i++) {
case SCAN_F10:
egScreenShot();
break;
+ case 0x0016: // F12
+ EjectMedia();
+ break;
}
switch (key.UnicodeChar) {
case CHAR_LINEFEED:
#define MENU_EXIT_ESCAPE (2)
#define MENU_EXIT_DETAILS (3)
#define MENU_EXIT_TIMEOUT (4)
+#define MENU_EXIT_EJECT (5)
#define TAG_RETURN (99)