From b1f2b2b0ba6ff5504af678cc93f05404239f7afa Mon Sep 17 00:00:00 2001 From: srs5694 Date: Mon, 2 Feb 2015 21:18:07 -0500 Subject: [PATCH] Added new "badge" option for the "hideui" configuration file token. This option removes the device-type badge from the boot menu icons. --- docs/refind/getting.html | 5 +++++ refind.conf-sample | 2 +- refind/config.c | 2 ++ refind/config.h | 1 + refind/lib.c | 42 ++++++++++++++++++++++------------------ refind/main.c | 4 ++-- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/docs/refind/getting.html b/docs/refind/getting.html index ba882da..4352412 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -284,6 +284,11 @@ computer.

href="http://packages.altlinux.org/en/Sisyphus/srpms/refind">this page for details. +
  • Slackware—As far as I know, an official rEFInd package is + not available as part of Slackware; however, a Slackware + package from SlackBuilds is available.
  • +
  • Fat Dog—This variant of Puppy Linux uses a combination of rEFInd and GRUB 2 to boot its installation medium in EFI mode and diff --git a/refind.conf-sample b/refind.conf-sample index 193a75d..92b15cb 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -221,7 +221,7 @@ timeout 20 # modification of NVRAM variables on each boot. Adding "0", "off", or # "false" resets to the default value. This token has no effect on Macs or # when no BIOS-mode options are set via scanfor. -# Default is unset (or "uefi_deep_legacy_scan true") +# Default is unset (or "uefi_deep_legacy_scan false") # #uefi_deep_legacy_scan diff --git a/refind/config.c b/refind/config.c index 1d3e927..f534841 100644 --- a/refind/config.c +++ b/refind/config.c @@ -514,6 +514,8 @@ VOID ReadConfig(CHAR16 *FileName) GlobalConfig.HideUIFlags |= HIDEUI_FLAG_EDITOR; } else if (StriCmp(FlagName, L"safemode") == 0) { GlobalConfig.HideUIFlags |= HIDEUI_FLAG_SAFEMODE; + } else if (StriCmp(FlagName, L"badges") == 0) { + GlobalConfig.HideUIFlags |= HIDEUI_FLAG_BADGES; } else if (StriCmp(FlagName, L"all") == 0) { GlobalConfig.HideUIFlags = HIDEUI_FLAG_ALL; } else { diff --git a/refind/config.h b/refind/config.h index 1aedd5d..2e39f50 100644 --- a/refind/config.h +++ b/refind/config.h @@ -77,6 +77,7 @@ typedef struct { #define HIDEUI_FLAG_HINTS (0x0020) #define HIDEUI_FLAG_EDITOR (0x0040) #define HIDEUI_FLAG_SAFEMODE (0x0080) +#define HIDEUI_FLAG_BADGES (0x0100) #define HIDEUI_FLAG_ALL ((0xffff)) #define CONFIG_FILE_NAME L"refind.conf" diff --git a/refind/lib.c b/refind/lib.c index d3347c7..50e7cc6 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -49,6 +49,7 @@ #include "../include/refit_call_wrapper.h" #include "../include/RemovableMedia.h" #include "gpt.h" +#include "config.h" #ifdef __MAKEWITH_GNUEFI #define EfiReallocatePool ReallocatePool @@ -698,6 +699,9 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) // Set default volume badge icon based on /.VolumeBadge.{icns|png} file or disk kind VOID SetVolumeBadgeIcon(REFIT_VOLUME *Volume) { + if (GlobalConfig.HideUIFlags & HIDEUI_FLAG_BADGES) + return; + if (Volume->VolBadgeImage == NULL) { Volume->VolBadgeImage = egLoadIconAnyType(Volume->RootDir, L"", L".VolumeBadge", GlobalConfig.IconSizes[ICON_SIZE_BADGE]); } @@ -933,32 +937,32 @@ VOID ScanVolume(REFIT_VOLUME *Volume) DevicePath = NextDevicePath; } // while - if (!Bootable) { + if (!Bootable) { #if REFIT_DEBUG > 0 - if (Volume->HasBootCode) - Print(L" Volume considered non-bootable, but boot code is present\n"); + if (Volume->HasBootCode) + Print(L" Volume considered non-bootable, but boot code is present\n"); #endif - Volume->HasBootCode = FALSE; - } + Volume->HasBootCode = FALSE; + } - // open the root directory of the volume - Volume->RootDir = LibOpenRoot(Volume->DeviceHandle); + // open the root directory of the volume + Volume->RootDir = LibOpenRoot(Volume->DeviceHandle); - // Set volume icon based on .VolumeBadge icon or disk kind - SetVolumeBadgeIcon(Volume); + // Set volume icon based on .VolumeBadge icon or disk kind + SetVolumeBadgeIcon(Volume); - Volume->VolName = GetVolumeName(Volume); + Volume->VolName = GetVolumeName(Volume); - if (Volume->RootDir == NULL) { - Volume->IsReadable = FALSE; - return; - } else { - Volume->IsReadable = TRUE; - } + if (Volume->RootDir == NULL) { + Volume->IsReadable = FALSE; + return; + } else { + Volume->IsReadable = TRUE; + } - // get custom volume icons if present - if (!Volume->VolIconImage) - Volume->VolIconImage = egLoadIconAnyType(Volume->RootDir, L"", L".VolumeIcon", GlobalConfig.IconSizes[ICON_SIZE_BIG]); + // get custom volume icons if present + if (!Volume->VolIconImage) + Volume->VolIconImage = egLoadIconAnyType(Volume->RootDir, L"", L".VolumeIcon", GlobalConfig.IconSizes[ICON_SIZE_BIG]); } // ScanVolume() static VOID ScanExtendedPartition(REFIT_VOLUME *WholeDiskVolume, MBR_PARTITION_INFO *MbrEntry) diff --git a/refind/main.c b/refind/main.c index 267bf2d..f78020b 100644 --- a/refind/main.c +++ b/refind/main.c @@ -176,10 +176,10 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.5.1"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.5.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); - AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith"); + AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith"); AddMenuInfoLine(&AboutMenu, L"Portions Copyright (c) Intel Corporation and others"); AddMenuInfoLine(&AboutMenu, L"Distributed under the terms of the GNU GPLv3 license"); AddMenuInfoLine(&AboutMenu, L""); -- 2.39.2