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
This commit is contained in:
Curtis Gedak 2011-02-22 14:40:02 -07:00
parent 2f99511228
commit 87acba030c
3 changed files with 2 additions and 25 deletions

2
README
View file

@ -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

View file

@ -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 ;

View file

@ -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 ;
}