aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-11-06 09:04:19 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-11-06 09:04:19 +0000
commit9ce2c74957bc5fb61c8b8e9fc9ca5fcf6a25b844 (patch)
tree5e9a14bb6fe2e3a2b66105445dceeef353e1dbaa
parent4ca571aba060489dbd628e880af130c26c80b269 (diff)
downloadsrc-9ce2c74957bc5fb61c8b8e9fc9ca5fcf6a25b844.tar.gz
src-9ce2c74957bc5fb61c8b8e9fc9ca5fcf6a25b844.zip
10570 Need workaround to EFI boot on AMI BIOS
illumos/illumos-gate@fd7977362aae2eaa5dcb89671159f4fd82f22ca1 https://github.com/illumos/illumos-gate/commit/fd7977362aae2eaa5dcb89671159f4fd82f22ca1 https://www.illumos.org/issues/10570 Some BIOS types are very pick about the GPT header size. Author: John Levon <john.levon@joyent.com>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=354384
-rw-r--r--uts/common/fs/zfs/zvol.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/uts/common/fs/zfs/zvol.c b/uts/common/fs/zfs/zvol.c
index 3566984ab4b0..10ea804f8de2 100644
--- a/uts/common/fs/zfs/zvol.c
+++ b/uts/common/fs/zfs/zvol.c
@@ -27,6 +27,7 @@
* Copyright (c) 2012, 2017 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
+ * Copyright (c) 2019, Joyent, Inc.
*/
/*
@@ -1509,7 +1510,7 @@ zvol_getefi(void *arg, int flag, uint64_t vs, uint8_t bs)
gpt.efi_gpt_Signature = LE_64(EFI_SIGNATURE);
gpt.efi_gpt_Revision = LE_32(EFI_VERSION_CURRENT);
- gpt.efi_gpt_HeaderSize = LE_32(sizeof (gpt));
+ gpt.efi_gpt_HeaderSize = LE_32(EFI_HEADER_SIZE);
gpt.efi_gpt_MyLBA = LE_64(1ULL);
gpt.efi_gpt_FirstUsableLBA = LE_64(34ULL);
gpt.efi_gpt_LastUsableLBA = LE_64((vs >> bs) - 1);
@@ -1519,7 +1520,7 @@ zvol_getefi(void *arg, int flag, uint64_t vs, uint8_t bs)
LE_32(sizeof (efi_gpe_t));
CRC32(crc, &gpe, sizeof (gpe), -1U, crc32_table);
gpt.efi_gpt_PartitionEntryArrayCRC32 = LE_32(~crc);
- CRC32(crc, &gpt, sizeof (gpt), -1U, crc32_table);
+ CRC32(crc, &gpt, EFI_HEADER_SIZE, -1U, crc32_table);
gpt.efi_gpt_HeaderCRC32 = LE_32(~crc);
if (ddi_copyout(&gpt, ptr, MIN(sizeof (gpt), length),
flag))