mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-01-14 19:41:31 +01:00
USe .VolumeLabel.txt for bottom right message.
This commit is contained in:
parent
3f3b85da08
commit
718c915f1f
@ -648,20 +648,12 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CHAR16 *LoaderPath,
|
||||
if (FullTitle) {
|
||||
Entry->me.Title = EfiStrDuplicate(FullTitle);
|
||||
}
|
||||
if ( Entry->me.Title == NULL && FileExists(Volume->RootDir, L"\\.VolumeLabel.txt") ) {
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_HANDLE FileHandle;
|
||||
Status = Volume->RootDir->Open(Volume->RootDir, &FileHandle, L"\\.VolumeLabel.txt", EFI_FILE_MODE_READ, 0);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
CHAR8 Buffer[32+1];
|
||||
UINTN BufferSize = sizeof(Buffer)-sizeof(CHAR8);
|
||||
SetMem(Buffer, BufferSize+sizeof(CHAR8), 0);
|
||||
Status = FileHandle->Read(FileHandle, &BufferSize, Buffer);
|
||||
FileHandle->Close(FileHandle);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Entry->me.Title = PoolPrint(L"Boot %s from %a", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Buffer);
|
||||
}
|
||||
}
|
||||
if ( Entry->me.Title == NULL && Volume->VolLabel != NULL ) {
|
||||
if ( Volume->VolLabel[0] == L'#' ) {
|
||||
Entry->me.Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel+1);
|
||||
}else{
|
||||
Entry->me.Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel);
|
||||
}
|
||||
}
|
||||
|
||||
if ( Entry->me.Title == NULL && ((Entry->VolName == NULL) || (StrLen(Entry->VolName) == 0)) ) {
|
||||
|
@ -963,6 +963,22 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume)
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if ( FileExists(Volume->RootDir, L"\\.VolumeLabel.txt") ) {
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_HANDLE FileHandle;
|
||||
Status = Volume->RootDir->Open(Volume->RootDir, &FileHandle, L"\\.VolumeLabel.txt", EFI_FILE_MODE_READ, 0);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
CHAR8 Buffer[32+1];
|
||||
UINTN BufferSize = sizeof(Buffer)-sizeof(CHAR8);
|
||||
SetMem(Buffer, BufferSize+sizeof(CHAR8), 0);
|
||||
Status = FileHandle->Read(FileHandle, &BufferSize, Buffer);
|
||||
FileHandle->Close(FileHandle);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Volume->VolLabel = PoolPrint(L"%a", Buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get volume name
|
||||
if (!Volume->VolName) {
|
||||
FileSystemInfoPtr = EfiLibFileSystemInfo(Volume->RootDir);
|
||||
|
@ -224,6 +224,7 @@ typedef struct {
|
||||
EFI_FILE *RootDir;
|
||||
CHAR16 *DevicePathString;
|
||||
CHAR16 *VolName;
|
||||
CHAR16 *VolLabel;
|
||||
UINT8 DiskKind;
|
||||
LEGACY_OS *LegacyOS;
|
||||
BOOLEAN Hidden;
|
||||
|
@ -3926,9 +3926,10 @@ VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
||||
switch (TextC) {
|
||||
case TEXT_CORNER_REVISION:
|
||||
// Display Clover boot volume
|
||||
if (SelfVolume->VolName[0] != L'#') {
|
||||
Text = PoolPrint(L"%s, booted from %s", gFirmwareRevision, SelfVolume->VolName);
|
||||
}else{
|
||||
if (SelfVolume->VolLabel && SelfVolume->VolLabel[0] != L'#') {
|
||||
Text = PoolPrint(L"%s, booted from %s", gFirmwareRevision, SelfVolume->VolLabel);
|
||||
}
|
||||
if ( !Text ) {
|
||||
Text = PoolPrint(L"%s", gFirmwareRevision, SelfVolume->VolName);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user