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