Skip to content

Commit

Permalink
Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
dakanji committed May 9, 2024
1 parent 6db2aef commit bc7fc4a
Show file tree
Hide file tree
Showing 26 changed files with 345 additions and 283 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ body:
label: Debug Log
description: |
Please run the RefindPlus 'DBG' efi and add debug logs.
Kindly attach logs and do not paste the contents directly.
You can attach logs by dragging/dropping on the field below.
Please attach log files and do not paste their contents.
Attach log files by dragging/dropping on the field below.
placeholder: |
Reports not requiring log files are typically best under Discussions.
Reports without log files will be automatically closed in most cases.
Expand Down
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ body:
id: extra-info
attributes:
label: Additional Context
description: Add any additional context that may facilitate understanding and implementing the feature
description: |
Add any additional context that may facilitate understanding and implementing the feature
placeholder: |
You can attach files by dragging/dropping them on this field.
You can also add screenshots to aid understanding the problem.
Screenshots can be saved by pressing the F10 key in RefindPlus.
18 changes: 9 additions & 9 deletions .github/workflows/issues-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:

jobs:

# Lock Threads - https://github.com/dessant/lock-threads
# Lock Threads - https://github.com/dakanji/lock-threads
lock:
name: Lock Threads
runs-on: ubuntu-20.04
Expand All @@ -29,7 +29,7 @@ jobs:
steps:

- name: Lock Resolved issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -47,7 +47,7 @@ jobs:
sleep 96s
- name: Lock Invalid/Not-Planned Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -65,7 +65,7 @@ jobs:
sleep 96s
- name: Lock Misc Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -84,7 +84,7 @@ jobs:
sleep 96s
- name: Lock Incomplete/Abandoned Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -103,7 +103,7 @@ jobs:
sleep 96s
- name: Lock Unclear Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -121,7 +121,7 @@ jobs:
sleep 96s
- name: Lock Inactive Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -141,7 +141,7 @@ jobs:
sleep 96s
- name: Lock Acknowledged/Known Issues
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-reason: ''
Expand All @@ -160,7 +160,7 @@ jobs:
sleep 96s
- name: Lock Declined Pull Requests
uses: dessant/lock-threads@v5
uses: dakanji/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-lock-reason: ''
Expand Down
6 changes: 5 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ $ xcode-select --install
#### Background
While Xcode provides a full development environment as well as a suite of different utilities, it does not provide all the tools required for TianoCore EDK II development as required to build RefindPlus on macOS natively.

This guide focuses on using HomeBrew to provide the required tools but equivalent steps can be taken in MacPorts and Fink which, unlike HomeBrew, maintain support for older versions of macOS. Just substitute in the equivalent commands as required.
This guide focuses on using HomeBrew to provide the required tools but equivalent steps can be taken in MacPorts and Fink; which may offer better support for older versions of macOS.
Substitute equivalent commands in as required.

