-----------------
- Added the ability to specify a volume name or number in the
- "dont_scan_dirs" token.
+ "dont_scan_dirs" and "also_scan_dirs" tokens.
- Fixed a bug that caused removable EFI media to not appear in scan lists
if rEFInd was installed as EFI/BOOT/boot{arch}.efi on a hard disk.
<tr>
<td><tt>also_scan_dirs</tt></td>
<td>directory path(s)</td>
- <td>Adds the specified directory or directories to the directory list that rEFInd scans for EFI boot loaders when <tt>scanfor</tt> includes the <tt>internal</tt>, <tt>external</tt>, or <tt>optical</tt> options. Directories are specified relative to the filesystem's root directory. If this option is used, it's applied to <i>all</i> the filesystems that rEFInd scans. If a specified directory doesn't exist, rEFInd ignores it (no error results). The default value is <tt>boot</tt>, which is useful for locating Linux kernels when you have an EFI driver for your Linux root (<tt>/</tt>) filesystem.</td>
+ <td>Adds the specified directory or directories to the directory list that rEFInd scans for EFI boot loaders when <tt>scanfor</tt> includes the <tt>internal</tt>, <tt>external</tt>, or <tt>optical</tt> options. Directories are specified relative to the filesystem's root directory. You may precede a directory path with a volume name and colon, as in <tt>somevol:/extra/path</tt>, to restrict the extra scan to a single volume. A volume number, preceded by <tt>fs</tt>, can be used for volumes that lack names, as in <tt>fs1:/extra/path</tt>. If you don't specify a volume name or number, this option is applied to <i>all</i> the filesystems that rEFInd scans. If a specified directory doesn't exist, rEFInd ignores it (no error results). The default value is <tt>boot</tt>, which is useful for locating Linux kernels when you have an EFI driver for your Linux root (<tt>/</tt>) filesystem.</td>
</tr>
<tr>
<td><tt>dont_scan_volumes</tt> or <tt>don't_scan_volumes</tt></td>
<tr>
<td><tt>dont_scan_dirs</tt> or <tt>don't_scan_dirs</tt></td>
<td>directory path(s)</td>
- <td>Adds the specified directory or directories to a directory "blacklist"—these directories are <i>not</i> scanned for boot loaders. You may optionally precede a directory path with a volume name and a colon to limit the blacklist to that volume. For instance, <tt>EFI/BOOT</tt> prevents scanning the <tt>EFI/BOOT</tt> directory on <i>all</i> volumes, whereas <tt>ESP:EFI/BOOT</tt> blocks scans of <tt>EFI/BOOT</tt> on the volume called <tt>ESP</tt> but not on other volumes. You can use a filesystem number, as in <tt>fs0</tt>, in place of a volume name. This token may be useful to keep duplicate boot loaders out of the menu (say, if <tt>EFI/BOOT/bootx64.efi</tt> is a duplicate of another boot loader); or to keep drivers or utilities out of the boot menu, if you've stored them in a subdirectory of <tt>EFI</tt>. This option takes precedence over <tt>also_scan_dirs</tt>; if a directory appears in both lists, it will <i>not</i> be scanned.</td>
+ <td>Adds the specified directory or directories to a directory "blacklist"—these directories are <i>not</i> scanned for boot loaders. You may optionally precede a directory path with a volume name and a colon to limit the blacklist to that volume; otherwise all volumes are affected. For instance, <tt>EFI/BOOT</tt> prevents scanning the <tt>EFI/BOOT</tt> directory on <i>all</i> volumes, whereas <tt>ESP:EFI/BOOT</tt> blocks scans of <tt>EFI/BOOT</tt> on the volume called <tt>ESP</tt> but not on other volumes. You can use a filesystem number, as in <tt>fs0</tt>, in place of a volume name. This token may be useful to keep duplicate boot loaders out of the menu (say, if <tt>EFI/BOOT/bootx64.efi</tt> is a duplicate of another boot loader); or to keep drivers or utilities out of the boot menu, if you've stored them in a subdirectory of <tt>EFI</tt>. This option takes precedence over <tt>also_scan_dirs</tt>; if a directory appears in both lists, it will <i>not</i> be scanned.</td>
</tr>
<tr>
<td><tt>dont_scan_files</tt> or <tt>don't_scan_files</tt></td>
caused by a truncated DevicePath to the shell, which includes the
shell's pathname but not the device identifier.</li>
+ <li>When specifying a volume by name in <tt>dont_scan_dirs</tt>,
+ slashes are converted to backslashes in the specification but not
+ in the actual volume name read from disk. Thus, you can't specify a
+ volume by name if it includes a slash (as in <tt>Fedora
+ /boot</tt>). Workarounds are to rename the volume to omit the slash
+ and to use a filesystem number rather than a volume label.</li>
+
<li>The code is in need of review to search for memory leaks and
similar problems.</li>
} else if ((StriCmp(TokenList[0], L"don't_scan_volumes") == 0) || (StriCmp(TokenList[0], L"dont_scan_volumes") == 0)) {
HandleStrings(TokenList, TokenCount, &(GlobalConfig.AlsoScan));
// Note: Don't use HandleStrings() because it modifies slashes, which might be present in volume name
- MyFreePool(GlobalConfig.DontScanVolumes);
- GlobalConfig.DontScanVolumes = NULL;
- for (i = 1; i < TokenCount; i++) {
- MergeStrings(&GlobalConfig.DontScanVolumes, TokenList[i], L',');
- }
+ MyFreePool(GlobalConfig.DontScanVolumes);
+ GlobalConfig.DontScanVolumes = NULL;
+ for (i = 1; i < TokenCount; i++) {
+ MergeStrings(&GlobalConfig.DontScanVolumes, TokenList[i], L',');
+ }
} else if ((StriCmp(TokenList[0], L"don't_scan_dirs") == 0) || (StriCmp(TokenList[0], L"dont_scan_dirs") == 0)) {
HandleStrings(TokenList, TokenCount, &(GlobalConfig.DontScanDirs));
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.2.2");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.2.3");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
UINTN i = 0, VolNum;
BOOLEAN ScanIt = TRUE;
- if (IsIn(Volume->VolName, GlobalConfig.DontScanVolumes)) {
- Print(L"Not scanning volume %s\n", Volume->VolName);
- PauseForKey();
+ if (IsIn(Volume->VolName, GlobalConfig.DontScanVolumes))
return FALSE;
- }
while ((DontScanDir = FindCommaDelimited(GlobalConfig.DontScanDirs, i++)) && ScanIt) {
SplitVolumeAndFilename(&DontScanDir, &VolName);
CleanUpPathNameSlashes(DontScanDir);
if (VolName != NULL) {
- if ((StriCmp(VolName, Volume->VolName) == 0) && (StriCmp(DontScanDir, Path)))
+ if ((StriCmp(VolName, Volume->VolName) == 0) && (StriCmp(DontScanDir, Path) == 0))
ScanIt = FALSE;
if ((VolName[0] == L'f') && (VolName[1] == L's') && (VolName[2] >= L'0') && (VolName[2] <= '9')) {
VolNum = Atoi(VolName + 2);
- if ((VolNum == Volume->VolNumber) && (StriCmp(DontScanDir, Path)))
+ if ((VolNum == Volume->VolNumber) && (StriCmp(DontScanDir, Path) == 0))
ScanIt = FALSE;
}
} else {
if ((!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && (Volume->DeviceHandle != SelfVolume->DeviceHandle)) ||
(StriCmp(Path, SelfDirPath) != 0)) &&
(ShouldScan(Volume, Path))) {
-// (!IsIn(Path, GlobalConfig.DontScanDirs)) &&
-// (!IsIn(Volume->VolName, GlobalConfig.DontScanVolumes))) {
// look through contents of the directory
DirIterOpen(Volume->RootDir, Path, &DirIter);
while (DirIterNext(&DirIter, 2, Pattern, &DirEntry)) {
EFI_STATUS Status;
REFIT_DIR_ITER EfiDirIter;
EFI_FILE_INFO *EfiDirEntry;
- CHAR16 FileName[256], *Directory, *MatchPatterns;
+ CHAR16 FileName[256], *Directory, *MatchPatterns, *VolName = NULL;
UINTN i, Length;
MatchPatterns = StrDuplicate(LOADER_MATCH_PATTERNS);
// Scan user-specified (or additional default) directories....
i = 0;
while ((Directory = FindCommaDelimited(GlobalConfig.AlsoScan, i++)) != NULL) {
+ SplitVolumeAndFilename(&Directory, &VolName);
CleanUpPathNameSlashes(Directory);
Length = StrLen(Directory);
- if (Length > 0)
+ if ((Length > 0) && ((VolName == NULL) || (StriCmp(VolName, Volume->VolName) == 0)))
ScanLoaderDir(Volume, Directory, MatchPatterns);
MyFreePool(Directory);
+ MyFreePool(VolName);
} // while
} // if
} // static VOID ScanEfiFiles()