Your message dated Tue, 01 Jan 2013 17:47:44 +0000
with message-id <e1tq5wg-0007ed...@franck.debian.org>
and subject line Bug#673042: fixed in parted 2.3-11.1
has caused the Debian Bug report #673042,
regarding parted: loses 'legacy BIOS bootable' flag on GPT disks
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
673042: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673042
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: parted
Version: 2.3-5
Severity: important
Tags: patch

Hi!

Parted currently does not handle GPT partition flags properly when
modifying a GPT. The most crucial flag that is lost is the 'legacy BIOS
bootable'. It is used by SYSLINUX to detect which partition the system
should be booted from, for example. Currently, any changes using parted
(or one of the tools that rely on parted e.g. gnome-disk-utility) will
make a system using SYSLINUX on GPT unbootable if the flag is not
manually re-added. Pretty annoying, to say the least.

Attached is a patch against the version of parted currently in squeeze.
It is made of three patches cherry-picked from upstream. Other GPT flags
are still not preserved, but at least the 'legacy BIOS bootable' is.

This patch fails on the version currently in sid due to some issues with
autoconf/automake stuff. I'd rather let you handle that, but the
backported patches apply cleanly and manually building the code showed
that they work as intended.

I think this issue is worth an update in the next stable point release.

Cheers,
-- 
Jérémy Bobbio                        .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
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
@@ -17,6 +17,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
 
 # Symbols for this ABI (amd64 as reference)
 update-abi-symbols.patch
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 <b...@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/libparted-gpt-copy-flags.patch
+++ parted-2.3/debian/patches/libparted-gpt-copy-flags.patch
@@ -0,0 +1,31 @@
+From: Brian C. Lane <b...@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-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 <b...@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_dom...@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:
+-- 

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: parted
Source-Version: 2.3-11.1

