Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsdinstall/partedit/partedit_x86.c
Show All 29 Lines | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "partedit.h" | #include "partedit.h" | ||||
/* EFI partition size in bytes */ | /* EFI partition size in bytes */ | ||||
#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) | #define EFI_BOOTPART_SIZE (260 * 1024 * 1024) | ||||
#define EFI_BOOTPART_PATH "/boot/boot1.efifat" | |||||
static const char * | static const char * | ||||
x86_bootmethod(void) | x86_bootmethod(void) | ||||
{ | { | ||||
static char fw[255] = ""; | static char fw[255] = ""; | ||||
size_t len = sizeof(fw); | size_t len = sizeof(fw); | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | bootcode_path(const char *part_type) | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
const char * | const char * | ||||
partcode_path(const char *part_type, const char *fs_type) | partcode_path(const char *part_type, const char *fs_type) | ||||
{ | { | ||||
if (strcmp(part_type, "GPT") == 0) { | if (strcmp(part_type, "GPT") == 0 && strcmp(x86_bootmethod(), "UEFI") != 0) { | ||||
if (strcmp(x86_bootmethod(), "UEFI") == 0) | if (strcmp(fs_type, "zfs") == 0) | ||||
return (EFI_BOOTPART_PATH); | |||||
else if (strcmp(fs_type, "zfs") == 0) | |||||
return ("/boot/gptzfsboot"); | return ("/boot/gptzfsboot"); | ||||
else | else | ||||
return ("/boot/gptboot"); | return ("/boot/gptboot"); | ||||
} | } | ||||
/* No partcode except for GPT */ | /* No partcode except for non-UEFI GPT */ | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||