Hello community,
here is the log from the commit of package yast2-storage
checked in at Mon Jul 2 18:28:12 CEST 2007.
--------
--- yast2-storage/yast2-storage.changes 2007-06-27 11:35:50.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-storage/yast2-storage.changes 2007-07-02 18:10:27.000000000 +0200
@@ -1,0 +2,12 @@
+Mon Jul 2 18:08:11 CEST 2007 - fehr@suse.de
+
+- make sure util-linux-crypto gets installed and boot.crypto is
+ insserved (#279900)
+- version 2.15.18
+
+-------------------------------------------------------------------
+Mon Jul 02 18:09:18 CEST 2007 - aschnell@suse.de
+
+- handle old encryption types with cryptsetup (bug #258222)
+
+-------------------------------------------------------------------
@@ -18 +30 @@
-- add menu extry to call iSCSI client setup (#278554)
+- add menu entry to call iSCSI client setup (#278554)
@@ -27 +39 @@
-- fix fs type detection for luks encrypted volumes
+- fix fs type detection for luks encrypted volumes
@@ -38 +50 @@
-- fix missing ldconfig call detect by RPMLINT
+- fix missing ldconfig call detect by RPMLINT
Old:
----
yast2-storage-2.15.17.tar.bz2
New:
----
yast2-storage-2.15.18.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-storage.spec ++++++
--- /var/tmp/diff_new_pack.S29617/_old 2007-07-02 18:27:01.000000000 +0200
+++ /var/tmp/diff_new_pack.S29617/_new 2007-07-02 18:27:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-storage (Version 2.15.17)
+# spec file for package yast2-storage (Version 2.15.18)
#
# 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.17
+Version: 2.15.18
Release: 1
-License: GNU General Public License (GPL)
+License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-storage-2.15.17.tar.bz2
+Source0: yast2-storage-2.15.18.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.17
+%setup -n yast2-storage-2.15.18
%build
%{prefix}/bin/y2tool y2autoconf
@@ -170,6 +170,12 @@
%doc %{prefix}/share/doc/packages/yast2-storage/config.xml.description
%changelog
+* Mon Jul 02 2007 - aschnell@suse.de
+- handle old encryption types with cryptsetup (bug #258222)
+* Mon Jul 02 2007 - fehr@suse.de
+- make sure util-linux-crypto gets installed and boot.crypto is
+ insserved (#279900)
+- version 2.15.18
* Tue Jun 26 2007 - fehr@suse.de
- add windows default mount points also in VM proposal (#262417)
- prevent win mount points on hotplug devices (#287252)
@@ -179,7 +185,7 @@
- prevent direct or indirect change of partitions used for swap or
as install source during installation (#274321,#262417)
* Mon Jun 18 2007 - fehr@suse.de
-- add menu extry to call iSCSI client setup (#278554)
+- add menu entry to call iSCSI client setup (#278554)
- version 2.15.16
* Thu Jun 14 2007 - fehr@suse.de
- use provided fstab options when mounting filesystems
++++++ yast2-storage-2.15.17.tar.bz2 -> yast2-storage-2.15.18.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/DmCo.cc new/yast2-storage-2.15.18/libstorage/src/DmCo.cc
--- old/yast2-storage-2.15.17/libstorage/src/DmCo.cc 2007-06-14 17:51:48.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/DmCo.cc 2007-07-02 18:07:38.000000000 +0200
@@ -67,6 +67,44 @@
dev = "/dev/mapper";
}
+
+// dev should be something like /dev/mapper/cr_test
+storage::EncryptType
+DmCo::detectEncryption( const string& dev ) const
+{
+ storage::EncryptType ret = ENC_UNKNOWN;
+
+ if( dev.substr( 0, 12 ) == "/dev/mapper/")
+ {
+ string tdev = dev.substr (12);
+ SystemCmd c( "cryptsetup status \"" + tdev + "\"" );
+
+ string cipher, keysize;
+ for( unsigned int i = 0; i < c.numLines(); i++)
+ {
+ string line = *c.getLine(i);
+ string key = extractNthWord( 0, line );
+ if( key == "cipher:" )
+ cipher = extractNthWord( 1, line );
+ if( key == "keysize:" )
+ keysize = extractNthWord( 1, line );
+ }
+
+ if( cipher == "aes-cbc-essiv:sha256" )
+ ret = ENC_LUKS;
+ else if( cipher == "twofish-cbc-plain" )
+ ret = ENC_TWOFISH;
+ else if( cipher == "twofish-cbc-null" && keysize == "192" )
+ ret = ENC_TWOFISH_OLD;
+ else if( cipher == "twofish-cbc-null" && keysize == "256" )
+ ret = ENC_TWOFISH256_OLD;
+ }
+
+ y2milestone( "ret:%d", ret );
+ return ret;
+}
+
+
void
DmCo::getDmData( ProcPart& ppart )
{
@@ -155,7 +193,7 @@
{
skip = true;
getStorage()->setDmcryptData( it->first, m->device(), min_num,
- m->sizeK() );
+ m->sizeK(), detectEncryption (m->device()) );
getStorage()->setUsedBy( it->first, UB_NONE, "" );
}
if( !skip && m->sizeK()>0 )
@@ -173,7 +211,7 @@
addToList( m );
else
{
- y2warning( "addDm alread exists %u", m->nr() );
+ y2warning( "addDm already exists %u", m->nr() );
delete m;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/DmCo.h new/yast2-storage-2.15.18/libstorage/src/DmCo.h
--- old/yast2-storage-2.15.17/libstorage/src/DmCo.h 2007-06-14 17:45:20.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/DmCo.h 2007-07-02 18:07:38.000000000 +0200
@@ -29,7 +29,6 @@
DmCo( Storage * const s, const string& File );
void getDmData( ProcPart& ppart );
- void getDmData( unsigned num );
bool findDm( unsigned num, DmIter& i );
bool findDm( unsigned num );
bool findDm( const string& dev, DmIter& i );
@@ -41,6 +40,8 @@
void init();
+ storage::EncryptType detectEncryption( const string& device ) const;
+
virtual void print( std::ostream& s ) const { s << *this; }
int doRemove( Volume* v );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/Storage.cc new/yast2-storage-2.15.18/libstorage/src/Storage.cc
--- old/yast2-storage-2.15.17/libstorage/src/Storage.cc 2007-06-21 11:42:29.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/Storage.cc 2007-07-02 18:07:38.000000000 +0200
@@ -5337,7 +5337,8 @@
}
bool Storage::setDmcryptData( const string& dev, const string& dm,
- unsigned dmnum, unsigned long long siz )
+ unsigned dmnum, unsigned long long siz,
+ storage::EncryptType typ )
{
y2milestone( "dev:%s dm:%s dmn:%u sizeK:%llu", dev.c_str(), dm.c_str(),
dmnum, siz );
@@ -5346,7 +5347,7 @@
if( dm.find("/temporary-cryptsetup-")==string::npos &&
findVolume( dev, v ) )
{
- v->setDmcryptDev( dm, siz!=0 );
+ v->setDmcryptDevEnc( dm, typ, siz!=0 );
v->replaceAltName( "/dev/dm-", Dm::dmDeviceName(dmnum) );
v->setSize( siz );
ret = true;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/Storage.h new/yast2-storage-2.15.18/libstorage/src/Storage.h
--- old/yast2-storage-2.15.17/libstorage/src/Storage.h 2007-06-14 17:50:03.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/Storage.h 2007-07-02 18:07:38.000000000 +0200
@@ -232,7 +232,8 @@
bool canUseDevice( const string& dev, bool disks_allowed=false );
bool knownDevice( const string& dev, bool disks_allowed=false );
bool setDmcryptData( const string& dev, const string& dm,
- unsigned dmnum, unsigned long long siz );
+ unsigned dmnum, unsigned long long siz,
+ storage::EncryptType typ );
bool deletedDevice( const string& dev );
bool isDisk( const string& dev );
const Volume* getVolume( const string& dev );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/Volume.cc new/yast2-storage-2.15.18/libstorage/src/Volume.cc
--- old/yast2-storage-2.15.17/libstorage/src/Volume.cc 2007-06-25 17:43:56.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/Volume.cc 2007-07-02 18:07:38.000000000 +0200
@@ -69,11 +69,20 @@
nm = dev.substr( 5 );
}
+// TODO: maybe obsoleted by function setDmcryptDevEnc
void Volume::setDmcryptDev( const string& dm, bool active )
{
y2mil( "dev:" << dev << " dm:" << dm << " active:" << active );
dmcrypt_dev = dm;
- encryption = orig_encryption = ENC_LUKS;
+ dmcrypt_active = active;
+ y2mil( "this:" << *this );
+ }
+
+void Volume::setDmcryptDevEnc( const string& dm, storage::EncryptType typ, bool active )
+ {
+ y2mil( "dev:" << dev << " dm:" << dm << " type:" << typ << " active:" << active );
+ dmcrypt_dev = dm;
+ encryption = orig_encryption = typ;
dmcrypt_active = active;
y2mil( "this:" << *this );
}
@@ -81,7 +90,7 @@
bool Volume::sameDevice( const string& device ) const
{
string d = normalizeDevice(device);
- return( d==dev ||
+ return( d==dev ||
find( alt_names.begin(), alt_names.end(), d )!=alt_names.end() );
}
@@ -102,7 +111,7 @@
if( mp=="swap" && mb==MOUNTBY_UUID )
mb = MOUNTBY_DEVICE;
y2mil( "path:" << udevPath() << " id:" << udevId() );
- if( (mb==MOUNTBY_PATH && udevPath().empty()) ||
+ if( (mb==MOUNTBY_PATH && udevPath().empty()) ||
(mb==MOUNTBY_ID && udevId().empty()) )
mb = MOUNTBY_DEVICE;
if( encryption != ENC_NONE &&
@@ -121,7 +130,7 @@
if( (mby==MOUNTBY_PATH && udevPath().empty()) ||
(mby==MOUNTBY_ID && udevId().empty()) )
ret = false;
- if( ret && encryption != ENC_NONE &&
+ if( ret && encryption != ENC_NONE &&
(mby==MOUNTBY_UUID || mby==MOUNTBY_LABEL) )
ret = false;
y2mil( "mby:" << mb_names[mby] << " mp:" << mp << " ret:" << ret )
@@ -434,8 +443,8 @@
{
uuid = i->second;
b << " uuid:" << uuid;
- list<string>::iterator i = find_if( alt_names.begin(),
- alt_names.end(),
+ list<string>::iterator i = find_if( alt_names.begin(),
+ alt_names.end(),
find_any( "/by-uuid/" ) );
if( i!=alt_names.end() )
{
@@ -448,8 +457,8 @@
{
label = orig_label = i->second;
b << " label:\"" << label << "\"";
- list<string>::iterator i = find_if( alt_names.begin(),
- alt_names.end(),
+ list<string>::iterator i = find_if( alt_names.begin(),
+ alt_names.end(),
find_any( "/by-label/" ) );
if( i!=alt_names.end() )
{
@@ -697,7 +706,6 @@
for( unsigned i=0; igetStorage()->test() )
{
@@ -791,7 +799,7 @@
SystemCmd c( cmd );
if( c.retcode()!=0 )
ret = VOLUME_TUNE2FS_FAILED;
- if( ret==0 && mp=="/" &&
+ if( ret==0 && mp=="/" &&
(fstab_opt.find( "data=writeback" )!=string::npos ||
fstab_opt.find( "data=journal" )!=string::npos) )
{
@@ -836,7 +844,8 @@
}
if( needMount )
{
- int r = mount( (ret==0)?mp:orig_mp );
+ // possible change of mp is handled later in doMount
+ int r = mount( orig_mp );
ret = (ret==0)?r:ret;
}
y2milestone( "ret:%d", ret );
@@ -1029,7 +1038,9 @@
else if( !orig_mp.empty() )
{
string fn = "/etc/fstab";
- if( encryption!=ENC_NONE && !optNoauto() )
+ if( inCrypttab() )
+ fn = "/etc/crypttab";
+ if( inCryptotab() )
fn = "/etc/cryptotab";
// displayed text before action, %1$s is replaced by device name e.g. /dev/hda1
// %2$s is replaced by pathname e.g. /etc/fstab
@@ -1275,7 +1286,7 @@
if( ret==0 && format )
{
encryption = typ;
- is_loop = encryption!=ENC_LUKS || cont->type()==LOOP;
+ is_loop = cont->type()==LOOP;
}
if( ret==0 && !format && !loop_active )
{
@@ -1422,80 +1433,110 @@
return( ret );
}
-string Volume::getLosetupCmd( storage::EncryptType e, const string& pwdfile ) const
+string Volume::getLosetupCmd( storage::EncryptType, const string& pwdfile ) const
{
string cmd = "/sbin/losetup";
- if( e!=ENC_NONE && e!=ENC_LUKS )
- cmd += " -e " + encTypeString(e);
- switch( e )
- {
- case ENC_TWOFISH:
- cmd = "rmmod loop_fish2; modprobe twofish; modprobe cryptoloop; " +
- cmd;
- break;
- case ENC_TWOFISH_OLD:
- case ENC_TWOFISH256_OLD:
- cmd = "rmmod twofish cryptoloop; modprobe loop_fish2; " + cmd;
- break;
- default:
- break;
- }
cmd += " ";
cmd += loop_dev;
cmd += " ";
- if( cont->type()!=LOOP )
- cmd += dev;
- else
- {
- const Loop* l = static_cast(this);
- cmd += l->lfileRealPath();
- }
- if( e!=ENC_LUKS )
- {
- cmd += " -p0 < ";
- cmd += pwdfile;
- }
+ const Loop* l = static_cast(this);
+ cmd += l->lfileRealPath();
y2milestone( "cmd:%s", cmd.c_str() );
return( cmd );
}
-string Volume::getCryptsetupCmd( const string& dmdev, const string& mount,
- const string& pwdf, bool format,
- bool empty_pwd ) const
+string Volume::getCryptsetupCmd( storage::EncryptType e, const string& dmdev,
+ const string& mount, const string& pwdf,
+ bool format, bool empty_pwd ) const
{
string table = dmdev;
- y2mil( "dmdev:" << dmdev << " mount:" << mount << " format:" << format <<
- " pwempty:" << empty_pwd );
+ y2mil( "enctype:" << e << " dmdev:" << dmdev << " mount:" << mount <<
+ " format:" << format << " pwempty:" << empty_pwd );
if( table.find( '/' )!=string::npos )
table.erase( 0, table.find_last_of( '/' )+1 );
string cmd = "/sbin/cryptsetup -q";
+
if( format )
+ {
+ switch( e )
{
- if( isTmpCryptMp(mount) && empty_pwd )
- {
- cmd += " --key-file /dev/urandom create";
- cmd += ' ';
- cmd += table;
- cmd += ' ';
- cmd += is_loop?loop_dev:dev;
- }
- else
- {
- cmd += " luksFormat";
- cmd += ' ';
- cmd += is_loop?loop_dev:dev;
- cmd += ' ';
- cmd += pwdf;
- }
+ case ENC_LUKS:
+ if( isTmpCryptMp(mount) && empty_pwd )
+ {
+ cmd += " --key-file /dev/urandom create";
+ cmd += ' ';
+ cmd += table;
+ cmd += ' ';
+ cmd += is_loop?loop_dev:dev;
+ }
+ else
+ {
+ cmd += " luksFormat";
+ cmd += ' ';
+ cmd += is_loop?loop_dev:dev;
+ cmd += ' ';
+ cmd += pwdf;
+ }
+ break;
+
+ case ENC_TWOFISH:
+ case ENC_TWOFISH_OLD:
+ case ENC_TWOFISH256_OLD:
+ cmd = "";
+ break;
+
+ case ENC_NONE:
+ case ENC_UNKNOWN:
+ cmd = "";
+ break;
}
+ }
else
+ {
+ switch( e )
{
- cmd += " --key-file " + pwdf;
- cmd += " luksOpen ";
- cmd += is_loop?loop_dev:dev;
- cmd += ' ';
- cmd += table;
+ case ENC_LUKS:
+ cmd += " --key-file " + pwdf;
+ cmd += " luksOpen ";
+ cmd += is_loop?loop_dev:dev;
+ cmd += ' ';
+ cmd += table;
+ break;
+
+ case ENC_TWOFISH:
+ cmd += " --hash sha512 --cipher twofish";
+ cmd += " create ";
+ cmd += table;
+ cmd += ' ';
+ cmd += is_loop?loop_dev:dev;
+ cmd += " < " + pwdf;
+ break;
+
+ case ENC_TWOFISH_OLD:
+ cmd += " --hash ripemd160:20 --cipher twofish-cbc-null --key-size 192";
+ cmd += " create ";
+ cmd += table;
+ cmd += ' ';
+ cmd += is_loop?loop_dev:dev;
+ cmd += " < " + pwdf;
+ break;
+
+ case ENC_TWOFISH256_OLD:
+ cmd += " --hash sha512 --cipher twofish-cbc-null --key-size 256";
+ cmd += " create ";
+ cmd += table;
+ cmd += ' ';
+ cmd += is_loop?loop_dev:dev;
+ cmd += " < " + pwdf;
+ break;
+
+ case ENC_NONE:
+ case ENC_UNKNOWN:
+ cmd = "";
+ break;
}
+ }
+
y2milestone( "cmd:%s", cmd.c_str() );
return( cmd );
}
@@ -1529,14 +1570,17 @@
bool Volume::needLosetup() const
{
- return( (is_loop!=loop_active) &&
+ return( (is_loop!=loop_active) &&
(encryption==ENC_NONE || !crypt_pwd.empty() ||
(dmcrypt()&&cont->type()==LOOP)) );
}
bool Volume::needCryptsetup() const
{
- return( dmcrypt()!=dmcrypt_active &&
+ if (dmcrypt() && encryption != orig_encryption)
+ return true;
+
+ return( dmcrypt()!=dmcrypt_active &&
(encryption==ENC_NONE || !crypt_pwd.empty() || isTmpCryptMp(mp)));
}
@@ -1546,10 +1590,10 @@
}
bool Volume::needFstabUpdate() const
- {
+ {
bool ret = !ignore_fstab && !(mp.empty() && orig_mp.empty()) &&
(fstab_opt!=orig_fstab_opt || mount_by!=orig_mount_by ||
- encryption!=orig_encryption);
+ encryption!=orig_encryption);
return( ret );
}
@@ -1565,7 +1609,7 @@
}
unsigned pos=0;
- static EncryptType try_order[] = { ENC_LUKS, ENC_TWOFISH_OLD,
+ static EncryptType try_order[] = { ENC_LUKS, ENC_TWOFISH_OLD,
ENC_TWOFISH256_OLD, ENC_TWOFISH };
string fname = cont->getStorage()->tmpDir()+"/pwdf";
string mpname = cont->getStorage()->tmpDir()+"/mp";
@@ -1577,32 +1621,24 @@
detected_fs = fs = FSUNKNOWN;
do
{
- bool losetup = try_order[pos]!=ENC_LUKS;
ofstream pwdfile( fname.c_str() );
pwdfile << crypt_pwd;
- if( losetup )
- pwdfile << endl;
pwdfile.close();
encryption = orig_encryption = try_order[pos];
- is_loop = losetup || cont->type()==LOOP;
- dmcrypt_dev = losetup ? "" : getDmcryptName();
+ is_loop = cont->type()==LOOP;
+ dmcrypt_dev = getDmcryptName();
crUnsetup( true );
- if( is_loop && !losetup )
+ if( is_loop )
{
string lfile;
if( getLoopFile( lfile ))
- c.execute( "losetup " + loop_dev + " " +
+ c.execute( "losetup " + loop_dev + " " +
cont->getStorage()->root() + lfile );
}
- string cmd = losetup ? getLosetupCmd( try_order[pos], fname )
- : getCryptsetupCmd( dmcrypt_dev, "", fname,
- false );
- if( !losetup )
- {
- c.execute( "modprobe dm-crypt; modprobe aes" );
- }
+ string cmd = getCryptsetupCmd( try_order[pos], dmcrypt_dev, "", fname, false );
+ c.execute( "modprobe dm-crypt" );
c.execute( cmd );
- string use_dev = losetup?loop_dev:dmcrypt_dev;
+ string use_dev = dmcrypt_dev;
if( c.retcode()==0 )
{
cont->getStorage()->waitForDevice( use_dev );
@@ -1652,7 +1688,7 @@
crUnsetup( true );
if( detected_fs!=FSUNKNOWN )
{
- is_loop = try_order[pos]!=ENC_LUKS || cont->type()==LOOP;
+ is_loop = cont->type()==LOOP;
ret = encryption = orig_encryption = try_order[pos];
}
else
@@ -1795,26 +1831,38 @@
}
if( ret==0 )
{
+ ret = cryptUnsetup();
+ }
+ if( ret==0 )
+ {
string fname = cont->getStorage()->tmpDir()+"/pwdf";
ofstream pwdfile( fname.c_str() );
pwdfile << crypt_pwd;
pwdfile.close();
- SystemCmd c;
- if( format || isTmpCryptMp(mp) )
+ SystemCmd cmd;
+ if( format || (isTmpCryptMp(mp)&&crypt_pwd.empty()) )
{
- c.execute( getCryptsetupCmd( dmcrypt_dev, mp, fname, true,
- crypt_pwd.empty() ));
- if( c.retcode()!=0 )
+ string cmdline = getCryptsetupCmd( encryption, dmcrypt_dev, mp, fname, true,
+ crypt_pwd.empty() );
+ if( !cmdline.empty() )
+ {
+ cmd.execute( cmdline );
+ if( cmd.retcode()!=0 )
ret = VOLUME_CRYPTFORMAT_FAILED;
if( ret==0 && mp=="swap" )
- c.execute( "mkswap " + dmcrypt_dev );
+ cmd.execute( "mkswap " + dmcrypt_dev );
+ }
}
if( ret==0 && (!isTmpCryptMp(mp)||!crypt_pwd.empty()) )
{
- c.execute( getCryptsetupCmd( dmcrypt_dev, mp, fname, false ));
- if( c.retcode()!=0 )
+ string cmdline = getCryptsetupCmd( encryption, dmcrypt_dev, mp, fname, false );
+ if( !cmdline.empty() )
+ {
+ cmd.execute( cmdline );
+ if( cmd.retcode()!=0 )
ret = VOLUME_CRYPTSETUP_FAILED;
}
+ }
unlink( fname.c_str() );
rmdir( cont->getStorage()->tmpDir().c_str() );
cont->getStorage()->waitForDevice( dmcrypt_dev );
@@ -2018,7 +2066,7 @@
else if( fs == FSUNKNOWN )
fsn = "auto";
const char * ign_opt[] = { "defaults", "" };
- const char * ign_beg[] = { "loop", "encryption=", "phash=",
+ const char * ign_beg[] = { "loop", "encryption=", "phash=",
"itercountk=" };
if( cont->getStorage()->instsys() )
ign_opt[1] = "ro";
@@ -2027,7 +2075,7 @@
for( unsigned i=0; itype()==LOOP ))
{
lstr = "loop";
@@ -2280,8 +2328,8 @@
{
string fname;
if( fstab->findDevice( dev, entry ) ||
- fstab->findDevice( alt_names, entry ) ||
- (cont->type()==LOOP && getLoopFile(fname) &&
+ fstab->findDevice( alt_names, entry ) ||
+ (cont->type()==LOOP && getLoopFile(fname) &&
fstab->findDevice( fname, entry )))
{
y2mil( "changed:" << entry )
@@ -2331,7 +2379,7 @@
if( !silent() && !fstab_added )
{
cont->getStorage()->showInfoCb(
- fstab->updateText( true, inCryptotab(),
+ fstab->updateText( true, inCryptotab(),
che.mount ));
}
y2mil( "update fstab: " << che );
@@ -2362,7 +2410,7 @@
}
if( !silent() )
{
- cont->getStorage()->showInfoCb(
+ cont->getStorage()->showInfoCb(
fstab->addText( true, inCryptotab(), che.mount ));
}
ret = fstab->addEntry( che );
@@ -2375,7 +2423,7 @@
}
}
if( ret==0 && !format && !cont->getStorage()->instsys() &&
- fstab_opt!=orig_fstab_opt && !orig_fstab_opt.empty() &&
+ fstab_opt!=orig_fstab_opt && !orig_fstab_opt.empty() &&
mp==orig_mp && mp!="swap" )
{
y2mil( "fstab_opt:" << fstab_opt << " fstab_opt_orig:" << orig_fstab_opt );
@@ -2457,7 +2505,7 @@
{
bool need = false;
need = mp!=orig_mp;
- if( !need && !mp.empty() && !isMounted() && !optNoauto() &&
+ if( !need && !mp.empty() && !isMounted() && !optNoauto() &&
is_loop==loop_active )
need = true;
return( need );
@@ -2718,11 +2766,11 @@
{
s << " alt_names:" << v.alt_names;
}
- if( v.encryption != storage::ENC_NONE ||
+ if( v.encryption != storage::ENC_NONE ||
v.orig_encryption != storage::ENC_NONE )
{
s << " encr:" << v.enc_names[v.encryption];
- if( v.encryption != v.orig_encryption &&
+ if( v.encryption != v.orig_encryption &&
v.orig_encryption!=storage::ENC_NONE )
s << " orig_encr:" << v.enc_names[v.orig_encryption];
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
@@ -2879,7 +2927,7 @@
fs==rhs.fs && mount_by==rhs.mount_by &&
uuid==rhs.uuid && label==rhs.label && mp==rhs.mp &&
fstab_opt==rhs.fstab_opt && mkfs_opt==rhs.mkfs_opt &&
- dtxt==rhs.dtxt &&
+ dtxt==rhs.dtxt &&
is_loop==rhs.is_loop && loop_active==rhs.loop_active &&
is_mounted==rhs.is_mounted && encryption==rhs.encryption &&
loop_dev==rhs.loop_dev && fstab_loop_dev==rhs.fstab_loop_dev &&
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/libstorage/src/Volume.h new/yast2-storage-2.15.18/libstorage/src/Volume.h
--- old/yast2-storage-2.15.17/libstorage/src/Volume.h 2007-06-21 11:38:33.000000000 +0200
+++ new/yast2-storage-2.15.18/libstorage/src/Volume.h 2007-07-02 18:07:38.000000000 +0200
@@ -65,7 +65,7 @@
int changeMountBy( storage::MountByType mby );
virtual int changeMount( const string& m );
bool loop() const { return is_loop; }
- bool dmcrypt() const { return( encryption==ENC_LUKS ); }
+ bool dmcrypt() const { return encryption != ENC_NONE && encryption != ENC_UNKNOWN; }
bool loopActive() const { return( is_loop&&loop_active ); }
bool dmcryptActive() const { return( dmcrypt()&&dmcrypt_active ); }
bool needCrsetup() const;
@@ -112,6 +112,7 @@
void setSize( unsigned long long SizeK ) { size_k=orig_size_k=SizeK; }
virtual void setResizedSize( unsigned long long SizeK ) { size_k=SizeK; }
void setDmcryptDev( const string& dm, bool active );
+ void setDmcryptDevEnc( const string& dm, storage::EncryptType typ, bool active );
virtual void forgetResize() { size_k=orig_size_k; }
virtual bool canUseDevice() const;
@@ -155,8 +156,8 @@
string sizeString() const;
string bootMount() const;
bool optNoauto() const;
- bool inCryptotab() const { return( !dmcrypt() && is_loop && !optNoauto() ); }
- bool inCrypttab() const { return( dmcrypt() && !optNoauto() ); }
+ bool inCryptotab() const { return( encryption!=ENC_LUKS && is_loop && !optNoauto() ); }
+ bool inCrypttab() const { return( encryption==ENC_LUKS && !optNoauto() ); }
virtual void print( std::ostream& s ) const { s << *this; }
int getFreeLoop();
int getFreeLoop( SystemCmd& loopData );
@@ -221,9 +222,9 @@
int cryptUnsetup( bool force=false );
std::ostream& logVolume( std::ostream& file ) const;
- string getLosetupCmd( storage::EncryptType e, const string& pwdfile ) const;
- string getCryptsetupCmd( const string& dmdev, const string& mp,
- const string& pwdfile, bool format,
+ string getLosetupCmd( storage::EncryptType, const string& pwdfile ) const;
+ string getCryptsetupCmd( storage::EncryptType e, const string& dmdev,
+ const string& mp, const string& pwdfile, bool format,
bool empty_pwd=false ) const;
storage::EncryptType detectEncryption();
string getFilesysSysfsPath() const;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/storage/src/include/custom_part_lib.ycp new/yast2-storage-2.15.18/storage/src/include/custom_part_lib.ycp
--- old/yast2-storage-2.15.17/storage/src/include/custom_part_lib.ycp 2007-06-25 17:48:14.000000000 +0200
+++ new/yast2-storage-2.15.18/storage/src/include/custom_part_lib.ycp 2007-07-02 18:09:32.000000000 +0200
@@ -13,7 +13,7 @@
*
*************************************************************
*
- $Id: custom_part_lib.ycp 39013 2007-06-25 15:48:13Z fehr $
+ $Id: custom_part_lib.ycp 39124 2007-07-02 16:09:31Z fehr $
*
*/
@@ -458,7 +458,7 @@
ret["field"] = `mount_point;
}
}
- if( !new["format"]:false &&
+ if( !new["format"]:false && !crypt_fs &&
contains( [`unknown, `none], new["detected_fs"]:`unknown ))
{
// error popup text
@@ -931,6 +931,7 @@
new["mountby"] = `device;
new["label"] = "";
new["ori_label"] = "";
+ Package::InstallAll( ["util-linux-crypto"] );
}
}
if( ret == `fs_options )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/storage/src/inst_prepdisk.ycp new/yast2-storage-2.15.18/storage/src/inst_prepdisk.ycp
--- old/yast2-storage-2.15.17/storage/src/inst_prepdisk.ycp 2007-05-23 12:45:16.000000000 +0200
+++ new/yast2-storage-2.15.18/storage/src/inst_prepdisk.ycp 2007-07-02 18:09:32.000000000 +0200
@@ -21,7 +21,7 @@
* possible return values: `back, `abort `next
*
- * $Id: inst_prepdisk.ycp 37624 2007-04-20 13:16:24Z arvin $
+ * $Id: inst_prepdisk.ycp 39124 2007-07-02 16:09:31Z fehr $
*/
// TODO: - check for errors on non i386
@@ -135,7 +135,10 @@
destproc = Installation::scr_destdir+"/sys";
SCR::Execute (.target.mount, ["sysfs", destproc], "-t sysfs");
}
-
+ else
+ {
+ Storage::FinishInstall();
+ }
Storage::UpdateTargetMap();
SCR::Write( .target.ycp, Storage::SaveDumpPath("targetMap_pe"),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/storage/src/modules/Storage.ycp new/yast2-storage-2.15.18/storage/src/modules/Storage.ycp
--- old/yast2-storage-2.15.17/storage/src/modules/Storage.ycp 2007-06-27 11:36:02.000000000 +0200
+++ new/yast2-storage-2.15.18/storage/src/modules/Storage.ycp 2007-07-02 18:09:32.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 39043 2007-06-27 09:36:01Z fehr $
+ * $Id: Storage.ycp 39124 2007-07-02 16:09:31Z fehr $
*/
{
@@ -4278,16 +4278,24 @@
pl = add( pl, "yast2-storage-evms" );
}
boolean need_quota = false;
+ boolean need_crypt = false;
foreach( string k, map e, tg,
``{
if( size(filter( map p, e["partitions"]:[],
``(FileSystems::HasQuota(p))))>0 )
need_quota = true;
+ if( size(filter( map p, e["partitions"]:[],
+ ``(p["enc_type"]:`none != `none)))>0 )
+ need_crypt = true;
});
if( need_quota )
{
pl = add( pl, "quota" );
}
+ if( need_crypt )
+ {
+ pl = add( pl, "util-linux-crypto" );
+ }
y2milestone( "AddPackageList ret %1", pl );
return( pl );
}
@@ -5502,65 +5510,83 @@
global define void FinishInstall()
``{
+ y2milestone( "FinishInstall initial:%1", Stage::initial() );
map tg = GetTargetMap();
- HandleModulesOnBoot( tg );
- list evms = GetUsedEvmsDisks( tg );
- y2milestone( "FinishInstall evms %1", evms );
- if( size(evms)>0 )
- {
- string cmd = "cd / && /sbin/insserv /etc/init.d/boot.evms";
- y2milestone( "FinishInstall cmd %1", cmd );
- map bo = (map)SCR::Execute (.target.bash_output, cmd );
- y2milestone( "FinishInstall bo %1", bo );
- }
- list<string> nonevms = GetUsedRealDisks( tg );
- nonevms = filter( string d, nonevms, ``(!contains( evms, d )));
- nonevms = maplist( string d, nonevms, ``(substring(d,5)));
- y2milestone( "FinishInstall nonevms %1", nonevms );
- nonevms = (list<string>)merge( nonevms, maplist( map p, GetPrepBoot(tg),
- ``(substring(p["device"]:"",5))));
- y2milestone( "FinishInstall nonevms %1", nonevms );
- if( size(nonevms)>0 && SCR::Read( .target.size, "/etc/evms.conf" )>=0 )
+ if( Stage::initial() )
{
- map evmsconf = $[];
- AsciiFile::ReadFile( evmsconf, "/etc/evms.conf" );
- boolean found = false;
- integer i = 1;
- string regex1 = "^[ \t]*activate[ \t]*\\{";
- string regex2 = "^[ \t]*exclude[ \t]*=";
- string regex3 = "^[ \t]*\\}";
- while( i<=AsciiFile::NumLines(evmsconf) && !found )
- {
- found = regexpmatch( evmsconf["l",i,"line"]:"", regex1 );
- i = i+1;
- }
- found = false;
- boolean found2 = false;
- while( i<=AsciiFile::NumLines(evmsconf) && !found && !found2)
+ HandleModulesOnBoot( tg );
+ list evms = GetUsedEvmsDisks( tg );
+ y2milestone( "FinishInstall evms %1", evms );
+ if( size(evms)>0 )
{
- found = regexpmatch( evmsconf["l",i,"line"]:"", regex2 );
- found2 = regexpmatch( evmsconf["l",i,"line"]:"", regex3 );
- if( found )
+ string cmd = "cd / && /sbin/insserv /etc/init.d/boot.evms";
+ y2milestone( "FinishInstall cmd %1", cmd );
+ map bo = (map)SCR::Execute (.target.bash_output, cmd );
+ y2milestone( "FinishInstall bo %1", bo );
+ }
+ list<string> nonevms = GetUsedRealDisks( tg );
+ nonevms = filter( string d, nonevms, ``(!contains( evms, d )));
+ nonevms = maplist( string d, nonevms, ``(substring(d,5)));
+ y2milestone( "FinishInstall nonevms %1", nonevms );
+ nonevms = (list<string>)merge( nonevms, maplist( map p, GetPrepBoot(tg),
+ ``(substring(p["device"]:"",5))));
+ y2milestone( "FinishInstall nonevms %1", nonevms );
+ if( size(nonevms)>0 && SCR::Read( .target.size, "/etc/evms.conf" )>=0 )
+ {
+ map evmsconf = $[];
+ AsciiFile::ReadFile( evmsconf, "/etc/evms.conf" );
+ boolean found = false;
+ integer i = 1;
+ string regex1 = "^[ \t]*activate[ \t]*\\{";
+ string regex2 = "^[ \t]*exclude[ \t]*=";
+ string regex3 = "^[ \t]*\\}";
+ while( i<=AsciiFile::NumLines(evmsconf) && !found )
{
- string co = evmsconf["l",i,"line"]:"";
- integer pos = search( co, "[" );
- if( pos!=nil )
- co = substring( co, pos+1 );
- pos = search( co, "]" );
- if( pos!=nil )
- co = substring( co, 0, pos );
- y2milestone( "FinishInstall co = \"%1\"", co );
- string li = "\texclude = [ " + co + mergestring( nonevms, " " ) +
- " ]";
- y2milestone( "FinishInstall li = %1", li );
- evmsconf["l",i,"line"] = li;
- evmsconf["l",i,"buildline"] = false;
- AsciiFile::RewriteFile( evmsconf, "/etc/evms.conf" );
+ found = regexpmatch( evmsconf["l",i,"line"]:"", regex1 );
+ i = i+1;
+ }
+ found = false;
+ boolean found2 = false;
+ while( i<=AsciiFile::NumLines(evmsconf) && !found && !found2)
+ {
+ found = regexpmatch( evmsconf["l",i,"line"]:"", regex2 );
+ found2 = regexpmatch( evmsconf["l",i,"line"]:"", regex3 );
+ if( found )
+ {
+ string co = evmsconf["l",i,"line"]:"";
+ integer pos = search( co, "[" );
+ if( pos!=nil )
+ co = substring( co, pos+1 );
+ pos = search( co, "]" );
+ if( pos!=nil )
+ co = substring( co, 0, pos );
+ y2milestone( "FinishInstall co = \"%1\"", co );
+ string li = "\texclude = [ " + co +
+ mergestring( nonevms, " " ) + " ]";
+ y2milestone( "FinishInstall li = %1", li );
+ evmsconf["l",i,"line"] = li;
+ evmsconf["l",i,"buildline"] = false;
+ AsciiFile::RewriteFile( evmsconf, "/etc/evms.conf" );
+ }
+ i = i+1;
}
- i = i+1;
}
}
- y2milestone( "FinishInstall" );
+ boolean need_crypt = false;
+ foreach( string k, map e, tg,
+ ``{
+ if( size(filter( map p, e["partitions"]:[],
+ ``(p["enc_type"]:`none != `none)))>0 )
+ need_crypt = true;
+ });
+ if( need_crypt )
+ {
+ string cmd = "cd / && /sbin/insserv /etc/init.d/boot.crypto";
+ y2milestone( "FinishInstall cmd %1", cmd );
+ map bo = (map)SCR::Execute (.target.bash_output, cmd );
+ y2milestone( "FinishInstall bo %1", bo );
+ }
+ y2milestone( "FinishInstall done" );
}
global define map GetEntryForMountpoint( string mp )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.17/VERSION new/yast2-storage-2.15.18/VERSION
--- old/yast2-storage-2.15.17/VERSION 2007-06-25 17:48:31.000000000 +0200
+++ new/yast2-storage-2.15.18/VERSION 2007-07-02 18:07:38.000000000 +0200
@@ -1 +1 @@
-2.15.17
+2.15.18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org