| 769 | } |
| 770 | |
| 771 | void LOADER_ENTRY::AddDefaultMenu() |
| 772 | { |
| 773 | XStringW FileName; |
| 774 | // CHAR16* TempOptions; |
| 775 | // CHAR16 DiagsFileName[256]; |
| 776 | LOADER_ENTRY *SubEntry; |
| 777 | // REFIT_MENU_SCREEN *SubScreen; |
| 778 | // REFIT_VOLUME *Volume; |
| 779 | UINT64 VolumeSize; |
| 780 | EFI_GUID *Guid = NULL; |
| 781 | BOOLEAN KernelIs64BitOnly; |
| 782 | UINT64 os_version = AsciiOSVersionToUint64(OSVersion); |
| 783 | |
| 784 | constexpr LString8 quietLitteral = "quiet"; |
| 785 | constexpr LString8 splashLitteral = "splash"; |
| 786 | |
| 787 | // Only kernels up to 10.7 have 32-bit mode |
| 788 | KernelIs64BitOnly = (OSVersion.isEmpty() || |
| 789 | os_version >= AsciiOSVersionToUint64("10.8"_XS8)); |
| 790 | |
| 791 | const char* macOS = (os_version < AsciiOSVersionToUint64("10.8"_XS8))? "Mac OS X" : |
| 792 | (os_version < AsciiOSVersionToUint64("10.12"_XS8))? "OS X" : "macOS"; |
| 793 | |
| 794 | FileName = LoaderPath.basename(); |
| 795 | |
| 796 | // create the submenu |
| 797 | SubScreen = new REFIT_MENU_SCREEN; |
| 798 | SubScreen->Title.SWPrintf("Options for %ls on %ls", Title.wc_str(), DisplayedVolName.wc_str()); |
| 799 | |
| 800 | SubScreen->TitleImage = Image; |
| 801 | SubScreen->ID = LoaderType + 20; //wow |
| 802 | // DBG("get anime for os=%lld\n", SubScreen->ID); |
| 803 | SubScreen->GetAnime(); |
| 804 | VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20); |
| 805 | SubScreen->AddMenuInfoLine_f("Volume size: %lluMb", VolumeSize); |
| 806 | SubScreen->AddMenuInfoLine_f("%ls", FileDevicePathToXStringW(DevicePath).wc_str()); |
| 807 | Guid = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); |
| 808 | if (Guid) { |
| 809 | SubScreen->AddMenuInfoLine_f("UUID: %s", strguid(Guid)); |
| 810 | } |
| 811 | if ( Volume->ApfsFileSystemUUID.notEmpty() || APFSTargetUUID.notEmpty() ) { |
| 812 | SubScreen->AddMenuInfoLine_f("APFS volume name: %ls", DisplayedVolName.wc_str()); |
| 813 | } |
| 814 | if ( Volume->ApfsFileSystemUUID.notEmpty() ) { |
| 815 | SubScreen->AddMenuInfoLine_f("APFS File System UUID: %s", Volume->ApfsFileSystemUUID.c_str()); |
| 816 | } |
| 817 | if ( APFSTargetUUID.notEmpty() ) { |
| 818 | SubScreen->AddMenuInfoLine_f("APFS Target UUID: %ls", APFSTargetUUID.wc_str()); |
| 819 | } |
| 820 | SubScreen->AddMenuInfoLine_f("Options: %s", LoadOptions.ConcatAll(" "_XS8).c_str()); |
| 821 | // loader-specific submenu entries |
| 822 | if (LoaderType == OSTYPE_OSX || |
| 823 | LoaderType == OSTYPE_OSX_INSTALLER || |
| 824 | LoaderType == OSTYPE_RECOVERY) { // entries for Mac OS X |
| 825 | SubScreen->AddMenuInfoLine_f("%s: %s", macOS, OSVersion.c_str()); |
| 826 | |
| 827 | if (OSFLAG_ISSET(Flags, OSFLAG_HIBERNATED)) { |
| 828 | SubEntry = getPartiallyDuplicatedEntry(); |
no test coverage detected