From 622ed08c231f81a83b5e2807e7abace1dec9502f Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 20 Apr 2012 13:40:25 -0400 Subject: [PATCH] Scans for drivers even if the volume name is NULL --- NEWS.txt | 8 ++++++++ docs/refind/drivers.html | 6 +++++- refind/config.c | 1 - refind/lib.c | 3 +++ refind/main.c | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 459db91..36f1777 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,11 @@ +0.2.8 (?/??/2012): +------------------ + +- Fixed a bug that caused rEFInd to fail to scan for drivers if the + filesystem driver didn't set a volume name (that is, if the relevant + field was set to NULL rather than even an empty string). In such + situations, rEFInd now reports the volume name as "Unknown". + 0.2.7 (4/19/2012): ------------------ diff --git a/docs/refind/drivers.html b/docs/refind/drivers.html index 96d08c0..5846704 100644 --- a/docs/refind/drivers.html +++ b/docs/refind/drivers.html @@ -121,7 +121,9 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • rEFIt's ext2fs and ReiserFS drivers—You can gain read-only access to ext2fs, ext3fs, and ReiserFS volumes with these drivers. You can use the binaries in the refit-bin-0.14/efi/tools/drivers directory of the binary package directly on a Mac. On a UEFI-based PC, though, you'll need to break the Mac-style "fat" binary into its 32- and 64-bit components. You can use my thin program for this job.
  • -
  • Clover EFI's ISO-9660, ext2fs, and HFS+ drivers—This project is an offshoot of TianoCore, the main UEFI project. It includes drivers for ISO-9660, ext2fs, and HFS+; however, building them requires a fair amount of expertise. You can find a compile script for the ISO-9660 driver here, and a compiled ISO-9660 binary here. I haven't yet tested the compiled binary, much less tried to compile the source code.
  • +
  • Clover EFI's ISO-9660, ext2fs, and HFS+ drivers—This project is an offshoot of TianoCore, the main UEFI project. It's primarily a Hackintosh boot loader, but it includes drivers for ISO-9660, ext2fs, and HFS+; however, building them requires a fair amount of expertise. You can find a compile script for the ISO-9660 driver here, and a compiled ISO-9660 binary here. I haven't yet tested the compiled binary, much less tried to compile the source code.
  • + +
  • Clover's EFI Tools package—This osx86.net thread includes links to a package called EFI_Tools_Clover_v2_r384_EFI_x32_x64_EN.zip, which holds an OS X application (a directory with a .app extension, as seen from other platforms) with a number of drivers in the Contents/Resources/EFI/drivers64 directory (and an equivalent for 32-bit binaries). Some of these, such as keyboard drivers, are unlikely to be useful unless your system is badly broken as delivered. Three that caught my eye, however, are VBoxExt2-64.efi, NTFS-64.efi, and VBoxIso9600-64.efi.
  • VirtualBox's HFS+ and ISO-9660 drivers—These drivers are available in source code form, and come with VirtualBox binaries. I've not attempted to compile them myself, but I've seen a report that suggests they may include assumptions that require use of MinGW, a GCC-based compiler for Windows (and cross-compiler to build Windows executables under Linux). I don't know of a source for binaries suitable for use on EFI-based computers; if you want to use them, you'll need to figure out how to compile them yourself.
  • @@ -145,6 +147,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    The ext2fs and ReiserFS drivers work, but they are a bit sluggish—particularly the ext2fs driver. The extent of the problem depends on the computer. In my tests so far, VirtualBox has fared the worse. On it, loading a Linux kernel with EFI stub loader from a FAT partition takes 2 seconds, from the moment of selecting the OS in rEFInd to the moment the kernel messages begin to appear. The equivalent time using ReiserFS is 20 seconds, and with ext2fs it's 200 seconds (that is, 3 minutes and 20 seconds). On a 32-bit Mac Mini, though, the speed problem is much less pronounced—my kernel loads in just 3 seconds from a ReiserFS partition and in 13 seconds from an ext2 filesystem. Times with ext2fs on a UEFI PC with an Intel motherboard were also reasonable, although I didn't record precise values. Nonetheless, if you try the ext2fs driver and it seems to hang, be patient; it may finally boot up. If so, and if the delay is too great for you to accept, you might consider using ReiserFS instead of ext2fs or ext3fs, at least if a change is practical. (For a /boot partition, it almost certainly is practical; you can back it up quite easily, create a fresh filesystem on it, and restore it. You may need to adjust your /etc/fstab entry for a new UUID value, though.)

    +

    The Clover EFI Tools ext2fs driver performs much like the rEFIt ext2fs driver, but it doesn't deliver a filesystem label, which makes it less desirable. The NTFS driver from this package is nice and speedy, though, so if for some reason you need to place a boot loader on an NTFS volume, this driver might be worth tracking down.

    +

    Although both ext2fs and ReiserFS are case-sensitive, these drivers treat them in a case-insensitive way. Symbolic links work, which opens up possibilities for configuration, such as using a single kernel binary for multiple Linux distributions, with a link in one subdirectory pointing to a file in another directory. (If you try this, though, be sure to use relative links, as in ../otherdist/bzImage.efi, at least if the partition is not Linux's root filesystem.)

    diff --git a/refind/config.c b/refind/config.c index 6d0ab16..dc8f2ea 100644 --- a/refind/config.c +++ b/refind/config.c @@ -612,7 +612,6 @@ VOID ScanUserConfigured(VOID) return; Volume = SelfVolume; - // TODO: Figure out how to set volumes (on per-image basis, preferably) while ((TokenCount = ReadTokenLine(&File, &TokenList)) > 0) { if ((StriCmp(TokenList[0], L"menuentry") == 0) && (TokenCount > 1)) { diff --git a/refind/lib.c b/refind/lib.c index f5037c5..81b71ad 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -593,6 +593,9 @@ static VOID ScanVolume(IN OUT REFIT_VOLUME *Volume) FreePool(FileSystemInfoPtr); } + if (Volume->VolName == NULL) { + Volume->VolName = StrDuplicate(L"Unknown"); + } // TODO: if no official volume name is found or it is empty, use something else, e.g.: // - name from bytes 3 to 10 of the boot sector // - partition number diff --git a/refind/main.c b/refind/main.c index de398aa..0196aab 100644 --- a/refind/main.c +++ b/refind/main.c @@ -84,7 +84,7 @@ static VOID AboutrEFInd(VOID) { if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.7"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.7.1"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); -- 2.39.2