[Parted-commits] GNU Parted Official Repository: Changes to 'debian/master'

Otavio Salvador otavio at alioth.debian.org
Wed Oct 22 12:24:34 UTC 2008


 debian/changelog                          |    7 +++
 debian/patches/00list                     |    1 
 debian/patches/unpartitioned-disks.dpatch |   60 ++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+)

New commits:
commit b4a3043583d346a93c94b5370d9e4fa1f843782c
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Wed Oct 22 10:14:23 2008 -0200

    Release 1.8.8.git.2008.03.24-11

diff --git a/debian/changelog b/debian/changelog
index ed1be0f..6089aa3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+parted (1.8.8.git.2008.03.24-11) unstable; urgency=low
+
+  * Add patch to avoid using partition names for loop devices. Thanks to
+    Colin Watson <cjwatson at ubuntu.com> for the patch. Closes: #502618
+
+ -- Otavio Salvador <otavio at ossystems.com.br>  Wed, 22 Oct 2008 10:13:52 -0200
+
 parted (1.8.8.git.2008.03.24-10) unstable; urgency=low
 
   * Merge from Ubuntu: debian/patches/parted-dmraid.dpatch: Patch to educate

commit b0443c8147a957c03a2afade1fd12f0a65a1c68a
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Wed Oct 22 10:13:24 2008 -0200

    Add patch to avoid using partition names for loop devices. Thanks to Colin Watson <cjwatson at ubuntu.com> for the patch. Closes: #502618

diff --git a/debian/patches/00list b/debian/patches/00list
index 977f09d..672008a 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -6,6 +6,7 @@ reiserfs-libname
 devfs
 #kfreebsd-gnu
 parted-dmraid
+unpartitioned-disks
 
 # Will also stay debian specific, but depends on some of the above :/
 sparc-fix-raid
diff --git a/debian/patches/unpartitioned-disks.dpatch b/debian/patches/unpartitioned-disks.dpatch
new file mode 100755
index 0000000..ac29579
--- /dev/null
+++ b/debian/patches/unpartitioned-disks.dpatch
@@ -0,0 +1,60 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## unpartitioned-disks.dpatch by Colin Watson <cjwatson at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Don't try to call BLKPG ioctls or tell device-mapper to create
+## DP: partitions on disks that can't be partitioned.
+
+ at DPATCH@
+diff -urNad parted-1.8.8.git.2008.03.24~/libparted/arch/linux.c parted-1.8.8.git.2008.03.24/libparted/arch/linux.c
+--- parted-1.8.8.git.2008.03.24~/libparted/arch/linux.c	2008-07-10 02:05:20.000000000 +0100
++++ parted-1.8.8.git.2008.03.24/libparted/arch/linux.c	2008-07-10 13:51:09.000000000 +0100
+@@ -2102,6 +2102,18 @@
+ }
+ 
+ static int
++_has_partitions (const PedDisk* disk)
++{
++        PED_ASSERT(disk != NULL, return 0);
++
++        /* Some devices can't be partitioned. */
++        if (!strcmp (disk->type->name, "loop"))
++                return 0;
++
++        return 1;
++}
++
++static int
+ _blkpg_part_command (PedDevice* dev, struct blkpg_partition* part, int op)
+ {
+         LinuxSpecific*          arch_specific = LINUX_SPECIFIC (dev);
+@@ -2126,6 +2138,9 @@
+         PED_ASSERT(disk->dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0,
+                    return 0);
+ 
++        if (!_has_partitions (disk))
++                return 0;
++
+         if (ped_disk_type_check_feature (disk->type,
+                                          PED_DISK_TYPE_PARTITION_NAME))
+                 vol_name = ped_partition_get_name (part);
+@@ -2174,6 +2189,9 @@
+ {
+         struct blkpg_partition  linux_part;
+ 
++        if (!_has_partitions (disk))
++                return 0;
++
+         memset (&linux_part, 0, sizeof (linux_part));
+         linux_part.pno = n;
+         return _blkpg_part_command (disk->dev, &linux_part,
+@@ -2351,6 +2369,9 @@
+         char*           dev_name = NULL;
+         char*           params = NULL;
+ 
++        if (!_has_partitions(disk))
++                return 0;
++
+         dev_name = _device_get_part_path (disk->dev, part->num);
+         if (!dev_name)
+                 return 0;



More information about the Parted-commits mailing list