Package: partman-base
Tags: patch

In preparation for the parted3 transition, this patch removes support
for filesystem creation and checking from parted_server.  The dependency
and linker flag changes can be left out for now and it should still
build against parted2.  They can be added after parted3 has been
uploaded to actually make the switch.

diff -Nru partman-base-172/debian/changelog partman-base-173/debian/changelog
--- partman-base-172/debian/changelog   2014-01-05 09:20:41.000000000 -0500
+++ partman-base-173/debian/changelog   2014-02-13 10:44:21.000000000 -0500
@@ -1,3 +1,10 @@
+partman-base (173) unstable; urgency=low
+
+  * parted_server: remove support for filesystem create/check/copy
+    and link to libparted2 instead of libparted0.
+
+ -- Phillip Susi <[email protected]>  Wed, 12 Feb 2014 11:57:20 -0500
+
 partman-base (172) unstable; urgency=low
 
   [ Updated translations ]
diff -Nru partman-base-172/debian/control partman-base-173/debian/control
--- partman-base-172/debian/control     2013-07-13 03:07:32.000000000 -0400
+++ partman-base-173/debian/control     2014-02-12 11:57:06.000000000 -0500
@@ -3,7 +3,7 @@
 Priority: standard
 Maintainer: Debian Install System Team <[email protected]>
 Uploaders: Anton Zinoviev <[email protected]>, Colin Watson 
<[email protected]>, Christian Perrier <[email protected]>, Max Vozeler 
<[email protected]>
-Build-Depends: debhelper (>= 9), dh-di (>= 2), po-debconf (>= 0.5.0), 
libparted0-dev (>= 2.2)
+Build-Depends: debhelper (>= 9), dh-di (>= 2), po-debconf (>= 0.5.0), 
libparted2-dev
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=d-i/partman-base.git
 Vcs-Git: git://anonscm.debian.org/d-i/partman-base.git
 
diff -Nru partman-base-172/Makefile partman-base-173/Makefile
--- partman-base-172/Makefile   2011-01-18 23:56:34.000000000 -0500
+++ partman-base-173/Makefile   2014-02-12 14:07:57.000000000 -0500
@@ -1,5 +1,5 @@
 CFLAGS=-Wall -Os -D_GNU_SOURCE
-LIBS=-lparted
+LIBS=-lparted -lparted-fs-resize -luuid
 
 all: parted_server parted_devices partmap
 
diff -Nru partman-base-172/parted_server.c partman-base-173/parted_server.c
--- partman-base-172/parted_server.c    2012-07-02 21:01:55.000000000 -0400
+++ partman-base-173/parted_server.c    2014-02-13 10:48:20.000000000 -0500
@@ -258,48 +258,6 @@
         oprintf("%.0f %s\n", 1000 * timer->frac, timer->state_name);
 }
 
-/* Like ped_file_system_create but automaticaly creates PedTimer */
-PedFileSystem *
-timered_file_system_create(PedGeometry *geom, PedFileSystemType *type)
-{
-        PedFileSystem *result;
-        PedTimer *timer;
-        start_timer();
-        timer = ped_timer_new(&timer_handler, NULL);
-        result = ped_file_system_create(geom, type, timer);
-        stop_timer();
-        ped_timer_destroy(timer);
-        return result;
-}
-
-/* Like ped_file_system_check but automaticaly creates PedTimer */
-int
-timered_file_system_check(PedFileSystem *fs)
-{
-        int result;
-        PedTimer *timer;
-        start_timer();
-        timer = ped_timer_new(&timer_handler, NULL);
-        result = ped_file_system_check(fs, timer);
-        stop_timer();
-        ped_timer_destroy(timer);
-        return result;
-}
-
-/* Like ped_file_system_copy but automaticaly creates PedTimer */
-PedFileSystem *
-timered_file_system_copy(PedFileSystem *fs, PedGeometry *geom)
-{
-        PedFileSystem *result;
-        PedTimer *timer;
-        start_timer();
-        timer = ped_timer_new(&timer_handler, NULL);
-        result = ped_file_system_copy(fs, geom, timer);
-        stop_timer();
-        ped_timer_destroy(timer);
-        return result;
-}
-
 /* Like ped_file_system_resize but automaticaly creates PedTimer */
 int
 timered_file_system_resize(PedFileSystem *fs, PedGeometry *geom)
@@ -940,14 +898,6 @@
                         ped_file_system_close(fs);
                 return false;
         }
-        log("try to check the file system for errors");
-        if (NULL != fs && !timered_file_system_check(fs)) {
-                /* TODO: inform the user. */
-                log("uncorrected errors");
-                ped_file_system_close(fs);
-                return false;
-        }
-        log("successfully checked");
         if (part->type & PED_PARTITION_LOGICAL)
                 maximize_extended_partition(disk);
         if (!ped_disk_set_partition_geom(disk, part, constraint, start, end))
@@ -1867,83 +1817,6 @@
 }
 
 void
