Bug#697170: unblock: parted/2.3-11.1
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package parted
The NMU I uploaded yesterdaty includes 3 upstream patches
cherry-picked by Jérémy Bobbio to fix #673042 (loses 'legacy BIOS
bootable' flag on GPT disks).
NMU diff attached.
unblock parted/2.3-11.1
-- System Information:
Debian Release: 7.0
Architecture: i386 (i686)
Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u parted-2.3/debian/changelog parted-2.3/debian/changelog
--- parted-2.3/debian/changelog
+++ parted-2.3/debian/changelog
@@ -1,3 +1,14 @@
+parted (2.3-11.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Cherry-pick upstream patches to fix the handling of GPT partition
+ flags when modifying a GPT. This, most particularly fixes the
+ handling of 'legagy BIOS bootable'.
+ Thanks to Jérémy Bobbio for providing the patch and analysis.
+ Closes: #673042
+
+ -- Christian Perrier <bubulle@debian.org> Tue, 01 Jan 2013 14:44:03 +0100
+
parted (2.3-11) unstable; urgency=medium
* Non-maintainer upload to fix partitioned md devices (bug #684713)
diff -u parted-2.3/debian/patches/series parted-2.3/debian/patches/series
--- parted-2.3/debian/patches/series
+++ parted-2.3/debian/patches/series
@@ -23,6 +23,9 @@
sun-raid-type-test-fix.patch
tiny-disk-constraint.patch
dasd-sync.patch
+gpt-add-partition-attribute-bits.patch
+gpt-add-legacy_boot-partition-flag.patch
+libparted-gpt-copy-flags.patch
linux-two-component.patch
md-partitions.patch
only in patch2:
unchanged:
--- parted-2.3.orig/debian/patches/libparted-gpt-copy-flags.patch
+++ parted-2.3/debian/patches/libparted-gpt-copy-flags.patch
@@ -0,0 +1,31 @@
+From: Brian C. Lane <bcl@redhat.com>
+Subject: libparted: copy flags when duplicating GPT partitions
+Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=febeedd8d3d
+Forwarded: not-needed
+Last-Update: 2011-05-15
+
+* libparted/labels/gpt.c (gpt_partition_duplicate): Copy flags to new
+partition.
+
+Reported by Chris Murphy in https://bugzilla.redhat.com/747497.
+
+---
+ libparted/labels/gpt.c | 4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
+index 8c895c4..dc3e8b4 100644
+--- a/libparted/labels/gpt.c
++++ b/libparted/labels/gpt.c
+@@ -1348,9 +1348,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:
+--
only in patch2:
unchanged:
--- parted-2.3.orig/debian/patches/gpt-add-partition-attribute-bits.patch
+++ parted-2.3/debian/patches/gpt-add-partition-attribute-bits.patch
@@ -0,0 +1,36 @@
+From: Brian C. Lane <bcl@redhat.com>
+Subject: gpt: add partition attribute bits: NoBlockIOProtocol, LegacyBIOSBootable
+Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=7fc2cf02e1e
+Forwaded: not-needed
+Last-Update: 2011-02-25
+
+Add NoBlockIOProtocol and LegacyBIOSBootable flags to the GPT partition
+Attributes entry.
+---
+ libparted/labels/gpt.c | 8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
+index e927b5b..321a240 100644
+--- a/libparted/labels/gpt.c
++++ b/libparted/labels/gpt.c
+@@ -167,12 +167,16 @@ struct __attribute__ ((packed)) _GuidPartitionEntryAttributes_t
+ {
+ #ifdef __GNUC__ /* XXX narrow this down to !TinyCC */
+ uint64_t RequiredToFunction:1;
+- uint64_t Reserved:47;
++ uint64_t NoBlockIOProtocol:1;
++ uint64_t LegacyBIOSBootable:1;
++ uint64_t Reserved:45;
+ uint64_t GuidSpecific:16;
+ #else
+ # warning "Using crippled partition entry type"
+ uint32_t RequiredToFunction:1;
+- uint32_t Reserved:32;
++ uint32_t NoBlockIOProtocol:1;
++ uint32_t LegacyBIOSBootable:1;
++ uint32_t Reserved:30;
+ uint32_t LOST:5;
+ uint32_t GuidSpecific:16;
+ #endif
+--
only in patch2:
unchanged:
--- parted-2.3.orig/debian/patches/gpt-add-legacy_boot-partition-flag.patch
+++ parted-2.3/debian/patches/gpt-add-legacy_boot-partition-flag.patch
@@ -0,0 +1,167 @@
+From: Brian C. Lane <bcl@redhat.com>
+Subject: gpt: add legacy_boot partition flag
+Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=3dd52c822a
+Forwarded: not-needed
+Last-Update: 2011-02-25
+
+Add support for the Legacy BIOS Bootable flag in the GPT
+Attribute field. This is used by software like syslinux to
+determine which partition to boot when in BIOS mode.
+
+See Page 105, Table 19 Bit 2 of the UEFI Spec 2.3 book.
+
+* doc/C/parted.8: Document legacy_boot.
+* doc/parted.texi: Document legacy_boot.
+* include/parted/disk.h: Add PED_PARTITION_LEGACY_BOOT flag.
+* libparted/disk.c (ped_partition_flag_get_name): Add legacy_boot flag.
+* libparted/labels/gpt.c (_parse_part_entry):
+(_partition_generate_part_entry, gpt_partition_new):
+(gpt_partition_set_flag, gpt_partition_get_flag):
+(gpt_partition_is_flag_available): Add legacy_boot flag support.
+---
+ doc/C/parted.8 | 2 +-
+ doc/parted.texi | 4 ++++
+ include/parted/disk.h | 5 +++--
+ libparted/disk.c | 2 ++
+ libparted/labels/gpt.c | 15 ++++++++++++++-
+ 5 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/doc/C/parted.8 b/doc/C/parted.8
+index 4c6b6ee..b8032ed 100644
+--- a/doc/C/parted.8
++++ b/doc/C/parted.8
+@@ -132,7 +132,7 @@ or an LVM logical volume if necessary.
+ .B set \fIpartition\fP \fIflag\fP \fIstate\fP
+ Change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP.
+ Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba",
+-and "palo".
++"legacy_boot" and "palo".
+ \fIstate\fP should be either "on" or "off".
+ .TP
+ .B unit \fIunit\fP
+diff --git a/doc/parted.texi b/doc/parted.texi
+index 4e0fec9..5a2f38f 100644
+--- a/doc/parted.texi
++++ b/doc/parted.texi
+@@ -1049,6 +1049,10 @@ depending on what disk label you are using:
+ (GPT) - Enable this to record that the selected partition is a
+ GRUB BIOS partition.
+
++@item legacy_boot
++(GPT) - this flag is used to tell special purpose software that the GPT
++partition may be bootable.
++
+ @item boot
+ (Mac, MS-DOS, PC98) - should be enabled if you want to boot off the
+ partition. The semantics vary between disk labels. For MS-DOS disk
+diff --git a/include/parted/disk.h b/include/parted/disk.h
+index f11e393..ddd3c86 100644
+--- a/include/parted/disk.h
++++ b/include/parted/disk.h
+@@ -69,10 +69,11 @@ enum _PedPartitionFlag {
+ PED_PARTITION_MSFT_RESERVED=11,
+ PED_PARTITION_BIOS_GRUB=12,
+ PED_PARTITION_APPLE_TV_RECOVERY=13,
+- PED_PARTITION_DIAG=14
++ PED_PARTITION_DIAG=14,
++ PED_PARTITION_LEGACY_BOOT=15
+ };
+ #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT
+-#define PED_PARTITION_LAST_FLAG PED_PARTITION_DIAG
++#define PED_PARTITION_LAST_FLAG PED_PARTITION_LEGACY_BOOT
+
+ enum _PedDiskTypeFeature {
+ PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */
+diff --git a/libparted/disk.c b/libparted/disk.c
+index 7a60a09..6fb9eb9 100644
+--- a/libparted/disk.c
++++ b/libparted/disk.c
+@@ -2443,6 +2443,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag)
+ return N_("atvrecv");
+ case PED_PARTITION_DIAG:
+ return N_("diag");
++ case PED_PARTITION_LEGACY_BOOT:
++ return N_("legacy_boot");
+
+ default:
+ ped_exception_throw (
+diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
+index 321a240..8c895c4 100644
+--- a/libparted/labels/gpt.c
++++ b/libparted/labels/gpt.c
+@@ -4,7 +4,7 @@
+ original version by Matt Domsch <Matt_Domsch@dell.com>
+ Disclaimed into the Public Domain
+
+- Portions Copyright (C) 2001-2003, 2005-2010 Free Software Foundation, Inc.
++ Portions Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
+
+ EFI GUID Partition Table handling
+ Per Intel EFI Specification v1.02
+@@ -282,6 +282,7 @@ typedef struct _GPTPartitionData
+ int msftres;
+ int atvrecv;
+ int msftrecv;
++ int legacy_boot;
+ } GPTPartitionData;
+
+ static PedDiskType gpt_disk_type;
+@@ -787,10 +788,13 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte)
+ = gpt_part_data->boot = gpt_part_data->hp_service
+ = gpt_part_data->hidden = gpt_part_data->msftres
+ = gpt_part_data->msftrecv
++ = gpt_part_data->legacy_boot
+ = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0;
+
+ if (pte->Attributes.RequiredToFunction & 0x1)
+ gpt_part_data->hidden = 1;
++ if (pte->Attributes.LegacyBIOSBootable & 0x1)
++ gpt_part_data->legacy_boot = 1;
+
+ if (!guid_cmp (gpt_part_data->type, PARTITION_SYSTEM_GUID))
+ gpt_part_data->boot = 1;
+@@ -1167,6 +1171,8 @@ _partition_generate_part_entry (PedPartition *part, GuidPartitionEntry_t *pte)
+
+ if (gpt_part_data->hidden)
+ pte->Attributes.RequiredToFunction = 1;
++ if (gpt_part_data->legacy_boot)
++ pte->Attributes.LegacyBIOSBootable = 1;
+
+ for (i = 0; i < 72 / sizeof (efi_char16_t); i++)
+ pte->PartitionName[i]
+@@ -1309,6 +1315,7 @@ gpt_partition_new (const PedDisk *disk,
+ gpt_part_data->msftres = 0;
+ gpt_part_data->msftrecv = 0;
+ gpt_part_data->atvrecv = 0;
++ gpt_part_data->legacy_boot = 0;
+ uuid_generate ((unsigned char *) &gpt_part_data->uuid);
+ swap_uuid_and_efi_guid ((unsigned char *) (&gpt_part_data->uuid));
+ memset (gpt_part_data->name, 0, sizeof gpt_part_data->name);
+@@ -1601,6 +1608,9 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
+ case PED_PARTITION_HIDDEN:
+ gpt_part_data->hidden = state;
+ return 1;
++ case PED_PARTITION_LEGACY_BOOT:
++ gpt_part_data->legacy_boot = state;
++ return 1;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_ROOT:
+ case PED_PARTITION_LBA:
+@@ -1637,6 +1647,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag)
+ return gpt_part_data->atvrecv;
+ case PED_PARTITION_HIDDEN:
+ return gpt_part_data->hidden;
++ case PED_PARTITION_LEGACY_BOOT:
++ return gpt_part_data->legacy_boot;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_LBA:
+ case PED_PARTITION_ROOT:
+@@ -1661,6 +1673,7 @@ gpt_partition_is_flag_available (const PedPartition *part,
+ case PED_PARTITION_DIAG:
+ case PED_PARTITION_APPLE_TV_RECOVERY:
+ case PED_PARTITION_HIDDEN:
++ case PED_PARTITION_LEGACY_BOOT:
+ return 1;
+ case PED_PARTITION_SWAP:
+ case PED_PARTITION_ROOT:
+--
Reply to: