From: srs5694
To the best of my knowledge, the best reason to want EFI driver support in rEFInd is to provide access to filesystems. Although EFI filesystem driver choices are currently limited, those that are available can help to improve your installation and configuration options, particularly if you've found yourself "boxed in" by awkward installation or bugs, such as the dinky ESP that Ubuntu creates by default or the bug that prevents a Linux kernel with EFI stub loader support from booting from the ESP of at least some Macs.
-As a side note, using the ISO-9660 driver might help you keep the size of a custom Linux boot CD/DVD down to a reasonable value. This is because EFI systems normally boot from optical discs by reading a FAT image file in El Torito format and treating that file as an ESP. If you need to store the kernel both in that file and directly in the ISO-9660 filesystem (to maintain bootability on BIOS systems), that can represent an unwanted extra space requirement. Placing rEFInd and an ISO-9660 driver in the FAT image file should enable you to store the kernel on the disc only once. Note, however, that this is theoretical; I've not yet tried creating a bootable disc in this way. Also, some EFI implementations include ISO-9660 drivers, so you might not need a separate ISO-9660 driver if you're building a disc for a particular computer.
+As a side note, using an ISO-9660 driver can theoretically help you keep the size of a custom Linux boot CD/DVD down to a reasonable value. This is because EFI systems normally boot from optical discs by reading a FAT image file in El Torito format and treating that file as an ESP. If you need to store the kernel both in that file and directly in the ISO-9660 filesystem (to maintain bootability on BIOS systems), that can represent an unwanted extra space requirement. Placing rEFInd and an ISO-9660 driver in the FAT image file should enable you to store the kernel on the disc only once. Unfortunately, my attempts to get this to work have failed to date. When the ISO-9660 driver is loaded from the El Torito image, my test systems seem to allow only one of the two filesystems (the El Torito image's FAT filesystem or the optical disc's ISO-9660 filesystem) to be active; load one and the other goes away. Also, some EFI implementations include ISO-9660 drivers, so you might not need a separate ISO-9660 driver if you're building a disc for a particular computer.
Most of these cross-project drivers appear to be related. For instance, the ISO-9660 drivers are both based on code written by Christoph Phisterer for rEFIt (although he doesn't seem to have finished and released it in binary form himself).
-As you can see, pickings are rather slim. Nonetheless, they are useful for certain purposes. The options could increase in the future, too. Source code to a wide variety of filesystems is available in GRUB Legacy, GRUB 2, Linux, various BSD kernels, and in other projects. Sooner or later somebody's likely to begin porting those drivers to EFI. If you do so, or if you know of additional EFI drivers, please tell me about it, so I can share the information here. Likewise if you know of a source for other EFI drivers—say, for a video card or disk controller card.
+As you can see, pickings are rather slim. Nonetheless, the drivers that exist are useful for certain purposes. The options could increase in the future, too. Source code to a wide variety of filesystems is available in GRUB Legacy, GRUB 2, Linux, various BSD kernels, and in other projects. Sooner or later somebody's likely to begin porting those drivers to EFI. If you do so, or if you know of additional EFI drivers, please tell me about it, so I can share the information here. Likewise if you know of a source for other EFI drivers—say, for a video card or disk controller card.
diff --git a/refind/lib.c b/refind/lib.c index fde385f..c7c5734 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -366,6 +366,14 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->OSIconName = L"grub,linux"; Volume->OSName = L"Linux"; + // GRUB in BIOS boot partition: + } else if (FindMem(SectorBuffer, 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 *)(SectorBuffer + 502)) == 0 && *((UINT32 *)(SectorBuffer + 506)) == 50000 && *((UINT16 *)(SectorBuffer + 510)) == 0xaa55) || @@ -435,7 +443,16 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->OSName, Volume->OSIconName); #endif - if (FindMem(SectorBuffer, 512, "Non-system disk", 15) >= 0) // dummy FAT boot sector + // dummy FAT boot sector (created by OS X's newfs_msdos) + if (FindMem(SectorBuffer, 512, "Non-system disk", 15) >= 0) + Volume->HasBootCode = FALSE; + + // dummy FAT boot sector (created by Linux's mkdosfs) + if (FindMem(SectorBuffer, 512, "This is not a bootable disk", 27) >= 0) + Volume->HasBootCode = FALSE; + + // dummy FAT boot sector (created by Windows) + if (FindMem(SectorBuffer, 512, "Press any key to restart", 24) >= 0) Volume->HasBootCode = FALSE; // check for MBR partition table @@ -461,7 +478,7 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl } } -// default volume icon based on disk kind +// default volume badge icon based on disk kind static VOID ScanVolumeDefaultIcon(IN OUT REFIT_VOLUME *Volume) { switch (Volume->DiskKind) { diff --git a/refind/main.c b/refind/main.c index 572f36a..6bdc3a1 100644 --- a/refind/main.c +++ b/refind/main.c @@ -104,7 +104,7 @@ static VOID AboutrEFInd(VOID) { if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.1"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.1.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -1110,7 +1110,7 @@ static VOID ScanLegacyVolume(REFIT_VOLUME *Volume, UINTN VolumeIndex) { Volume->BlockIOOffset == 0 && Volume->OSName == NULL) // this is a whole disk (MBR) entry; hide if we have entries for partitions - HideIfOthersFound = TRUE; + HideIfOthersFound = TRUE; } if (HideIfOthersFound) { // check for other bootable entries on the same disk