Print this page
10570 Need workaround to EFI boot on AMI BIOS

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zvol.c
          +++ new/usr/src/uts/common/fs/zfs/zvol.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   *
  24   24   * Portions Copyright 2010 Robert Milkowski
  25   25   *
  26   26   * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  27   27   * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  28   28   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  29   29   * Copyright (c) 2014 Integros [integros.com]
       30 + * Copyright (c) 2019, Joyent, Inc.
  30   31   */
  31   32  
  32   33  /*
  33   34   * ZFS volume emulation driver.
  34   35   *
  35   36   * Makes a DMU object look like a volume of arbitrary size, up to 2^64 bytes.
  36   37   * Volumes are accessed through the symbolic links named:
  37   38   *
  38   39   * /dev/zvol/dsk/<pool_name>/<dataset_name>
  39   40   * /dev/zvol/rdsk/<pool_name>/<dataset_name>
↓ open down ↓ 1462 lines elided ↑ open up ↑
1502 1503  
1503 1504          gpe.efi_gpe_StartingLBA = LE_64(34ULL);
1504 1505          gpe.efi_gpe_EndingLBA = LE_64((vs >> bs) - 1);
1505 1506          UUID_LE_CONVERT(gpe.efi_gpe_PartitionTypeGUID, uuid);
1506 1507  
1507 1508          if (efi.dki_lba == 1) {
1508 1509                  efi_gpt_t gpt = { 0 };
1509 1510  
1510 1511                  gpt.efi_gpt_Signature = LE_64(EFI_SIGNATURE);
1511 1512                  gpt.efi_gpt_Revision = LE_32(EFI_VERSION_CURRENT);
1512      -                gpt.efi_gpt_HeaderSize = LE_32(sizeof (gpt));
     1513 +                gpt.efi_gpt_HeaderSize = LE_32(EFI_HEADER_SIZE);
1513 1514                  gpt.efi_gpt_MyLBA = LE_64(1ULL);
1514 1515                  gpt.efi_gpt_FirstUsableLBA = LE_64(34ULL);
1515 1516                  gpt.efi_gpt_LastUsableLBA = LE_64((vs >> bs) - 1);
1516 1517                  gpt.efi_gpt_PartitionEntryLBA = LE_64(2ULL);
1517 1518                  gpt.efi_gpt_NumberOfPartitionEntries = LE_32(1);
1518 1519                  gpt.efi_gpt_SizeOfPartitionEntry =
1519 1520                      LE_32(sizeof (efi_gpe_t));
1520 1521                  CRC32(crc, &gpe, sizeof (gpe), -1U, crc32_table);
1521 1522                  gpt.efi_gpt_PartitionEntryArrayCRC32 = LE_32(~crc);
1522      -                CRC32(crc, &gpt, sizeof (gpt), -1U, crc32_table);
     1523 +                CRC32(crc, &gpt, EFI_HEADER_SIZE, -1U, crc32_table);
1523 1524                  gpt.efi_gpt_HeaderCRC32 = LE_32(~crc);
1524 1525                  if (ddi_copyout(&gpt, ptr, MIN(sizeof (gpt), length),
1525 1526                      flag))
1526 1527                          return (SET_ERROR(EFAULT));
1527 1528                  ptr += sizeof (gpt);
1528 1529                  length -= sizeof (gpt);
1529 1530          }
1530 1531          if (length > 0 && ddi_copyout(&gpe, ptr, MIN(sizeof (gpe),
1531 1532              length), flag))
1532 1533                  return (SET_ERROR(EFAULT));
↓ open down ↓ 656 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX