Hello community, here is the log from the commit of package yast2-storage checked in at Thu Sep 20 23:04:48 CEST 2007. -------- --- yast2-storage/yast2-storage.changes 2007-09-17 14:26:46.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-storage/yast2-storage.changes 2007-09-20 15:52:28.000000000 +0200 @@ -1,0 +2,11 @@ +Thu Sep 20 15:50:27 CEST 2007 - fehr@suse.de + +- make importing fstab cope with changing disk names (#309774) +- version 2.15.26 + +------------------------------------------------------------------- +Tue Sep 18 18:22:57 CEST 2007 - fehr@suse.de + +- fix wrong cryptotab line for old style encryption (#325597) + +------------------------------------------------------------------- @@ -4 +15 @@ -- version 2.15.24 +- version 2.15.25 Old: ---- yast2-storage-2.15.25.tar.bz2 New: ---- yast2-storage-2.15.26.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-storage.spec ++++++ --- /var/tmp/diff_new_pack.R25396/_old 2007-09-20 23:04:31.000000000 +0200 +++ /var/tmp/diff_new_pack.R25396/_new 2007-09-20 23:04:31.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-storage (Version 2.15.25) +# spec file for package yast2-storage (Version 2.15.26) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,12 +11,12 @@ # norootforbuild Name: yast2-storage -Version: 2.15.25 +Version: 2.15.26 Release: 1 License: GPL v2 or later Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-storage-2.15.25.tar.bz2 +Source0: yast2-storage-2.15.26.tar.bz2 Prefix: /usr BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen evms evms-devel gcc-c++ libxcrypt-devel libxslt openssl-devel perl-XML-Writer sablot sgml-skel swig update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-installation yast2-perl-bindings yast2-testsuite # Required only in inst-sys @@ -44,7 +44,7 @@ %prep -%setup -n yast2-storage-2.15.25 +%setup -n yast2-storage-2.15.26 %build %{prefix}/bin/y2tool y2autoconf @@ -172,10 +172,14 @@ %doc %{prefix}/share/doc/packages/yast2-storage/examples %doc %{prefix}/share/doc/packages/yast2-storage/libstorage %doc %{prefix}/share/doc/packages/yast2-storage/config.xml.description - %changelog +* Thu Sep 20 2007 - fehr@suse.de +- make importing fstab cope with changing disk names (#309774) +- version 2.15.26 +* Tue Sep 18 2007 - fehr@suse.de +- fix wrong cryptotab line for old style encryption (#325597) * Mon Sep 17 2007 - fehr@suse.de -- version 2.15.24 +- version 2.15.25 * Thu Sep 13 2007 - fehr@suse.de - change activation of md devices (#309841) * Tue Sep 11 2007 - fehr@suse.de ++++++ yast2-storage-2.15.25.tar.bz2 -> yast2-storage-2.15.26.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/libstorage/src/LoopCo.h new/yast2-storage-2.15.26/libstorage/src/LoopCo.h --- old/yast2-storage-2.15.25/libstorage/src/LoopCo.h 2007-07-18 12:39:00.000000000 +0200 +++ new/yast2-storage-2.15.26/libstorage/src/LoopCo.h 2007-09-18 13:49:59.000000000 +0200 @@ -90,7 +90,6 @@ bool findLoopDev( const string& dev, LoopIter& i ); void addLoop( Loop* m ); void updateEntry( const Loop* m ); - static int getFreeLoop( string& dev ); void init(); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/libstorage/src/Storage.cc new/yast2-storage-2.15.26/libstorage/src/Storage.cc --- old/yast2-storage-2.15.25/libstorage/src/Storage.cc 2007-09-13 12:17:22.000000000 +0200 +++ new/yast2-storage-2.15.26/libstorage/src/Storage.cc 2007-09-20 14:56:00.000000000 +0200 @@ -5748,6 +5748,7 @@ Storage::readFstab( const string& dir, deque<VolumeInfo>& infos ) { static deque<VolumeInfo> vil; + static Regex disk_part( "^/dev/[sh]d[a-z]+[0-9]+$" ); vil.clear(); bool ret = false; VolIterator vol; @@ -5759,13 +5760,31 @@ for( list<FstabEntry>::const_iterator i=le.begin(); i!=le.end(); ++i ) { y2mil( "entry:" << *i ); - if( findVolume( i->dentry, vol ) ) + VolumeInfo* info = NULL; + if( disk_part.match( i->dentry ) ) { - VolumeInfo info; - vol->getInfo( info ); - vol->mergeFstabInfo( info, *i ); + info = new VolumeInfo; + info->create = info->format = info->resize = false; + info->sizeK = info->OrigSizeK = info->minor = info->major = 0; + info->device = i->dentry; + info->mount = i->mount; + info->mount_by = MOUNTBY_DEVICE; + info->fs = Volume::toFsType( i->fs ); + info->fstab_options = mergeString( i->opts, "," ); + vil.push_back( *info ); + } + else if( findVolume( i->dentry, vol ) ) + { + info = new VolumeInfo; + vol->getInfo( *info ); + vol->mergeFstabInfo( *info, *i ); y2mil( "volume:" << *vol ); - vil.push_back( info ); + vil.push_back( *info ); + } + if( info ) + { + delete info; + info = NULL; } } delete fstab; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/libstorage/src/Volume.cc new/yast2-storage-2.15.26/libstorage/src/Volume.cc --- old/yast2-storage-2.15.25/libstorage/src/Volume.cc 2007-09-05 12:06:17.000000000 +0200 +++ new/yast2-storage-2.15.26/libstorage/src/Volume.cc 2007-09-18 18:19:15.000000000 +0200 @@ -2268,7 +2268,7 @@ if( cont->type()!=LOOP ) { if( dmcrypt() ) - ret = optNoauto()?dev:dmcrypt_dev; + ret = (inCryptotab()||optNoauto())?dev:dmcrypt_dev; else ret = getMountByString( mount_by, dev, uuid, label ); } @@ -2414,8 +2414,11 @@ { changed = true; che.encr = encryption; - if( !dmcrypt() ) + if( inCryptotab() ) + { + getFreeLoop(); che.loop_dev = fstab_loop_dev; + } che.dentry = de; if( encryption!=ENC_NONE ) che.freq = che.passno = 0; @@ -2448,8 +2451,11 @@ che.encr = encryption; if( dmcrypt() && isTmpCryptMp(mp) && crypt_pwd.empty() ) che.tmpcrypt = true; - if( !dmcrypt() ) + if( inCryptotab() ) + { + getFreeLoop(); che.loop_dev = fstab_loop_dev; + } che.fs = fs_names[fs]; getFstabOpts( che.opts ); che.mount = mp; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/libstorage/src/Volume.h new/yast2-storage-2.15.26/libstorage/src/Volume.h --- old/yast2-storage-2.15.25/libstorage/src/Volume.h 2007-08-28 17:07:46.000000000 +0200 +++ new/yast2-storage-2.15.26/libstorage/src/Volume.h 2007-09-18 14:42:13.000000000 +0200 @@ -157,7 +157,7 @@ string sizeString() const; string bootMount() const; bool optNoauto() const; - bool inCryptotab() const { return( encryption!=ENC_LUKS && is_loop && !optNoauto() ); } + bool inCryptotab() const { return( encryption!=ENC_LUKS && !optNoauto() ); } bool inCrypttab() const { return( encryption==ENC_LUKS && !optNoauto() ); } virtual void print( std::ostream& s ) const { s << *this; } int getFreeLoop(); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/storage/src/include/custom_part_lib.ycp new/yast2-storage-2.15.26/storage/src/include/custom_part_lib.ycp --- old/yast2-storage-2.15.25/storage/src/include/custom_part_lib.ycp 2007-08-27 15:41:53.000000000 +0200 +++ new/yast2-storage-2.15.26/storage/src/include/custom_part_lib.ycp 2007-09-20 15:52:49.000000000 +0200 @@ -13,7 +13,7 @@ * ************************************************************* * - $Id: custom_part_lib.ycp 40502 2007-08-27 13:41:53Z fehr $ + $Id: custom_part_lib.ycp 40987 2007-09-20 13:52:49Z fehr $ * */ @@ -28,6 +28,61 @@ #include "partitioning/partition_defines.ycp"; +define string mountVar( map var, map root, string rdev, string mp, + map<string,map> targetMap ) + ``{ + string ret = ""; + boolean mount_success = false; + y2milestone( "mountVar rdev:%1 mp:%2 var:%3 root:%4", rdev, mp, var, root ); + if( var["size_k"]:0>0 ) + { + ret = var["device"]:""; + } + else + { + list<string> ds = maplist( string d, map disk, targetMap, ``(d)); + y2milestone( "mountVar ds:%1", ds ); + ds = filter( string d, ds, ``(targetMap[d,"type"]:`CT_UNKNOWN==`CT_DISK)); + y2milestone( "mountVar ds:%1", ds ); + map rootm = Storage::GetDiskPartition( rdev ); + map rootf = Storage::GetDiskPartition( root["device"]:"" ); + map varf = Storage::GetDiskPartition( var["device"]:"" ); + if( rootf["disk"]:""==varf["disk"]:"" ) + { + ret = Storage::GetDeviceName( rootm["disk"]:"", varf["nr"]:(any)0 ); + } + else if( size(ds)==1 ) + { + ret = Storage::GetDeviceName( ds[0]:"", varf["nr"]:(any)0 ); + } + else if( size(ds)>1 ) + { + integer i = 0; + while( i<size(ds) && size(ret)==0 ) + { + ret = Storage::GetDeviceName( ds[i]:"", varf["nr"]:(any)0 ); + if( size(Storage::GetPartition( targetMap, ret ))>0 && + Storage::Mount( ret, mp ) ) + { + map d = (map)SCR::Read( .target.stat, mp+"/lib/hardware" ); + y2milestone( "mountVar d:%1", d ); + if( !d["isdir"]:false ) + ret = ""; + Storage::Umount( ret ); + } + else + ret = ""; + i = i+1; + } + } + } + if( size(ret)>0 && !Storage::Mount( ret, mp )) + ret = ""; + y2milestone( "mountVar ret:%1", ret ); + return( ret ); + } + + /** * Find and read fstab by installation. Scan existing partitions. * @parm targetMap all targets @@ -38,14 +93,15 @@ ``{ ///////////////////////////////////////////////////////////////// // foreach partition on each target - list<list> fstab = []; - list skip_fs = [ `unknown, `swap, `vfat, `ntfs ]; + list<list> fstab = []; + list skip_fs = [ `unknown, `swap, `vfat, `ntfs ]; foreach( string dev, map disk, targetMap, ``{ foreach( map part, filter( map p, disk["partitions"]:[], - ``(!contains( skip_fs, p["detected_fs"]:`unknown) )), + ``(!contains( skip_fs, + p["detected_fs"]:`unknown) )), ``{ ///////////////////////////////////////////////////// // try to mount @@ -55,10 +111,40 @@ if( mount_success && SCR::Read(.target.size, search_point+"/etc/fstab") > 0 ) { - list tmp = Storage::ReadFstab( search_point+"/etc" ); + list<map> tmp = + (list<map>)Storage::ReadFstab( search_point+"/etc" ); y2milestone( "findExistingFstab fstab %1", tmp ); if( size(tmp)>0 ) { + if( find( map p, tmp, ``(p["size_k"]:0==0 ))!=nil ) + { + string vardev = ""; + map var = find( map p, tmp, ``(p["mount"]:""=="/var")); + map root = find( map p, tmp, ``(p["mount"]:""=="/")); + y2milestone( "findExistingFstab var %1", var ); + if( var != nil ) + { + vardev = mountVar( var, root, part["device"]:"", + search_point+"/var", targetMap ); + y2milestone( "findExistingFstab vardev %1", + vardev ); + } + map dmap = Storage::BuildDiskmap( $[] ); + if( size(dmap)>0 ) + { + y2milestone( "findExistingFstab dmap %1", dmap ); + y2milestone( "findExistingFstab tmp %1", tmp ); + tmp = maplist( map p, tmp, + ``{ + if( p["size_k"]:0 == 0 ) + p["device"] = Storage::HdDiskMap( p["device"]:"", dmap ); + return( p ); + }); + y2milestone( "findExistingFstab tmp %1", tmp ); + } + if( size(vardev)>0 ) + Storage::Umount( vardev ); + } fstab = add( fstab, tmp ); } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/storage/src/modules/Storage.ycp new/yast2-storage-2.15.26/storage/src/modules/Storage.ycp --- old/yast2-storage-2.15.25/storage/src/modules/Storage.ycp 2007-09-10 19:15:39.000000000 +0200 +++ new/yast2-storage-2.15.26/storage/src/modules/Storage.ycp 2007-09-20 15:52:49.000000000 +0200 @@ -19,7 +19,7 @@ * wurde versucht "intelligent" zu gestallten und ist im einzelen bei den * entspechenden Funktionen n�her erkl�rt. * - * $Id: Storage.ycp 40839 2007-09-10 17:15:39Z fehr $ + * $Id: Storage.ycp 40987 2007-09-20 13:52:49Z fehr $ */ { @@ -5243,10 +5243,12 @@ } -define map BuildDiskmap( map oldv ) +global define map BuildDiskmap( map oldv ) ``{ map d = (map)SCR::Read( .target.stat, Installation::destdir + "/var/lib/hardware" ); + if( !d["isdir"]:false ) + DiskMap = $[]; if( d["isdir"]:false && (oldv != DiskMapVersion || size(oldv)==0) ) { DiskMap = $[]; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.25/VERSION new/yast2-storage-2.15.26/VERSION --- old/yast2-storage-2.15.25/VERSION 2007-09-17 14:26:13.000000000 +0200 +++ new/yast2-storage-2.15.26/VERSION 2007-09-20 15:51:57.000000000 +0200 @@ -1 +1 @@ -2.15.25 +2.15.26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de