From unknown Mon Jun 16 23:49:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15356 <15356@debbugs.gnu.org> To: bug#15356 <15356@debbugs.gnu.org> Subject: Status: [PATCH 00/19] Fedora parted patches Reply-To: bug#15356 <15356@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:49:58 +0000 retitle 15356 [PATCH 00/19] Fedora parted patches reassign 15356 parted submitter 15356 "Brian C. Lane" severity 15356 normal tag 15356 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:17:58 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:17:58 +0000 Received: from localhost ([127.0.0.1]:56524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqrN-0004Nk-Vz for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:17:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47031) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqrM-0004NX-6u for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqrC-0002iK-UY for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:17:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrC-0002i6-Rq for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:17:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqr8-0003iM-Ko for bug-parted@gnu.org; Wed, 11 Sep 2013 16:17:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqr4-0002g7-FC for bug-parted@gnu.org; Wed, 11 Sep 2013 16:17:42 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqr3-0000sS-Q6 for bug-parted@gnu.org; Wed, 11 Sep 2013 16:17:38 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPAp7015274 for ; Wed, 11 Sep 2013 12:25:11 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPAir015273 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:10 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 00/19] Fedora parted patches Date: Wed, 11 Sep 2013 12:24:50 -0700 Message-Id: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" Here is the stack of patches that I'm currently carrying for the master branch of parted in Fedora. I think patches 1-12 have been posted before, but I recently rebased things onto parted master. The patches adding new flags (13-16) are all new. Patch 4 is my take on handling the uuid of dm devices. Patch 18 is similar to Phillip's, except that I didn't see any reason to sync all the partition devices since all of our access is via offsets into the parent device so I left the kernel 2.6 check in place. Brian C. Lane (14): libparted: copy pmbr_boot when duplicating GPT disk tests: test creating 20 device-mapper partitions (#803108) libparted: use dm_udev_wait (#698121) libparted: preserve the uuid on dm partitions (#832145) tests: Make sure dm UUIDs are not erased libparted: don't canonicalize /dev/md/ paths (#872361) tests: rewrite t6001 to use /dev/mapper libparted: Add Intel Rapid Start Technology partition flag. libparted: Add UEFI System Partition flag. libparted: Add hfs_esp partition flag to GPT. libparted: Recognize btrfs filesystem tests: Add btrfs and xfs to the fs probe test libparted: Flush parent device on open (#962611) tests: Restrict gpt-header-munge to little-endian systems Nageswara R Sastry (5): libparted: add support for implicit FBA DASD partitions libparted: add support for EAV DASD partitions libparted: mklabel to support EAV DASD libparted: Avoid dasd as default disk type while probe libparted: mklabel to support EDEV DASD NEWS | 18 ++ doc/C/parted.8 | 2 +- doc/parted.texi | 13 + include/parted/disk.in.h | 7 +- include/parted/fdasd.in.h | 93 +++++- include/parted/vtoc.in.h | 59 +++- libparted/arch/linux.c | 74 +++-- libparted/device.c | 7 +- libparted/disk.c | 6 + libparted/fs/Makefile.am | 1 + libparted/fs/btrfs/btrfs.c | 78 +++++ libparted/labels/dasd.c | 64 +++- libparted/labels/dos.c | 42 +++ libparted/labels/fdasd.c | 353 +++++++++++++++++------ libparted/labels/gpt.c | 84 ++++++ libparted/labels/vtoc.c | 173 +++++++++-- libparted/libparted.c | 4 + tests/Makefile.am | 2 + tests/t0210-gpt-resized-partition-entry-array.sh | 5 + tests/t0211-gpt-rewrite-header.sh | 5 + tests/t1700-probe-fs.sh | 2 +- tests/t6001-psep.sh | 42 ++- tests/t6004-dm-many-partitions.sh | 60 ++++ tests/t6005-dm-uuid.sh | 58 ++++ 24 files changed, 1061 insertions(+), 191 deletions(-) create mode 100644 libparted/fs/btrfs/btrfs.c create mode 100755 tests/t6004-dm-many-partitions.sh create mode 100755 tests/t6005-dm-uuid.sh -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:18:29 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:18:29 +0000 Received: from localhost ([127.0.0.1]:56538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqrs-0004Pw-DY for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47270) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqrp-0004Pj-Il for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqrc-0002pF-4q for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrc-0002p9-1B for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrW-0003ib-0a for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqrP-0002lk-Sp for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:05 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrP-0000sS-Hj for bug-parted@gnu.org; Wed, 11 Sep 2013 16:17:59 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPHoF015306 for ; Wed, 11 Sep 2013 12:25:17 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPH42015305 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:17 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 08/19] libparted: mklabel to support EAV DASD Date: Wed, 11 Sep 2013 12:24:58 -0700 Message-Id: <1378927509-15215-9-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: Nageswara R Sastry Extended Address Volume (EAV) DASDs are ECKD DASDs with more than 65520 cylinders. This patch adds support for mklabel to properly handle unformatted EAV DASDs. Signed-off-by: Nageswara R Sastry --- include/parted/fdasd.in.h | 1 - libparted/labels/fdasd.c | 92 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h index b4e7dd1..3692596 100644 --- a/include/parted/fdasd.in.h +++ b/include/parted/fdasd.in.h @@ -288,7 +288,6 @@ void fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int fd); void fdasd_check_api_version (fdasd_anchor_t *anc, int fd); int fdasd_check_volume (fdasd_anchor_t *anc, int fd); int fdasd_write_labels (fdasd_anchor_t *anc, int fd); -int fdasd_invalid_vtoc_pointer(fdasd_anchor_t *anc); void fdasd_recreate_vtoc(fdasd_anchor_t *anc); partition_info_t * fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start, unsigned int stop); diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c index 2735b2a..b58b2be 100644 --- a/libparted/labels/fdasd.c +++ b/libparted/labels/fdasd.c @@ -581,6 +581,22 @@ fdasd_recreate_vtoc (fdasd_anchor_t *anc) anc->vtoc_changed++; } + /* + * initialize the VOL1 volume label + */ +static void +fdasd_init_volume_label(fdasd_anchor_t *anc, int fd) +{ + volume_label_t *vlabel = anc->vlabel; + + vtoc_volume_label_init(vlabel); + vtoc_volume_label_set_key(vlabel, "VOL1"); + vtoc_volume_label_set_label(vlabel, "VOL1"); + + vtoc_set_cchhb(&vlabel->vtoc, VTOC_START_CC, VTOC_START_HH, 0x01); +} + + /* * sets some important partition data * (like used, start_trk, end_trk, len_trk) @@ -769,6 +785,52 @@ fdasd_process_valid_vtoc (fdasd_anchor_t * anc, unsigned long b, int fd) fdasd_update_partition_info (anc); } +static void +fdasd_invalid_vtoc_pointer(fdasd_anchor_t *anc) +{ + PDEBUG + anc->formatted_cylinders = anc->hw_cylinders; + anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads + - FIRST_USABLE_TRK; + vtoc_init_format4_label(anc->f4, USABLE_PARTITIONS, + anc->geo.cylinders, anc->formatted_cylinders, + anc->geo.heads, anc->geo.sectors, + anc->blksize, anc->dev_type); + + vtoc_init_format5_label(anc->f5); + vtoc_init_format7_label(anc->f7); + + vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '+', anc->verbose, + FIRST_USABLE_TRK, + anc->formatted_cylinders * anc->geo.heads - 1, + anc->formatted_cylinders, anc->geo.heads); + + vtoc_set_cchhb(&anc->vlabel->vtoc, VTOC_START_CC, VTOC_START_HH, 0x01); +} + +/* + * we have a invalid FMT4 DSCB and therefore we will re-create the VTOC + */ +static void +fdasd_process_invalid_vtoc(fdasd_anchor_t *anc) +{ + anc->formatted_cylinders = anc->hw_cylinders; + anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads + - FIRST_USABLE_TRK; + vtoc_init_format4_label(anc->f4, USABLE_PARTITIONS, + anc->geo.cylinders, anc->formatted_cylinders, + anc->geo.heads, anc->geo.sectors, + anc->blksize, anc->dev_type); + + vtoc_init_format5_label(anc->f5); + vtoc_init_format7_label(anc->f7); + vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '+', anc->verbose, + FIRST_USABLE_TRK, + anc->formatted_cylinders * anc->geo.heads - 1, + anc->formatted_cylinders, anc->geo.heads); +} + + static int fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long b, int fd) { @@ -781,6 +843,8 @@ fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long b, int fd) if (anc->f4->DS4IDFMT == 0xf4) { fdasd_process_valid_vtoc (anc, b, fd); return 0; + } else { + fdasd_process_invalid_vtoc(anc); } if (strncmp(anc->vlabel->volkey, vtoc_ebcdic_enc("LNX1",str,4),4) == 0 || strncmp(anc->vlabel->volkey, vtoc_ebcdic_enc("CMS1",str,4),4) == 0) @@ -817,13 +881,37 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd) else return 0; } else { - return 1; + fdasd_invalid_vtoc_pointer(anc); } } else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0 || strncmp (v->volkey, vtoc_ebcdic_enc ("CMS1", str, 4), 4) == 0) { return 0; - } + } else if (anc->FBA_layout == 1) { + /* Some times LDL formatted disks does not + contain any volume label */ + return 1; + } else { + /* didn't find VOL1 volume label */ + anc->formatted_cylinders = anc->hw_cylinders; + anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads + - FIRST_USABLE_TRK; + + fdasd_init_volume_label(anc, fd); + vtoc_init_format4_label(anc->f4, USABLE_PARTITIONS, + anc->geo.cylinders, anc->formatted_cylinders, + anc->geo.heads, anc->geo.sectors, + anc->blksize, anc->dev_type); + + vtoc_init_format5_label(anc->f5); + vtoc_init_format7_label(anc->f7); + + vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '+', + anc->verbose, FIRST_USABLE_TRK, + anc->formatted_cylinders * anc->geo.heads - 1, + anc->formatted_cylinders, anc->geo.heads); + return 0; + } return 1; } -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:18:44 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:18:45 +0000 Received: from localhost ([127.0.0.1]:56541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqs8-0004QT-54 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47394) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqs6-0004QE-2S for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqrv-0002vk-M8 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrv-0002vX-IT for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrq-00046h-Fx for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqrl-0002se-NV for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:26 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqrl-0000sS-66 for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:21 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPFhC015286 for ; Wed, 11 Sep 2013 12:25:15 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPFPZ015285 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:15 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 03/19] libparted: use dm_udev_wait (#698121) Date: Wed, 11 Sep 2013 12:24:53 -0700 Message-Id: <1378927509-15215-4-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" This is based on Peter Rajnoha's patch to use dm_udev_wait to synchronize with udev. This requires libdevmapper v1.02.39 and higher. mailing list thread: https://lists.gnu.org/archive/html/bug-parted/2010-09/msg00007.html * libparted/arch/linux.c (_dm_task_run_wait): New function (_is_dm_major): Add cookie and change call to _dm_task_run_wait (_is_dmraid_device): Same (_dm_is_part): Same (dm_canonical_path): Same (_dm_remove_partition): Same (_dm_get_partition_start_and_length): Same (_dm_add_partition): Same (linux_new): Enable udev sync support --- libparted/arch/linux.c | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 2bb8774..1c5faa5 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -438,6 +438,17 @@ _is_virtblk_major (int major) #ifdef ENABLE_DEVICE_MAPPER static int +_dm_task_run_wait (struct dm_task *task, uint32_t cookie) +{ + int rc = 0; + + rc = dm_task_run (task); + dm_udev_wait (cookie); + + return rc; +} + +static int _is_dm_major (int major) { return _major_type_in_devices (major, "device-mapper"); @@ -466,7 +477,7 @@ _dm_maptype (PedDevice *dev) dm_task_no_open_count(dmt); - if (!dm_task_run(dmt)) + if (!dm_task_run (dmt)) goto bad; dm_get_next_target(dmt, NULL, &start, &length, &target_type, ¶ms); @@ -519,7 +530,7 @@ _dm_is_part (const char *path) return 0; dm_task_set_name(task, path); - if (!dm_task_run(task)) + if (!dm_task_run (task)) goto err; struct dm_info *info = alloca (sizeof *info); @@ -1398,6 +1409,10 @@ linux_new (const char* path) dev->dirty = 0; dev->boot_dirty = 0; +#ifdef ENABLE_DEVICE_MAPPER + dm_udev_set_sync_support(1); +#endif + if (!_device_probe_type (dev)) goto error_free_arch_specific; @@ -2316,7 +2331,7 @@ dm_canonical_path (PedDevice const *dev) if (!dm_task_set_major_minor (task, arch_specific->major, arch_specific->minor, 0)) goto err; - if (!dm_task_run(task)) + if (!dm_task_run (task)) goto err; char *dev_name = zasprintf ("/dev/mapper/%s", dm_task_get_name (task)); if (dev_name == NULL) @@ -2637,31 +2652,29 @@ _device_get_partition_range(PedDevice const* dev) static int _dm_remove_partition(PedDisk* disk, int partno) { - int rc; + int rc = 0; + uint32_t cookie = 0; char *part_name = _device_get_part_path (disk->dev, partno); int fd = open (part_name, O_RDONLY | O_EXCL); if (fd == -1) { if (errno == ENOENT) errno = ENXIO; /* nothing to remove, device already doesn't exist */ - free (part_name); - return 0; + goto err; } close (fd); struct dm_task *task = dm_task_create(DM_DEVICE_REMOVE); - if (!task) { - free (part_name); - return 0; - } + if (!task) + goto err; dm_task_set_name (task, part_name); - rc = dm_task_run(task); + if (!dm_task_set_cookie (task, &cookie, 0)) + goto err; + rc = _dm_task_run_wait (task, cookie); dm_task_update_nodes(); dm_task_destroy(task); +err: free (part_name); - if (!rc) - return 0; - - return 1; + return rc; } static bool @@ -2677,7 +2690,7 @@ _dm_get_partition_start_and_length(PedPartition const *part, char *path = _device_get_part_path (part->disk->dev, part->num); PED_ASSERT(path); dm_task_set_name(task, path); - if (!dm_task_run(task)) + if (!dm_task_run (task)) goto err; int major, minor; @@ -2700,6 +2713,7 @@ _dm_add_partition (PedDisk* disk, const PedPartition* part) LinuxSpecific* arch_specific = LINUX_SPECIFIC (disk->dev); char *params = NULL; char *vol_name = NULL; + uint32_t cookie = 0; /* Get map name from devicemapper */ struct dm_task *task = dm_task_create (DM_DEVICE_INFO); @@ -2710,7 +2724,7 @@ _dm_add_partition (PedDisk* disk, const PedPartition* part) arch_specific->minor, 0)) goto err; - if (!dm_task_run(task)) + if (!dm_task_run (task)) goto err; const char *dev_name = dm_task_get_name (task); @@ -2736,7 +2750,9 @@ _dm_add_partition (PedDisk* disk, const PedPartition* part) dm_task_set_name (task, vol_name); dm_task_add_target (task, 0, part->geom.length, "linear", params); - if (dm_task_run (task)) { + if (!dm_task_set_cookie (task, &cookie, 0)) + goto err; + if (_dm_task_run_wait (task, cookie)) { dm_task_update_nodes (); dm_task_destroy (task); free (params); -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:19:05 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:19:05 +0000 Received: from localhost ([127.0.0.1]:56548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqsS-0004Rk-Ud for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47479) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqsR-0004Qt-9J for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqsG-00030I-VC for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsG-00030E-SJ for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:18:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsC-0004GU-4X for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqs7-0002yY-Gp for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:48 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqs7-0000sS-6W for bug-parted@gnu.org; Wed, 11 Sep 2013 16:18:43 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPKw8015338 for ; Wed, 11 Sep 2013 12:25:20 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPJRv015337 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:19 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 16/19] libparted: Recognize btrfs filesystem Date: Wed, 11 Sep 2013 12:25:06 -0700 Message-Id: <1378927509-15215-17-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" Add support for showing 'btrfs' in the 'file system' column. Also allows the used to enter btrfs as the fs type. It doesn't really do anything -- just sets the partition type to linux. * NEWS (Changes in behavior): Mention it. * doc/parted.texti: Document btrfs fs. * (libparted/fs/Makefile.am): Add btrfs.c * (libparted/fs/btrfs/btrfs.c): Probe for btrfs * (libparted/libparted.c): Register btrfs --- NEWS | 3 ++ doc/parted.texi | 1 + libparted/fs/Makefile.am | 1 + libparted/fs/btrfs/btrfs.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++ libparted/libparted.c | 4 +++ 5 files changed, 87 insertions(+) create mode 100644 libparted/fs/btrfs/btrfs.c diff --git a/NEWS b/NEWS index 026e897..df259d6 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,9 @@ GNU parted NEWS -*- outline -*- ** Changes in behavior + Added support for recognizing btrfs filesystem. This simply displays + btrfs in the 'file system' column of the parted output. + Added new GPT partition type flag, hfs_esp, that sets the GUID to 47CB5633-7E3E-408B-B7B8-2D915B7B21B1 so that you can distinguish between OSX's native HFS+ partition and one used Linux on UEFI. The diff --git a/doc/parted.texi b/doc/parted.texi index ee5b3f7..03522e7 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -575,6 +575,7 @@ partition table. @item NTFS @item reiserfs @item ufs +@item btrfs @end itemize For example, the following creates a logical partition that will contain diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am index aac03cc..1949617 100644 --- a/libparted/fs/Makefile.am +++ b/libparted/fs/Makefile.am @@ -23,6 +23,7 @@ libfs_la_SOURCES = \ amiga/asfs.c \ amiga/asfs.h \ amiga/a-interface.c \ + btrfs/btrfs.c \ ext2/ext2.h \ ext2/ext2_fs.h \ ext2/interface.c \ diff --git a/libparted/fs/btrfs/btrfs.c b/libparted/fs/btrfs/btrfs.c new file mode 100644 index 0000000..e5abed6 --- /dev/null +++ b/libparted/fs/btrfs/btrfs.c @@ -0,0 +1,78 @@ +/* + libparted - a library for manipulating disk partitions + Copyright (C) 2013 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +#include +#include + +/* Located 64k inside the partition (start of the first btrfs superblock) */ +#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */ +#define BTRFS_CSUM_SIZE 32 +#define BTRFS_FSID_SIZE 16 + + +static PedGeometry* +btrfs_probe (PedGeometry* geom) +{ + union { + struct { + /* Just enough of the btrfs_super_block to get the magic */ + uint8_t csum[BTRFS_CSUM_SIZE]; + uint8_t fsid[BTRFS_FSID_SIZE]; + uint64_t bytenr; + uint64_t flags; + uint64_t magic; + } sb; + int8_t sector[8192]; + } buf; + PedSector offset = (64*1024)/geom->dev->sector_size; + + if (geom->length < offset+1) + return 0; + if (!ped_geometry_read (geom, &buf, offset, 1)) + return 0; + + if (PED_LE64_TO_CPU(buf.sb.magic) == BTRFS_MAGIC) { + return ped_geometry_new (geom->dev, geom->start, geom->length); + } + return NULL; +} + +static PedFileSystemOps btrfs_ops = { + probe: btrfs_probe, +}; + +static PedFileSystemType btrfs_type = { + next: NULL, + ops: &btrfs_ops, + name: "btrfs", + block_sizes: ((int[2]){512, 0}) +}; + +void +ped_file_system_btrfs_init () +{ + ped_file_system_type_register (&btrfs_type); +} + +void +ped_file_system_btrfs_done () +{ + ped_file_system_type_unregister (&btrfs_type); +} diff --git a/libparted/libparted.c b/libparted/libparted.c index 9923bfa..3afbf8e 100644 --- a/libparted/libparted.c +++ b/libparted/libparted.c @@ -109,6 +109,7 @@ extern void ped_file_system_hfs_init (void); extern void ped_file_system_fat_init (void); extern void ped_file_system_ext2_init (void); extern void ped_file_system_nilfs2_init (void); +extern void ped_file_system_btrfs_init (void); static void init_file_system_types () @@ -124,6 +125,7 @@ init_file_system_types () ped_file_system_fat_init (); ped_file_system_ext2_init (); ped_file_system_nilfs2_init (); + ped_file_system_btrfs_init (); } extern void ped_disk_aix_done (); @@ -186,6 +188,7 @@ extern void ped_file_system_reiserfs_done (void); extern void ped_file_system_ufs_done (void); extern void ped_file_system_xfs_done (void); extern void ped_file_system_amiga_done (void); +extern void ped_file_system_btrfs_done (void); static void done_file_system_types () @@ -201,6 +204,7 @@ done_file_system_types () ped_file_system_ufs_done (); ped_file_system_xfs_done (); ped_file_system_amiga_done (); + ped_file_system_btrfs_done (); } static void _done() __attribute__ ((destructor)); -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:19:34 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:19:34 +0000 Received: from localhost ([127.0.0.1]:56552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqsv-0004SR-5C for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47707) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqst-0004SE-1M for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqsf-00037z-DR for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsf-00037q-BE for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsZ-0004Gu-Ai for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqsT-000343-6J for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:11 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsS-0000sS-QJ for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:05 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPGK8015298 for ; Wed, 11 Sep 2013 12:25:16 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPGgZ015297 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:16 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 06/19] libparted: add support for implicit FBA DASD partitions Date: Wed, 11 Sep 2013 12:24:56 -0700 Message-Id: <1378927509-15215-7-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: Nageswara R Sastry Fixed Block Access (FBA) DASDs are mainframe-specific disk devices which are layed out as a sequence of 512-byte sectors. In contrast to ECKD DASDs, these disks do not require formatting and resemble the LBA layout of non-mainframe disks. Despite this resemblance, the Linux kernel applies special handling during partition detection for FBA DASDs, resulting in a single, immutable partition being reported. While actual FBA DASD hardware is no longer available, the z/VM hypervisor can simulate FBA DASD disks, backed by either ECKD or SCSI devices. This patch adds support for recognizing FBA DASD partitions to parted. Signed-off-by: Nageswara R Sastry Signed-off-by: Peter Oberparleiter --- include/parted/fdasd.in.h | 2 ++ libparted/labels/dasd.c | 63 ++++++++++++++++++++++++++++++++++++++++------- libparted/labels/fdasd.c | 5 ++++ 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h index ac30134..a755246 100644 --- a/include/parted/fdasd.in.h +++ b/include/parted/fdasd.in.h @@ -194,6 +194,8 @@ typedef struct fdasd_anchor { volume_label_t *vlabel; config_data_t confdata[USABLE_PARTITIONS]; struct fdasd_hd_geometry geo; + unsigned int label_block; + unsigned int FBA_layout; } fdasd_anchor_t; enum offset {lower, upper}; diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c index a769866..b4e80b1 100644 --- a/libparted/labels/dasd.c +++ b/libparted/labels/dasd.c @@ -71,6 +71,7 @@ typedef struct { typedef struct { unsigned int format_type; + unsigned int label_block; volume_label_t vlabel; } DasdDiskSpecific; @@ -151,6 +152,7 @@ dasd_alloc (const PedDevice* dev) /* CDL format, newer */ disk_specific->format_type = 2; + disk_specific->label_block = 2; /* Setup volume label (for fresh disks) */ snprintf(volser, sizeof(volser), "0X%04X", arch_specific->devno); @@ -226,7 +228,9 @@ dasd_probe (const PedDevice *dev) fdasd_check_api_version(&anchor, arch_specific->fd); - if (fdasd_check_volume(&anchor, arch_specific->fd)) + /* Labels are required on CDL formatted DASDs. */ + if (fdasd_check_volume(&anchor, arch_specific->fd) && + anchor.FBA_layout == 0) goto error_cleanup; fdasd_cleanup(&anchor); @@ -273,17 +277,53 @@ dasd_read (PedDisk* disk) fdasd_initialize_anchor(&anchor); fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); + disk_specific->label_block = anchor.label_block; + + if ((anchor.geo.cylinders * anchor.geo.heads) > BIG_DISK_SIZE) + anchor.big_disk++; /* check dasd for labels and vtoc */ - if (fdasd_check_volume(&anchor, arch_specific->fd)) - goto error_close_dev; + if (fdasd_check_volume(&anchor, arch_specific->fd)) { + DasdPartitionData* dasd_data; + + /* Kernel partitioning code will report 'implicit' partitions + * for non-CDL format DASDs even when there is no + * label/VTOC. */ + if (anchor.FBA_layout == 0) + goto error_close_dev; + + disk_specific->format_type = 1; + + /* Register implicit partition */ + ped_disk_delete_all (disk); + + start = (PedSector) arch_specific->real_sector_size / + (PedSector) disk->dev->sector_size * + (PedSector) (anchor.label_block + 1); + end = disk->dev->length - 1; + part = ped_partition_new (disk, PED_PARTITION_NORMAL, NULL, + start, end); + if (!part) + goto error_close_dev; + + part->num = 1; + part->fs_type = ped_file_system_probe (&part->geom); + dasd_data = part->disk_specific; + dasd_data->raid = 0; + dasd_data->lvm = 0; + dasd_data->type = 0; + + if (!ped_disk_add_partition (disk, part, NULL)) + goto error_close_dev; + + fdasd_cleanup(&anchor); + + return 1; + } /* Save volume label (read by fdasd_check_volume) for writing */ memcpy(&disk_specific->vlabel, anchor.vlabel, sizeof(volume_label_t)); - if ((anchor.geo.cylinders * anchor.geo.heads) > BIG_DISK_SIZE) - anchor.big_disk++; - ped_disk_delete_all (disk); bool is_ldl = strncmp(anchor.vlabel->volkey, @@ -348,7 +388,7 @@ dasd_read (PedDisk* disk) / (long long) disk->dev->sector_size * (long long) (cms_ptr->block_count - 1) - 1; - part = ped_partition_new (disk, PED_PARTITION_PROTECTED, NULL, start, end); + part = ped_partition_new (disk, PED_PARTITION_NORMAL, NULL, start, end); if (!part) goto error_close_dev; @@ -923,7 +963,12 @@ dasd_alloc_metadata (PedDisk* disk) the start of the first partition */ if (disk_specific->format_type == 1) { part = ped_disk_get_partition(disk, 1); - vtoc_end = part->geom.start - 1; + if (part) + vtoc_end = part->geom.start - 1; + else + vtoc_end = (PedSector) arch_specific->real_sector_size / + (PedSector) disk->dev->sector_size * + (PedSector) disk_specific->label_block; } else { if (disk->dev->type == PED_DEVICE_FILE) @@ -943,7 +988,7 @@ dasd_alloc_metadata (PedDisk* disk) goto error; } - if (disk_specific->format_type == 1) { + if (disk_specific->format_type == 1 && part) { /* For LDL or CMS there may be trailing metadata as well. For example: the last block of a CMS reserved file, diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c index e235dd3..f92065f 100644 --- a/libparted/labels/fdasd.c +++ b/libparted/labels/fdasd.c @@ -721,6 +721,7 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd) unsigned long b = -1; char str[LINE_LENGTH]; + memset(v, 0, sizeof(volume_label_t)); vtoc_read_volume_label (fd, anc->label_pos, v); if (strncmp(v->vollbl, vtoc_ebcdic_enc ("VOL1", str, 4), 4) == 0) { @@ -800,6 +801,8 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) dasd_info.dev_type = 13200; dasd_info.label_block = 2; dasd_info.devno = 513; + dasd_info.label_block = 2; + dasd_info.FBA_layout = 0; } else { if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0) fdasd_error(anc, unable_to_ioctl, @@ -820,6 +823,8 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) anc->label_pos = dasd_info.label_block * blksize; anc->devno = dasd_info.devno; anc->fspace_trk = anc->geo.cylinders * anc->geo.heads - FIRST_USABLE_TRK; + anc->label_block = dasd_info.label_block; + anc->FBA_layout = dasd_info.FBA_layout; } /* -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:19:59 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:19:59 +0000 Received: from localhost ([127.0.0.1]:56557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqtG-0004T8-H7 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47817) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqtE-0004Su-MD for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqt1-0003DJ-50 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqt1-0003DF-24 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:19:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqsv-0004VK-0j for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqso-0003Al-Pc for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:32 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqso-0000sS-FS for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:26 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPJ6a015330 for ; Wed, 11 Sep 2013 12:25:19 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPJpN015329 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:19 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 14/19] libparted: Add UEFI System Partition flag. Date: Wed, 11 Sep 2013 12:25:04 -0700 Message-Id: <1378927509-15215-15-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" This adds support for the ESP partition type on MS-DOS. It also aliases it to the boot flag on GPT which sets the ESP GUID type. * NEWS (Changes in behavior): Mention it. * doc/C/parted.8: Document esp flag. * doc/parted.texti: Document esp flag. * include/parted/disk.in.h (_PedPartitionFlag): Add PED_PARTITION_ESP flag * libparted/disk.c (ped_partition_flag_get_name): Add esp flag * libparted/labels/dos.c (DosPartitionData): Likewise (raw_part_parse): Likewise (msdos_partition_new): Likewise (msdos_partition_duplicate): Likewise (msdos_partition_set_system): Likewise (clear_flags): Likewise (msdos_partition_set_flag): Likewise (msdos_partition_get_flag): Likewise (msdos_partition_is_flag_available): Likewise * libparted/labels/gpt.c (gpt_partition_set_flag): Add PED_PARTITION_ESP (gpt_partition_get_flag): Likewise (gpt_partition_is_flag_available): Likewise --- NEWS | 3 +++ doc/C/parted.8 | 2 +- doc/parted.texi | 4 ++++ include/parted/disk.in.h | 5 +++-- libparted/disk.c | 2 ++ libparted/labels/dos.c | 21 +++++++++++++++++++++ libparted/labels/gpt.c | 3 +++ 7 files changed, 37 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index b53a9d0..541ea1c 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,9 @@ GNU parted NEWS -*- outline -*- ** Changes in behavior + Added new partition type flag, esp, to set the type to 0xEF on MS-DOS. + Also aliased to boot on GPT to set the UEFI ESP GUID. + Added new partition type flag, irst, for use with Intel Rapid Start Technology. On MS-DOS disk labels it sets the type to 0x84 and on GPT it sets the GUID to D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593. diff --git a/doc/C/parted.8 b/doc/C/parted.8 index 2f8e9f5..f8e6a3d 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -104,7 +104,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", -"legacy_boot", "irst" and "palo". +"legacy_boot", "irst", "esp" 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 fd8ccb9..a5effd5 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -840,6 +840,10 @@ filesystems). (MS-DOS, GPT) - this flag identifies an Intel Rapid Start Technology partition. +@item esp +(MS-DOS, GPT) - this flag identifies a UEFI System Partition. On GPT +it is an alias for boot. + @item lba (MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and MS Windows ME based operating systems to use Linear (LBA) mode. diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h index 585383d..d144e21 100644 --- a/include/parted/disk.in.h +++ b/include/parted/disk.in.h @@ -74,10 +74,11 @@ enum _PedPartitionFlag { PED_PARTITION_DIAG=14, PED_PARTITION_LEGACY_BOOT=15, PED_PARTITION_MSFT_DATA=16, - PED_PARTITION_IRST=17 + PED_PARTITION_IRST=17, + PED_PARTITION_ESP=18 }; #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT -#define PED_PARTITION_LAST_FLAG PED_PARTITION_IRST +#define PED_PARTITION_LAST_FLAG PED_PARTITION_ESP enum _PedDiskTypeFeature { PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ diff --git a/libparted/disk.c b/libparted/disk.c index 4ca7255..c22b2a2 100644 --- a/libparted/disk.c +++ b/libparted/disk.c @@ -2443,6 +2443,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) return N_("legacy_boot"); case PED_PARTITION_IRST: return N_("irst"); + case PED_PARTITION_ESP: + return N_("esp"); default: ped_exception_throw ( diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c index f8591ff..fc7292a 100644 --- a/libparted/labels/dos.c +++ b/libparted/labels/dos.c @@ -92,6 +92,7 @@ static const char MBR_BOOT_CODE[] = { #define PARTITION_SUN_UFS 0xbf #define PARTITION_DELL_DIAG 0xde #define PARTITION_GPT 0xee +#define PARTITION_ESP 0xef #define PARTITION_PALO 0xf0 #define PARTITION_PREP 0x41 #define PARTITION_LINUX_RAID 0xfd @@ -161,6 +162,7 @@ typedef struct { int prep; int diag; int irst; + int esp; OrigState* orig; /* used for CHS stuff */ } DosPartitionData; @@ -927,6 +929,7 @@ raw_part_parse (const PedDisk* disk, const DosRawPartition* raw_part, dos_data->palo = raw_part->type == PARTITION_PALO; dos_data->prep = raw_part->type == PARTITION_PREP; dos_data->irst = raw_part->type == PARTITION_IRST; + dos_data->esp = raw_part->type == PARTITION_ESP; dos_data->orig = ped_malloc (sizeof (OrigState)); if (!dos_data->orig) { ped_partition_destroy (part); @@ -1330,6 +1333,7 @@ msdos_partition_new (const PedDisk* disk, PedPartitionType part_type, dos_data->palo = 0; dos_data->prep = 0; dos_data->irst = 0; + dos_data->esp = 0; } else { part->disk_specific = NULL; } @@ -1366,6 +1370,7 @@ msdos_partition_duplicate (const PedPartition* part) new_dos_data->palo = old_dos_data->palo; new_dos_data->prep = old_dos_data->prep; new_dos_data->irst = old_dos_data->irst; + new_dos_data->esp = old_dos_data->esp; if (old_dos_data->orig) { new_dos_data->orig = ped_malloc (sizeof (OrigState)); @@ -1415,6 +1420,7 @@ msdos_partition_set_system (PedPartition* part, dos_data->palo = 0; dos_data->prep = 0; dos_data->irst = 0; + dos_data->esp = 0; if (dos_data->lba) dos_data->system = PARTITION_EXT_LBA; else @@ -1451,6 +1457,10 @@ msdos_partition_set_system (PedPartition* part, dos_data->system = PARTITION_IRST; return 1; } + if (dos_data->esp) { + dos_data->system = PARTITION_ESP; + return 1; + } if (!fs_type) dos_data->system = PARTITION_LINUX; @@ -1488,6 +1498,7 @@ clear_flags (DosPartitionData *dos_data) dos_data->palo = 0; dos_data->prep = 0; dos_data->irst = 0; + dos_data->esp = 0; dos_data->raid = 0; } @@ -1572,6 +1583,12 @@ msdos_partition_set_flag (PedPartition* part, dos_data->irst = state; return ped_partition_set_system (part, part->fs_type); + case PED_PARTITION_ESP: + if (state) + clear_flags (dos_data); + dos_data->esp = state; + return ped_partition_set_system (part, part->fs_type); + default: return 0; } @@ -1617,6 +1634,9 @@ msdos_partition_get_flag (const PedPartition* part, PedPartitionFlag flag) case PED_PARTITION_IRST: return dos_data->irst; + case PED_PARTITION_ESP: + return dos_data->esp; + default: return 0; } @@ -1640,6 +1660,7 @@ msdos_partition_is_flag_available (const PedPartition* part, case PED_PARTITION_PALO: case PED_PARTITION_PREP: case PED_PARTITION_IRST: + case PED_PARTITION_ESP: case PED_PARTITION_DIAG: return 1; diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c index 0b7d08b..64b92b4 100644 --- a/libparted/labels/gpt.c +++ b/libparted/labels/gpt.c @@ -1592,6 +1592,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) switch (flag) { + case PED_PARTITION_ESP: case PED_PARTITION_BOOT: gpt_part_data->boot = state; if (state) @@ -1754,6 +1755,7 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) return gpt_part_data->raid; case PED_PARTITION_LVM: return gpt_part_data->lvm; + case PED_PARTITION_ESP: case PED_PARTITION_BOOT: return gpt_part_data->boot; case PED_PARTITION_BIOS_GRUB: @@ -1801,6 +1803,7 @@ gpt_partition_is_flag_available (const PedPartition *part, case PED_PARTITION_HIDDEN: case PED_PARTITION_LEGACY_BOOT: case PED_PARTITION_IRST: + case PED_PARTITION_ESP: return 1; case PED_PARTITION_SWAP: case PED_PARTITION_ROOT: -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:20:17 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:20:17 +0000 Received: from localhost ([127.0.0.1]:56564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqtc-0004UV-Cm for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47921) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqta-0004UH-2x for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqtM-0003GZ-L5 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtM-0003GV-Hu for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtG-0004We-F0 for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqtA-0003F1-Cd for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:54 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtA-0000sS-1y for bug-parted@gnu.org; Wed, 11 Sep 2013 16:19:48 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPJZY015334 for ; Wed, 11 Sep 2013 12:25:19 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPJGb015333 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:19 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 15/19] libparted: Add hfs_esp partition flag to GPT. Date: Wed, 11 Sep 2013 12:25:05 -0700 Message-Id: <1378927509-15215-16-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" Mac uses a HFS+ formatted partition for ESP. When dual booting with Linux we need a way to differentiate between the Mac partition and the one created by Linux which contains just enough stuff to fake OSX into displaying a nice logo and allowing it to be selected for boot. I generated a GUID (47CB5633-7E3E-408B-B7B8-2D915B7B21B1) and added a new flag to control it. * NEWS (Changes in behavior): Mention it. * doc/C/parted.8: Document hfs_esp flag. * doc/parted.texti: Document hfs_esp flag. * include/parted/disk.in.h (_PedPartitionFlag): Add PED_PARTITION_HFS_ESP flag * libparted/disk.c (ped_partition_flag_get_name): Add hfs_esp flag * libparted/labels/gpt.c: Add PARTITION_HFS_ESP_GUID (GPTPartitionData): Add hfs_esp flag (_parse_part_entry): Likewise (gpt_partition_new): Likewise (gpt_partition_set_system): Set PARTITION_HFS_ESP_GUID (gpt_partition_set_flag): Add hfs_esp and PED_PARTITION_HFS_ESP (gpt_partition_get_flag): Likewise (gpt_partition_is_flag_available): Likewise --- NEWS | 8 ++++++++ doc/C/parted.8 | 2 +- doc/parted.texi | 4 ++++ include/parted/disk.in.h | 5 +++-- libparted/disk.c | 2 ++ libparted/labels/gpt.c | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 541ea1c..026e897 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,14 @@ GNU parted NEWS -*- outline -*- ** Changes in behavior + Added new GPT partition type flag, hfs_esp, that sets the GUID to + 47CB5633-7E3E-408B-B7B8-2D915B7B21B1 so that you can distinguish + between OSX's native HFS+ partition and one used Linux on UEFI. The + way Mac handles UEFI is unique, it only uses the standard ESP for + firmware updates and needs a HFS+ formatted partition for UEFI. This + GUID will allow dual booting Linux systems to determine the correct + partition to use when upgrading or re-installing systems. + Added new partition type flag, esp, to set the type to 0xEF on MS-DOS. Also aliased to boot on GPT to set the UEFI ESP GUID. diff --git a/doc/C/parted.8 b/doc/C/parted.8 index f8e6a3d..ccbfd18 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -104,7 +104,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", -"legacy_boot", "irst", "esp" and "palo". +"legacy_boot", "irst", "esp", "hfs_esp" 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 a5effd5..ee5b3f7 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -844,6 +844,10 @@ partition. (MS-DOS, GPT) - this flag identifies a UEFI System Partition. On GPT it is an alias for boot. +@item hfs_esp +(GPT) - this flag identifies a special UEFI HFS+ ESP for use with Mac +hardware. + @item lba (MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and MS Windows ME based operating systems to use Linear (LBA) mode. diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h index d144e21..c34c294 100644 --- a/include/parted/disk.in.h +++ b/include/parted/disk.in.h @@ -75,10 +75,11 @@ enum _PedPartitionFlag { PED_PARTITION_LEGACY_BOOT=15, PED_PARTITION_MSFT_DATA=16, PED_PARTITION_IRST=17, - PED_PARTITION_ESP=18 + PED_PARTITION_ESP=18, + PED_PARTITION_HFS_ESP=19 }; #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT -#define PED_PARTITION_LAST_FLAG PED_PARTITION_ESP +#define PED_PARTITION_LAST_FLAG PED_PARTITION_HFS_ESP enum _PedDiskTypeFeature { PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ diff --git a/libparted/disk.c b/libparted/disk.c index c22b2a2..7d24f74 100644 --- a/libparted/disk.c +++ b/libparted/disk.c @@ -2445,6 +2445,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) return N_("irst"); case PED_PARTITION_ESP: return N_("esp"); + case PED_PARTITION_HFS_ESP: + return N_("hfs_esp"); default: ped_exception_throw ( diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c index 64b92b4..c72573c 100644 --- a/libparted/labels/gpt.c +++ b/libparted/labels/gpt.c @@ -150,6 +150,10 @@ typedef struct ((efi_guid_t) { PED_CPU_TO_LE32 (0xD3BFE2DE), PED_CPU_TO_LE16 (0x3DAF), \ PED_CPU_TO_LE16 (0x11DF), 0xba, 0x40, \ { 0xE3, 0xA5, 0x56, 0xD8, 0x95, 0x93 }}) +#define PARTITION_HFS_ESP_GUID \ + ((efi_guid_t) { PED_CPU_TO_LE32 (0x47CB5633), PED_CPU_TO_LE16 (0x7E3E), \ + PED_CPU_TO_LE16 (0x408B), 0xB7, 0xB8, \ + { 0x2D, 0x91, 0x5B, 0x7B, 0x21, 0xB1 }}) struct __attribute__ ((packed)) _GuidPartitionTableHeader_t { @@ -293,6 +297,7 @@ typedef struct _GPTPartitionData int msftrecv; int legacy_boot; int irst; + int hfs_esp; } GPTPartitionData; static PedDiskType gpt_disk_type; @@ -803,6 +808,7 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) = gpt_part_data->msftrecv = gpt_part_data->legacy_boot = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; if (pte->Attributes.RequiredToFunction & 0x1) @@ -830,6 +836,8 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) gpt_part_data->atvrecv = 1; else if (!guid_cmp (gpt_part_data->type, PARTITION_IRST_GUID)) gpt_part_data->irst = 1; + else if (!guid_cmp (gpt_part_data->type, PARTITION_HFS_ESP_GUID)) + gpt_part_data->hfs_esp = 1; return part; } @@ -1348,6 +1356,7 @@ gpt_partition_new (const PedDisk *disk, gpt_part_data->atvrecv = 0; gpt_part_data->legacy_boot = 0; gpt_part_data->irst = 0; + gpt_part_data->hfs_esp = 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); @@ -1461,6 +1470,11 @@ gpt_partition_set_system (PedPartition *part, gpt_part_data->type = PARTITION_IRST_GUID; return 1; } + if (gpt_part_data->hfs_esp) + { + gpt_part_data->type = PARTITION_HFS_ESP_GUID; + return 1; + } if (fs_type) { @@ -1604,6 +1618,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_BIOS_GRUB: @@ -1617,6 +1632,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_RAID: @@ -1630,6 +1646,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_LVM: @@ -1643,6 +1660,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_HPSERVICE: @@ -1656,6 +1674,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_MSFT_RESERVED: @@ -1669,6 +1688,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_MSFT_DATA: @@ -1682,6 +1702,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftrecv = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; gpt_part_data->msftdata = 1; } else { @@ -1699,6 +1720,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftdata = gpt_part_data->msftres = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_APPLE_TV_RECOVERY: @@ -1712,6 +1734,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->irst + = gpt_part_data->hfs_esp = gpt_part_data->msftrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_IRST: @@ -1725,6 +1748,21 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->hfs_esp + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); + case PED_PARTITION_HFS_ESP: + gpt_part_data->hfs_esp = state; + if (state) + gpt_part_data->boot + = gpt_part_data->raid + = gpt_part_data->lvm + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres + = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_HIDDEN: @@ -1776,6 +1814,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) return gpt_part_data->legacy_boot; case PED_PARTITION_IRST: return gpt_part_data->irst; + case PED_PARTITION_HFS_ESP: + return gpt_part_data->hfs_esp; case PED_PARTITION_SWAP: case PED_PARTITION_LBA: case PED_PARTITION_ROOT: @@ -1804,6 +1844,7 @@ gpt_partition_is_flag_available (const PedPartition *part, case PED_PARTITION_LEGACY_BOOT: case PED_PARTITION_IRST: case PED_PARTITION_ESP: + case PED_PARTITION_HFS_ESP: return 1; case PED_PARTITION_SWAP: case PED_PARTITION_ROOT: -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:20:39 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:20:39 +0000 Received: from localhost ([127.0.0.1]:56567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqty-0004V6-FI for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48240) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqtw-0004Uq-1V for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqti-0003g1-Hy for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqti-0003fu-EZ for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtc-0004de-CF for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqtW-0003Z8-3j for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:16 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtV-0000sS-NY for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:10 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPIxV015326 for ; Wed, 11 Sep 2013 12:25:18 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPIu5015325 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:18 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 13/19] libparted: Add Intel Rapid Start Technology partition flag. Date: Wed, 11 Sep 2013 12:25:03 -0700 Message-Id: <1378927509-15215-14-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: "Brian C. Lane" This adds support for the irst partition type flag. Sets the type to 0x84 on MS-DOS and D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593 on GPT. * NEWS (Changes in behavior): Mention it. * doc/C/parted.8: Document irst flag. * doc/parted.texti: Document irst flag. * include/parted/disk.in.h (_PedPartitionFlag): Add PED_PARTITION_IRST flag * libparted/disk.c (ped_partition_flag_get_name): Add irst flag * libparted/labels/dos.c (DosPartitionData): Likewise (raw_part_parse): Likewise (msdos_partition_new): Likewise (msdos_partition_duplicate): Likewise (msdos_partition_set_system): Likewise (clear_flags): Likewise (msdos_partition_set_flag): Likewise (msdos_partition_get_flag): Likewise (msdos_partition_is_flag_available): Likewise * libparted/labels/gpt.c: Add PARTITION_IRST_GUID (GPTPartitionData): Add irst flag (_parse_part_entry): Likewise (gpt_partition_new): Likewise (gpt_partition_set_system): Likewise (gpt_partition_set_flag): Likewise (gpt_partition_get_flag): Likewise (gpt_partition_is_flag_available): Likewise --- NEWS | 4 ++++ doc/C/parted.8 | 2 +- doc/parted.texi | 4 ++++ include/parted/disk.in.h | 5 +++-- libparted/disk.c | 2 ++ libparted/labels/dos.c | 21 +++++++++++++++++++++ libparted/labels/gpt.c | 39 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 74 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 98f7c6e..b53a9d0 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ GNU parted NEWS -*- outline -*- ** Changes in behavior + Added new partition type flag, irst, for use with Intel Rapid Start + Technology. On MS-DOS disk labels it sets the type to 0x84 and on GPT + it sets the GUID to D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593. + parted -l no longer lists device-mapper devices other than dmraid whole disks. diff --git a/doc/C/parted.8 b/doc/C/parted.8 index a9f73f5..2f8e9f5 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -104,7 +104,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", -"legacy_boot" and "palo". +"legacy_boot", "irst" 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 008c383..fd8ccb9 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -836,6 +836,10 @@ used by Windows on GPT disks. Note that this flag should not normally be set on Windows filesystem partitions (those that contain NTFS or FAT filesystems). +@item irst +(MS-DOS, GPT) - this flag identifies an Intel Rapid Start Technology +partition. + @item lba (MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and MS Windows ME based operating systems to use Linear (LBA) mode. diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h index aa905c5..585383d 100644 --- a/include/parted/disk.in.h +++ b/include/parted/disk.in.h @@ -73,10 +73,11 @@ enum _PedPartitionFlag { PED_PARTITION_APPLE_TV_RECOVERY=13, PED_PARTITION_DIAG=14, PED_PARTITION_LEGACY_BOOT=15, - PED_PARTITION_MSFT_DATA=16 + PED_PARTITION_MSFT_DATA=16, + PED_PARTITION_IRST=17 }; #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT -#define PED_PARTITION_LAST_FLAG PED_PARTITION_MSFT_DATA +#define PED_PARTITION_LAST_FLAG PED_PARTITION_IRST enum _PedDiskTypeFeature { PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ diff --git a/libparted/disk.c b/libparted/disk.c index d3cd5bb..4ca7255 100644 --- a/libparted/disk.c +++ b/libparted/disk.c @@ -2441,6 +2441,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) return N_("diag"); case PED_PARTITION_LEGACY_BOOT: return N_("legacy_boot"); + case PED_PARTITION_IRST: + return N_("irst"); default: ped_exception_throw ( diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c index b8c161f..f8591ff 100644 --- a/libparted/labels/dos.c +++ b/libparted/labels/dos.c @@ -85,6 +85,7 @@ static const char MBR_BOOT_CODE[] = { #define PARTITION_LDM 0x42 #define PARTITION_LINUX_SWAP 0x82 #define PARTITION_LINUX 0x83 +#define PARTITION_IRST 0x84 #define PARTITION_LINUX_EXT 0x85 #define PARTITION_LINUX_LVM 0x8e #define PARTITION_HFS 0xaf @@ -159,6 +160,7 @@ typedef struct { int palo; int prep; int diag; + int irst; OrigState* orig; /* used for CHS stuff */ } DosPartitionData; @@ -924,6 +926,7 @@ raw_part_parse (const PedDisk* disk, const DosRawPartition* raw_part, dos_data->lba = raw_part_is_lba (raw_part); dos_data->palo = raw_part->type == PARTITION_PALO; dos_data->prep = raw_part->type == PARTITION_PREP; + dos_data->irst = raw_part->type == PARTITION_IRST; dos_data->orig = ped_malloc (sizeof (OrigState)); if (!dos_data->orig) { ped_partition_destroy (part); @@ -1326,6 +1329,7 @@ msdos_partition_new (const PedDisk* disk, PedPartitionType part_type, dos_data->lba = 0; dos_data->palo = 0; dos_data->prep = 0; + dos_data->irst = 0; } else { part->disk_specific = NULL; } @@ -1361,6 +1365,7 @@ msdos_partition_duplicate (const PedPartition* part) new_dos_data->lba = old_dos_data->lba; new_dos_data->palo = old_dos_data->palo; new_dos_data->prep = old_dos_data->prep; + new_dos_data->irst = old_dos_data->irst; if (old_dos_data->orig) { new_dos_data->orig = ped_malloc (sizeof (OrigState)); @@ -1409,6 +1414,7 @@ msdos_partition_set_system (PedPartition* part, dos_data->lvm = 0; dos_data->palo = 0; dos_data->prep = 0; + dos_data->irst = 0; if (dos_data->lba) dos_data->system = PARTITION_EXT_LBA; else @@ -1441,6 +1447,10 @@ msdos_partition_set_system (PedPartition* part, dos_data->system = PARTITION_PREP; return 1; } + if (dos_data->irst) { + dos_data->system = PARTITION_IRST; + return 1; + } if (!fs_type) dos_data->system = PARTITION_LINUX; @@ -1477,6 +1487,7 @@ clear_flags (DosPartitionData *dos_data) dos_data->lvm = 0; dos_data->palo = 0; dos_data->prep = 0; + dos_data->irst = 0; dos_data->raid = 0; } @@ -1555,6 +1566,12 @@ msdos_partition_set_flag (PedPartition* part, dos_data->prep = state; return ped_partition_set_system (part, part->fs_type); + case PED_PARTITION_IRST: + if (state) + clear_flags (dos_data); + dos_data->irst = state; + return ped_partition_set_system (part, part->fs_type); + default: return 0; } @@ -1597,6 +1614,9 @@ msdos_partition_get_flag (const PedPartition* part, PedPartitionFlag flag) case PED_PARTITION_PREP: return dos_data->prep; + case PED_PARTITION_IRST: + return dos_data->irst; + default: return 0; } @@ -1619,6 +1639,7 @@ msdos_partition_is_flag_available (const PedPartition* part, case PED_PARTITION_LBA: case PED_PARTITION_PALO: case PED_PARTITION_PREP: + case PED_PARTITION_IRST: case PED_PARTITION_DIAG: return 1; diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c index 25490af..0b7d08b 100644 --- a/libparted/labels/gpt.c +++ b/libparted/labels/gpt.c @@ -146,6 +146,10 @@ typedef struct ((efi_guid_t) { PED_CPU_TO_LE32 (0x5265636F), PED_CPU_TO_LE16 (0x7665), \ PED_CPU_TO_LE16 (0x11AA), 0xaa, 0x11, \ { 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC }}) +#define PARTITION_IRST_GUID \ + ((efi_guid_t) { PED_CPU_TO_LE32 (0xD3BFE2DE), PED_CPU_TO_LE16 (0x3DAF), \ + PED_CPU_TO_LE16 (0x11DF), 0xba, 0x40, \ + { 0xE3, 0xA5, 0x56, 0xD8, 0x95, 0x93 }}) struct __attribute__ ((packed)) _GuidPartitionTableHeader_t { @@ -288,6 +292,7 @@ typedef struct _GPTPartitionData int atvrecv; int msftrecv; int legacy_boot; + int irst; } GPTPartitionData; static PedDiskType gpt_disk_type; @@ -797,6 +802,7 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) = gpt_part_data->msftdata = gpt_part_data->msftrecv = gpt_part_data->legacy_boot + = gpt_part_data->irst = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; if (pte->Attributes.RequiredToFunction & 0x1) @@ -822,6 +828,8 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) gpt_part_data->msftrecv = 1; else if (!guid_cmp (gpt_part_data->type, PARTITION_APPLE_TV_RECOVERY_GUID)) gpt_part_data->atvrecv = 1; + else if (!guid_cmp (gpt_part_data->type, PARTITION_IRST_GUID)) + gpt_part_data->irst = 1; return part; } @@ -1339,6 +1347,7 @@ gpt_partition_new (const PedDisk *disk, gpt_part_data->msftrecv = 0; gpt_part_data->atvrecv = 0; gpt_part_data->legacy_boot = 0; + gpt_part_data->irst = 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); @@ -1447,6 +1456,11 @@ gpt_partition_set_system (PedPartition *part, gpt_part_data->type = PARTITION_APPLE_TV_RECOVERY_GUID; return 1; } + if (gpt_part_data->irst) + { + gpt_part_data->type = PARTITION_IRST_GUID; + return 1; + } if (fs_type) { @@ -1588,6 +1602,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_BIOS_GRUB: @@ -1600,6 +1615,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_RAID: @@ -1612,6 +1628,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_LVM: @@ -1624,6 +1641,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_HPSERVICE: @@ -1636,6 +1654,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->msftres = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_MSFT_RESERVED: @@ -1648,6 +1667,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->hp_service = gpt_part_data->msftdata = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_MSFT_DATA: @@ -1660,6 +1680,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->hp_service = gpt_part_data->msftres = gpt_part_data->msftrecv + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; gpt_part_data->msftdata = 1; } else { @@ -1676,6 +1697,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->hp_service = gpt_part_data->msftdata = gpt_part_data->msftres + = gpt_part_data->irst = gpt_part_data->atvrecv = 0; return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_APPLE_TV_RECOVERY: @@ -1688,8 +1710,22 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) = gpt_part_data->hp_service = gpt_part_data->msftres = gpt_part_data->msftdata + = gpt_part_data->irst = gpt_part_data->msftrecv = 0; return gpt_partition_set_system (part, part->fs_type); + case PED_PARTITION_IRST: + gpt_part_data->irst = state; + if (state) + gpt_part_data->boot + = gpt_part_data->raid + = gpt_part_data->lvm + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres + = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); case PED_PARTITION_HIDDEN: gpt_part_data->hidden = state; return 1; @@ -1736,6 +1772,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) return gpt_part_data->hidden; case PED_PARTITION_LEGACY_BOOT: return gpt_part_data->legacy_boot; + case PED_PARTITION_IRST: + return gpt_part_data->irst; case PED_PARTITION_SWAP: case PED_PARTITION_LBA: case PED_PARTITION_ROOT: @@ -1762,6 +1800,7 @@ gpt_partition_is_flag_available (const PedPartition *part, case PED_PARTITION_APPLE_TV_RECOVERY: case PED_PARTITION_HIDDEN: case PED_PARTITION_LEGACY_BOOT: + case PED_PARTITION_IRST: return 1; case PED_PARTITION_SWAP: case PED_PARTITION_ROOT: -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:21:00 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:21:00 +0000 Received: from localhost ([127.0.0.1]:56570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJquI-0004Vi-G7 for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:21:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48373) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJquE-0004VP-Fx for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqu3-0003oY-Bv for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqu2-0003oK-Gp for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:20:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtx-0004oD-E9 for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqts-0003lP-0P for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:37 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqtr-0000sS-Gg for bug-parted@gnu.org; Wed, 11 Sep 2013 16:20:31 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPGrY015302 for ; Wed, 11 Sep 2013 12:25:16 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPGGK015301 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:16 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 07/19] libparted: add support for EAV DASD partitions Date: Wed, 11 Sep 2013 12:24:57 -0700 Message-Id: <1378927509-15215-8-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: Nageswara R Sastry Extended Address Volume (EAV) DASDs are ECKD DASDs with more than 65520 cylinders. This patch adds support for recognizing and modifying partitions on EAV DASDs to Parted. The changes are based on the EAV support added to version 1.8.1 [1] of the s390-tools package. [1] http://www.ibm.com/developerworks/linux/linux390/s390-tools-1.8.1.html Signed-off-by: Nageswara R Sastry Signed-off-by: Peter Oberparleiter --- include/parted/fdasd.in.h | 89 +++++++++++++++--- include/parted/vtoc.in.h | 59 ++++++++++-- libparted/labels/dasd.c | 1 + libparted/labels/fdasd.c | 226 ++++++++++++++++++++++++++++++++-------------- libparted/labels/vtoc.c | 173 ++++++++++++++++++++++++++++++----- 5 files changed, 436 insertions(+), 112 deletions(-) diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h index a755246..b4e7dd1 100644 --- a/include/parted/fdasd.in.h +++ b/include/parted/fdasd.in.h @@ -74,6 +74,80 @@ typedef struct dasd_information_t { char configuration_data[256]; /* from read_configuration_data */ } dasd_information_t; +struct dasd_eckd_characteristics { + unsigned short cu_type; + struct { + unsigned char support:2; + unsigned char async:1; + unsigned char reserved:1; + unsigned char cache_info:1; + unsigned char model:3; + } __attribute__ ((packed)) cu_model; + unsigned short dev_type; + unsigned char dev_model; + struct { + unsigned char mult_burst:1; + unsigned char RT_in_LR:1; + unsigned char reserved1:1; + unsigned char RD_IN_LR:1; + unsigned char reserved2:4; + unsigned char reserved3:8; + unsigned char defect_wr:1; + unsigned char XRC_supported:1; + unsigned char reserved4:1; + unsigned char striping:1; + unsigned char reserved5:4; + unsigned char cfw:1; + unsigned char reserved6:2; + unsigned char cache:1; + unsigned char dual_copy:1; + unsigned char dfw:1; + unsigned char reset_alleg:1; + unsigned char sense_down:1; + } __attribute__ ((packed)) facilities; + unsigned char dev_class; + unsigned char unit_type; + unsigned short no_cyl; + unsigned short trk_per_cyl; + unsigned char sec_per_trk; + unsigned char byte_per_track[3]; + unsigned short home_bytes; + unsigned char formula; + union { + struct { + unsigned char f1; + unsigned short f2; + unsigned short f3; + } __attribute__ ((packed)) f_0x01; + struct { + unsigned char f1; + unsigned char f2; + unsigned char f3; + unsigned char f4; + unsigned char f5; + } __attribute__ ((packed)) f_0x02; + } __attribute__ ((packed)) factors; + unsigned short first_alt_trk; + unsigned short no_alt_trk; + unsigned short first_dia_trk; + unsigned short no_dia_trk; + unsigned short first_sup_trk; + unsigned short no_sup_trk; + unsigned char MDR_ID; + unsigned char OBR_ID; + unsigned char director; + unsigned char rd_trk_set; + unsigned short max_rec_zero; + unsigned char reserved1; + unsigned char RWANY_in_LR; + unsigned char factor6; + unsigned char factor7; + unsigned char factor8; + unsigned char reserved2[3]; + unsigned char reserved3[6]; + unsigned int long_no_cyl; +} __attribute__ ((packed)); + /* * struct format_data_t * represents all data necessary to format a dasd @@ -116,18 +190,6 @@ typedef struct format_data_t { #define BLKRRPART _IO(0x12,95) /* get block device sector size */ #define BLKSSZGET _IO(0x12,104) - -/***************************************************************************** - * SECTION: Definition from hdreq.h * - *****************************************************************************/ - -struct fdasd_hd_geometry { - unsigned char heads; - unsigned char sectors; - unsigned short cylinders; - unsigned long start; -}; - /* get device geometry */ #define HDIO_GETGEO 0x0301 @@ -189,10 +251,13 @@ typedef struct fdasd_anchor { format4_label_t *f4; format5_label_t *f5; format7_label_t *f7; + format9_label_t *f9; /* template for all f9 labels */ partition_info_t *first; partition_info_t *last; volume_label_t *vlabel; config_data_t confdata[USABLE_PARTITIONS]; + u_int32_t hw_cylinders; + u_int32_t formatted_cylinders; struct fdasd_hd_geometry geo; unsigned int label_block; unsigned int FBA_layout; diff --git a/include/parted/vtoc.in.h b/include/parted/vtoc.in.h index d79ce39..499c2d3 100644 --- a/include/parted/vtoc.in.h +++ b/include/parted/vtoc.in.h @@ -42,6 +42,18 @@ #define VOLSER_LENGTH 6 #define BIG_DISK_SIZE 0x10000 +#define LV_COMPAT_CYL 0xFFFE + +/***************************************************************************** + * SECTION: Definition from hdreq.h * + *****************************************************************************/ + +struct fdasd_hd_geometry { + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; typedef struct ttr ttr_t; @@ -59,6 +71,7 @@ typedef struct ds5ext ds5ext_t; typedef struct format5_label format5_label_t; typedef struct ds7ext ds7ext_t; typedef struct format7_label format7_label_t; +typedef struct format9_label format9_label_t; struct __attribute__ ((packed)) ttr { u_int16_t tt; @@ -169,6 +182,10 @@ struct __attribute__ ((packed)) dev_const { u_int8_t DS4DEVDB; /* number of directory blocks per track */ }; +/* + * format 1 and format 8 label have the same layout so we use the following + * structure for both. + */ struct __attribute__ ((packed)) format1_label { char DS1DSNAM[44]; /* data set name */ u_int8_t DS1FMTID; /* format identifier */ @@ -229,7 +246,11 @@ struct __attribute__ ((packed)) format4_label { char res2[10]; /* reserved */ u_int8_t DS4EFLVL; /* extended free-space management level */ cchhb_t DS4EFPTR; /* pointer to extended free-space info */ - char res3[9]; /* reserved */ + char res3; /* reserved */ + u_int32_t DS4DCYL; /* number of logical cyls */ + char res4[2]; /* reserved */ + u_int8_t DS4DEVF2; /* device flags */ + char res5; /* reserved */ }; struct __attribute__ ((packed)) ds5ext { @@ -261,12 +282,28 @@ struct __attribute__ ((packed)) format7_label { cchhb_t DS7PTRDS; /* pointer to next FMT7 DSCB */ }; +struct __attribute__ ((packed)) format9_label { + u_int8_t DS9KEYID; /* key code for format 9 labels (0x09) */ + u_int8_t DS9SUBTY; /* subtype (0x01) */ + u_int8_t DS9NUMF9; /* number of F9 datasets */ + u_int8_t res1[41]; /* reserved */ + u_int8_t DS9FMTID; /* format identifier */ + u_int8_t res2[95]; /* reserved */ +}; + char *vtoc_ebcdic_enc (char const *source, char *target, int l); char *vtoc_ebcdic_dec (char const *source, char *target, int l); void vtoc_set_extent (extent_t *ext, u_int8_t typeind, u_int8_t seqno, cchh_t *lower, cchh_t *upper); -void vtoc_set_cchh (cchh_t *addr, u_int16_t cc, u_int16_t hh); -void vtoc_set_cchhb (cchhb_t *addr, u_int16_t cc, u_int16_t hh, u_int8_t b); +void vtoc_set_cchh (cchh_t *addr, u_int32_t cc, u_int16_t hh); +u_int32_t vtoc_get_cyl_from_cchh(cchh_t *addr); +u_int16_t vtoc_get_head_from_cchh(cchh_t *addr); +void vtoc_set_cchhb (cchhb_t *addr, u_int32_t cc, u_int16_t hh, u_int8_t b); +u_int32_t vtoc_get_cyl_from_cchhb(cchhb_t *addr); +u_int16_t vtoc_get_head_from_cchhb(cchhb_t *addr); +u_int64_t cchhb2blk(cchhb_t *p, struct fdasd_hd_geometry *geo); +u_int64_t cchh2blk (cchh_t *p, struct fdasd_hd_geometry *geo); +u_int32_t cchh2trk (cchh_t *p, struct fdasd_hd_geometry *geo); void vtoc_set_date (labeldate_t *d, u_int8_t year, u_int16_t day); void vtoc_volume_label_init (volume_label_t *vlabel); @@ -295,14 +332,16 @@ void vtoc_write_label (int fd, unsigned long position, format1_label_t const *f1, format4_label_t const *f4, format5_label_t const *f5, - format7_label_t const *f7); + format7_label_t const *f7, + format9_label_t const *f9); void vtoc_init_format1_label (char *volid, unsigned int blksize, extent_t *part_extent, format1_label_t *f1); void vtoc_init_format4_label (format4_label_t *f4lbl, unsigned int usable_partitions, - unsigned int cylinders, + unsigned int compat_cylinders, + unsigned int real_cylinders, unsigned int tracks, unsigned int blocks, unsigned int blksize, @@ -329,8 +368,16 @@ void vtoc_update_format7_label_add (format7_label_t *f7, int verbose, void vtoc_update_format7_label_del (format7_label_t *f7, int verbose, u_int32_t a, u_int32_t b); +void vtoc_init_format8_label (char *volid, unsigned int blksize, + extent_t *part_extent, format1_label_t *f1); + +void vtoc_update_format8_label (cchhb_t *associated_f9, format1_label_t *f8); + +void vtoc_init_format9_label (format9_label_t *f9); + void vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5, format7_label_t *f7, char ch, int verbose, - u_int32_t start, u_int32_t stop, int cyl, int trk); + u_int32_t start, u_int32_t stop, u_int32_t cyl, + u_int32_t trk); #endif /* VTOC_H */ diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c index b4e80b1..081b3c5 100644 --- a/libparted/labels/dasd.c +++ b/libparted/labels/dasd.c @@ -631,6 +631,7 @@ dasd_write (const PedDisk* disk) /* initialize the anchor */ fdasd_initialize_anchor(&anchor); fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); + fdasd_check_volume(&anchor, arch_specific->fd); memcpy(anchor.vlabel, &disk_specific->vlabel, sizeof(volume_label_t)); anchor.vlabel_changed++; diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c index f92065f..2735b2a 100644 --- a/libparted/labels/fdasd.c +++ b/libparted/labels/fdasd.c @@ -59,6 +59,48 @@ setpos (fdasd_anchor_t *anc, int dsn, int pos) anc->partno[dsn] = pos; } +static u_int32_t +get_usable_cylinders (fdasd_anchor_t *anc) +{ + u_int32_t cyl; + + /* large volume */ + if (anc->f4->DS4DEVCT.DS4DSCYL == LV_COMPAT_CYL && + anc->f4->DS4DCYL > anc->f4->DS4DEVCT.DS4DSCYL) + return anc->f4->DS4DCYL; + /* normal volume */ + if (anc->f4->DS4DEVCT.DS4DEVFG & ALTERNATE_CYLINDERS_USED) + cyl = anc->f4->DS4DEVCT.DS4DSCYL - + (u_int16_t) anc->f4->DS4DEVAC; + else + cyl = anc->f4->DS4DEVCT.DS4DSCYL; + return cyl; +} + +static void +get_addr_of_highest_f1_f8_label (fdasd_anchor_t *anc, cchhb_t *addr) +{ + + u_int8_t record; + /* We have to count the follwing labels: + * one format 4 + * one format 5 + * format 7 only if we have moren then BIG_DISK_SIZE tracks + * one for each format 1 or format 8 label == one for each partition + * one for each format 9 label before the last format 8 + * We assume that all partitions use format 8 labels when + * anc->formatted_cylinders > LV_COMPAT_CYL + * Note: Record zero is special, so block 0 on our disk is record 1! + */ + + record = anc->used_partitions + 2; + if (anc->big_disk) + record++; + if (anc->formatted_cylinders > LV_COMPAT_CYL) + record += anc->used_partitions - 1; + vtoc_set_cchhb(addr, VTOC_START_CC, VTOC_START_HH, record); +} + void fdasd_cleanup (fdasd_anchor_t *anchor) { @@ -72,6 +114,7 @@ fdasd_cleanup (fdasd_anchor_t *anchor) free(anchor->f4); free(anchor->f5); free(anchor->f7); + free(anchor->f9); free(anchor->vlabel); p = anchor->first; @@ -82,6 +125,7 @@ fdasd_cleanup (fdasd_anchor_t *anchor) if (p == NULL) return; q = p->next; + free(p->f1); free(p); p = q; } @@ -154,17 +198,6 @@ fdasd_error (fdasd_anchor_t *anc, enum fdasd_failure why, char const *str) } /* - * converts cyl-cyl-head-head-blk to blk - */ -static unsigned long -cchhb2blk (cchhb_t *p, struct fdasd_hd_geometry *geo) -{ - PDEBUG - return (unsigned long) (p->cc * geo->heads * geo->sectors - + p->hh * geo->sectors + p->b); -} - -/* * initializes the anchor structure and allocates some * memory for the labels */ @@ -216,9 +249,16 @@ fdasd_initialize_anchor (fdasd_anchor_t * anc) if (anc->f7 == NULL) fdasd_error(anc, malloc_failed, "FMT7 DSCB."); + /* template for all format 9 labels */ + anc->f9 = malloc(sizeof(format9_label_t)); + if (anc->f9 == NULL) + fdasd_error(anc, malloc_failed, "FMT9 DSCB."); + bzero(anc->f4, sizeof(format4_label_t)); bzero(anc->f5, sizeof(format5_label_t)); bzero(anc->f7, sizeof(format7_label_t)); + bzero(anc->f9, sizeof(format9_label_t)); + vtoc_init_format9_label(anc->f9); v = malloc(sizeof(volume_label_t)); if (v == NULL) @@ -259,6 +299,8 @@ fdasd_initialize_anchor (fdasd_anchor_t * anc) q = p; } + anc->hw_cylinders = 0; + anc->formatted_cylinders = 0; } /* @@ -269,44 +311,46 @@ fdasd_write_vtoc_labels (fdasd_anchor_t * anc, int fd) { PDEBUG partition_info_t *p; - unsigned long b; + unsigned long b, maxblk; char dsno[6], s1[7], s2[45], *c1, *c2, *ch; int i = 0, k = 0; + cchhb_t f9addr; + format1_label_t emptyf1; b = (cchhb2blk (&anc->vlabel->vtoc, &anc->geo) - 1) * anc->blksize; if (b <= 0) fdasd_error (anc, vlabel_corrupted, ""); + maxblk = b + anc->blksize * 9; /* f4+f5+f7+3*f8+3*f9 */ /* write FMT4 DSCB */ - vtoc_write_label (fd, b, NULL, anc->f4, NULL, NULL); + vtoc_write_label (fd, b, NULL, anc->f4, NULL, NULL, NULL); + b += anc->blksize; /* write FMT5 DSCB */ + vtoc_write_label (fd, b, NULL, NULL, anc->f5, NULL, NULL); b += anc->blksize; - vtoc_write_label (fd, b, NULL, NULL, anc->f5, NULL); /* write FMT7 DSCB */ if (anc->big_disk) { + vtoc_write_label (fd, b, NULL, NULL, NULL, anc->f7, NULL); b += anc->blksize; - vtoc_write_label (fd, b, NULL, NULL, NULL, anc->f7); } - /* loop over all FMT1 DSCBs */ - p = anc->first; - for (i = 0; i < USABLE_PARTITIONS; i++) { - b += anc->blksize; + /* loop over all partitions (format 1 or format 8 DCB) */ + for (p = anc->first; p != NULL; p = p->next) { if (p->used != 0x01) { - vtoc_write_label (fd, b, p->f1, NULL, NULL, NULL); continue; } + i++; strncpy (p->f1->DS1DSSN, anc->vlabel->volid, 6); ch = p->f1->DS1DSNAM; vtoc_ebcdic_dec (ch, ch, 44); c1 = ch + 7; - if (getdsn (anc, i) > -1) { + if (getdsn (anc, i-1) > -1) { /* re-use the existing data set name */ c2 = strchr (c1, '.'); if (c2 != NULL) @@ -325,11 +369,7 @@ fdasd_write_vtoc_labels (fdasd_anchor_t * anc, int fd) while (getpos (anc, k) > -1) k++; - setpos (anc, k, i); - - strncpy (s2, ch, 44); - s2[44] = 0; - vtoc_ebcdic_dec (s2, s2, 44); + setpos (anc, k, i-1); strncpy (ch, "LINUX.V " " ", 44); @@ -366,8 +406,32 @@ fdasd_write_vtoc_labels (fdasd_anchor_t * anc, int fd) vtoc_ebcdic_enc (ch, ch, 44); - vtoc_write_label (fd, b, p->f1, NULL, NULL, NULL); - p = p->next; + if (p->f1->DS1FMTID == 0xf8 ) { + /* Now as we know where which label will be written, we + * can add the address of the format 9 label to the + * format 8 label. The f9 record will be written to the + * block after the current blk. Remember: records are of + * by one, so we have to add 2 and not just one. + */ + vtoc_set_cchhb(&f9addr, VTOC_START_CC, VTOC_START_HH, + ((b / anc->blksize) % anc->geo.sectors) + 2); + vtoc_update_format8_label(&f9addr, p->f1); + vtoc_write_label(fd, b, p->f1, NULL, NULL, NULL, NULL); + b += anc->blksize; + vtoc_write_label(fd, b, NULL, NULL, NULL, NULL, + anc->f9); + b += anc->blksize; + } else { + vtoc_write_label(fd, b, p->f1, NULL, NULL, NULL, NULL); + b += anc->blksize; + } + } + + /* write empty labels to the rest of the blocks */ + bzero(&emptyf1, sizeof(emptyf1)); + while (b < maxblk) { + vtoc_write_label(fd, b, &emptyf1, NULL, NULL, NULL, NULL); + b += anc->blksize; } } @@ -394,20 +458,25 @@ int fdasd_prepare_labels (fdasd_anchor_t *anc, int fd) { PDEBUG - partition_info_t *p = anc->first; + partition_info_t *p; char dsno[6], s1[7], s2[45], *c1, *c2, *ch; int i = 0, k = 0; - /* loop over all FMT1 DSCBs */ - p = anc->first; - for (i = 0; i < USABLE_PARTITIONS; i++) { + /* loop over all partitions (format 1 or format 8 DCB) */ + for (p = anc->first; p != NULL; p = p->next) { + + if (p->used != 0x01) { + continue; + } + + i++; strncpy (p->f1->DS1DSSN, anc->vlabel->volid, 6); ch = p->f1->DS1DSNAM; vtoc_ebcdic_dec (ch, ch, 44); c1 = ch + 7; - if (getdsn (anc, i) > -1) { + if (getdsn (anc, i-1) > -1) { /* re-use the existing data set name */ c2 = strchr (c1, '.'); if (c2 != NULL) @@ -426,11 +495,7 @@ fdasd_prepare_labels (fdasd_anchor_t *anc, int fd) while (getpos (anc, k) > -1) k++; - setpos (anc, k, i); - - strncpy (s2, ch, 44); - s2[44] = 0; - vtoc_ebcdic_dec (s2, s2, 44); + setpos (anc, k, i-1); strncpy (ch, "LINUX.V " " ", 44); @@ -466,7 +531,6 @@ fdasd_prepare_labels (fdasd_anchor_t *anc, int fd) } vtoc_ebcdic_enc (ch, ch, 44); - p = p->next; } return 1; @@ -482,6 +546,7 @@ fdasd_recreate_vtoc (fdasd_anchor_t *anc) vtoc_init_format4_label(anc->f4, USABLE_PARTITIONS, anc->geo.cylinders, + anc->formatted_cylinders, anc->geo.heads, anc->geo.sectors, anc->blksize, @@ -492,8 +557,8 @@ fdasd_recreate_vtoc (fdasd_anchor_t *anc) vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '+', anc->verbose, FIRST_USABLE_TRK, - anc->geo.cylinders * anc->geo.heads - 1, - anc->geo.cylinders, anc->geo.heads); + anc->formatted_cylinders * anc->geo.heads - 1, + anc->formatted_cylinders, anc->geo.heads); for (i = 0; i < USABLE_PARTITIONS; i++) { bzero(p->f1, sizeof(format1_label_t)); @@ -507,7 +572,8 @@ fdasd_recreate_vtoc (fdasd_anchor_t *anc) } anc->used_partitions = 0; - anc->fspace_trk = anc->geo.cylinders * anc->geo.heads - FIRST_USABLE_TRK; + anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads - + FIRST_USABLE_TRK; for (i=0; ifirst; - unsigned int h = anc->geo.heads; - unsigned long max = anc->geo.cylinders * h - 1; + unsigned long max = anc->formatted_cylinders * anc->geo.heads - 1; int i; char *ch; anc->used_partitions = anc->geo.sectors - 2 - anc->f4->DS4DSREC; for (i = 1; i <= USABLE_PARTITIONS; i++) { - if (p->f1->DS1FMTID != 0xf1) { + if (p->f1->DS1FMTID != 0xf1 && + p->f1->DS1FMTID != 0xf8) { if (i == 1) /* there is no partition at all */ anc->fspace_trk = max - FIRST_USABLE_TRK + 1; @@ -546,8 +612,8 @@ fdasd_update_partition_info (fdasd_anchor_t *anc) /* this is a valid format 1 label */ p->used = 0x01; - p->start_trk = p->f1->DS1EXT1.llimit.cc * h + p->f1->DS1EXT1.llimit.hh; - p->end_trk = p->f1->DS1EXT1.ulimit.cc * h + p->f1->DS1EXT1.ulimit.hh; + p->start_trk = cchh2trk(&p->f1->DS1EXT1.llimit, &anc->geo); + p->end_trk = cchh2trk(&p->f1->DS1EXT1.ulimit, &anc->geo); p->len_trk = p->end_trk - p->start_trk + 1; if (i == 1) { @@ -618,14 +684,22 @@ fdasd_process_valid_vtoc (fdasd_anchor_t * anc, unsigned long b, int fd) format1_label_t q; char s[5], *ch; + if (anc->f4->DS4DEVCT.DS4DSCYL == LV_COMPAT_CYL && + anc->f4->DS4DCYL > anc->f4->DS4DEVCT.DS4DSCYL) + anc->formatted_cylinders = anc->f4->DS4DCYL; + else + anc->formatted_cylinders = anc->f4->DS4DEVCT.DS4DSCYL; + anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads - + FIRST_USABLE_TRK; b += anc->blksize; - for (i = 1; i <= anc->geo.sectors; i++) { + for (i = 1; i < anc->geo.sectors; i++) { bzero (&q, f1size); vtoc_read_label (fd, b, &q, NULL, NULL, NULL); switch (q.DS1FMTID) { case 0xf1: + case 0xf8: if (p == NULL) break; memcpy (p->f1, &q, f1size); @@ -669,6 +743,12 @@ fdasd_process_valid_vtoc (fdasd_anchor_t * anc, unsigned long b, int fd) memcpy (anc->f7, &q, f1size); f7_counter++; break; + case 0xf9: + /* each format 8 lable has an associated + * format 9 lable, but they are of no further + * use to us. + */ + break; } b += anc->blksize; @@ -718,7 +798,7 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd) { PDEBUG volume_label_t *v = anc->vlabel; - unsigned long b = -1; + long long b = -1; char str[LINE_LENGTH]; memset(v, 0, sizeof(volume_label_t)); @@ -784,6 +864,7 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) PDEBUG int blksize = 0; dasd_information_t dasd_info; + struct dasd_eckd_characteristics *characteristics; /* We can't get geometry from a regular file, so simulate something usable, for the sake of testing. */ @@ -803,6 +884,8 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) dasd_info.devno = 513; dasd_info.label_block = 2; dasd_info.FBA_layout = 0; + anc->hw_cylinders = ((st.st_size / blksize) / anc->geo.sectors) / + anc->geo.heads; } else { if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0) fdasd_error(anc, unable_to_ioctl, @@ -816,13 +899,20 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) if (ioctl(f, BIODASDINFO, &dasd_info) != 0) fdasd_error(anc, unable_to_ioctl, _("Could not retrieve disk information.")); + + characteristics = (struct dasd_eckd_characteristics *) + &dasd_info.characteristics; + if (characteristics->no_cyl == LV_COMPAT_CYL && + characteristics->long_no_cyl) + anc->hw_cylinders = characteristics->long_no_cyl; + else + anc->hw_cylinders = characteristics->no_cyl; } anc->dev_type = dasd_info.dev_type; anc->blksize = blksize; anc->label_pos = dasd_info.label_block * blksize; anc->devno = dasd_info.devno; - anc->fspace_trk = anc->geo.cylinders * anc->geo.heads - FIRST_USABLE_TRK; anc->label_block = dasd_info.label_block; anc->FBA_layout = dasd_info.FBA_layout; } @@ -850,20 +940,17 @@ fdasd_get_partition_data (fdasd_anchor_t *anc, extent_t *part_extent, unsigned int *stop_ptr) { PDEBUG - unsigned int limit, cc, hh; + unsigned int limit; + u_int32_t cc, c; + u_int16_t hh, h; cchh_t llimit, ulimit; partition_info_t *q; u_int8_t b1, b2; - u_int16_t c, h; unsigned int start = *start_ptr, stop = *stop_ptr; int i; char *ch; - if (anc->f4->DS4DEVCT.DS4DEVFG & ALTERNATE_CYLINDERS_USED) - c = anc->f4->DS4DEVCT.DS4DSCYL - (u_int16_t) anc->f4->DS4DEVAC; - else - c = anc->f4->DS4DEVCT.DS4DSCYL; - + c = get_usable_cylinders(anc); h = anc->f4->DS4DEVCT.DS4DSTRK; limit = (h * c - 1); @@ -1019,7 +1106,6 @@ fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start, cchhb_t hf1; partition_info_t *p; extent_t ext; - int i; PDEBUG; @@ -1032,8 +1118,14 @@ fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start, if (fdasd_get_partition_data(anc, &ext, p, &start, &stop) != 0) return 0; - PDEBUG; - vtoc_init_format1_label(anc->vlabel->volid, anc->blksize, &ext, p->f1); + if (anc->formatted_cylinders > LV_COMPAT_CYL) { + vtoc_init_format8_label(anc->vlabel->volid, anc->blksize, &ext, + p->f1); + } else { + PDEBUG; + vtoc_init_format1_label(anc->vlabel->volid, anc->blksize, &ext, + p->f1); + } PDEBUG; fdasd_enqueue_new_partition(anc); @@ -1041,23 +1133,17 @@ fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start, PDEBUG; anc->used_partitions += 1; - i = anc->used_partitions + 2; - if (anc->big_disk) - i++; - PDEBUG; - - vtoc_set_cchhb(&hf1, VTOC_START_CC, VTOC_START_HH, i); - + get_addr_of_highest_f1_f8_label(anc, &hf1); vtoc_update_format4_label(anc->f4, &hf1, anc->f4->DS4DSREC - 1); PDEBUG; - start = ext.llimit.cc * anc->geo.heads + ext.llimit.hh; - stop = ext.ulimit.cc * anc->geo.heads + ext.ulimit.hh; + start = cchh2trk(&ext.llimit, &anc->geo); + stop = cchh2trk(&ext.ulimit, &anc->geo); PDEBUG; vtoc_set_freespace(anc->f4, anc->f5, anc->f7, '-', anc->verbose, - start, stop, anc->geo.cylinders, anc->geo.heads); + start, stop, anc->formatted_cylinders, anc->geo.heads); anc->vtoc_changed++; diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c index cf2990e..fdfa94f 100644 --- a/libparted/labels/vtoc.c +++ b/libparted/labels/vtoc.c @@ -218,11 +218,32 @@ vtoc_set_extent (extent_t *ext, u_int8_t typeind, u_int8_t seqno, } void -vtoc_set_cchh (cchh_t *addr, u_int16_t cc, u_int16_t hh) +vtoc_set_cchh (cchh_t *addr, u_int32_t cc, u_int16_t hh) { PDEBUG - addr->cc = cc; - addr->hh = hh; + addr->cc = (u_int16_t) cc; + addr->hh = cc >> 16; + addr->hh <<= 4; + addr->hh |= hh; +} + +u_int32_t +vtoc_get_cyl_from_cchh (cchh_t *addr) +{ + u_int32_t cyl; + + /*decode cylinder for large volumes */ + cyl = addr->hh & 0xFFF0; + cyl <<= 12; + cyl |= addr->cc; + return cyl; +} + +u_int16_t +vtoc_get_head_from_cchh (cchh_t *addr) +{ + /* decode heads for large volumes */ + return addr->hh & 0x000F; } static void @@ -234,12 +255,63 @@ vtoc_set_ttr (ttr_t *addr, u_int16_t tt, u_int8_t r) } void -vtoc_set_cchhb (cchhb_t *addr, u_int16_t cc, u_int16_t hh, u_int8_t b) +vtoc_set_cchhb (cchhb_t *addr, u_int32_t cc, u_int16_t hh, u_int8_t b) { PDEBUG - addr->cc = cc; - addr->hh = hh; - addr->b = b; + addr->cc = (u_int16_t) cc; + addr->hh = cc >> 16; + addr->hh <<= 4; + addr->hh |= hh; + addr->b = b; +} + +u_int32_t +vtoc_get_cyl_from_cchhb(cchhb_t *addr) +{ + u_int32_t cyl; + + /* decode cylinder for large volumes */ + cyl = addr->hh & 0xFFF0; + cyl <<= 12; + cyl |= addr->cc; + return cyl; +} + +u_int16_t +vtoc_get_head_from_cchhb(cchhb_t *addr) +{ + /* decode heads for large volumes */ + return addr->hh & 0x000F; +} + +/* + * some functions to convert cyl-cyl-head-head addresses to + * block or track numbers + * Note: Record zero is special, so first block on a track is + * in record 1! + */ +u_int64_t +cchhb2blk (cchhb_t *p, struct fdasd_hd_geometry *geo) +{ + return (u_int64_t) vtoc_get_cyl_from_cchhb(p) * + geo->heads * geo->sectors + + vtoc_get_head_from_cchhb(p) * geo->sectors + + p->b; +} + +u_int64_t +cchh2blk (cchh_t *p, struct fdasd_hd_geometry *geo) +{ + return (u_int64_t) vtoc_get_cyl_from_cchh(p) * + geo->heads * geo->sectors + + vtoc_get_head_from_cchh(p) * geo->sectors; +} + +u_int32_t +cchh2trk (cchh_t *p, struct fdasd_hd_geometry *geo) +{ + return vtoc_get_cyl_from_cchh(p) * geo->heads + + vtoc_get_head_from_cchh(p); } void @@ -506,7 +578,8 @@ vtoc_write_label (int f, unsigned long position, format1_label_t const *f1, format4_label_t const *f4, format5_label_t const *f5, - format7_label_t const *f7) + format7_label_t const *f7, + format9_label_t const *f9) { PDEBUG int t; @@ -542,6 +615,17 @@ vtoc_write_label (int f, unsigned long position, vtoc_error(unable_to_write, "vtoc_write_label", _("Could not write VTOC FMT7 DSCB.")); } + + if (f9 != NULL) + { + t = sizeof(format9_label_t); + if (write(f, f9, t) != t) + { + close(f); + vtoc_error(unable_to_write, "vtoc_write_label", + _("Could not write VTOC FMT9 DSCB.")); + } + } } /* @@ -549,7 +633,8 @@ vtoc_write_label (int f, unsigned long position, */ void vtoc_init_format4_label (format4_label_t *f4, unsigned int usable_partitions, - unsigned int cylinders, unsigned int tracks, + unsigned int compat_cylinders, + unsigned int real_cylinders, unsigned int tracks, unsigned int blocks, unsigned int blksize, u_int16_t dev_type) { @@ -574,7 +659,7 @@ vtoc_init_format4_label (format4_label_t *f4, unsigned int usable_partitions, f4->DS4DEVAC = 0x00; /* -- begin f4->DS4DEVCT -- */ - f4->DS4DEVCT.DS4DSCYL = cylinders; + f4->DS4DEVCT.DS4DSCYL = compat_cylinders; f4->DS4DEVCT.DS4DSTRK = tracks; switch (dev_type) { @@ -613,7 +698,11 @@ vtoc_init_format4_label (format4_label_t *f4, unsigned int usable_partitions, bzero(f4->res2, sizeof(f4->res2)); f4->DS4EFLVL = 0x00; bzero(&f4->DS4EFPTR, sizeof(f4->DS4EFPTR)); - bzero(f4->res3, sizeof(f4->res3)); + bzero(&f4->res3, sizeof(f4->res3)); + f4->DS4DCYL = real_cylinders; + bzero(f4->res4, sizeof(f4->res4)); + f4->DS4DEVF2 = 0x40; /* allow format 8 and 9 labels */ + bzero(&f4->res5, sizeof(f4->res5)); } /* @@ -647,11 +736,12 @@ vtoc_init_format7_label (format7_label_t *f7) } /* - * initializes a format1 label + * helper function that initializes a most parts of a + * format1 or format 8 label, all but the field DS1FMTID */ void -vtoc_init_format1_label (char *volid, unsigned int blksize, - extent_t *part_extent, format1_label_t *f1) +vtoc_init_format_1_8_label (char *volid, unsigned int blksize, + extent_t *part_extent, format1_label_t *f1) { PDEBUG struct tm * creatime; @@ -666,7 +756,6 @@ vtoc_init_format1_label (char *volid, unsigned int blksize, sprintf(str, "PART .NEW "); vtoc_ebcdic_enc(str, str, 44); strncpy(f1->DS1DSNAM, str, 44); - f1->DS1FMTID = 0xf1; strncpy(f1->DS1DSSN, " ", 6); f1->DS1VOLSQ = 0x0001; @@ -704,6 +793,37 @@ vtoc_init_format1_label (char *volid, unsigned int blksize, vtoc_set_cchhb(&f1->DS1PTRDS, 0x0000, 0x0000, 0x00); } +void +vtoc_init_format1_label (char *volid, unsigned int blksize, + extent_t *part_extent, format1_label_t *f1) +{ + vtoc_init_format_1_8_label(volid, blksize, part_extent, f1); + f1->DS1FMTID = 0xf1; +} + +void +vtoc_init_format8_label (char *volid, unsigned int blksize, + extent_t *part_extent, format1_label_t *f8) +{ + vtoc_init_format_1_8_label(volid, blksize, part_extent, f8); + f8->DS1FMTID = 0xf8; +} + +void +vtoc_update_format8_label (cchhb_t *associated_f9, format1_label_t *f8) +{ + memcpy(&f8->DS1PTRDS, associated_f9, sizeof(*associated_f9)); +} + +void +vtoc_init_format9_label (format9_label_t *f9) +{ + f9->DS9KEYID = 0x09; + f9->DS9SUBTY = 0x01; + f9->DS9NUMF9 = 1; + f9->DS9FMTID = 0xf9; +} + /* * do some updates to the VTOC format4 label */ @@ -1060,7 +1180,7 @@ vtoc_update_format7_label_add (format7_label_t *f7, int verbose, if ((ext->a + ext->b) == 0x00000000) continue; - if ((ext->b + 1) == tmp->a) { + if (ext->b == tmp->a) { /* this extent precedes the new one */ ext->b = tmp->b; bzero(tmp, sizeof(ds7ext_t)); @@ -1074,7 +1194,7 @@ vtoc_update_format7_label_add (format7_label_t *f7, int verbose, continue; } - if (ext->a == (tmp->b + 1)) { + if (ext->a == tmp->b) { /* this extent succeeds the new one */ ext->a = tmp->a; bzero(tmp, sizeof(ds7ext_t)); @@ -1119,7 +1239,7 @@ vtoc_update_format7_label_del (format7_label_t *f7, int verbose, if ((a == ext->a) && (b < ext->b)) { /* left-bounded in free space gap */ - ext->a = b + 1; + ext->a = b; if (verbose) puts ("FMT7 add extent: left-bounded"); @@ -1130,7 +1250,7 @@ vtoc_update_format7_label_del (format7_label_t *f7, int verbose, if ((a > ext->a) && (b == ext->b)) { /* right-bounded in free space gap */ - ext->b = a - 1; + ext->b = a; if (verbose) puts ("FMT7 add extent: right-bounded"); @@ -1141,8 +1261,8 @@ vtoc_update_format7_label_del (format7_label_t *f7, int verbose, if ((a > ext->a) && (b < ext->b)) { /* partition devides free space into 2 pieces */ - vtoc_update_format7_label_add(f7, verbose, b+1, ext->b); - ext->b = a - 1; + vtoc_update_format7_label_add(f7, verbose, b, ext->b); + ext->b = a; if (verbose) puts ("FMT7 add extent: 2 pieces"); @@ -1172,14 +1292,19 @@ vtoc_update_format7_label_del (format7_label_t *f7, int verbose, void vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5, format7_label_t *f7, char ch, int verbose, - u_int32_t start, u_int32_t stop, int cyl, int trk) + u_int32_t start, u_int32_t stop, u_int32_t cyl, + u_int32_t trk) { PDEBUG if ((cyl * trk) > BIG_DISK_SIZE) { if (ch == '+') - vtoc_update_format7_label_add(f7, verbose, start, stop); + vtoc_update_format7_label_add(f7, verbose, start, + /* ds7ext RTA + 1 */ + stop + 1); else if (ch == '-') - vtoc_update_format7_label_del(f7, verbose, start, stop); + vtoc_update_format7_label_del(f7, verbose, start, + /* ds7ext RTA + 1 */ + stop + 1); else puts ("BUG: syntax error in vtoc_set_freespace call"); -- 1.8.3.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:46:42 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:46:42 +0000 Received: from localhost ([127.0.0.1]:56613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJrJC-0005F0-4J for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:46:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57702) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJrJ9-0005Ej-Fg for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:46:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJrIy-0004xn-Vu for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:46:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJrIy-0004xj-TE for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:46:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJrIt-0001hh-Vz for bug-parted@gnu.org; Wed, 11 Sep 2013 16:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJrIp-0004wU-4N for bug-parted@gnu.org; Wed, 11 Sep 2013 16:46:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJrIo-0004wF-SF for bug-parted@gnu.org; Wed, 11 Sep 2013 16:46:19 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8BKkGrp021208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 11 Sep 2013 16:46:16 -0400 Received: from lister.brianlane.com (ovpn-113-155.phx2.redhat.com [10.3.113.155]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8BKkEgI009161 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 11 Sep 2013 16:46:15 -0400 Date: Wed, 11 Sep 2013 13:46:14 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches Message-ID: <20130911204614.GT1931@lister.brianlane.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H6tyVQTLTcEE6OpN" Content-Disposition: inline In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --H6tyVQTLTcEE6OpN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Uhh, what the heck is up with the To: line and the subject lines? I sent th= ese to the list address (bug-parted@gnu.org) -=20 Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8= PDT) --H6tyVQTLTcEE6OpN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEVAwUBUjDWlhF+jBaO/jp/AQIbYgf+PU9kudguxgJd00x7HYJvpAwHOSER/Psk kllvd6s3up3Ljyc7jxtBMqh0qPevpKGdylP8iLc04HgmYya/xlsJOvI83vNzV4Yb LOrZGrplBjhJlV1rhVesiTsVYe1zj8eKFTKJEjoZomRe80UyLaMNCKUeCL5uSZa/ 7L5LMLfyV6Tb/4B0K23OrJ0gIKiswMidJz2M7lzyAGReZp32qSyNFmkdGLYSlX5G LnNifoSbXwIQif9TrUdTUxwptfb8BHF7WCt0g7j8M4J3T1l1WEzbJomRjWXZ/xhK Bw40ec4eaGFB4lCndC16cOqiZxk+8itNxVEGMfgquLfDWQnqGWCLcw== =2Boa -----END PGP SIGNATURE----- --H6tyVQTLTcEE6OpN-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 23:16:41 2013 Received: (at 15356) by debbugs.gnu.org; 12 Sep 2013 03:16:41 +0000 Received: from localhost ([127.0.0.1]:57379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJxOb-0006q5-EI for submit@debbugs.gnu.org; Wed, 11 Sep 2013 23:16:41 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:64152) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJxOZ-0006pr-RR for 15356@debbugs.gnu.org; Wed, 11 Sep 2013 23:16:40 -0400 X-Authority-Analysis: v=2.0 cv=PogRnnw3 c=1 sm=0 a=3SewDSjaRW4vdJyuxQ33ZQ==:17 a=DeBnktw0k-IA:10 a=HewVDi6x77QA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=pOz21gae_WwA:10 a=mDV3o1hIAAAA:8 a=QfKxxUxMAAAA:8 a=72cI4pqjkW6YoIr7Vt0A:9 a=wPNLvfGTeEIA:10 a=ii61gXl28gQA:10 a=3SewDSjaRW4vdJyuxQ33ZQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 72.238.73.171 Received: from [72.238.73.171] ([72.238.73.171:34161] helo=[192.168.1.6]) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 59/4C-02184-21231325; Thu, 12 Sep 2013 03:16:34 +0000 Message-ID: <52313212.20401@ubuntu.com> Date: Wed, 11 Sep 2013 23:16:34 -0400 From: Phillip Susi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: "Brian C. Lane" Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <20130911204614.GT1931@lister.brianlane.com> In-Reply-To: <20130911204614.GT1931@lister.brianlane.com> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 Cc: 15356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 It looks like somehow the mailing list got tangled in with the debbugs system and all messages to the list are automatically converted into a bug report. I've been in contact with the sysadmins about it. On 09/11/2013 04:46 PM, Brian C. Lane wrote: > Uhh, what the heck is up with the To: line and the subject lines? I > sent these to the list address (bug-parted@gnu.org) > > - Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port > Orchard, WA (PST8PDT) > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSMTISAAoJEJrBOlT6nu75B7AIALBeZykoPMZ8e+20/Yhclt3h W2ktbLPWu0bzesqfe8oWFNRaSwZZVq5EFg9hud+7b+ocp7G7QKpNAuq97grQgtqW CgYwmiGQmiYRl5I19sc1iwt0oGEvMrkdRsmORcOolgiAgG58Atr2ikVqalPFfLCm ngPk6LBR+cR21299OdPhdJNMpJrfor125B+akJh6LE9gQpBVdwQkNq6EPuAxVTIS a9x6CRZHryLwee7pTtvJ0FFfD176jgatj4sth/yA5sQNT4JoocP2gaXROLxVo7yQ 0dMEwbFA1x0MAny0T3kdZ2frWTWuHhSvXZnOOCZzl3tJIxugO2ItgP/QEYYwlGA= =jTx4 -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 12 17:42:57 2013 Received: (at 15356) by debbugs.gnu.org; 12 Sep 2013 21:42:57 +0000 Received: from localhost ([127.0.0.1]:59864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKEfA-0005nF-Jl for submit@debbugs.gnu.org; Thu, 12 Sep 2013 17:42:56 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:55141) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKEf8-0005mt-4r for 15356@debbugs.gnu.org; Thu, 12 Sep 2013 17:42:54 -0400 Received: by mail-pa0-f52.google.com with SMTP id kq13so1648470pab.25 for <15356@debbugs.gnu.org>; Thu, 12 Sep 2013 14:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AjCiQGZt4tYx/zaaoEebvPVhjxWIdK7yUiQo2VpzvlQ=; b=IjnLy1/WL2dSWcJeRB6V2FwCjaVN3F9rYIdLxboIa8uWFtYHet5RLY04cNEJQ/vs6n FTz7dlGk4SGSJnIcZNdLIlbcvcVahYVWK6Yb9IEUJwPnqYmU7j96999UucLvWpKpTChE tXwUDoWVnratoWlKbaGXJRPxvBoUejtjGFNee2Hj1Q6UcJmAebpQhoYhYvaSLM0heXOB dM4VuF1aYP8ZpqOhvLVIZxpqDIIMgLlGlY11boMOoru1rUEJpEdwRvIn0kFSiTDuHSo5 RSMWMk6+ER2ma8TPUUsw7a355ReaV/1OAgJYT+L3YUhqW8k84NmqDJCf219/un5iL41k 5dlA== X-Received: by 10.66.168.7 with SMTP id zs7mr11866433pab.152.1379022168089; Thu, 12 Sep 2013 14:42:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.6.164 with HTTP; Thu, 12 Sep 2013 14:42:28 -0700 (PDT) In-Reply-To: <20130911204614.GT1931@lister.brianlane.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <20130911204614.GT1931@lister.brianlane.com> From: Jim Meyering Date: Thu, 12 Sep 2013 14:42:28 -0700 X-Google-Sender-Auth: RNhNolmrzziBaGvk8jWR8vZ2MSU Message-ID: Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches To: "Brian C. Lane" Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15356 Cc: 15356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Sep 11, 2013 at 1:46 PM, Brian C. Lane wrote: > Uhh, what the heck is up with the To: line and the subject lines? I sent these to the list > address (bug-parted@gnu.org) Hi Brian, Sorry I didn't announce it, but I've requested that this list (like coreutils, emacs -- and now grep, gzip, diffutils, etc.) be hooked up to the debbugs bug-tracking system. I should have asked or at least given a heads-up here, but have been distracted with things like piano-through-window moving details. Nothing broke :) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 14:18:14 2013 Received: (at submit) by debbugs.gnu.org; 13 Sep 2013 18:18:14 +0000 Received: from localhost ([127.0.0.1]:34364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKXwb-0007kN-R8 for submit@debbugs.gnu.org; Fri, 13 Sep 2013 14:18:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39642) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKXwZ-0007k9-Be for submit@debbugs.gnu.org; Fri, 13 Sep 2013 14:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKXwN-0006Cn-3R for submit@debbugs.gnu.org; Fri, 13 Sep 2013 14:18:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKXwM-0006Cc-WD for submit@debbugs.gnu.org; Fri, 13 Sep 2013 14:17:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKXwG-0002jX-W5 for bug-parted@gnu.org; Fri, 13 Sep 2013 14:17:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKXwA-00065M-PC for bug-parted@gnu.org; Fri, 13 Sep 2013 14:17:52 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:51983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKXwA-00064M-L7 for bug-parted@gnu.org; Fri, 13 Sep 2013 14:17:46 -0400 X-Authority-Analysis: v=2.0 cv=YJQdOG6x c=1 sm=0 a=/DbS/tiKggfTkRRHPZEB4g==:17 a=Qsx_du5GiBkA:10 a=sCfsyOEanakA:10 a=S1A5HrydsesA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=Yw5mYAB0I9oA:10 a=QfKxxUxMAAAA:8 a=eSpCuRBrf4gQ-z53CZkA:9 a=wPNLvfGTeEIA:10 a=MG8ekCHh_I4A:10 a=/DbS/tiKggfTkRRHPZEB4g==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 67.78.168.186 Received: from [67.78.168.186] ([67.78.168.186:64490] helo=[10.1.1.236]) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id A6/2A-00757-AC653325; Fri, 13 Sep 2013 18:17:46 +0000 Message-ID: <523356C9.1020105@ubuntu.com> Date: Fri, 13 Sep 2013 14:17:45 -0400 From: Phillip Susi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "bug-parted@gnu.org" Subject: Re: cross post test References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <20130911204614.GT1931@lister.brianlane.com> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is a test to see how badly the list header munging breaks cross posting. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSM1bJAAoJEJrBOlT6nu75lycIALhiYMN+K9ZGwOzzJpIAS3Dd 7ppW2oePEZN8Dfsmze9j1bBsaBrKEpwnaXnki+3MNBULJTE8qs1x8Wdcf7h1nfbv rmgLXuLA14ybp7IlzDmBjzDUzAQfiFbN/c5RvNMS/PYBKs6eXKfJ/OGM8CXjoVjq h6mhrF/l766UpEOP+Z0+XclshIsp2yeZKe1J7HaO1miOsOM7kcFuTrsf4p9GDnUD 1H57lIlqkc9DKXBCDoBJuK7NrvjMZ/JYN3slwB0ZvgCKCnyGV1CLz+GsfC1qzHei +fxkmKu/P482XsrmdQOYDtXclBOC6q7X7lz4MiPvPR15KisrfJ1EE8GzYQnvVnA= =1/RZ -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 23 17:28:04 2013 Received: (at submit) by debbugs.gnu.org; 23 Sep 2013 21:28:04 +0000 Received: from localhost ([127.0.0.1]:59043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VODfo-0007pQ-A5 for submit@debbugs.gnu.org; Mon, 23 Sep 2013 17:28:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43892) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VODfk-0007ot-Ji for submit@debbugs.gnu.org; Mon, 23 Sep 2013 17:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VODfW-0006gI-V1 for submit@debbugs.gnu.org; Mon, 23 Sep 2013 17:27:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VODfW-0006gE-S1 for submit@debbugs.gnu.org; Mon, 23 Sep 2013 17:27:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VODfQ-0005pE-Sd for bug-parted@gnu.org; Mon, 23 Sep 2013 17:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VODfK-0006fK-RD for bug-parted@gnu.org; Mon, 23 Sep 2013 17:27:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VODfK-0006fE-K7 for bug-parted@gnu.org; Mon, 23 Sep 2013 17:27:34 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8NLRXY7025997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Sep 2013 17:27:33 -0400 Received: from lister.brianlane.com (ovpn-113-155.phx2.redhat.com [10.3.113.155]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8NLRVKe031547 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 23 Sep 2013 17:27:33 -0400 Date: Mon, 23 Sep 2013 14:27:31 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: Re: bug#15356: [PATCH 15/19] libparted: Add hfs_esp partition flag to GPT. Message-ID: <20130923212731.GP1931@lister.brianlane.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <1378927509-15215-16-git-send-email-bcl@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GCWBOFkugzEtwVYF" Content-Disposition: inline In-Reply-To: <1378927509-15215-16-git-send-email-bcl@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --GCWBOFkugzEtwVYF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 11, 2013 at 12:25:05PM -0700, Brian C. Lane wrote: > From: "Brian C. Lane" >=20 > Mac uses a HFS+ formatted partition for ESP. When dual booting with > Linux we need a way to differentiate between the Mac partition and the > one created by Linux which contains just enough stuff to fake OSX into > displaying a nice logo and allowing it to be selected for boot. I > generated a GUID (47CB5633-7E3E-408B-B7B8-2D915B7B21B1) and added a new > flag to control it. Ends up this doesn't work -- Apple firmware ignores the GUID and won't boot, so I'll be dropping this patch. --=20 Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8= PDT) --GCWBOFkugzEtwVYF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEVAwUBUkCyQxF+jBaO/jp/AQIsUgf/ZzPcrTwI0Y1ivSquPlEZ1pe3qfOiehyk TjsDzS7LolrlMQGUiIAjcimV9E37XP4gKzr35vguub0/ZZTpnR7wmXLea1j5iCJE BdXfV7II2dy1OnwaEb7O8dWYkm+5Ml0LdF8H860xHv5gRAh8bQO5FJ3GdOIcEhPV 5nUxV/5MX5mSB4cyqxXGBq8A7Af8b6MWRAj9t+RqCj0UmcEVC4h4thehQv5OqfFR EAvWtK4trICRE6DQi6ziOgraTdS06RafAhIW5wow1JEBjRsZyIxmiGFWAEsE2dqD ZAD0Epe2WIuqKb/D6rh4D/jkqpG9j0Gly6v5Y1kE/0cG0BJb4iTJcg== =PC6T -----END PGP SIGNATURE----- --GCWBOFkugzEtwVYF-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 21:05:57 2013 Received: (at 15356) by debbugs.gnu.org; 29 Sep 2013 01:05:57 +0000 Received: from localhost ([127.0.0.1]:44014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQ5SP-0003c2-Af for submit@debbugs.gnu.org; Sat, 28 Sep 2013 21:05:57 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:46803) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQ5SL-0003bq-GY for 15356@debbugs.gnu.org; Sat, 28 Sep 2013 21:05:53 -0400 X-Authority-Analysis: v=2.0 cv=aItyWMBm c=1 sm=0 a=3SewDSjaRW4vdJyuxQ33ZQ==:17 a=DeBnktw0k-IA:10 a=3KVzincvWKMA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=pOz21gae_WwA:10 a=QfKxxUxMAAAA:8 a=BktxDmqp5u5OVxs8S0QA:9 a=wPNLvfGTeEIA:10 a=3SewDSjaRW4vdJyuxQ33ZQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 72.238.73.171 Received: from [72.238.73.171] ([72.238.73.171:35658] helo=[192.168.1.6]) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 9D/FC-06587-0FC77425; Sun, 29 Sep 2013 01:05:52 +0000 Message-ID: <52477CF0.7040907@ubuntu.com> Date: Sat, 28 Sep 2013 21:05:52 -0400 From: Phillip Susi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "Brian C. Lane" , 15356@debbugs.gnu.org Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 I see what you meant now about the comment style: *file1: add feature x *file2: same *file3: test feature x *file4: document feature x I don't think these kind of comments adds anything of value so I'd prefer to avoid it. A few of the patches you posted also could use NEWS entries. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSR3zsAAoJEJrBOlT6nu75kcwH/1tqFrwJ3gY64bUSuLOobkiR 4ySQJ4jseSKlZVE4vI0qLP5powypA2fGagX6KejhZjkn+YhbveDS/nteyD/kjJzL MYxGj9Rlq84NuifnEwUNrE5XnCZcG12tYWyaj9ipnxbN8g88lZd11i4IMjJsiHR3 XFGJwvA53SYRkkM23Ld2X4JxbxdJbiJOh5UpfQ9YrepxKatFcVb6i+pxQaqn551r XHi27tel9MgHRm4yIZetQzb0TD+DjxAUuUckIFP1NDGHcXr2bWajJmSuAVkpEKfT 3Nih14GqABaKnAdzWM8IjUtZ33lKXTQUQleJyMiQb4zW/2JWRGvji3h4CgPtbb0= =CVzY -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 11:59:51 2013 Received: (at 15356) by debbugs.gnu.org; 29 Sep 2013 15:59:51 +0000 Received: from localhost ([127.0.0.1]:44964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQJPS-0001lA-EM for submit@debbugs.gnu.org; Sun, 29 Sep 2013 11:59:50 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:39792) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQJPP-0001l0-On for 15356@debbugs.gnu.org; Sun, 29 Sep 2013 11:59:48 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp2so4558614pbb.14 for <15356@debbugs.gnu.org>; Sun, 29 Sep 2013 08:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=4DtZPXxga5ehs5eQ6BlFTxLE87a0Ta9aWlrBMaaisZI=; b=ZtBfuPrasI3SJD94T9eFjfdIKHDNCD30RHuIVx1YTrrsY8580JbnRppzz7ro+eCbYA wZbv5k5aWdnXURs3mB/GnuG37WNYFo0fT9Tdne/C4DsIWw7fp90ro3g2wshuwCY2il1I l4IhCAvVFyIiNlCHUf+SftfOgEFKEYgiCxTrHW6ubtWTKYdacqslcmgaijnyo7FCe6FL VUSIiIlqMYfOE70wq3C80pWzVqpTNx6vnmVOx6J7ZRfcxN6kqy3dBhDnqHIbk+3C24aG CChjWVEGR05lsyKgkSmCHnIVPNQ/u/BnPuz43Jl32cruLYc8TFrbwM8pFJFMZRR62f52 IK3w== X-Received: by 10.68.196.227 with SMTP id ip3mr2017939pbc.163.1380470386589; Sun, 29 Sep 2013 08:59:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.6.66 with HTTP; Sun, 29 Sep 2013 08:59:26 -0700 (PDT) In-Reply-To: <52477CF0.7040907@ubuntu.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <52477CF0.7040907@ubuntu.com> From: Jim Meyering Date: Sun, 29 Sep 2013 08:59:26 -0700 X-Google-Sender-Auth: 4gfgFP2ESoY3uY4nVZ8QTwSbSSg Message-ID: Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches To: Phillip Susi Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15356 Cc: "Brian C. Lane" , 15356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, Sep 28, 2013 at 6:05 PM, Phillip Susi wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > I see what you meant now about the comment style: > > *file1: add feature x > *file2: same > *file3: test feature x > *file4: document feature x > > I don't think these kind of comments adds anything of value so I'd > prefer to avoid it. A few of the patches you posted also could use > NEWS entries. Hi Phillip, I have found that the discipline imposed by having to write up that style of ChangeLog entry tends to help me spot my own errors (as I write it), and also makes it easier to review changes written by others -- when they adopt that style. Of course, it works only if you provide the sort of detail that is useful. If you merely say "as above", referring to the high-level what-this-does description, it provides almost no value. However, the intent is to provide additional, typically lower-level detail. Sometimes, it feels stilted, because you've already given that detail in the top-level description, but when the implementation details are not 100% obvious, and especially when you're changing types, adding or removing global variables, parameters, etc. there are plenty of ways to make a commit message better by saying more. Given a well-written ChangeLog, it is often possible to use it as a spec and produce an identical patch. This ostensible duplication is what makes it so useful (and hard to write if you're not used to it) for catching differences between the detailed, expressed intent of the patch-writer, and the actual patch. Sure, it is an added cost, but in the write-once-read-many coding world, it is a worthwhile investment. Your patches will be read by far more than one or two people, so optimizing for the reader makes sense. Jim From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 21:02:15 2013 Received: (at 15356) by debbugs.gnu.org; 30 Sep 2013 01:02:15 +0000 Received: from localhost ([127.0.0.1]:45292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQRsM-0008Eh-Tl for submit@debbugs.gnu.org; Sun, 29 Sep 2013 21:02:15 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:45124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQRsK-0008EX-EB for 15356@debbugs.gnu.org; Sun, 29 Sep 2013 21:02:12 -0400 X-Authority-Analysis: v=2.0 cv=bJWU0YCZ c=1 sm=0 a=3SewDSjaRW4vdJyuxQ33ZQ==:17 a=DeBnktw0k-IA:10 a=3KVzincvWKMA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=pOz21gae_WwA:10 a=QfKxxUxMAAAA:8 a=DfKbTA2TtG3hCGsEMVcA:9 a=wPNLvfGTeEIA:10 a=3SewDSjaRW4vdJyuxQ33ZQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 72.238.73.171 Received: from [72.238.73.171] ([72.238.73.171:39642] helo=[192.168.1.6]) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 82/9D-01465-39DC8425; Mon, 30 Sep 2013 01:02:11 +0000 Message-ID: <5248CD93.6020009@ubuntu.com> Date: Sun, 29 Sep 2013 21:02:11 -0400 From: Phillip Susi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <52477CF0.7040907@ubuntu.com> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 Cc: 15356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 I find that most comments that get added this way end up being of the useless restating the obvious variety. In the event that some code isn't obvious from the general description, either the description needs a little more fleshing out, or the code in question deserves a good comment in the code instead of a one liner in the commit message. On 09/29/2013 11:59 AM, Jim Meyering wrote: > I have found that the discipline imposed by having to write up > that style of ChangeLog entry tends to help me spot my own errors > (as I write it), and also makes it easier to review changes written > by others -- when they adopt that style. Of course, it works only > if you provide the sort of detail that is useful. If you merely > say "as above", referring to the high-level what-this-does > description, it provides almost no value. However, the intent is > to provide additional, typically lower-level detail. Sometimes, it > feels stilted, because you've already given that detail in the > top-level description, but when the implementation details are not > 100% obvious, and especially when you're changing types, adding or > removing global variables, parameters, etc. there are plenty of > ways to make a commit message better by saying more. Given a > well-written ChangeLog, it is often possible to use it as a spec > and produce an identical patch. This ostensible duplication is what > makes it so useful (and hard to write if you're not used to it) for > catching differences between the detailed, expressed intent of the > patch-writer, and the actual patch. > > Sure, it is an added cost, but in the write-once-read-many coding > world, it is a worthwhile investment. Your patches will be read > by far more than one or two people, so optimizing for the reader > makes sense. > > Jim > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSSM2TAAoJEJrBOlT6nu75r7sH/2930x5RmfPx1kAd5//NK7Hk TbeDEaE6O9uBTWrGmVmN9ysw9/cfwRgOz3HbZnjt+zRLkS4NsS8vZi+IUb7fvPRd Uh6KAO+v4XWW8A3Uau/kKL57hd1qo/BsRp813r9fAO219o5hxFpSpw3ITowKgNEH th+xGo7dK5PxULQigmfKn48LuRBu5+ATjPYg2q3R1/3qSAqE8DeAmxjhgjqlJbuB YkYgNrX264O5DH9iaOrxVBacfDuG8O/m0IHXKzWpSuFT4guEr/7WVhI8VLOyKJwq Vvk1I6yPABSdLA234En9mzI4G6XF8/KRrRnp3fYr6sDPotKXumeU8YzjyxPDhUc= =d/w2 -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 01 10:22:19 2013 Received: (at 15356) by debbugs.gnu.org; 1 Oct 2013 14:22:19 +0000 Received: from localhost ([127.0.0.1]:47439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VR0qA-0004EW-PI for submit@debbugs.gnu.org; Tue, 01 Oct 2013 10:22:19 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:32930) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VR0q8-0004EN-Ir for 15356@debbugs.gnu.org; Tue, 01 Oct 2013 10:22:17 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so7356851pdj.1 for <15356@debbugs.gnu.org>; Tue, 01 Oct 2013 07:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=0tx8X5ch/7LkTfv+9qpdy02WxG0XgHKX0KX/Dfsul2w=; b=0pQAxr/DSl/f0UcIY2Q+N5hDA/D1C8yrmMfNZ2SiGKh8LDsk48JhWDeceqQj/SgFHb fn9ac3fCe2GJbYq6DvvK9Tac19QZIa25hmAhAa6e9sEekBiv5JhveUVuW3F7typ0z41T sqlJdamvk6SBimhpMMQbbQgUkePtpcGIM1OsXLRnXeJv0sZ+5oaAbs53SCyjqnFjr8SG V/2FKuxWv/ciTkWVipHeaCl4w8UT2Mijv0l2XDfQt5URUJdlYoggL+UCQWcaR3qFIrAf AkbXiaRfkXF+pBZ1AP7Nzpwc4EfS0B+vdHZvj7Lp7EbXu3tMK5SbjDXm9crMqazyeQBK 5UsA== X-Received: by 10.68.180.34 with SMTP id dl2mr29267522pbc.6.1380637335702; Tue, 01 Oct 2013 07:22:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.6.66 with HTTP; Tue, 1 Oct 2013 07:21:55 -0700 (PDT) In-Reply-To: <5248CD93.6020009@ubuntu.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <52477CF0.7040907@ubuntu.com> <5248CD93.6020009@ubuntu.com> From: Jim Meyering Date: Tue, 1 Oct 2013 07:21:55 -0700 X-Google-Sender-Auth: hclwr_Zy07WEm_ApEAM5T-mxrzg Message-ID: Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches To: Phillip Susi Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 Cc: 15356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sun, Sep 29, 2013 at 6:02 PM, Phillip Susi wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > I find that most comments that get added this way end up being of the > useless restating the obvious variety. In the event that some code > isn't obvious from the general description, either the description > needs a little more fleshing out, or the code in question deserves a > good comment in the code instead of a one liner in the commit message. I agree 100% with the detailed-log->comment sentiment. Since I often write the ChangeLog last, since it forces me to reexamine my patch chunk by chunk and to organize the description well enough to present it, that tends to catch little things that I might otherwise overlook. Bottom line: please try to include enough information (the "why" motivation and/or a test case is easy to forget) to help someone less familiar than you with the code to decide whether to revert your change -- and the consequences -- in the event that someday we find reason to consider that. The consequences part often ends up in the NEWS entry, so people get an idea of which bugs have been fixed per release, along with enough description e.g., to match symptoms. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 11:06:05 2013 Received: (at 15356) by debbugs.gnu.org; 21 Nov 2013 16:06:05 +0000 Received: from localhost ([127.0.0.1]:36892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjWlX-0006H9-PP for submit@debbugs.gnu.org; Thu, 21 Nov 2013 11:06:05 -0500 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:49538) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjWlU-0006Gd-SX for 15356@debbugs.gnu.org; Thu, 21 Nov 2013 11:06:01 -0500 X-Authority-Analysis: v=2.0 cv=LKjkseq9 c=1 sm=0 a=/DbS/tiKggfTkRRHPZEB4g==:17 a=Qsx_du5GiBkA:10 a=h_Sp9wbh10QA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=pOz21gae_WwA:10 a=QfKxxUxMAAAA:8 a=doupyKFmAAAA:8 a=A4JKvoQ8RmPV6nHXpksA:9 a=wPNLvfGTeEIA:10 a=0vUscowIxtUA:10 a=/DbS/tiKggfTkRRHPZEB4g==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 67.78.168.186 Received: from [67.78.168.186] ([67.78.168.186:56307] helo=[10.1.1.236]) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 9D/3B-09301-36F2E825; Thu, 21 Nov 2013 16:05:55 +0000 Message-ID: <528E2F62.2070609@ubuntu.com> Date: Thu, 21 Nov 2013 11:05:54 -0500 From: Phillip Susi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: "Brian C. Lane" , 15356@debbugs.gnu.org Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Brian, I was just wondering if you might coordinate with Nageswara R Sastry and get the DASD patches ironed out so this series can be pushed soon. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSji9iAAoJEJrBOlT6nu75OV4H/iGLKCM3ojhqDLDvDGneZtde zpkKsdUcqVsu5MMlil79kk5g/FjgzMTw1+t7OgrSmrsQezYPRsKw6lJ9d728tZqo qHQYGzBaTywUmuyo/1J24PZ8gZD0tlSOVCSYSEcqNBw+/bboRnciEtrCR/co/o5O aUO61FHY1kS+mT+5/ildkkHAHQlWiImBvWZ6QZRGu1fDnIdh8L46f0rYE474aiBw i8m3AB1LawdccKfKbudg1mu9H1QP8FrEeR9f42cf0GBiK1WOH46RrYf5A+Be+lF0 2FpbTdcByL7DtAxLomHKa4NwZVrmiRp/0s4U03carNT40SEUmZbNFk3oRw4Eplo= =Z2SF -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 19:46:13 2013 Received: (at submit) by debbugs.gnu.org; 25 Nov 2013 00:46:13 +0000 Received: from localhost ([127.0.0.1]:43020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VkkJZ-0000GO-6d for submit@debbugs.gnu.org; Sun, 24 Nov 2013 19:46:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37531) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vkfft-0001RK-Gl for submit@debbugs.gnu.org; Sun, 24 Nov 2013 14:48:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkffn-0001Os-5a for submit@debbugs.gnu.org; Sun, 24 Nov 2013 14:48:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkffn-0001Oo-1u for submit@debbugs.gnu.org; Sun, 24 Nov 2013 14:48:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkffm-0004ns-10 for bug-parted@gnu.org; Sun, 24 Nov 2013 14:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkffk-0001Lu-Vt for bug-parted@gnu.org; Sun, 24 Nov 2013 14:48:49 -0500 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:59850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkffk-0001Hr-M8 for bug-parted@gnu.org; Sun, 24 Nov 2013 14:48:48 -0500 Received: by mail-pb0-f52.google.com with SMTP id uo5so4287933pbc.11 for ; Sun, 24 Nov 2013 11:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=C1C0MsHFiLJV50QPTJ5boQdaQlN1ry7yNev0E428uF8=; b=ZY8q3bg2P4azhtO0wc5ZjYdBZg+L1zpdSD8r2+h+AJnNvt22SwZBWvaDdImHbB3y7H HIPR48rIXX3WO71KEK3ie72k/g7+3paDNdtNxhfHUi9byJvBbia1X8dJRXAhhpFQYXrd CSqrsGXujxmYKO5WRHh53PFXmbAgYqwupsEfws35DIfZmrksIAzSY2KeotsvyHCflNlP cphh1dENapKYgpkEXeNOfDh9cDIznAv6kpfmq/9HFJpzow8Vnk+QOtcQV0xyo1mSq9UN /NMjywBuQ+IlJu5wcsW7xClvVxXygY86LN4E86ukoHafwKoGXG3sfFjXR1oh2eKMmKXs NQGA== MIME-Version: 1.0 X-Received: by 10.68.6.99 with SMTP id z3mr14338996pbz.114.1385322526222; Sun, 24 Nov 2013 11:48:46 -0800 (PST) Received: by 10.68.215.101 with HTTP; Sun, 24 Nov 2013 11:48:46 -0800 (PST) In-Reply-To: <1378927509-15215-17-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> <1378927509-15215-17-git-send-email-bcl@redhat.com> Date: Sun, 24 Nov 2013 20:48:46 +0100 Message-ID: Subject: Re: bug#15356: [PATCH 16/19] libparted: Recognize btrfs filesystem From: =?UTF-8?B?SMOla29uIEzDuHZkYWw=?= To: "Brian C. Lane" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 24 Nov 2013 19:46:09 -0500 Cc: 15356@debbugs.gnu.org, "bug-parted@gnu.org" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) On 11 September 2013 21:25, Brian C. Lane wrote: > From: "Brian C. Lane" > +static PedGeometry* > +btrfs_probe (PedGeometry* geom) > +{ ... > + if (geom->length < offset+1) > + return 0; > + if (!ped_geometry_read (geom, &buf, offset, 1)) > + return 0; Should not these be NULL rather than 0? > + > + if (PED_LE64_TO_CPU(buf.sb.magic) =3D=3D BTRFS_MAGIC) { > + return ped_geometry_new (geom->dev, geom->start, geom->l= ength); > + } > + return NULL; > +} When already providing feedback on this code, I will also ask if this test can be reversed, so that the conceptual flow is if (some_error_condition) { handle_error } normal_code e.g. "test exceptions, not the normal case" BR H=C3=A5kon L=C3=B8vdal From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 25 10:55:27 2014 Received: (at 15356) by debbugs.gnu.org; 25 Feb 2014 15:55:27 +0000 Received: from localhost ([127.0.0.1]:39551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WIKLu-0000xH-O7 for submit@debbugs.gnu.org; Tue, 25 Feb 2014 10:55:27 -0500 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:53983) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WIKLq-0000x5-5h for 15356@debbugs.gnu.org; Tue, 25 Feb 2014 10:55:22 -0500 X-Authority-Analysis: v=2.0 cv=MODiabll c=1 sm=0 a=/DbS/tiKggfTkRRHPZEB4g==:17 a=JipEcVzqA9wA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=Qsx_du5GiBkA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=pOz21gae_WwA:10 a=20KFwNOVAAAA:8 a=QfKxxUxMAAAA:8 a=NTCkw3k9-ZiaPYs5pjQA:9 a=wPNLvfGTeEIA:10 a=jEp0ucaQiEUA:10 a=/DbS/tiKggfTkRRHPZEB4g==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 67.78.168.186 Received: from [67.78.168.186] ([67.78.168.186:54384] helo=[10.1.1.236]) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id B0/3E-23887-6ECBC035; Tue, 25 Feb 2014 15:55:19 +0000 Message-ID: <530CBCE7.4020404@ubuntu.com> Date: Tue, 25 Feb 2014 10:55:19 -0500 From: Phillip Susi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "Brian C. Lane" , 15356@debbugs.gnu.org Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 9/11/2013 3:24 PM, Brian C. Lane wrote: > From: "Brian C. Lane" > > Here is the stack of patches that I'm currently carrying for the > master branch of parted in Fedora. I think patches 1-12 have been > posted before, but I recently rebased things onto parted master. > The patches adding new flags (13-16) are all new. > > Patch 4 is my take on handling the uuid of dm devices. > > Patch 18 is similar to Phillip's, except that I didn't see any > reason to sync all the partition devices since all of our access is > via offsets into the parent device so I left the kernel 2.6 check > in place. > > > Brian C. Lane (14): libparted: copy pmbr_boot when duplicating GPT > disk tests: test creating 20 device-mapper partitions (#803108) > libparted: use dm_udev_wait (#698121) There are a few instances of unneccesary whitespace changes of the form: - - if (!dm_task_run(dmt)) + if (!dm_task_run (dmt)) Do you mind if I drop those before I commit? Also could you write a NEWS entry? > libparted: preserve the uuid on dm partitions (#832145) tests: Make > sure dm UUIDs are not erased libparted: don't canonicalize /dev/md/ > paths (#872361) Could you write a NEWS entry for this? > tests: rewrite t6001 to use /dev/mapper libparted: Add Intel Rapid > Start Technology partition flag. libparted: Add UEFI System > Partition flag. libparted: Add hfs_esp partition flag to GPT. Dropped per your request. > libparted: Recognize btrfs filesystem For the two flags and btrfs changes, you added the entry in the NEWS file under the changes in behavior section. I think they should be under the new features section instead. Do you mind if I move them before I commit? > tests: Add btrfs and xfs to the fs probe test libparted: Flush > parent device on open (#962611) Holding this one for now due to reasons posted previously. My patch titled [PATCH 9/9] Revert "linux-commit: do not unnecessarily open partition device nodes" should solve this instead. > tests: Restrict gpt-header-munge to little-endian systems > > Nageswara R Sastry (5): libparted: add support for implicit FBA > DASD partitions libparted: add support for EAV DASD partitions > libparted: mklabel to support EAV DASD libparted: Avoid dasd as > default disk type while probe libparted: mklabel to support EDEV > DASD Holding these DASD patches since it sounded like they still needed some cleaning up. The rest look good and I'm ready to commit them if you are ok with those minor changes and can send some NEWS entries to add. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTDLznAAoJEI5FoCIzSKrwnv8H/2x2vEjd+cXfKk8EpaUEUf5a 1Nl+EyVDDd8WDxa03OZUZXYSv71beKldCBH9k/AR7+5cog2DmuBNsRsvbupAFlAN MgtKhdvKve8YaKH7CyG9GKDNTvS/ovhVzSLkj3Z+VEt6PhseGU9hMJXEr4rKlrfD 6YmCbC5ePKH+lZvvs8EMoztE2xgbaHgGBC8XSzMZokX750Q5Y+vmY+ldOKN+XesI vtqnfU38NzEZRRQm9t17XLuWrbTzxwnDDP37zlnMqxxPJ3jgIlIro4M+gE7y/SYs wkwgzXJ7w+SK4/uh4rLkhV4fvfTlYc/iPB1+f+nwkPlyLoLKme9Qcc+a895dncE= =dUsW -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 23:16:48 2014 Received: (at 15356-done) by debbugs.gnu.org; 3 Mar 2014 04:16:48 +0000 Received: from localhost ([127.0.0.1]:48390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WKKJ5-0000et-Pz for submit@debbugs.gnu.org; Sun, 02 Mar 2014 23:16:48 -0500 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:47037) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WKKJ3-0000el-Uy for 15356-done@debbugs.gnu.org; Sun, 02 Mar 2014 23:16:46 -0500 X-Authority-Analysis: v=2.0 cv=GMaK45xK c=1 sm=0 a=S/gQ7PeTrZbCJAhh99lbaw==:17 a=cs1xLa0W9aIA:10 a=wpvLUwOcp9sA:10 a=S1A5HrydsesA:10 a=ossw24rp0ecA:10 a=8nJEP1OIZ-IA:10 a=fxJcL_dCAAAA:8 a=KGjhK52YXX0A:10 a=QfKxxUxMAAAA:8 a=TPQ419UucgK8NkqF62gA:9 a=wPNLvfGTeEIA:10 a=S/gQ7PeTrZbCJAhh99lbaw==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 72.238.67.160 Received: from [72.238.67.160] ([72.238.67.160:60148] helo=[192.168.1.101]) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 06/48-00728-B2204135; Mon, 03 Mar 2014 04:16:44 +0000 Message-ID: <5314022D.2010109@ubuntu.com> Date: Sun, 02 Mar 2014 23:16:45 -0500 From: Phillip Susi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: 15356-done@debbugs.gnu.org Subject: Re: bug#15356: [PATCH 00/19] Fedora parted patches References: <1378927509-15215-1-git-send-email-bcl@redhat.com> In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15356-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Patches pushed, save for the dasd patches which will need resubmitted when cleaned up. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJTFAItAAoJEI5FoCIzSKrw8hUH+QH0avfvw2MPK36AUUr/SGRV xAE6pv8/USc/Daopm0YUxF7rR8cZqS0CkImotQiGf7ImKAqhpfnEO3zChqLi7L+k mqQ0HZYcCvfag6aJdSc3vuDY7mFNlAyReLs51en4JnokOB2PCDXiBSUWNorx3eAI uXrWCqB0geWHNiltU6AthGFlUrTMzF9N8Bh4TWEcFNbSjlwaig2a+oGHHBq3hXF5 Iy+xOef22bzDFABpBROpXKy/Ivv7zQi5jnMiG2gk4bh8g8mYhI8EOFDMTZqWtrQk obFhgorJk/AsmMahtJBvx7iripJIFsmkZbn+8hMh82m1rvrmqWBZMe0S/Tc/x+Q= =ae2q -----END PGP SIGNATURE----- From unknown Mon Jun 16 23:49:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 31 Mar 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator