Hello community, here is the log from the commit of package libstorage for openSUSE:Factory checked in at 2013-06-28 11:50:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage (Old) and /work/SRC/openSUSE:Factory/.libstorage.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage" Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes 2013-05-27 09:52:11.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes 2013-06-28 11:50:54.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Jun 19 12:20:14 CEST 2013 - [email protected] + +- version 2.24.1 +- adapt to changed functionality of losetup (bnc#825503) + +------------------------------------------------------------------- Old: ---- libstorage-2.24.0.tar.bz2 New: ---- libstorage-2.24.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage.spec ++++++ --- /var/tmp/diff_new_pack.HVgG3f/_old 2013-06-28 11:50:56.000000000 +0200 +++ /var/tmp/diff_new_pack.HVgG3f/_new 2013-06-28 11:50:56.000000000 +0200 @@ -17,7 +17,7 @@ Name: libstorage -Version: 2.24.0 +Version: 2.24.1 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: libstorage-%{version}.tar.bz2 ++++++ libstorage-2.24.0.tar.bz2 -> libstorage-2.24.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/VERSION new/libstorage-2.24.1/VERSION --- old/libstorage-2.24.0/VERSION 2013-04-16 17:08:01.000000000 +0200 +++ new/libstorage-2.24.1/VERSION 2013-06-19 12:25:52.000000000 +0200 @@ -1 +1 @@ -2.24.0 +2.24.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/Loop.cc new/libstorage-2.24.1/storage/Loop.cc --- old/libstorage-2.24.0/storage/Loop.cc 2013-02-20 18:26:33.000000000 +0100 +++ new/libstorage-2.24.1/storage/Loop.cc 2013-06-19 12:25:52.000000000 +0200 @@ -42,16 +42,12 @@ bool dmcrypt, const string& dm_dev, SystemInfo& systeminfo, SystemCmd& losetup) : Volume(d, 0, 0), lfile(LoopFile), reuseFile(true), delFile(false) -{ + { y2mil("constructed loop dev:" << LoopDev << " file:" << LoopFile << " dmcrypt:" << dmcrypt << " dmdev:" << dm_dev); if( d.type() != LOOP ) y2err("constructed loop with wrong container"); loop_dev = fstab_loop_dev = LoopDev; - if( loop_dev.empty() ) - getLoopData( losetup ); - if( loop_dev.empty() ) - getFreeLoop(losetup, d.usedNumbers()); string proc_dev; if( !dmcrypt ) { @@ -76,7 +72,7 @@ is_loop = true; unsigned long long s = 0; if( !proc_dev.empty() ) - systeminfo.getProcParts().getSize(proc_dev, s); + systeminfo.getProcParts().getSize(proc_dev, s); if( s>0 ) { setSize( s ); @@ -87,18 +83,19 @@ if( stat( lfile.c_str(), &st )>=0 ) setSize( st.st_size/1024 ); } -} + } Loop::Loop(const LoopCo& d, const string& file, bool reuseExisting, unsigned long long sizeK, bool dmcr) : Volume(d, 0, 0), lfile(file), reuseFile(reuseExisting), delFile(false) -{ + { y2mil("constructed loop file:" << file << " reuseExisting:" << reuseExisting << " sizek:" << sizeK << " dmcrypt:" << dmcr); if( d.type() != LOOP ) y2err("constructed loop with wrong container"); - getFreeLoop(); + SystemCmd c(LOSETUPBIN " -a"); + loop_dev = getFreeLoop(c,d.usedNumbers()); is_loop = true; if( !dmcr ) { @@ -120,7 +117,7 @@ checkReuse(); if( !reuseFile ) setSize( sizeK ); -} + } Loop::Loop(const LoopCo& c, const Loop& v) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/Storage.cc new/libstorage-2.24.1/storage/Storage.cc --- old/libstorage-2.24.0/storage/Storage.cc 2013-05-13 13:26:32.000000000 +0200 +++ new/libstorage-2.24.1/storage/Storage.cc 2013-06-19 12:25:52.000000000 +0200 @@ -5364,7 +5364,7 @@ return( ret ); } -bool Storage::usedDmName( const string& nm ) const +bool Storage::usedDmName( const string& nm, const Volume* volp ) const { bool ret = false; y2mil("nm:" << nm); @@ -5373,6 +5373,7 @@ while( !ret && v!=vp.end() ) { ret = v->dmcryptDevice()==nm || (v->cType()==DM&&v->device()==nm); + ret = ret && &(*v)!=volp; if( !ret ) ++v; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/Storage.h new/libstorage-2.24.1/storage/Storage.h --- old/libstorage-2.24.0/storage/Storage.h 2013-04-16 17:08:01.000000000 +0200 +++ new/libstorage-2.24.1/storage/Storage.h 2013-06-19 12:25:52.000000000 +0200 @@ -261,7 +261,7 @@ string prependRoot(const string& mp) const; const string& tmpDir() const { return tempdir; } bool hasIScsiDisks() const; - bool usedDmName( const string& nm ) const; + bool usedDmName( const string& nm, const Volume* volp ) const; string bootMount() const; const ArchInfo& getArchInfo() const { return archinfo; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/Volume.cc new/libstorage-2.24.1/storage/Volume.cc --- old/libstorage-2.24.0/storage/Volume.cc 2013-04-04 15:36:33.000000000 +0200 +++ new/libstorage-2.24.1/storage/Volume.cc 2013-06-19 12:25:52.000000000 +0200 @@ -1934,11 +1934,16 @@ return( ret ); } -string Volume::getLosetupCmd( storage::EncryptType, const string& pwdfile ) const +string Volume::getLosetupCmd( const string& fpath ) const { - string cmd = LOSETUPBIN " " + quote(loop_dev) + " "; - const Loop* l = static_cast<const Loop*>(this); - cmd += quote(l->lfileRealPath()); + string cmd = LOSETUPBIN " --find --show "; + if( fpath.empty() ) + { + const Loop* l = static_cast<const Loop*>(this); + cmd += quote(l->lfileRealPath()); + } + else + cmd += quote(fpath); y2mil("cmd:" << cmd); return( cmd ); } @@ -2164,8 +2169,6 @@ y2mil("device:" << dev); mkdir( mpname.c_str(), 0700 ); - if( is_loop ) - getFreeLoop(); detected_fs = fs = FSUNKNOWN; bool luks_ok = false; do @@ -2180,10 +2183,11 @@ crUnsetup( true ); if( is_loop ) { - string lfile; - if( getLoopFile( lfile )) - c.execute(LOSETUPBIN " " + quote(loop_dev) + " " + - quote(getStorage()->root() + lfile)); + c.execute(getLosetupCmd("")); + y2mil( "loop_dev:" << loop_dev ); + if( !c.stdout().empty() ) + loop_dev = c.stdout().front(); + y2mil( "loop_dev:" << loop_dev ); } string cmd = getCryptsetupCmd( try_order[pos], dmcrypt_dev, "", fname, false ); c.execute(MODPROBEBIN " dm-crypt"); @@ -2293,32 +2297,31 @@ if( is_loop ) { getStorage()->removeDmTableTo( *this ); - if( ret==0 && loop_dev.empty() ) + string fname; + if( !dmcrypt() ) { - ret = getFreeLoop(); + fname = getStorage()->tmpDir() + "/pwdf"; + ofstream pwdfile( fname.c_str() ); + classic(pwdfile); + pwdfile << crypt_pwd << endl; + pwdfile.close(); } - if( ret==0 ) + SystemCmd c( getLosetupCmd("")); + if( c.retcode()!=0 ) + ret = VOLUME_LOSETUP_FAILED; + else { - string fname; - if( !dmcrypt() ) - { - fname = getStorage()->tmpDir() + "/pwdf"; - ofstream pwdfile( fname.c_str() ); - classic(pwdfile); - pwdfile << crypt_pwd << endl; - pwdfile.close(); - } - SystemCmd c( getLosetupCmd( encryption, fname )); - if( c.retcode()!=0 ) - ret = VOLUME_LOSETUP_FAILED; - else - orig_crypt_pwd = crypt_pwd; - if( !fname.empty() ) - { - unlink( fname.c_str() ); - } - Storage::waitForDevice(loop_dev); + y2mil( "loop_dev:" << loop_dev ); + if( !c.stdout().empty() ) + loop_dev = c.stdout().front(); + y2mil( "loop_dev:" << loop_dev ); + orig_crypt_pwd = crypt_pwd; + } + if( !fname.empty() ) + { + unlink( fname.c_str() ); } + Storage::waitForDevice(loop_dev); if( ret==0 ) { loop_active = true; @@ -2374,7 +2377,7 @@ nm.erase( 0, nm.find_last_of( '/' )+1 ); string ret = "/dev/mapper/cr_" + nm; unsigned cnt=1; - while( getStorage()->usedDmName(ret)) + while( getStorage()->usedDmName(ret,this)) ret = "/dev/mapper/cr_" + nm + "_" + decString(cnt++); y2mil( "nm:" << ret ); return( ret ); @@ -3100,7 +3103,6 @@ che.encr = encryption; if( inCryptotab() ) { - getFreeLoop(); che.loop_dev = fstab_loop_dev; } che.dentry = de; @@ -3134,7 +3136,6 @@ che.tmpcrypt = true; if( inCryptotab() ) { - getFreeLoop(); che.loop_dev = fstab_loop_dev; } che.fs = toString(fs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/Volume.h new/libstorage-2.24.1/storage/Volume.h --- old/libstorage-2.24.0/storage/Volume.h 2013-03-26 17:31:39.000000000 +0100 +++ new/libstorage-2.24.1/storage/Volume.h 2013-06-19 12:25:52.000000000 +0200 @@ -247,7 +247,7 @@ int umountTmpMount( const string& m, int ret ) const; int doFormatBtrfs(); - string getLosetupCmd( storage::EncryptType, const string& pwdfile ) const; + string getLosetupCmd( const string& fname ) const; string getCryptsetupCmd( storage::EncryptType e, const string& dmdev, const string& mp, const string& pwdfile, bool format, bool empty_pwd=false ) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.24.0/storage/gen_md5sum.cc new/libstorage-2.24.1/storage/gen_md5sum.cc --- old/libstorage-2.24.0/storage/gen_md5sum.cc 2013-05-13 13:33:04.000000000 +0200 +++ new/libstorage-2.24.1/storage/gen_md5sum.cc 2013-06-19 12:41:44.000000000 +0200 @@ -1,5 +1,5 @@ -#define SOURCES_MD5SUM "ff532e4a9eed072311561487c8d2b102" -#define SOURCES_MD5_DATE " Mon May 13 13:33:04 CEST 2013 " +#define SOURCES_MD5SUM "7a7c73b36739330d1e0b8631b9b422a0" +#define SOURCES_MD5_DATE " Wed Jun 19 12:41:44 CEST 2013 " namespace storage { const char* GetSourceMd5() { return SOURCES_MD5SUM; } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
