Author: fehr Date: Thu Sep 6 15:41:10 2007 New Revision: 40786 URL: http://svn.opensuse.org/viewcvs/yast?rev=40786&view=rev Log: fix problems mounting nfs in instsys (#308200) Modified: trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/Storage.h trunk/storage/libstorage/src/StorageInterface.h trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/nfs.ycp trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Thu Sep 6 15:41:10 2007 @@ -3519,8 +3519,8 @@ } int -Storage::addNfsDevice( const string& nfsDev, unsigned long long sizeK, - const string& mp ) +Storage::addNfsDevice( const string& nfsDev, const string& opts, + unsigned long long sizeK, const string& mp ) { int ret = 0; assertInit(); @@ -3540,7 +3540,7 @@ if( ret==0 && co!=NULL ) { if( sizeK==0 ) - checkNfsDevice( nfsDev, sizeK ); + checkNfsDevice( nfsDev, opts, sizeK ); ret = co->addNfs( nfsDev, sizeK, mp ); } if( !have ) @@ -3559,7 +3559,8 @@ } int -Storage::checkNfsDevice( const string& nfsDev, unsigned long long& sizeK ) +Storage::checkNfsDevice( const string& nfsDev, const string& opts, + unsigned long long& sizeK ) { int ret = 0; assertInit(); @@ -3569,12 +3570,20 @@ rmdir( mdir.c_str() ); createPath( mdir ); ret = co.addNfs( nfsDev, 0, "" ); + if( !opts.empty() ) + co.vBegin()->setFstabOption( opts ); + if( instsys() ) + { + SystemCmd c; + c.execute( "/sbin/portmap" ); + } if( ret==0 && (ret=co.vBegin()->mount( mdir ))==0 ) { sizeK = getDfSize( mdir ); ret = co.vBegin()->umount( mdir ); } - y2mil( "name:" << nfsDev << " ret:" << ret << " sizeK:" << sizeK ); + y2mil( "name:" << nfsDev << " opts:" << opts << " ret:" << ret << + " sizeK:" << sizeK ); return( ret ); } Modified: trunk/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.h (original) +++ trunk/storage/libstorage/src/Storage.h Thu Sep 6 15:41:10 2007 @@ -426,9 +426,10 @@ int changeMdParity( const string& name, storage::MdParity ptype ); int checkMd( const string& name ); - int addNfsDevice( const string& nfsDev, unsigned long long sizeK, - const string& mp ); - int checkNfsDevice( const string& nfsDev, unsigned long long& sizeK ); + int addNfsDevice( const string& nfsDev, const string& opts, + unsigned long long sizeK, const string& mp ); + int checkNfsDevice( const string& nfsDev, const string& opts, + unsigned long long& sizeK ); int createFileLoop( const string& lname, bool reuseExisting, unsigned long long sizeK, const string& mp, Modified: trunk/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageInterface.h (original) +++ trunk/storage/libstorage/src/StorageInterface.h Thu Sep 6 15:41:10 2007 @@ -1734,10 +1734,11 @@ * * @param nfsDev name of nfs device * @param sizeK size of the nfs device + * @param opts mount options for nfs mount * @param mp mount point of the nfs device * @return zero if all is ok, a negative number to indicate an error */ - virtual int addNfsDevice( const string& nfsDev, + virtual int addNfsDevice( const string& nfsDev, const string& opts, unsigned long long sizeK, const string& mp ) = 0; @@ -1745,10 +1746,11 @@ * Check accessability and size of nfs device. * * @param nfsDev name of nfs device + * @param opts mount options for nfs mount * @param sizeK size of the nfs device * @return zero if all is ok, a negative number to indicate an error */ - virtual int checkNfsDevice( const string& nfsDev, + virtual int checkNfsDevice( const string& nfsDev, const string& opts, unsigned long long& sizeK ) = 0; /** Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Thu Sep 6 15:41:10 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Sep 6 15:40:49 CEST 2007 - fehr@suse.de + +- fix problems mounting nfs in instsys (#308200) + +------------------------------------------------------------------- Wed Sep 5 12:02:21 CEST 2007 - fehr@suse.de - fix another case of nonzero passno for encrypted fstab @@ -7,7 +12,7 @@ ------------------------------------------------------------------- Tue Sep 4 16:55:55 CEST 2007 - fehr@suse.de -- fix problem with resizing encrypted volumes (#307219) +- fix problem with resizing encrypted volumes (#307222) - fix missing initialisation of tmpcrypt (#307219) - fix possible usage of nonzero passno for encrypted fstab entries (#296409) Modified: trunk/storage/storage/src/include/nfs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/nfs.ycp?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/storage/src/include/nfs.ycp (original) +++ trunk/storage/storage/src/include/nfs.ycp Thu Sep 6 15:41:10 2007 @@ -193,7 +193,8 @@ continue; } string dev = server + ":" + spath; - integer sizeK = Storage::CheckNfsVolume( dev ); + integer sizeK = Storage::CheckNfsVolume( dev, + retval["fstopt"]:"" ); if( sizeK<=0 ) { Popup::Error( sformat(_("The NFS mount Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=40786&r1=40785&r2=40786&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Thu Sep 6 15:41:10 2007 @@ -2879,25 +2879,27 @@ return( ret==0 ); } -global boolean AddNfsVolume( string nfsdev, integer sz, string mp ) +global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp ) { - y2milestone( "AddNfsVolume dev:%1 size:%2 mp:%3", nfsdev, sz, mp ); + y2milestone( "AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4", nfsdev, opts, + sz, mp ); integer ret = 0; string dummy = ""; - ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, sz, mp ); + ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, opts, sz, mp ); if( ret<0 ) y2error( "AddNfsVolume sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/nfs" ); return( ret==0 ); } -global integer CheckNfsVolume( string nfsdev ) +global integer CheckNfsVolume( string nfsdev, string opts ) { - y2milestone( "CheckNfsVolume dev:%1", nfsdev ); + y2milestone( "CheckNfsVolume dev:%1 opts:%2", nfsdev, opts ); integer ret = 0; integer sz = 0; string dummy = ""; - ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, sz ); + ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, opts, + sz ); if( ret<0 ) y2error( "CheckNfsVolume sint ret:%1", ret ); else @@ -3216,8 +3218,8 @@ } else if( ctype == `CT_NFS ) { - ret = Storage::AddNfsVolume( p["device"]:"", p["size_k"]:0, - p["mount"]:"" ); + ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"", + p["size_k"]:0, p["mount"]:"" ); } y2milestone( "CreateAny ret:%1", ret ); return( ret ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org