partedit_x86.c (52f39da1f8c7fc23ea5379ce0d4980b9c43b02af) | partedit_x86.c (db8b56134506840832bec2d1ce07b9e00d4d6d71) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2011 Nathan Whitehorn 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 21 unchanged lines hidden (view full) --- 30 31#include <sys/types.h> 32#include <sys/sysctl.h> 33#include <string.h> 34 35#include "partedit.h" 36 37/* EFI partition size in bytes */ | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2011 Nathan Whitehorn 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 21 unchanged lines hidden (view full) --- 30 31#include <sys/types.h> 32#include <sys/sysctl.h> 33#include <string.h> 34 35#include "partedit.h" 36 37/* EFI partition size in bytes */ |
38#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) 39#define EFI_BOOTPART_PATH "/boot/boot1.efifat" | 38#define EFI_BOOTPART_SIZE (260 * 1024 * 1024) |
40 41static const char * 42x86_bootmethod(void) 43{ 44 static char fw[255] = ""; 45 size_t len = sizeof(fw); 46 int error; 47 --- 88 unchanged lines hidden (view full) --- 136 137 return (NULL); 138} 139 140const char * 141partcode_path(const char *part_type, const char *fs_type) 142{ 143 | 39 40static const char * 41x86_bootmethod(void) 42{ 43 static char fw[255] = ""; 44 size_t len = sizeof(fw); 45 int error; 46 --- 88 unchanged lines hidden (view full) --- 135 136 return (NULL); 137} 138 139const char * 140partcode_path(const char *part_type, const char *fs_type) 141{ 142 |
144 if (strcmp(part_type, "GPT") == 0) { 145 if (strcmp(x86_bootmethod(), "UEFI") == 0) 146 return (EFI_BOOTPART_PATH); 147 else if (strcmp(fs_type, "zfs") == 0) | 143 if (strcmp(part_type, "GPT") == 0 && strcmp(x86_bootmethod(), "UEFI") != 0) { 144 if (strcmp(fs_type, "zfs") == 0) |
148 return ("/boot/gptzfsboot"); 149 else 150 return ("/boot/gptboot"); 151 } 152 | 145 return ("/boot/gptzfsboot"); 146 else 147 return ("/boot/gptboot"); 148 } 149 |
153 /* No partcode except for GPT */ | 150 /* No partcode except for non-UEFI GPT */ |
154 return (NULL); 155} 156 | 151 return (NULL); 152} 153 |