-command_check_file_system()
-{
-        char *id;
-        PedPartition *part;
-        PedFileSystem *fs;
-        char *status;
-        scan_device_name();
-        if (dev == NULL)
-                critical_error("The device %s is not opened.", device_name);
-        open_out();
-        if (1 != iscanf("%as", &id))
-                critical_error("Expected partition id");
-        log("command_check_file_system(%s)", id);
-        part = partition_with_id(disk, id);
-        free(id);
-        fs = ped_file_system_open(&(part->geom));
-        if (NULL == fs)
-                status = "n/c";
-        else {
-                if (timered_file_system_check(fs))
-                        status = "good";
-                else
-                        status = "bad";
-                ped_file_system_close(fs);
-        }
-        oprintf("OK\n");
-        oprintf("%s\n", status);
-}
-
-void
-command_create_file_system()
-{
-        char *id;
-        PedPartition *part;
-        char *s_fstype;
-        PedFileSystemType *fstype;
-        PedFileSystem *fs;
-        scan_device_name();
-        if (dev == NULL)
-                critical_error("The device %s is not opened.", device_name);
-        change_named(device_name);
-        open_out();
-        if (2 != iscanf("%as %as", &id, &s_fstype))
-                critical_error("Expected partition id and file system");
-        log("command_create_file_system(%s,%s)", id, s_fstype);
-        part = partition_with_id(disk, id);
-        if (part == NULL)
-                critical_error("No such partition: %s", id);
-        free(id);
-
-        mangle_fstype_name(&s_fstype);
-
-        fstype = ped_file_system_type_get(s_fstype);
-        if (fstype == NULL)
-                critical_error("Bad file system type: %s", s_fstype);
-        ped_partition_set_system(part, fstype);
-        deactivate_exception_handler();
-        if ((fs = timered_file_system_create(&(part->geom), fstype)) != NULL) {
-                ped_file_system_close(fs);
-                /* If the partition is at the very start of the disk, then
-                 * we've already done all the committing we need to do, and
-                 * ped_disk_commit_to_dev will overwrite the partition
-                 * header.
-                 */
-                if (part->geom.start != 0)
-                        ped_disk_commit_to_dev(disk);
-        }
-        activate_exception_handler();
-        free(s_fstype);
-        oprintf("OK\n");
-        if (fs != NULL)
-                oprintf("OK\n");
-        else
-                oprintf("failed\n");
-}
-
-void
 command_new_label()
 {
         PedDiskType *type;
@@ -2280,46 +2153,6 @@
 }
 
 void
-command_copy_partition()
-{
-        char *srcid, *srcdiskid, *destid;
-        PedPartition *source, *destination;
-        PedDisk *srcdisk;
-        PedFileSystem *fs;
-        scan_device_name();
-        if (dev == NULL)
-                critical_error("The device %s is not opened.", device_name);
-        assert(disk != NULL);
-        log("command_copy_partition()");
-        change_named(device_name);
-        open_out();
-        if (3 != iscanf("%as %as %as", &destid, &srcdiskid, &srcid))
-                critical_error("Expected id device_identifier id");
-        if (!device_opened(srcdiskid))
-                critical_error("The device %s is not opened.", srcdiskid);
-        srcdisk = disk_named(srcdiskid);
-        if (srcdisk == NULL)
-                critical_error("The source device has label");
-        source = partition_with_id(srcdisk, srcid);
-        destination = partition_with_id(disk, destid);
-        if (source == NULL)
-                critical_error("No source partition %s", srcid);
-        if (destination == NULL)
-                critical_error("No destination partition %s", destid);
-        fs = ped_file_system_open(&(source->geom));
-        if (fs != NULL) {
-                /* TODO: is ped_file_system_check(fs, ...) necessary? */
-                if (timered_file_system_copy(fs, &(destination->geom)))
-                        ped_partition_set_system(destination, fs->type);
-                ped_file_system_close(fs);
-        }
-        oprintf("OK\n");
-        free(destid);
-        free(srcdiskid);
-        free(srcid);
-}
-
-void
 command_get_label_type()
 {
         log("command_get_label_type()");
@@ -2554,10 +2387,6 @@
                         command_get_file_system();
                 else if (!strcasecmp(str, "CHANGE_FILE_SYSTEM"))
                         command_change_file_system();
-                else if (!strcasecmp(str, "CHECK_FILE_SYSTEM"))
-                        command_check_file_system();
-                else if (!strcasecmp(str, "CREATE_FILE_SYSTEM"))
-                        command_create_file_system();
                 else if (!strcasecmp(str, "NEW_LABEL"))
                         command_new_label();
                 else if (!strcasecmp(str, "NEW_PARTITION"))
@@ -2573,8 +2402,6 @@
                         command_virtual_resize_partition();
                 else if (!strcasecmp(str, "GET_VIRTUAL_RESIZE_RANGE"))
                         command_get_virtual_resize_range();
-                else if (!strcasecmp(str, "COPY_PARTITION"))
-                        command_copy_partition();
                 else if (!strcasecmp(str, "GET_LABEL_TYPE"))
                         command_get_label_type();
                 else if (!strcasecmp(str, "IS_BUSY"))

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to