You will find installation instructions on the HomeBrew website (https://brew.sh)

Expand Down Expand Up @@ -69,6 +70,9 @@ $ brew uninstall mtoc && brew install ocmtoc && brew upgrade ocmtoc

**NB:** Only install one of `mtoc` or `ocmtoc` at a time.

`mtoc` and `ocmtoc` are only available as packages on HomeBrew.
Prebuilt versions of `ocmtoc` can be found here: https://github.com/acidanthera/ocmtoc/releases

# Prepare RefindPlus Environment
#### Fork the RefindPlus Repository
Navigate to `https://github.com/dakanji/RefindPlus` and fork the repository.
Expand Down
10 changes: 5 additions & 5 deletions BootMaster/driver_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
// Seems to have been replaced by ParseHandleDatabaseByRelationshipWithType(), but the latter is not working for me.
EFI_STATUS
LibScanHandleDatabase (
EFI_HANDLE DriverBindingHandle, OPTIONAL
UINT32 *DriverBindingHandleIndex, OPTIONAL
EFI_HANDLE ControllerHandle, OPTIONAL
UINT32 *ControllerHandleIndex, OPTIONAL
UINTN *HandleCount,
EFI_HANDLE DriverBindingHandle OPTIONAL,
UINT32 *DriverBindingHandleIndex OPTIONAL,
EFI_HANDLE ControllerHandle OPTIONAL,
UINT32 *ControllerHandleIndex OPTIONAL,
UINTN *HandleCount,
EFI_HANDLE **HandleBuffer,
UINT32 **HandleType
);
Expand Down
4 changes: 3 additions & 1 deletion BootMaster/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
#endif

#define DEFAULT_ICONS_DIR L"icons"
#define HIDDEN_TAG_DELIMITER L" @@ "

// NVRAM ACCESS FLAGS
#define ACCESS_FLAGS_FULL EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS;
Expand Down Expand Up @@ -604,9 +605,10 @@ extern BOOLEAN DevicePresence;
extern EFI_FILE_PROTOCOL *SelfDir;
extern EFI_FILE_PROTOCOL *SelfRootDir;

extern EFI_GUID GuidESP;
extern EFI_GUID GlobalGuid;
extern EFI_GUID RefindPlusGuid;
extern EFI_GUID AppleBootGuid;
extern EFI_GUID RefindPlusGuid;
extern EFI_GUID gEfiLegacyBootProtocolGuid;

extern EFI_HANDLE SelfImageHandle;
Expand Down
4 changes: 2 additions & 2 deletions BootMaster/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ESP_LIST * FindAllESPs (VOID) {
ESP_LIST *AllESPs;
ESP_LIST *NewESP;
UINTN VolumeIndex;
EFI_GUID ESPGuid = ESP_GUID_VALUE;


#if REFIT_DEBUG > 0
ALT_LOG(1, LOG_LINE_NORMAL, L"Search for ESPs");
Expand All @@ -78,7 +78,7 @@ ESP_LIST * FindAllESPs (VOID) {
AllESPs = NULL;
for (VolumeIndex = 0; VolumeIndex < VolumesCount; VolumeIndex++) {
if (Volumes[VolumeIndex]->DiskKind == DISK_KIND_INTERNAL &&
GuidsAreEqual (&(Volumes[VolumeIndex]->PartTypeGuid), &ESPGuid) &&
GuidsAreEqual (&(Volumes[VolumeIndex]->PartTypeGuid), &GuidESP) &&
!GuidsAreEqual (&(Volumes[VolumeIndex]->PartGuid), &SelfVolume->PartGuid)
) {
NewESP = AllocateZeroPool (sizeof (ESP_LIST));
Expand Down
8 changes: 4 additions & 4 deletions BootMaster/launch_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ EFI_STATUS ApfsRecoveryBoot (

Status = ConstructBootEntry (
Entry->Volume->DeviceHandle,
Basename (Entry->EfiLoaderPath),
Basename (DevicePathToStr (Entry->EfiLoaderPath)),
L"Mac Recovery",
(CHAR8**) &Entry->EfiLoaderPath,
&Size
Expand Down Expand Up @@ -517,7 +517,7 @@ BOOLEAN IsValidLoader (
break;
}

// Allow plain binaries on Apple Firmware
// Allow plain binaries on Apple firmware
IsValid = AppleBinaryPlain = AppleFirmware;
if (IsValid) {
//LoaderType = LOADER_TYPE_EFI;
Expand Down Expand Up @@ -848,7 +848,7 @@ EFI_STATUS StartEFIImage (

Status = EfivarSetRaw (
&SystemdGuid, L"LoaderDevicePartUUID",
EspGUID, StrLen (EspGUID) * 2 + 2, TRUE
EspGUID, StrLen (EspGUID) * 2 + 2, FALSE
);
#if REFIT_DEBUG > 0
if (EFI_ERROR(Status)) {
Expand Down Expand Up @@ -1137,7 +1137,7 @@ VOID RebootIntoLoader (
return;
}

StoreLoaderName(Entry->me.Title);
StoreLoaderName (Entry->me.Title);

#if REFIT_DEBUG > 0
OUT_TAG();
Expand Down
67 changes: 37 additions & 30 deletions BootMaster/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ EFI_STATUS FindVarsDir (VOID) {
#if REFIT_DEBUG > 0
ALT_LOG(1, LOG_BLANK_LINE_SEP, L"X");
ALT_LOG(1, LOG_LINE_NORMAL,
L"Locate/Create Emulated Variable Storage for RefindPlus-Specific Items ... In Installation Folder:- '%r'",
L"Locate/Create Variable Storage (Emulated) for RefindPlus-Specific Items ... In Installation Folder:- '%r'",
Status
);
#endif
Expand All @@ -640,7 +640,7 @@ EFI_STATUS FindVarsDir (VOID) {

#if REFIT_DEBUG > 0
ALT_LOG(1, LOG_LINE_NORMAL,
L"Locate/Create Emulated Variable Storage for RefindPlus-Specific Items ... In First Available ESP:- '%r'",
L"Locate/Create Variable Storage (Emulated) for RefindPlus-Specific Items ... In First Available ESP:- '%r'",
Status
);

Expand Down Expand Up @@ -1949,7 +1949,7 @@ CHAR16 * GetVolumeName (
// Try to use fs type and size as name
FileSystemInfoPtr = (Volume->RootDir != NULL)
? LibFileSystemInfo (Volume->RootDir) : NULL;
if (FileSystemInfoPtr) {
if (FileSystemInfoPtr != NULL) {
SISize = SizeInIEEEUnits (FileSystemInfoPtr->VolumeSize);
FoundName = PoolPrint (L"%s %s Volume", SISize, TypeName);
MY_FREE_POOL(SISize);
Expand Down Expand Up @@ -2766,13 +2766,6 @@ VOID ScanVolumes (VOID) {
return;
}

#if REFIT_DEBUG > 0
ALT_LOG(1, LOG_LINE_NORMAL,
L"Found Handles for %d Volumes",
HandleCount
);
#endif

UuidList = AllocateZeroPool (sizeof (EFI_GUID) * HandleCount);
if (UuidList == NULL) {
#if REFIT_DEBUG > 0
Expand Down Expand Up @@ -2806,13 +2799,7 @@ VOID ScanVolumes (VOID) {
#endif

for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
#if REFIT_DEBUG > 0
/* Exception for LOG_LINE_THIN_SEP */
ALT_LOG(1, LOG_LINE_THIN_SEP, L"NEXT VOLUME");
#endif

Volume = AllocateZeroPool (sizeof (REFIT_VOLUME));
Volume->VolRole = APFS_VOLUME_ROLE_UNKNOWN;
if (Volume == NULL) {
MY_FREE_POOL(UuidList);

Expand All @@ -2834,6 +2821,7 @@ VOID ScanVolumes (VOID) {
return;
}

Volume->VolRole = APFS_VOLUME_ROLE_UNKNOWN;
Volume->DeviceHandle = Handles[HandleIndex];
AddPartitionTable (Volume);
ScanVolume (Volume);
Expand Down Expand Up @@ -3739,6 +3727,7 @@ BOOLEAN RefitMetaiMatch (
#if defined (__MAKEWITH_GNUEFI)
return MetaiMatch (String, Pattern);
#elif defined(__MAKEWITH_TIANO)
EFI_STATUS Status;
static EFI_UNICODE_COLLATION_PROTOCOL *UnicodeCollationEng = NULL;

if (UnicodeCollationEng == NULL) {
Expand All @@ -3748,9 +3737,9 @@ BOOLEAN RefitMetaiMatch (
return UnicodeCollationEng->MetaiMatch (UnicodeCollationEng, String, Pattern);
}

// DA-TAG: Fallback on original inadequate upstream implementation
// DA-TAG: Fallback on original upstream implementation
// Should not get here when support is present
EFI_STATUS Status = REFIT_CALL_3_WRAPPER(
Status = REFIT_CALL_3_WRAPPER(
gBS->LocateProtocol, &gEfiUnicodeCollation2ProtocolGuid,
NULL, (VOID **) &UnicodeCollationEng
);
Expand All @@ -3760,9 +3749,9 @@ BOOLEAN RefitMetaiMatch (
NULL, (VOID **) &UnicodeCollationEng
);
}
#endif

return FALSE;
#endif
} // static BOOLEAN RefitMetaiMatch()

BOOLEAN DirIterNext (
Expand Down Expand Up @@ -4241,21 +4230,26 @@ BOOLEAN VolumeMatchesDescription (
IN REFIT_VOLUME *Volume,
IN CHAR16 *Description
) {
EFI_GUID TargetVolGuid = NULL_GUID_VALUE;
CHAR16 *FilteredDescription;
EFI_GUID TargetVolGuid = NULL_GUID_VALUE;

if (Volume == NULL || Description == NULL) {
return FALSE;
}

if (!IsGuid (Description)) {
FilteredDescription = GetSubStrAfter (HIDDEN_TAG_DELIMITER, Description);

if (!IsGuid (FilteredDescription)) {
return (
MyStriCmp (Description, Volume->VolName) ||
MyStriCmp (Description, Volume->FsName) ||
MyStriCmp (Description, Volume->PartName)
MyStriCmp (FilteredDescription, Volume->VolName) ||
MyStriCmp (FilteredDescription, Volume->FsName) ||
MyStriCmp (FilteredDescription, Volume->PartName)
);
}

TargetVolGuid = StringAsGuid (Description);
TargetVolGuid = StringAsGuid (FilteredDescription);
FilteredDescription = NULL;

return GuidsAreEqual (&TargetVolGuid, &(Volume->PartGuid));
} // BOOLEAN VolumeMatchesDescription()

Expand All @@ -4271,6 +4265,7 @@ BOOLEAN FilenameIn (
IN CHAR16 *List
) {
UINTN i;
CHAR16 *AnElement; // Do *NOT* Free
CHAR16 *OneElement;
CHAR16 *TargetPath;
CHAR16 *TargetVolName;
Expand All @@ -4289,14 +4284,26 @@ BOOLEAN FilenameIn (
!Found &&
(OneElement = FindCommaDelimited (List, i++)) != NULL
) {
Found = TRUE;
SplitPathName (OneElement, &TargetVolName, &TargetPath, &TargetFilename);
if ((TargetVolName != NULL && !VolumeMatchesDescription (Volume, TargetVolName)) ||
(TargetPath != NULL && !MyStriCmp (TargetPath, Directory)) ||
(TargetFilename != NULL && !MyStriCmp (TargetFilename, Filename))
AnElement = GetSubStrAfter (HIDDEN_TAG_DELIMITER, OneElement);
SplitPathName (AnElement, &TargetVolName, &TargetPath, &TargetFilename);

if (TargetPath == NULL &&
TargetVolName == NULL &&
TargetFilename == NULL
) {
return FALSE;
}

if (MyStriCmp (TargetPath, Directory) &&
MyStriCmp (TargetFilename, Filename) &&
VolumeMatchesDescription (Volume, TargetVolName)
) {
Found = TRUE;
}
else {
Found = FALSE;
}

MY_FREE_POOL(OneElement);
MY_FREE_POOL(TargetPath);
MY_FREE_POOL(TargetVolName);
Expand Down
Loading

0 comments on commit bc7fc4a

Please sign in to comment.