2010-04-02 11:35:12 +00:00
|
|
|
---
|
2014-05-07 09:41:13 +00:00
|
|
|
libparted/labels/gpt.c | 240 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
|
|
|
1 file changed, 236 insertions(+), 4 deletions(-)
|
2010-04-02 11:35:12 +00:00
|
|
|
|
2015-04-24 15:49:30 +00:00
|
|
|
Index: parted-3.2/libparted/labels/gpt.c
|
2008-07-18 22:25:20 +00:00
|
|
|
===================================================================
|
2015-04-24 15:49:30 +00:00
|
|
|
--- parted-3.2.orig/libparted/labels/gpt.c
|
|
|
|
+++ parted-3.2/libparted/labels/gpt.c
|
|
|
|
@@ -305,6 +305,7 @@ typedef struct _GPTPartitionData
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
} GPTPartitionData;
|
2008-07-18 22:25:20 +00:00
|
|
|
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
static PedDiskType gpt_disk_type;
|
|
|
|
+static PedDiskType gpt_sync_mbr_disk_type;
|
|
|
|
|
|
|
|
static inline uint32_t
|
|
|
|
pth_get_size (const PedDevice *dev)
|
2015-04-24 15:49:30 +00:00
|
|
|
@@ -473,8 +474,50 @@ _pmbr_is_valid (const LegacyMBR_t *mbr)
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+/* checks if device has a hybrid protective MBR partition table
|
|
|
|
+ *
|
|
|
|
+ * If the 1st partition has type 0xEE that spans the entire
|
|
|
|
+ * size of the disk from sector 1 to the last sector
|
|
|
|
+ * (or 2 TiB, whichever is smaller), we consider it 'normal' GPT.
|
|
|
|
+ * Otherwise it is synced GPT with hybridized pMBR.
|
|
|
|
+ */
|
|
|
|
+static inline int
|
|
|
|
+_has_hybrid_pmbr (const PedDevice *dev)
|
|
|
|
+{
|
|
|
|
+ int has_hybrid_pmbr = 1;
|
|
|
|
+
|
|
|
|
+ PED_ASSERT (dev != NULL);
|
|
|
|
+
|
|
|
|
+ void *label;
|
|
|
|
+ if (!ptt_read_sector (dev, 0, &label))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ LegacyMBR_t mbr;
|
|
|
|
+ memcpy(&mbr, label, sizeof(mbr));
|
|
|
|
+
|
|
|
|
+ if (mbr.Signature != PED_CPU_TO_LE16 (MSDOS_MBR_SIGNATURE)) {
|
|
|
|
+ free(label);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uint32_t efi_gpt_expected_size;
|
|
|
|
+ if ((dev->length - 1ULL) > 0xFFFFFFFFULL)
|
|
|
|
+ efi_gpt_expected_size = 0xFFFFFFFF;
|
|
|
|
+ else
|
|
|
|
+ efi_gpt_expected_size = dev->length - 1UL;
|
|
|
|
+
|
|
|
|
+ if ((mbr.PartitionRecord[0].OSType == EFI_PMBR_OSTYPE_EFI) &&
|
|
|
|
+ (mbr.PartitionRecord[0].StartingLBA == PED_CPU_TO_LE32(1)) &&
|
|
|
|
+ (mbr.PartitionRecord[0].SizeInLBA == PED_CPU_TO_LE32(efi_gpt_expected_size)))
|
|
|
|
+ /* pMBR is not hybrid */
|
|
|
|
+ has_hybrid_pmbr = 0;
|
|
|
|
+
|
|
|
|
+ free(label);
|
|
|
|
+ return has_hybrid_pmbr;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static int
|
|
|
|
-gpt_probe (const PedDevice *dev)
|
|
|
|
+_gpt_probe_generic(const PedDevice *dev)
|
|
|
|
{
|
|
|
|
int gpt_sig_found = 0;
|
2015-04-24 15:49:30 +00:00
|
|
|
|
2014-05-07 09:41:13 +00:00
|
|
|
@@ -508,6 +551,19 @@ gpt_probe (const PedDevice *dev)
|
2015-04-24 15:49:30 +00:00
|
|
|
return gpt_sig_found;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+gpt_probe (const PedDevice *dev)
|
|
|
|
+{
|
|
|
|
+ return _gpt_probe_generic(dev) && !_has_hybrid_pmbr(dev);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
+gpt_sync_mbr_probe (const PedDevice *dev)
|
|
|
|
+{
|
|
|
|
+ return _gpt_probe_generic(dev) && _has_hybrid_pmbr(dev);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static PedDisk *
|
|
|
|
gpt_alloc (const PedDevice *dev)
|
|
|
|
{
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -553,6 +609,50 @@ error:
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static PedDisk *
|
|
|
|
+gpt_sync_mbr_alloc (const PedDevice *dev)
|
|
|
|
+{
|
|
|
|
+ PedDisk *disk;
|
|
|
|
+ GPTDiskData *gpt_disk_data;
|
|
|
|
+ PedSector data_start, data_end;
|
2008-07-18 22:25:20 +00:00
|
|
|
+
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ disk = _ped_disk_alloc ((PedDevice *) dev, &gpt_sync_mbr_disk_type);
|
|
|
|
+ if (!disk)
|
|
|
|
+ goto error;
|
|
|
|
+
|
|
|
|
+ data_start = 2 + GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
|
|
|
|
+ data_end = dev->length - 2
|
|
|
|
+ - GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
|
2015-09-19 17:56:08 +00:00
|
|
|
+
|
|
|
|
+ /* If the device is too small to accommodate GPT headers and one data
|
|
|
|
+ sector, reject it. */
|
|
|
|
+ if (data_end < data_start)
|
|
|
|
+ {
|
|
|
|
+ ped_exception_throw (PED_EXCEPTION_ERROR,
|
|
|
|
+ PED_EXCEPTION_OK,
|
|
|
|
+ _("device is too small for GPT"));
|
|
|
|
+ goto error_free_disk;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ disk->disk_specific = gpt_disk_data = ped_malloc (sizeof (GPTDiskData));
|
|
|
|
+ if (!disk->disk_specific)
|
|
|
|
+ goto error_free_disk;
|
|
|
|
+
|
|
|
|
+ gpt_disk_data->AlternateLBA = dev->length - 1;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ ped_geometry_init (&gpt_disk_data->data_area, dev, data_start,
|
|
|
|
+ data_end - data_start + 1);
|
|
|
|
+ gpt_disk_data->entry_count = GPT_DEFAULT_PARTITION_ENTRIES;
|
|
|
|
+ uuid_generate ((unsigned char *) &gpt_disk_data->uuid);
|
|
|
|
+ swap_uuid_and_efi_guid ((unsigned char *) (&gpt_disk_data->uuid));
|
2015-09-19 17:56:08 +00:00
|
|
|
+ gpt_disk_data->pmbr_boot = 0;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ return disk;
|
|
|
|
+
|
|
|
|
+error_free_disk:
|
|
|
|
+ free (disk);
|
|
|
|
+error:
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static PedDisk *
|
|
|
|
gpt_duplicate (const PedDisk *disk)
|
|
|
|
{
|
|
|
|
PedDisk *new_disk;
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -963,7 +1063,7 @@ gpt_read (PedDisk *disk)
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
|
|
|
|
/* motivation: let the user decide about the pmbr... during
|
|
|
|
ped_disk_probe(), they probably didn't get a choice... */
|
|
|
|
- if (!gpt_probe (disk->dev))
|
|
|
|
+ if (!gpt_probe (disk->dev) && !gpt_sync_mbr_probe(disk->dev))
|
|
|
|
goto error;
|
2008-07-18 22:25:20 +00:00
|
|
|
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
GuidPartitionTableHeader_t *gpt = NULL;
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -1120,11 +1220,59 @@ error:
|
2010-04-02 11:35:12 +00:00
|
|
|
return 0;
|
2008-07-18 22:25:20 +00:00
|
|
|
}
|
|
|
|
|
2010-04-02 11:35:12 +00:00
|
|
|
+
|
2008-07-18 22:25:20 +00:00
|
|
|
+static inline unsigned char
|
|
|
|
+_part_to_ostype (PedPartition* part)
|
|
|
|
+{
|
2010-04-02 11:35:12 +00:00
|
|
|
+ if (part->fs_type) {
|
|
|
|
+ if (strncmp (part->fs_type->name, "fat", 3) == 0) return 0xc;
|
|
|
|
+ if (strncmp (part->fs_type->name, "ntfs", 4) == 0) return 0x7;
|
|
|
|
+ if (strncmp (part->fs_type->name, "hfs", 3) == 0) return 0xaf;
|
|
|
|
+ if (strstr (part->fs_type->name, "swap")) return 0x82;
|
|
|
|
+ }
|
|
|
|
+ return 0x83; // Everything else is Linux
|
2008-07-18 22:25:20 +00:00
|
|
|
+}
|
|
|
|
+
|
2008-08-11 21:37:59 +00:00
|
|
|
+static inline PedPartition*
|
2009-08-06 20:06:27 +00:00
|
|
|
+_find_first_part (const PedDisk* disk)
|
2008-08-11 21:37:59 +00:00
|
|
|
+{
|
2010-04-02 11:35:12 +00:00
|
|
|
+ PedPartition *retval = NULL, *part = NULL;
|
|
|
|
+ uint64_t lowest_end = 0xffffffffffffffff;
|
|
|
|
+ while (part = ped_disk_next_partition (disk, part)) {
|
|
|
|
+ if (part->geom.start == 0 || part->type == PED_PARTITION_METADATA
|
|
|
|
+ || part->type == PED_PARTITION_FREESPACE)
|
|
|
|
+ continue;
|
|
|
|
+ if (part->geom.end < lowest_end) {
|
|
|
|
+ retval = part;
|
|
|
|
+ lowest_end = part->geom.end;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return retval;
|
2008-08-11 21:37:59 +00:00
|
|
|
+}
|
|
|
|
+
|
2008-07-18 22:25:20 +00:00
|
|
|
+static inline uint32_t
|
|
|
|
+_part_32bitmax (uint64_t in)
|
|
|
|
+{
|
2010-04-02 11:35:12 +00:00
|
|
|
+ if (in > 0xFFFFFFFFULL)
|
|
|
|
+ return 0xFFFFFFFF;
|
|
|
|
+ else
|
|
|
|
+ return (uint32_t)in;
|
2008-07-18 22:25:20 +00:00
|
|
|
+}
|
2009-08-06 20:06:27 +00:00
|
|
|
+
|
2008-07-18 22:25:20 +00:00
|
|
|
+
|
|
|
|
#ifndef DISCOVER_ONLY
|
2009-08-06 20:06:27 +00:00
|
|
|
/* Write the protective MBR (to keep DOS happy) */
|
2008-07-18 22:25:20 +00:00
|
|
|
static int
|
2014-05-07 09:41:13 +00:00
|
|
|
-_write_pmbr (PedDevice *dev, bool pmbr_boot)
|
|
|
|
+_write_pmbr (const PedDisk *disk, bool pmbr_boot)
|
2008-07-18 22:25:20 +00:00
|
|
|
{
|
2014-05-07 09:41:13 +00:00
|
|
|
+ PedDevice * dev = disk->dev;
|
2010-04-02 11:35:12 +00:00
|
|
|
+
|
2014-05-07 09:41:13 +00:00
|
|
|
+ /* need sync GPT -> hybrid pMBR ? */
|
|
|
|
+ int sync_pmbr = !strcmp(disk->type->name, "gpt_sync_mbr") ? 1 : 0;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+
|
2014-05-07 09:41:13 +00:00
|
|
|
+ int i, pmbr_id, first_entry = 0, last_entry = 3;
|
|
|
|
+ PedPartition *part = NULL, *esp;
|
2009-08-06 20:06:27 +00:00
|
|
|
+
|
2010-04-02 11:35:12 +00:00
|
|
|
/* The UEFI spec is not clear about what to do with the following
|
|
|
|
elements of the Protective MBR (pmbr): BootCode (0-440B),
|
|
|
|
UniqueMBRSignature (440B-444B) and Unknown (444B-446B).
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -1138,6 +1286,8 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
|
2010-04-02 11:35:12 +00:00
|
|
|
memset (pmbr->PartitionRecord, 0, sizeof pmbr->PartitionRecord);
|
2009-08-06 20:06:27 +00:00
|
|
|
|
2010-04-02 11:35:12 +00:00
|
|
|
pmbr->Signature = PED_CPU_TO_LE16 (MSDOS_MBR_SIGNATURE);
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+
|
|
|
|
+ if (!sync_pmbr) {
|
2010-04-02 11:35:12 +00:00
|
|
|
pmbr->PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI;
|
|
|
|
pmbr->PartitionRecord[0].StartSector = 1;
|
|
|
|
pmbr->PartitionRecord[0].EndHead = 0xFE;
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -1150,6 +1300,60 @@ _write_pmbr (PedDevice *dev, bool pmbr_b
|
2010-04-02 11:35:12 +00:00
|
|
|
pmbr->PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32 (dev->length - 1UL);
|
2014-05-07 09:41:13 +00:00
|
|
|
if (pmbr_boot)
|
|
|
|
pmbr->PartitionRecord[0].BootIndicator = 0x80;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ } else {
|
2010-04-02 11:35:12 +00:00
|
|
|
+ /* Search for an EFI System Partition */
|
|
|
|
+ esp = _find_first_part(disk);
|
|
|
|
+ if (!esp || !esp->fs_type || strncmp (esp->fs_type->name, "fat", 3) != 0)
|
|
|
|
+ esp = NULL;
|
2008-08-11 21:37:59 +00:00
|
|
|
+
|
2010-04-02 11:35:12 +00:00
|
|
|
+ pmbr_id = 3;
|
|
|
|
+ if (esp) {
|
|
|
|
+ pmbr_id = 0;
|
|
|
|
+ first_entry = 1;
|
|
|
|
+ last_entry = 4;
|
|
|
|
+ }
|
2008-08-11 21:37:59 +00:00
|
|
|
+
|
2010-04-02 11:35:12 +00:00
|
|
|
+ /* Write a pseudo-PMBR so Linux is happy */
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].OSType = EFI_PMBR_OSTYPE_EFI;
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].StartSector = 1;
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].EndHead = 0xFE;
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].EndSector = 0xFF;
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].EndTrack = 0xFF;
|
|
|
|
+ pmbr->PartitionRecord[pmbr_id].StartingLBA = PED_CPU_TO_LE32(1);
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ pmbr->PartitionRecord[pmbr_id].SizeInLBA = PED_CPU_TO_LE32 (1);
|
2010-04-02 11:35:12 +00:00
|
|
|
+ if (esp)
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ pmbr->PartitionRecord[pmbr_id].SizeInLBA = PED_CPU_TO_LE32 (esp->geom.end - 1);
|
2008-08-11 21:37:59 +00:00
|
|
|
+
|
2010-04-02 11:35:12 +00:00
|
|
|
+ /* sync the first 3 GPT entries to MBR primary partitions */
|
|
|
|
+ for (i=first_entry; i < last_entry; i++) {
|
|
|
|
+ part = ped_disk_next_partition (disk, part);
|
|
|
|
+ if (part == NULL)
|
|
|
|
+ break;
|
|
|
|
+ /* we might get a starting garbage partition */
|
|
|
|
+ if (part->geom.start == 0 || part->type == PED_PARTITION_METADATA || part->type == PED_PARTITION_FREESPACE || part == esp) {
|
|
|
|
+ i--;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+
|
|
|
|
+ /* partition can not be represented by dos label - don't sync it */
|
|
|
|
+ if (part->geom.start > 0xFFFFFFFF ||
|
|
|
|
+ (part->geom.end - part->geom.start + 1) > 0xFFFFFFFF) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
2014-05-07 09:41:13 +00:00
|
|
|
+
|
2010-04-02 11:35:12 +00:00
|
|
|
+ pmbr->PartitionRecord[i].OSType = _part_to_ostype(part);
|
|
|
|
+ pmbr->PartitionRecord[i].StartHead = 0xFE;
|
|
|
|
+ pmbr->PartitionRecord[i].StartSector = 0xFF;
|
|
|
|
+ pmbr->PartitionRecord[i].StartTrack = 0xFF;
|
|
|
|
+ pmbr->PartitionRecord[i].EndHead = 0xFE;
|
|
|
|
+ pmbr->PartitionRecord[i].EndSector = 0xFF;
|
|
|
|
+ pmbr->PartitionRecord[i].EndTrack = 0xFF;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ pmbr->PartitionRecord[i].StartingLBA = PED_CPU_TO_LE32 (_part_32bitmax(part->geom.start));
|
2010-04-02 11:35:12 +00:00
|
|
|
+ if(((GPTPartitionData*)part->disk_specific)->boot)
|
|
|
|
+ pmbr->PartitionRecord[i].BootIndicator = 0x80;
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
+ pmbr->PartitionRecord[i].SizeInLBA = PED_CPU_TO_LE32 (_part_32bitmax(part->geom.end - part->geom.start + 1));
|
|
|
|
+ }
|
2010-04-02 11:35:12 +00:00
|
|
|
+ }
|
2014-05-07 09:41:13 +00:00
|
|
|
|
2010-04-02 11:35:12 +00:00
|
|
|
int write_ok = ped_device_write (dev, pmbr, GPT_PMBR_LBA,
|
|
|
|
GPT_PMBR_SECTORS);
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -1269,7 +1473,7 @@ gpt_write (const PedDisk *disk)
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
ptes_crc = efi_crc32 (ptes, ptes_bytes);
|
2008-07-18 22:25:20 +00:00
|
|
|
|
2010-04-02 11:35:12 +00:00
|
|
|
/* Write protective MBR */
|
2014-05-07 09:41:13 +00:00
|
|
|
- if (!_write_pmbr (disk->dev, gpt_disk_data->pmbr_boot))
|
|
|
|
+ if (!_write_pmbr (disk, gpt_disk_data->pmbr_boot))
|
2010-04-02 11:35:12 +00:00
|
|
|
goto error_free_ptes;
|
2008-07-18 22:25:20 +00:00
|
|
|
|
2010-04-02 11:35:12 +00:00
|
|
|
/* Write PTH and PTEs */
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -2034,6 +2238,38 @@ static PedDiskOps gpt_disk_ops =
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
PT_op_function_initializers (gpt)
|
|
|
|
};
|
|
|
|
|
|
|
|
+static PedDiskOps gpt_sync_mbr_disk_ops =
|
|
|
|
+{
|
|
|
|
+ clobber: NULL,
|
|
|
|
+ write: NULL_IF_DISCOVER_ONLY (gpt_write),
|
|
|
|
+
|
|
|
|
+ partition_set_name: gpt_partition_set_name,
|
|
|
|
+ partition_get_name: gpt_partition_get_name,
|
|
|
|
+
|
|
|
|
+ /* probe function redefined */
|
|
|
|
+ probe: gpt_sync_mbr_probe,
|
|
|
|
+ /* alloc function redefined */
|
|
|
|
+ alloc: gpt_sync_mbr_alloc,
|
|
|
|
+ duplicate: gpt_duplicate,
|
|
|
|
+ free: gpt_free,
|
|
|
|
+ read: gpt_read,
|
|
|
|
+ partition_new: gpt_partition_new,
|
|
|
|
+ partition_duplicate: gpt_partition_duplicate,
|
|
|
|
+ partition_set_flag: gpt_partition_set_flag,
|
|
|
|
+ partition_get_flag: gpt_partition_get_flag,
|
|
|
|
+ partition_set_system: gpt_partition_set_system,
|
|
|
|
+ partition_is_flag_available: gpt_partition_is_flag_available,
|
|
|
|
+ partition_align: gpt_partition_align,
|
|
|
|
+ partition_destroy: gpt_partition_destroy,
|
|
|
|
+ partition_enumerate: gpt_partition_enumerate,
|
|
|
|
+ alloc_metadata: gpt_alloc_metadata,
|
|
|
|
+ get_max_primary_partition_count: gpt_get_max_primary_partition_count,
|
|
|
|
+ get_max_supported_partition_count: gpt_get_max_supported_partition_count,
|
|
|
|
+ partition_check: gpt_partition_check,
|
|
|
|
+ max_length: gpt_partition_max_length,
|
|
|
|
+ max_start_sector: gpt_partition_max_start_sector
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
static PedDiskType gpt_disk_type =
|
|
|
|
{
|
|
|
|
next: NULL,
|
2015-09-19 17:56:08 +00:00
|
|
|
@@ -2042,16 +2278,26 @@ static PedDiskType gpt_disk_type =
|
- update to parted-3.1 (fate#316110)
- changes in parted-3.1:
* Changes in behavior
- Floppy drives are no longer scanned on linux: they cannot be
partitioned anyhow, and some users have a misconfigured BIOS
that claims to have a floppy when they don't, and scanning
gets hung up.
- parted: the mkpart command has changed semantics with regard
to specifying the end of the partition. If the end is
specified using units of MiB, GiB, etc., parted subtracts one
sector from the specified value. With this change, it is now
possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
so on.
* Many bugfixes (see changelog)
- changes in parted-3.0:
* Changes in behavior
- Remove all FS-related (file system-related) sub-commands;
these commands are no longer recognized because they were all
dependent on parted "knowing" too much about file system:
mkpartfs, mkfs, cp, move, check.
- 'resize' command changed semantics:
it no longer resizes the filesystem, but only moves end
sector of the partition
- libparted-devel contains libparted-fs-resize library
- add ability to change size of the partition (ignoring contained
filesystem) with 'resize' command; this command has different
semantics than the former 'resize' command which upstream
decided to drop
- parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00
|
|
|
features: PED_DISK_TYPE_PARTITION_NAME
|
|
|
|
};
|
|
|
|
|
|
|
|
+static PedDiskType gpt_sync_mbr_disk_type =
|
|
|
|
+{
|
|
|
|
+ next: NULL,
|
|
|
|
+ name: "gpt_sync_mbr",
|
|
|
|
+ ops: &gpt_sync_mbr_disk_ops,
|
|
|
|
+ features: PED_DISK_TYPE_PARTITION_NAME
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
void
|
|
|
|
ped_disk_gpt_init ()
|
|
|
|
{
|
|
|
|
ped_disk_type_register (&gpt_disk_type);
|
|
|
|
+ ped_disk_type_register (&gpt_sync_mbr_disk_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ped_disk_gpt_done ()
|
|
|
|
{
|
|
|
|
ped_disk_type_unregister (&gpt_disk_type);
|
|
|
|
+ ped_disk_type_unregister (&gpt_sync_mbr_disk_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
verify (sizeof (GuidPartitionEntryAttributes_t) == 8);
|