We believe that the bug you reported is fixed in the latest version of
parted, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 673...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Perrier <bubu...@debian.org> (supplier of updated parted package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 01 Jan 2013 14:44:03 +0100
Source: parted
Binary: parted parted-udeb libparted0 libparted0debian1 libparted0-udeb 
libparted0-i18n libparted0-dev libparted0debian1-dbg parted-doc
Architecture: source i386 all
Version: 2.3-11.1
Distribution: unstable
Urgency: low
Maintainer: Parted Maintainer Team <parted-maintain...@lists.alioth.debian.org>
Changed-By: Christian Perrier <bubu...@debian.org>
Description: 
 libparted0 - disk partition manipulator - dummy package
 libparted0-dev - disk partition manipulator - development files
 libparted0-i18n - disk partition manipulator - i18n support
 libparted0-udeb - disk partition manipulator - library udeb (udeb)
 libparted0debian1 - disk partition manipulator - shared library
 libparted0debian1-dbg - disk partition manipulator - debugging symbols
 parted     - disk partition manipulator
 parted-doc - disk partition manipulator - documentation
 parted-udeb - Manually partition a hard drive (parted) (udeb)
Closes: 673042
Changes: 
 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
Checksums-Sha1: 
 dccf30c6961635eae8af3e8a300fd6edd0f61b06 2646 parted_2.3-11.1.dsc
 bf3f86eb1bcb8a7c22c9c58552a597c489eaa28f 86858 parted_2.3-11.1.diff.gz
 df8a09adbcd6dc7b07fde3e743449caeec0b3958 158506 parted_2.3-11.1_i386.deb
 4c4cc699222de0ea15095188e9479f717b222133 26288 parted-udeb_2.3-11.1_i386.udeb
 939e538411cad31427f2e5e3a0c9331503cf9919 113790 libparted0_2.3-11.1_i386.deb
 c0aaf43bc95638a27f041ebea9f872157c0d4757 329724 
libparted0debian1_2.3-11.1_i386.deb
 a05de7c88497be38d6a15de3a65d948b9c61729d 154844 
libparted0-udeb_2.3-11.1_i386.udeb
 0c828e93d17c8565fb79d8bb8d81a6ad9d64c9c3 399916 
libparted0-dev_2.3-11.1_i386.deb
 cc6cd407b8f4477925b09ae8d17b22abf27bcbda 1153828 
libparted0debian1-dbg_2.3-11.1_i386.deb
 3b69979b69d0f6b481800880254b097d04b52456 577322 
libparted0-i18n_2.3-11.1_all.deb
 e3cbef6a8ebe1af5abd9fbb9c2fba874c5700707 186324 parted-doc_2.3-11.1_all.deb
Checksums-Sha256: 
 8cf8f6de09b2d5498409ff9963d5e87cb6f09d7164d6c32692f0148a452fd467 2646 
parted_2.3-11.1.dsc
 742379cb1553bffebd52f8eca6d24f7a50c93e1b32da9ce76d422e1b8882d24b 86858 
parted_2.3-11.1.diff.gz
 70a833f740dedcd0851a165a9aa6624fc9be645d11a71ee0764578f1ee1d0519 158506 
parted_2.3-11.1_i386.deb
 d5b62239ca0fa1bafc92e06cdf77f55da9cffc1a57413baf7809d6090c810582 26288 
parted-udeb_2.3-11.1_i386.udeb
 0b28bf30605260d5c50e8d03c21f67e4ea735853693e9ac144576f1b1d1e1723 113790 
libparted0_2.3-11.1_i386.deb
 4555a0996ce8c8ca524f0f4aa7e77f7cdc88abd2304bbc3a5a7a4b64b70407a7 329724 
libparted0debian1_2.3-11.1_i386.deb
 3934a8eebee79f8cbdc2dd9751af9e7811bd23204ea1d15fc4c2dcc95e60b15f 154844 
libparted0-udeb_2.3-11.1_i386.udeb
 98617e55ed590f1dc206a83b9cc2dd6af9b613cb33871eab1c3c0d45e9797879 399916 
libparted0-dev_2.3-11.1_i386.deb
 5d7423deff28bae83704cf8a7f7e254ceeb8c833fc7b892128ef2d24519ef0d0 1153828 
libparted0debian1-dbg_2.3-11.1_i386.deb
 bdd11902044f31342ded7ace96b10600cf5d2fc62e4d36b171720f822bddc636 577322 
libparted0-i18n_2.3-11.1_all.deb
 ff65a823238ed6264651aeb1efdd248a250d70f6b4908e45eb4f7150ba90246e 186324 
parted-doc_2.3-11.1_all.deb
Files: 
 e2becbe557930f730af57c35c8c6947b 2646 admin optional parted_2.3-11.1.dsc
 4b9bf4639e90094bdc85aca31c8badb1 86858 admin optional parted_2.3-11.1.diff.gz
 1ab65f35033d3c0e0966fb84a56ac40f 158506 admin optional parted_2.3-11.1_i386.deb
 1ff42d43d44ea7424395614a86ddad3c 26288 debian-installer extra 
parted-udeb_2.3-11.1_i386.udeb
 f94fa89ee14c10ee16522f5c69408044 113790 libs extra libparted0_2.3-11.1_i386.deb
 8d0c530e1e418afc2e2d6b5588117971 329724 libs optional 
libparted0debian1_2.3-11.1_i386.deb
 a1b2117a6bc0f3a0fa5ab632cb4429bc 154844 debian-installer extra 
libparted0-udeb_2.3-11.1_i386.udeb
 8b59f35acc0113d68273e359cc3e4c86 399916 libdevel optional 
libparted0-dev_2.3-11.1_i386.deb
 c7748f14c11bd9055653f3179a2a49a5 1153828 debug extra 
libparted0debian1-dbg_2.3-11.1_i386.deb
 45055f721cafb455ba99a01109b482d0 577322 localization optional 
libparted0-i18n_2.3-11.1_all.deb
 a27688a9cba42af77fbaeab79cb6991c 186324 doc optional 
parted-doc_2.3-11.1_all.deb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIVAwUBUOMdiIcvcCxNbiWoAQKFEg/+PUSkVbaXrPNHsSLY/3Ztz7pk7PUDUY4q
7A57RO8oTjZZ4c9mbGMbka1HGAYn2+nmY15T1J8kU2tTDCEQmNtAdp2FcF2HBZoV
4eq74xaO46Ng4BzX5ixD6UHacIHaVZrS72JxWGP6SfNoZ2Y8DDZ7ii/2oJ6UsT/b
FlHuFUyc+WPb9grfp/PG/UlBw3rgEgZLt6nDLMetUheez6sRWKZm1VSxe2gLpDtS
H+WXS5bQJ30CAIf6tIy0ug8uS2qjKQeWlTreGq+mKoDbsyOLImXDc4Ddq6OmTVNP
nK7KjERIe+l75PmgaJqZZHBiXptJvCCJSPlCnLGe8h3BlV9ul1zP582EHYnSlxim
BFEQuIwblk3OXR4sNzZS/iSN1UesMnNufaxz4mUHccMCQnXK7m8zfHPSqFaKrP4D
gooWm2tFZPv2mP/Caoe0KBYA5OjKcHiGjT7hlIXMoFkni6zAyMCAQNZA32zOR0eP
dvNJIU4ZKKLirmmRvMQdKgnui0hGv/nxLlQ62E3cHr2RXLKWJkAIBmLI2kaVTA6b
NjI3V3O9EK2yv9B26pfPktZewfQzKXoZQaM+E1U43jSduvVyGuc0BJk2UllJNW1H
n4WA8paqnRviZcUcwrrJ85uAuN772ewkUg2dcT/UF+9asmw+bhxKUhoC7skozONu
w3gmra3vxDo=
=DQhL
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to