Bootmgr (macOS): add support

This commit is contained in:
李通洲 2024-05-16 16:27:37 +08:00
parent b2ea5d8f3e
commit 72138dbde5
No known key found for this signature in database
GPG Key ID: 269AD4F5325A22A3
3 changed files with 17 additions and 2 deletions

View File

@ -592,7 +592,7 @@ elseif(APPLE)
src/detection/bios/bios_apple.c
src/detection/bluetooth/bluetooth_apple.m
src/detection/board/board_apple.c
src/detection/bootmgr/bootmgr_nosupport.c
src/detection/bootmgr/bootmgr_apple.c
src/detection/brightness/brightness_apple.c
src/detection/chassis/chassis_nosupport.c
src/detection/cpu/cpu_apple.c

View File

@ -0,0 +1,12 @@
#include "bootmgr.h"
#include "common/io/io.h"
const char* ffDetectBootmgr(FFBootmgrResult* result)
{
if (ffPathExists("/System/Library/CoreServices/boot.efi", FF_PATHTYPE_FILE))
ffStrbufSetStatic(&result->firmware, "/System/Library/CoreServices/boot.efi");
ffStrbufSetStatic(&result->name, "iBoot");
return NULL;
}

View File

@ -22,8 +22,11 @@ void ffPrintBootmgr(FFBootmgrOptions* options)
}
FF_STRBUF_AUTO_DESTROY firmwareName = ffStrbufCreateCopy(&bootmgr.firmware);
ffStrbufSubstrBeforeLastC(&firmwareName, '.');
#ifndef __APPLE__
ffStrbufSubstrAfterLastC(&firmwareName, '\\');
#else
ffStrbufSubstrAfterLastC(&firmwareName, '/');
#endif
if(options->moduleArgs.outputFormat.length == 0)
{