- Update patch for copying flags so that it is generic

- Copy pmbr_boot flag in gpt_duplicate
This commit is contained in:
Brian C. Lane 2012-02-03 14:31:21 -08:00
parent c45765537f
commit c4a50494de
3 changed files with 51 additions and 29 deletions

View File

@ -1,18 +1,19 @@
From e356e46263c93f0ffdcd830d9f4d051fc961067e Mon Sep 17 00:00:00 2001
From febeedd8d3dbddcc6e831591b05f590eaca97b12 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
Date: Mon, 31 Oct 2011 16:35:16 -0700
Subject: [PATCH] libparted: copy flags when duplicating GPT partitions
* libparted/labels/gpt.c (gpt_partition_duplicate): copy flags to new
partition.
* NEWS: Mention this fix.
* libparted/labels/gpt.c (gpt_partition_duplicate): Copy flags to new
partition.
* NEWS: Mention this fix.
Reported by Chris Murphy in https://bugzilla.redhat.com/747497.
---
NEWS | 3 +++
libparted/labels/gpt.c | 12 ++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
libparted/labels/gpt.c | 4 +---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index b7fb56b..915b5ff 100644
index bc5152b..af1d957 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ GNU parted NEWS -*- outline -*-
@ -26,28 +27,20 @@ index b7fb56b..915b5ff 100644
[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
index 8c9816f..f2bda41 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;
@@ -1362,9 +1362,7 @@ gpt_partition_duplicate (const PedPartition *part)
if (!result_data)
goto error_free_part;
- result_data->type = part_data->type;
- result_data->uuid = part_data->uuid;
- strcpy (result_data->name, part_data->name);
+ *result_data = *part_data;
return result;
error_free_part:
--
1.7.6.4
1.7.6.5

View File

@ -0,0 +1,25 @@
From 43663f1226da0a6284b5f52f6e2f741473c077b6 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Fri, 3 Feb 2012 13:03:27 -0800
Subject: [PATCH] libparted: copy pmbr_boot when duplicating GPT disk
* libparted/labels/gpt.c (gpt_duplicate): copy pmbr_boot flag
---
libparted/labels/gpt.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index bad9ed4..0f07250 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -562,6 +562,7 @@ gpt_duplicate (const PedDisk *disk)
old_disk_data->data_area.length);
new_disk_data->entry_count = old_disk_data->entry_count;
new_disk_data->uuid = old_disk_data->uuid;
+ new_disk_data->pmbr_boot = old_disk_data->pmbr_boot;
return new_disk;
}
--
1.7.6.5

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.0
Release: 6%{?dist}
Release: 7%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@ -37,7 +37,7 @@ Patch16: parted-3.0-parted-when-printing-also-print-the-new-disk-flags.patch
Patch17: parted-3.0-tests-update-tests-for-new-disk-flags-output.patch
Patch18: parted-3.0-tests-add-test-for-GPT-PMBR-pmbr_boot-flag.patch
Patch19: parted-3.0-doc-update-parted-documentation.patch
Patch20: parted-3.0-libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel
@ -168,6 +168,10 @@ fi
%changelog
* Fri Feb 03 2012 Brian C. Lane <bcl@redhat.com> - 3.0-7
- Update patch for copying flags so that it is generic
- Copy pmbr_boot flag in gpt_duplicate
* Thu Feb 02 2012 Brian C. Lane <bcl@redhat.com> - 3.0-6
- gpt: add commands to manipulate pMBR boot flag (#754850)
- parted: when printing, also print the new disk flags