[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kFreeBSD _device_get_part_path() doesn't support GPT

Haven't tested it, but I think this patch should fix the problem.

Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
diff -ur parted-1.8.8.git.2009.07.19/libparted/arch/freebsd.c parted-1.8.8.git.2009.07.19.new/libparted/arch/freebsd.c
--- parted-1.8.8.git.2009.07.19/libparted/arch/freebsd.c	2009-11-21 10:35:29.000000000 +0100
+++ parted-1.8.8.git.2009.07.19.new/libparted/arch/freebsd.c	2009-11-21 10:35:56.000000000 +0100
@@ -1110,13 +1110,18 @@
 	int		path_len = strlen (dev->path);
 	int		result_len = path_len + 16;
 	char*		result;
+	PedDisk*	disk;
+	disk = ped_disk_new (device);
+	if (!disk)
+		return NULL;
 	result = (char*) ped_malloc (result_len);
 	if (!result)
 		return NULL;
 	/* append slice number (ad0, partition 1 => ad0s1)*/
-	snprintf (result, result_len, "%ss%d", dev->path, num);
+	snprintf (result, result_len, strcmp (disk->type->name, "gpt") ? "%ss%d" : "%sp%d", dev->path, num);
 	return result;
Only in parted-1.8.8.git.2009.07.19.new/libparted/arch: freebsd.c~

Reply to: