Author: fehr Date: Thu Nov 3 13:54:09 2011 New Revision: 66680 URL: http://svn.opensuse.org/viewcvs/yast?rev=66680&view=rev Log: - fix fstab handling when mount-by-uuid is reformatted (bnc#728000) Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.h branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc?rev=66680&r1=66679&r2=66680&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc Thu Nov 3 13:54:09 2011 @@ -542,9 +542,7 @@ if (!entry.fs_uuid.empty()) { - uuid = entry.fs_uuid; - alt_names.remove_if(string_contains("/by-uuid/")); - alt_names.push_back("/dev/disk/by-uuid/" + uuid); + updateUuid(entry.fs_uuid); } if (!entry.fs_label.empty()) @@ -916,6 +914,13 @@ return( ret ); } +void Volume::updateUuid( const string& new_uuid ) + { + uuid = new_uuid; + alt_names.remove_if(string_contains("/by-uuid/")); + alt_names.push_back("/dev/disk/by-uuid/" + uuid); + } + int Volume::doFormat() { static int fcount=1000; @@ -1083,6 +1088,10 @@ if( ret==0 ) { triggerUdevUpdate(); + Blkid blkid(mountDevice()); + Blkid::Entry entry; + if( findBlkid( blkid, entry ) && entry.is_fs && !entry.fs_uuid.empty()) + updateUuid( entry.fs_uuid ); } if( ret==0 && !orig_mp.empty() ) { @@ -2734,6 +2743,7 @@ else if( l ) ret = l->loopFile(); } + y2mil( "dev:" << dev << " ret:" << ret ); return( ret ); } Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.h?rev=66680&r1=66679&r2=66680&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.h Thu Nov 3 13:54:09 2011 @@ -217,6 +217,7 @@ void getLoopData( SystemCmd& loopData ); void getMountData(const ProcMounts& mounts, bool swap_only = false); void getFstabData( EtcFstab& fstabData ); + void updateUuid( const string& new_uuid ); void replaceAltName( const string& prefix, const string& newn ); string getMountByString() const; string getFstabDevice() const; Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=66680&r1=66679&r2=66680&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Thu Nov 3 13:54:09 2011 @@ -1,6 +1,7 @@ ------------------------------------------------------------------- Thu Nov 3 10:55:36 CET 2011 - fehr@suse.de +- fix fstab handling when mount-by-uuid is reformatted (bnc#728000) - add local static struct to getContVolInfo to prevent strings from being freed while perl interface might still access them -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org