rpms/parted/devel parted-1.8.2-vista.patch, NONE, 1.1 parted.spec, 1.93, 1.94

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Jan 19 16:47:05 UTC 2007


Author: dcantrel

Update of /cvs/dist/rpms/parted/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17530

Modified Files:
	parted.spec 
Added Files:
	parted-1.8.2-vista.patch 
Log Message:
* Thu Jan 18 2007 David Cantrell <dcantrell at redhat.com> - 1.8.2-2
- Preserve starting sector for primary NTFS 3.1 partitions (Windows
  Vista) when modifying the DOS disk label.  NTFS 3.1 partitions do
  not start on the 2nd head of the 1st cylinder at the beginning of
  the drive.


parted-1.8.2-vista.patch:
 dos.c |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

--- NEW FILE parted-1.8.2-vista.patch ---
--- parted-1.8.2/libparted/labels/dos.c.vista	2006-12-15 17:20:53.000000000 -0500
+++ parted-1.8.2/libparted/labels/dos.c	2007-01-18 08:58:43.000000000 -0500
@@ -1535,9 +1535,15 @@
 
 /* This constraint is for partitions starting on the first cylinder.  They
  * must start on the 2nd head of the 1st cylinder.
+ *
+ * NOTE: We don't always start on the 2nd head of the 1st cylinder.  If the
+ * partition's starting sector is not equal to the starting sector of the
+ * second head, we preserve it's location in this alignment.  This is needed
+ * for operating systems such as Windows Vista (NTFS v3.1).
  */
 static PedConstraint*
-_primary_start_constraint (PedDisk* disk, const PedCHSGeometry* bios_geom,
+_primary_start_constraint (PedDisk* disk, PedPartition *part,
+			   const PedCHSGeometry* bios_geom,
 			   PedGeometry* min_geom)
 {
 	PedDevice*	dev = disk->dev;
@@ -1546,21 +1552,26 @@
 	PedAlignment	end_align;
 	PedGeometry	start_geom;
 	PedGeometry	end_geom;
+	PedSector	start_pos;
+
+	if (part->geom.start == bios_geom->sectors)
+		start_pos = bios_geom->sectors;
+	else
+		start_pos = part->geom.start;
 
 	if (!ped_alignment_init (&start_align, bios_geom->sectors, 0))
 		return NULL;
 	if (!ped_alignment_init (&end_align, -1, cylinder_size))
 		return NULL;
 	if (min_geom) {
-		if (!ped_geometry_init (&start_geom, dev,
-					bios_geom->sectors, 1))
+		if (!ped_geometry_init (&start_geom, dev, start_pos, 1))
 			return NULL;
 		if (!ped_geometry_init (&end_geom, dev, min_geom->end,
 			       		dev->length - min_geom->end))
 			return NULL;
 	} else {
-		if (!ped_geometry_init (&start_geom, dev, bios_geom->sectors,
-					dev->length - bios_geom->sectors))
+		if (!ped_geometry_init (&start_geom, dev, start_pos,
+					dev->length - start_pos))
 			return NULL;
 		if (!ped_geometry_init (&end_geom, dev, 0, dev->length))
 			return NULL;
@@ -1669,12 +1680,14 @@
 
 	solution = _best_solution (part, bios_geom, solution,
 			_try_constraint (part, constraint,
-					 _primary_start_constraint (disk,
+					 _primary_start_constraint (disk, part,
 						 bios_geom, min_geom)));
-	solution = _best_solution (part, bios_geom, solution,
-			_try_constraint (part, constraint,
-					 _primary_constraint (disk, bios_geom,
-						 min_geom)));
+
+	if (!solution)
+		solution = _best_solution (part, bios_geom, solution,
+				_try_constraint (part, constraint,
+					_primary_constraint (disk, bios_geom,
+					min_geom)));
 
 	if (min_geom)
 		ped_geometry_destroy (min_geom);


Index: parted.spec
===================================================================
RCS file: /cvs/dist/rpms/parted/devel/parted.spec,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- parted.spec	12 Jan 2007 20:07:49 -0000	1.93
+++ parted.spec	19 Jan 2007 16:47:02 -0000	1.94
@@ -4,9 +4,11 @@
 Summary: The GNU disk partition manipulation program.
 Name:    parted
 Version: 1.8.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 Source:  ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.bz2
 
+Patch0:  parted-1.8.2-vista.patch
+
 Buildroot: %{_tmppath}/%{name}-root
 License: GPL
 Group: Applications/System
@@ -34,6 +36,7 @@
 
 %prep
 %setup -q
+%patch0 -p 1 -b .vista
 aclocal
 autoconf
 
@@ -89,6 +92,12 @@
 %{_libdir}/*.so
 
 %changelog
+* Thu Jan 18 2007 David Cantrell <dcantrell at redhat.com> - 1.8.2-2
+- Preserve starting sector for primary NTFS 3.1 partitions (Windows
+  Vista) when modifying the DOS disk label.  NTFS 3.1 partitions do
+  not start on the 2nd head of the 1st cylinder at the beginning of
+  the drive.
+
 * Fri Jan 12 2007 David Cantrell <dcantrell at redhat.com> - 1.8.2-1
 - Upgrade to GNU parted-1.8.2
 




More information about the fedora-cvs-commits mailing list