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

Bug#373629: add patch for get rid of cd device



Hi

I tried to get rid of the cd device to make sure that autopartkit doesn't try 
to do partitioning on this read-only device.
I am using the ped_device_destroy() function from libparted, please have a 
look and comment, I guess this is a good workaround to exclude the cd device 
from the list.

Greetings
Steffen
--- autopartkit.c.orig	2006-06-20 20:53:45.000000000 +0200
+++ autopartkit.c	2006-06-20 20:57:03.000000000 +0200
@@ -335,6 +335,12 @@
 
     dev = ped_device_get_next(NULL);
 
+    /* We delete the cd device from the list */
+    if (strstr(dev->path, "/cd"))
+    {
+    	ped_device_destroy(dev);
+    }
+
     if (dev == NULL)
     {
 	/* No devices detected */
--- distribute.c.orig	2006-06-20 20:51:16.000000000 +0200
+++ distribute.c	2006-06-20 20:53:10.000000000 +0200
@@ -257,6 +257,13 @@
     {
         assert(dev);
 
+	/* We delete the cd device from the list */
+	if (strstr(dev->path, "/cd"))
+	{
+		ped_device_destroy(dev);
+		continue;
+	}
+
 	autopartkit_log(2, "  checking dev: %s, sector_size=%d\n",
 			dev->path,
 			dev->sector_size /* in bytes */);

Attachment: pgpzK0q8Kg5xH.pgp
Description: PGP signature


Reply to: