parted/parted-3.0-libparted-copy-flags-when-duplicating-GPT-partitions.patch
Brian C. Lane 68bb9e0f50 - Fix ped_disk_duplicate on GPT so that it copies the partition flags (#747947)
- Add new test to check ped_disk_duplicate on msdos, gpt, bsd disk labels
- Add e2fsprogs and dosfstools so that skipped tests will be run
2011-10-31 16:15:41 -07:00

54 lines
1.8 KiB
Diff

From e356e46263c93f0ffdcd830d9f4d051fc961067e Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 27 Oct 2011 16:29:15 -0700
Subject: [PATCH 1/2] libparted: copy flags when duplicating GPT partitions
* libparted/labels/gpt.c (gpt_partition_duplicate): copy flags to new
partition.
* NEWS: Mention this fix.
---
NEWS | 3 +++
libparted/labels/gpt.c | 12 ++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/NEWS b/NEWS
index b7fb56b..915b5ff 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ GNU parted NEWS -*- outline -*-
** Bug fixes
+ libparted: gpt_disk_duplicate now copies the flags over to the new
+ disk object. Previously the flags would be undefined.
+
libparted: no longer aborts (failed assertion) due to a nilfs2_probe bug
[bug introduced in parted-2.4 with the addition of nilfs2 support]
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 8c9816f..7b4e014 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1365,6 +1365,18 @@ gpt_partition_duplicate (const PedPartition *part)
result_data->type = part_data->type;
result_data->uuid = part_data->uuid;
strcpy (result_data->name, part_data->name);
+
+ /* Copy over all the flags */
+ result_data->lvm = part_data->lvm;
+ result_data->raid = part_data->raid;
+ result_data->boot = part_data->boot;
+ result_data->bios_grub = part_data->bios_grub;
+ result_data->hp_service = part_data->hp_service;
+ result_data->hidden = part_data->hidden;
+ result_data->msftres = part_data->msftres;
+ result_data->atvrecv = part_data->atvrecv;
+ result_data->msftrecv = part_data->msftrecv;
+ result_data->legacy_boot = part_data->legacy_boot;
return result;
error_free_part:
--
1.7.6.4