Switch to using jfs_tune to read the UUID

Not necessary but use the simpler file system tune command rather than
the file system debug command where possible.  Also saves creating an
echo process.
This commit is contained in:
Mike Fleetwood 2012-09-23 12:15:27 +01:00 committed by Curtis Gedak
parent ee87cee96f
commit aa16bf5451
1 changed files with 3 additions and 3 deletions

View File

@ -31,12 +31,12 @@ FS jfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "jfs_debugfs" ) .empty() ) { if ( ! Glib::find_program_in_path( "jfs_debugfs" ) .empty() ) {
fs .read = GParted::FS::EXTERNAL ; fs .read = GParted::FS::EXTERNAL ;
fs .read_uuid = GParted::FS::EXTERNAL ;
} }
if ( ! Glib::find_program_in_path( "jfs_tune" ) .empty() ) { if ( ! Glib::find_program_in_path( "jfs_tune" ) .empty() ) {
fs .read_label = FS::EXTERNAL ; fs .read_label = FS::EXTERNAL ;
fs .write_label = FS::EXTERNAL ; fs .write_label = FS::EXTERNAL ;
fs .read_uuid = FS::EXTERNAL ;
fs .write_uuid = FS::EXTERNAL ; fs .write_uuid = FS::EXTERNAL ;
} }
@ -128,9 +128,9 @@ bool jfs::write_label( const Partition & partition, OperationDetail & operationd
void jfs::read_uuid( Partition & partition ) void jfs::read_uuid( Partition & partition )
{ {
if ( ! Utils::execute_command( "echo su | jfs_debugfs " + partition .get_path(), output, error, true ) ) if ( ! Utils::execute_command( "jfs_tune -l " + partition .get_path(), output, error, true ) )
{ {
partition .uuid = Utils::regexp_label( output, "s_uuid:[[:blank:]]*([^[:space:]]+)" ) ; partition .uuid = Utils::regexp_label( output, "^File system UUID:[[:blank:]]*([^[:space:]]+)" ) ;
if ( partition .uuid == "00000000-0000-0000-0000-000000000000" ) if ( partition .uuid == "00000000-0000-0000-0000-000000000000" )
partition .uuid .clear() ; partition .uuid .clear() ;
} }