Enhance to use new linux-swap "filesystem" types added in parted-1.9.0
Excerpt from parted-1.9.0 release notes follows: In libparted, the linux-swap "filesystem" types are now called "linux-swap(v0)" and "linux-swap(v1)" rather than "linux-swap(old)" and "linux-swap(new)" as in parted 1.8, or "linux-swap" as in older versions; "old" and "new" generally make poor names, and v1 is the only format supported by current Linux kernels. Aliases for all previous names are available.
This commit is contained in:
parent
5f3c806561
commit
8aa941204c
|
@ -880,7 +880,9 @@ GParted::FILESYSTEM GParted_Core::get_filesystem()
|
|||
else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ext4" )
|
||||
return GParted::FS_EXT4 ;
|
||||
else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap" ||
|
||||
Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(v1)" ||
|
||||
Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(new)" ||
|
||||
Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(v0)" ||
|
||||
Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(old)" )
|
||||
return GParted::FS_LINUX_SWAP ;
|
||||
else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "fat16" )
|
||||
|
@ -2178,6 +2180,10 @@ bool GParted_Core::set_partition_type( const Partition & partition, OperationDet
|
|||
PedFileSystemType * fs_type =
|
||||
ped_file_system_type_get( Utils::get_filesystem_string( partition .filesystem ) .c_str() ) ;
|
||||
|
||||
//If not found, and FS is linux-swap, then try linux-swap(v1)
|
||||
if ( ! fs_type && Utils::get_filesystem_string( partition .filesystem ) == "linux-swap" )
|
||||
fs_type = ped_file_system_type_get( "linux-swap(v1)" ) ;
|
||||
|
||||
//If not found, and FS is linux-swap, then try linux-swap(new)
|
||||
if ( ! fs_type && Utils::get_filesystem_string( partition .filesystem ) == "linux-swap" )
|
||||
fs_type = ped_file_system_type_get( "linux-swap(new)" ) ;
|
||||
|
|
Loading…
Reference in New Issue