[gparted] Remove all usage of kpartx to avoid partition entry duplicates



commit 87acba030c945d7a8cb5c69f045fc2914c1ed859
Author: Curtis Gedak <gedakc gmail com>
Date:   Tue Feb 22 14:40:02 2011 -0700

    Remove all usage of kpartx to avoid partition entry duplicates
    
    Usage of the kpartx package to create partition names has been
    completely removed.  Hence kpartx is no longer even an optionally used
    package by gparted.
    
    This change is related to the following bug report:
    
    Ubuntu launchpad bug 719129 - [Natty] Gparted duplicates dmraid
                                  partition devices
    https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/719129

 README           |    2 --
 include/DMRaid.h |    3 +--
 src/DMRaid.cc    |   22 +---------------------
 3 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/README b/README
index c26d2be..3280e34 100644
--- a/README
+++ b/README
@@ -167,8 +167,6 @@ These commands include:
    hal-lock      - used to prevent automounting of file systems
    gksu          - used to acquire root privileges in .desktop file,
                    but only if available when gparted source is configured.
-   kpartx        - used in dmraid to create /dev/mapper entries such as
-                     /dev/mapper/isw_idedecefg_Volume0p1
    udevinfo      - used in dmraid to query udev name
    udevadm       - used in dmraid to query udev name
    yelp          - used to display help manual
diff --git a/include/DMRaid.h b/include/DMRaid.h
index 6ddf734..0a52ce1 100644
--- a/include/DMRaid.h
+++ b/include/DMRaid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009, 2010 Curtis Gedak
+/* Copyright (C) 2009, 2010, 2011 Curtis Gedak
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -71,7 +71,6 @@ private:
 	static bool dmraid_cache_initialized ;
 	static bool dmraid_found ;
 	static bool dmsetup_found ;
-	static bool kpartx_found ;
 	static bool udevinfo_found ;
 	static bool udevadm_found ;
 	static std::vector<Glib::ustring> dmraid_devices ;
diff --git a/src/DMRaid.cc b/src/DMRaid.cc
index 79da86c..da82530 100644
--- a/src/DMRaid.cc
+++ b/src/DMRaid.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009, 2010 Curtis Gedak
+/* Copyright (C) 2009, 2010, 2011 Curtis Gedak
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -26,7 +26,6 @@ namespace GParted
 bool DMRaid::dmraid_cache_initialized = false ;
 bool DMRaid::dmraid_found  = false ;
 bool DMRaid::dmsetup_found = false ;
-bool DMRaid::kpartx_found  = false ;
 bool DMRaid::udevinfo_found = false ;
 bool DMRaid::udevadm_found  = false ;
 std::vector<Glib::ustring> DMRaid::dmraid_devices ;
@@ -83,7 +82,6 @@ void DMRaid::set_commands_found()
 	//Set status of commands found 
 	dmraid_found = (! Glib::find_program_in_path( "dmraid" ) .empty() ) ;
 	dmsetup_found = (! Glib::find_program_in_path( "dmsetup" ) .empty() ) ;
-	kpartx_found = (! Glib::find_program_in_path( "kpartx" ) .empty() ) ;
 	udevinfo_found = (! Glib::find_program_in_path( "udevinfo" ) .empty() ) ;
 	udevadm_found = (! Glib::find_program_in_path( "udevadm" ) .empty() ) ;
 }
@@ -316,7 +314,6 @@ Glib::ustring DMRaid::make_path_dmraid_compatible( Glib::ustring partition_path
 bool DMRaid::create_dev_map_entries( const Partition & partition, OperationDetail & operationdetail )
 {
 	//Create all missing dev mapper entries for a specified device.
-	//  Try both dmraid -ay and (if available) kpartx -a
 
 	Glib::ustring command ;
 	bool exit_status = true ;
@@ -337,14 +334,6 @@ bool DMRaid::create_dev_map_entries( const Partition & partition, OperationDetai
 			exit_status = false ;	//command failed
 	}
 
-	if ( kpartx_found )
-	{
-		Glib::ustring dmraid_name = get_dmraid_name( partition .device_path ) ;
-		command = "kpartx -a -v " + DEV_MAP_PATH + dmraid_name ;
-		if ( execute_command( command, operationdetail .get_last_child() ) )
-			exit_status = false ;	//command failed
-	}
-
 	operationdetail .get_last_child() .set_status( exit_status ? STATUS_SUCCES : STATUS_ERROR ) ;
 
 	return exit_status ;
@@ -353,7 +342,6 @@ bool DMRaid::create_dev_map_entries( const Partition & partition, OperationDetai
 bool DMRaid::create_dev_map_entries( const Glib::ustring & dev_path )
 {
 	//Create all missing dev mapper entries for a specified device.
-	//  Try both dmraid -ay and (if available) kpartx -a
 
 	Glib::ustring command, output, error ;
 	bool exit_status = true ;
@@ -370,14 +358,6 @@ bool DMRaid::create_dev_map_entries( const Glib::ustring & dev_path )
 			exit_status = false;	//command failed
 	}
 
-	if ( kpartx_found )
-	{
-		Glib::ustring dmraid_name = get_dmraid_name( dev_path ) ;
-		command = "kpartx -a -v " + DEV_MAP_PATH + dmraid_name ;
-		if ( Utils::execute_command( command, output, error, true ) )
-			exit_status = false;	//command failed
-	}
-
 	return exit_status ;
 }
 



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