Hello community, here is the log from the commit of package yast2-storage checked in at Thu Jun 28 19:51:26 CEST 2007. -------- --- yast2-storage/yast2-storage.changes 2007-06-18 12:48:15.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-storage/yast2-storage.changes 2007-06-27 11:35:50.000000000 +0200 @@ -1,0 +2,14 @@ +Tue Jun 26 10:57:56 CEST 2007 - fehr@suse.de + +- add windows default mount points also in VM proposal (#262417) +- prevent win mount points on hotplug devices (#287252) +- version 2.15.17 + +------------------------------------------------------------------- +Mon Jun 25 17:41:27 CEST 2007 - fehr@suse.de + +- fixed problem mounting filesystem in inst-sys (#286686) +- prevent direct or indirect change of partitions used for swap or + as install source during installation (#274321,#262417) + +------------------------------------------------------------------- Old: ---- yast2-storage-2.15.16.tar.bz2 New: ---- yast2-storage-2.15.17.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-storage.spec ++++++ --- /var/tmp/diff_new_pack.Z10558/_old 2007-06-28 19:46:45.000000000 +0200 +++ /var/tmp/diff_new_pack.Z10558/_new 2007-06-28 19:46:45.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-storage (Version 2.15.16) +# spec file for package yast2-storage (Version 2.15.17) # # 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.16 +Version: 2.15.17 Release: 1 License: GNU General Public License (GPL) Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-storage-2.15.16.tar.bz2 +Source0: yast2-storage-2.15.17.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.16 +%setup -n yast2-storage-2.15.17 %build %{prefix}/bin/y2tool y2autoconf @@ -170,6 +170,14 @@ %doc %{prefix}/share/doc/packages/yast2-storage/config.xml.description %changelog +* 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) +- version 2.15.17 +* Mon Jun 25 2007 - fehr@suse.de +- fixed problem mounting filesystem in inst-sys (#286686) +- 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) - version 2.15.16 ++++++ yast2-storage-2.15.16.tar.bz2 -> yast2-storage-2.15.17.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/libstorage/src/Dm.cc new/yast2-storage-2.15.17/libstorage/src/Dm.cc --- old/yast2-storage-2.15.16/libstorage/src/Dm.cc 2007-05-23 12:45:15.000000000 +0200 +++ new/yast2-storage-2.15.17/libstorage/src/Dm.cc 2007-06-20 17:48:23.000000000 +0200 @@ -128,7 +128,9 @@ } else { - y2warning( "unknown target type \"%s\"", target.c_str() ); + if( find( known_types.begin(), known_types.end(), target ) == + known_types.end() ) + y2warning( "unknown target type \"%s\"", target.c_str() ); extractNthWord( 1, line ) >> le; y2mil( "le:" << le ); le /= 2; @@ -597,4 +599,6 @@ bool Dm::active = false; unsigned Dm::dm_major = 0; +static const char* elem[] = { "crypt" }; +list<string> Dm::known_types( elem, elem+lengthof(elem) ); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/libstorage/src/Dm.h new/yast2-storage-2.15.17/libstorage/src/Dm.h --- old/yast2-storage-2.15.16/libstorage/src/Dm.h 2007-05-23 12:45:15.000000000 +0200 +++ new/yast2-storage-2.15.17/libstorage/src/Dm.h 2007-06-20 17:33:49.000000000 +0200 @@ -76,6 +76,7 @@ std::map<string,unsigned long> pe_map; static bool active; static unsigned dm_major; + static std::list<string> known_types; mutable storage::DmInfo info; }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/libstorage/src/Storage.cc new/yast2-storage-2.15.17/libstorage/src/Storage.cc --- old/yast2-storage-2.15.16/libstorage/src/Storage.cc 2007-06-14 17:58:16.000000000 +0200 +++ new/yast2-storage-2.15.17/libstorage/src/Storage.cc 2007-06-21 11:42:29.000000000 +0200 @@ -829,8 +829,7 @@ { if( i->getUsedByType()==UB_NONE ) { - if( detectMounted ) - i->getMountData( Mounts ); + i->getMountData( Mounts, !detectMounted ); i->getFstabData( *fstab ); y2mil( "detect:" << *i ); if( i->getFs()==FSUNKNOWN && i->getEncryption()==ENC_NONE ) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/libstorage/src/Volume.cc new/yast2-storage-2.15.17/libstorage/src/Volume.cc --- old/yast2-storage-2.15.16/libstorage/src/Volume.cc 2007-06-14 18:04:34.000000000 +0200 +++ new/yast2-storage-2.15.17/libstorage/src/Volume.cc 2007-06-25 17:43:56.000000000 +0200 @@ -268,10 +268,10 @@ } } -void Volume::getMountData( const ProcMounts& mountData ) +void Volume::getMountData( const ProcMounts& mountData, bool swap_only ) { y2mil( "this:" << *this ); - y2mil( "mountDevice:" << mountDevice() ); + y2mil( "swap_only:" << swap_only << " mountDevice:" << mountDevice() ); mp = mountData.getMount( mountDevice() ); if( mp.empty() ) { @@ -280,7 +280,13 @@ if( !mp.empty() ) { is_mounted = true; - y2milestone( "%s mounted on %s", device().c_str(), mp.c_str() ); + if( swap_only && mp!="swap" ) + { + is_mounted = false; + mp.clear(); + } + if( is_mounted ) + y2milestone( "%s mounted on %s", device().c_str(), mp.c_str() ); } orig_mp = mp; } @@ -2368,8 +2374,12 @@ ret = fstab->flush(); } } - if( ret==0 && !format && mp==orig_mp && mp!="swap" ) + if( ret==0 && !format && !cont->getStorage()->instsys() && + 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 ); + y2mil( "remount:" << *this ); int r = umount( mp ); y2mil( "remount umount:" << r ); if( r==0 ) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/libstorage/src/Volume.h new/yast2-storage-2.15.17/libstorage/src/Volume.h --- old/yast2-storage-2.15.16/libstorage/src/Volume.h 2007-05-23 12:45:15.000000000 +0200 +++ new/yast2-storage-2.15.17/libstorage/src/Volume.h 2007-06-21 11:38:33.000000000 +0200 @@ -199,7 +199,7 @@ bool allowedMountBy( storage::MountByType mby, const string& mp="" ); void getFsData( SystemCmd& blkidData ); void getLoopData( SystemCmd& loopData ); - void getMountData( const ProcMounts& mountData ); + void getMountData( const ProcMounts& mountData, bool swap_only=false ); void getFstabData( EtcFstab& fstabData ); void getStartData(); void getTestmodeData( const string& data ); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/auto_part_prepare.ycp new/yast2-storage-2.15.17/storage/src/include/auto_part_prepare.ycp --- old/yast2-storage-2.15.16/storage/src/include/auto_part_prepare.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/auto_part_prepare.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -8,7 +8,7 @@ * cover the whole disk, including unpartitioned * areas as 'dummy' partitions. * - * $Id: auto_part_prepare.ycp 27076 2006-01-16 18:04:08Z fehr $ + * $Id: auto_part_prepare.ycp 39013 2007-06-25 15:48:13Z fehr $ * */ { @@ -161,7 +161,7 @@ p["ui_id"] = ui_id; if( p["type"]:`unknown == `free ) p["size_k"] = size_of_region( p["region"]:[0,0], bytes_per_unit )/1024; - if( haskey(p,"mount")) + if( haskey(p,"mount") && p["mount"]:""!="swap" && !p["inactive"]:false ) p = remove( p, "mount" ); return( p ); }); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/custom_part_check_generated.ycp new/yast2-storage-2.15.17/storage/src/include/custom_part_check_generated.ycp --- old/yast2-storage-2.15.16/storage/src/include/custom_part_check_generated.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/custom_part_check_generated.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -24,7 +24,7 @@ * ************************************************************* - $Id: custom_part_check_generated.ycp 35893 2007-02-06 11:25:45Z fehr $ + $Id: custom_part_check_generated.ycp 39013 2007-06-25 15:48:13Z fehr $ */ { @@ -825,11 +825,14 @@ Remove the volume before editing it. "), curr_part["used_by"]:"" )); } - return( used==`UB_NONE ); + boolean ret = used==`UB_NONE; + if( ret ) + ret = Storage::CanEdit( curr_part, true ); + return( ret ); } define boolean check_device_delete( map curr_part, boolean bsd_label, - boolean installation, list<map> pl ) + boolean installation, map disk ) ``{ string part_name = curr_part["device"]:""; @@ -930,10 +933,11 @@ } } } - if( curr_part["type"]:`unknown==`logical ) + if( !installation && curr_part["type"]:`unknown==`logical ) { boolean ok = true; - list<map> ppl = filter( map p, pl, ``(p["nr"]:0>curr_part["nr"]:0)); + list<map> ppl = filter( map p, disk["partitions"]:[], + ``(p["nr"]:0>curr_part["nr"]:0)); if( size(ppl)>0 && check_devices_used( ppl, true )!=`UB_NONE ) ok = false; if( ok && !installation && size(ppl)>0 ) @@ -956,7 +960,10 @@ return( false ); } } - return true; + boolean ret = used==`UB_NONE; + if( ret ) + ret = Storage::CanDelete( curr_part, disk, true ); + return ret; }; @@ -1057,7 +1064,15 @@ deleting the extended partition. ")); } - return( used==`UB_NONE ); + boolean ret = used==`UB_NONE; + if( ret ) + { + map extd = find( map p, partitions, + ``(p["type"]:`primary==`extended)); + if( extd!=nil && size(extd)>0 ) + ret = Storage::CanDelete( extd, curr_disk, true ); + } + return( ret ); }; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/custom_part_lib.ycp new/yast2-storage-2.15.17/storage/src/include/custom_part_lib.ycp --- old/yast2-storage-2.15.16/storage/src/include/custom_part_lib.ycp 2007-06-14 16:48:36.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/custom_part_lib.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -13,7 +13,7 @@ * ************************************************************* * - $Id: custom_part_lib.ycp 38463 2007-06-14 14:48:35Z fehr $ + $Id: custom_part_lib.ycp 39013 2007-06-25 15:48:13Z fehr $ * */ @@ -418,6 +418,8 @@ ret["ok"] = true; new["mount"] = UI::QueryWidget(`id(`mount_point), `Value); new["mount"] = deletechars( new["mount"]:"", " \t" ); + if( old["mount"]:"" != new["mount"]:"" ) + new["inactive"] = true; if( ret["ok"]:false && size(new["mount"]:"")>0 ) { boolean crypt_fs = false; @@ -643,7 +645,10 @@ { not_used_mp = selected_fs[`mountpoints]:[]; if( mount != "swap" && (new["type"]:`primary!=`lvm || mount!="")) + { new["mount"] = "swap"; + new["inactive"] = true; + } } else { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/do_proposal_flexible.ycp new/yast2-storage-2.15.17/storage/src/include/do_proposal_flexible.ycp --- old/yast2-storage-2.15.16/storage/src/include/do_proposal_flexible.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/do_proposal_flexible.ycp 2007-06-26 10:58:49.000000000 +0200 @@ -14,7 +14,7 @@ * ************************************************************* - $Id: do_proposal_flexible.ycp 37859 2007-05-07 17:03:29Z fehr $ + $Id: do_proposal_flexible.ycp 39029 2007-06-26 08:58:49Z fehr $ */ { @@ -821,6 +821,8 @@ { y2milestone( "process_partition_data reuse part %1", p ); p["format"] = true; + if( p["mount"]:"" != mount ) + p["inactive"] = true; p["mount"] = mount; p["used_fs"] = solution["partitions",pindex,"fsys"]:Partitions::DefaultFs(); @@ -920,6 +922,7 @@ } part["size_k"] = part["region",1]:0 * disk["cyl_size"]:0 / 1024; part["mount"] = mount; + part["inactive"] = true; part["used_fs"] = solution["partitions",pindex,"fsys"]:Partitions::DefaultFs(); value = solution["partitions",pindex,"fstopt"]:""; @@ -1002,6 +1005,7 @@ part["type"] = `logical; } part["mount"] = mount; + part["inactive"] = true; part["used_fs"] = solution["partitions",pindex,"fsys"]:Partitions::DefaultFs(); value = solution["partitions",pindex,"fstopt"]:""; @@ -1633,7 +1637,8 @@ p["type"]:`primary != `extended && !contains( conf["keep_partition_num"]:[], p["nr"]:0 ) && !contains( conf["keep_partition_id"]:[], fsid ) && - !contains( conf["keep_partition_fsys"]:[], p["used_fs"]:`none )) + !contains( conf["keep_partition_fsys"]:[], p["used_fs"]:`none ) && + Storage::CanDelete( p, disk, false )) { p["delete"] = true; } @@ -2206,6 +2211,8 @@ if( !p["delete"]:false && p["device"]:""==swaps[0,"device"]:"" ) { + if( p["mount"]:"" != "swap" ) + p["inactive"] = true; p["mount"] = "swap"; if( haskey( p, "vg" )) { @@ -2278,8 +2285,9 @@ { ret = maplist( map p, partitions, ``{ - if( !p["delete"]:false && - p["device"]:""==boot["device"]:"" ) + if( !p["delete"]:false && + p["device"]:""==boot["device"]:"" && + Storage::CanEdit(p,false) ) { p["mount"] = Partitions::BootMount(); p["used_fs"] = Partitions::DefaultBootFs(); @@ -2312,7 +2320,8 @@ p["used_by_type"]:`UB_NONE == `UB_NONE && size(p["mount"]:"")==0 && p["size_k"]:0/1024 >= min && - (max==0 || p["size_k"]:0/1024 <= max))); + (max==0 || p["size_k"]:0/1024 <= max) && + Storage::CanEdit( p, false ))); y2milestone( "can_mp_reuse normal %1", pl ); if( size(pl)>0 ) { @@ -2563,11 +2572,12 @@ parts = maplist( map p, parts, ``{ - if( size(mp)==0 || contains( mp, p["mount"]:"") ) + if( (size(mp)==0 || contains( mp, p["mount"]:"")) && + !(p["mount"]:""=="swap" && !p["inactive"]:false) ) { foreach( string s, rems, ``{ - if( haskey( p, s )) + if( haskey( p, s ) ) p = remove( p, s ); }); } @@ -2576,8 +2586,9 @@ return( parts ); } -list<map> remove_one_partition( list<map> partitions ) +list<map> remove_one_partition( map disk ) { + list<map> partitions = disk["partitions"]:[]; list<map> pl = filter( map p, partitions, ``( p["linux"]:false && size(p["mount"]:"")==0 && !p["delete"]:false )); @@ -2594,7 +2605,8 @@ ``{ if( p["linux"]:false && !p["delete"]:false && size(p["mount"]:"")==0 && - p["device"]:""==pl[0,"device"]:"" ) + p["device"]:""==pl[0,"device"]:"" && + Storage::CanDelete( p, disk, false )) { p["delete"] = true; y2milestone( "remove_one_partition p %1", p ); @@ -2631,7 +2643,8 @@ ``{ if( p["linux"]:false && !p["delete"]:false && size(p["mount"]:"")==0 && - p["device"]:""==pl[0,"device"]:"" ) + p["device"]:""==pl[0,"device"]:"" && + Storage::CanDelete( p, disk, false )) { p["delete"] = true; nr = p["nr"]:0; @@ -2711,7 +2724,8 @@ maplist( map p, target[s,"partitions"]:[], ``{ if( !contains( Partitions::do_not_delete, - p["fsid"]:0 )) + p["fsid"]:0 ) && + Storage::CanDelete( p, target[s]:$[], false)) { if( usable_for_win_resize(p,false) ) p["dtxt"] = _("Resize impossible due to inconsistent fs. Try checking fs under Windows."); @@ -2744,7 +2758,7 @@ foreach( string s, filter( string d, ddev, ``(valid[d]:false)), ``{ target[s,"partitions"] = - remove_one_partition( target[s,"partitions"]:[] ); + remove_one_partition( target[s]:$[] ); }); } } @@ -3029,7 +3043,16 @@ { foreach( string s, map disk, target, ``{ - target[s,"partitions"] = remove_keys( target[s,"partitions"]:[], + target[s,"partitions"] = + maplist( map p, target[s,"partitions"]:[], + ``{ + if( haskey( p, "mount" ) && + search( p["mount"]:"", "/windows/" )!=0 && + search( p["mount"]:"", "/dos/" )!=0 ) + p = remove( p, "mount" ); + return( p ); + }); + remove_keys( target[s,"partitions"]:[], [ "mount" ] ); }); return( target ); @@ -3499,7 +3522,8 @@ maplist( map p, target[s,"partitions"]:[], ``{ if( !contains( Partitions::do_not_delete, - p["fsid"]:0 )) + p["fsid"]:0 ) && + Storage::CanDelete( p, target[s]:$[], false)) { if( usable_for_win_resize(p,false) ) p["dtxt"] = _("Resize impossible due to inconsistent fs. Try checking fs under Windows."); @@ -3771,6 +3795,7 @@ Storage::ActivateEvms(); target = Storage::GetTargetMap(); } + y2milestone( "target:%1", target ); ret = get_inst_prop_vm( target, vg ); } return( ret ); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/evms_lib.ycp new/yast2-storage-2.15.17/storage/src/include/evms_lib.ycp --- old/yast2-storage-2.15.16/storage/src/include/evms_lib.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/evms_lib.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -11,7 +11,7 @@ * Thomas Fehr <fehr@suse.de> * * - * $Id: evms_lib.ycp 35921 2007-02-06 18:54:16Z fehr $ + * $Id: evms_lib.ycp 39013 2007-06-25 15:48:13Z fehr $ * */ @@ -1323,7 +1323,7 @@ %1 is not a logical volume produced by a container. "), device )); } - else if( check_device_delete( part, false, Mode::installation(), [] )) + else if( check_device_delete( part, false, Mode::installation(), $[] )) { string txt = sformat( _("Really delete %1?"), part["device"]:"" ); if( Popup::YesNo( txt ) ) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/include/signatures.ycp new/yast2-storage-2.15.17/storage/src/include/signatures.ycp --- old/yast2-storage-2.15.16/storage/src/include/signatures.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/include/signatures.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -3,7 +3,7 @@ * ************************************************************* * - $Id: signatures.ycp 35893 2007-02-06 11:25:45Z fehr $ + $Id: signatures.ycp 39013 2007-06-25 15:48:13Z fehr $ * */ { @@ -11,7 +11,7 @@ boolean CheckFstabOptions( map part ); symbol check_devices_used( list<map> partitions, boolean not_cr ); boolean check_device_delete( map curr_part, boolean bsd_label, - boolean installation, list<map> pl ); + boolean installation, map disk ); list<map> get_possible_pvs( map<string,map> targetMap ); map DlgCreateVolumeGroup( list vgm_list ); void new_vg_list( list vg_list ); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/inst_custom_part.ycp new/yast2-storage-2.15.17/storage/src/inst_custom_part.ycp --- old/yast2-storage-2.15.16/storage/src/inst_custom_part.ycp 2007-06-18 12:48:58.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/inst_custom_part.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -26,7 +26,7 @@ * ************************************************************* - $Id: inst_custom_part.ycp 38499 2007-06-18 10:48:57Z fehr $ + $Id: inst_custom_part.ycp 39013 2007-06-25 15:48:13Z fehr $ */ { @@ -3154,7 +3154,7 @@ } else if( part["type"]:`unknown==`lvm ) { - if( !check_device_delete( part, false, Stage::initial(), [] )) + if( !check_device_delete( part, false, Stage::initial(), $[] )) { ret = `again; continue; @@ -3185,7 +3185,7 @@ } if( part["type"]:`primary != `extended && !check_device_delete( part, bsd_label, Stage::initial(), - disk["partitions"]:[] )) + disk )) { ret = `again; continue; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/inst_lvm_lv.ycp new/yast2-storage-2.15.17/storage/src/inst_lvm_lv.ycp --- old/yast2-storage-2.15.16/storage/src/inst_lvm_lv.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/inst_lvm_lv.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -10,7 +10,7 @@ * Authors: * mike <mike@suse.de> * - * $Id: inst_lvm_lv.ycp 35893 2007-02-06 11:25:45Z fehr $ + * $Id: inst_lvm_lv.ycp 39013 2007-06-25 15:48:13Z fehr $ * * *---------------------------------------------------- @@ -253,7 +253,7 @@ else { map Lv = Storage::GetPartition( targetMap, id ); - if( !check_device_delete( Lv, false, Stage::initial(), [])) + if( !check_device_delete( Lv, false, Stage::initial(), $[])) { ret = `again; continue; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/inst_target_part.ycp new/yast2-storage-2.15.17/storage/src/inst_target_part.ycp --- old/yast2-storage-2.15.16/storage/src/inst_target_part.ycp 2007-05-23 12:45:16.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/inst_target_part.ycp 2007-06-25 17:48:14.000000000 +0200 @@ -9,7 +9,7 @@ * -Ask the user which partition to use. * -Check the input and return error-messages. * - * $Id: inst_target_part.ycp 37390 2007-04-11 10:51:39Z fehr $ + * $Id: inst_target_part.ycp 39013 2007-06-25 15:48:13Z fehr $ */ { textdomain "storage"; @@ -207,6 +207,21 @@ if( target["label"]:""!="msdos" && !Storage::BootEvms() ) UI::ChangeWidget( `id(`evms), `Enabled, false ); } + boolean disable_full = false; + foreach( map p, partitions, + ``{ + y2milestone( "p:%1", p ); + if( p["type"]:`unknown!=`extended && !Storage::CanDelete( p, target, false )) + { + if( UI::WidgetExists( `id(p["ui_id"]:0) )) + { + UI::ChangeWidget( `id(p["ui_id"]:0), `Enabled, false ); + disable_full = true; + } + } + }); + if( disable_full && UI::WidgetExists( `id(`full) )) + UI::ChangeWidget( `id(`full), `Enabled, false ); // Event handling diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/storage/src/modules/Storage.ycp new/yast2-storage-2.15.17/storage/src/modules/Storage.ycp --- old/yast2-storage-2.15.16/storage/src/modules/Storage.ycp 2007-06-14 16:48:36.000000000 +0200 +++ new/yast2-storage-2.15.17/storage/src/modules/Storage.ycp 2007-06-27 11:36:02.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 38463 2007-06-14 14:48:35Z fehr $ + * $Id: Storage.ycp 39043 2007-06-27 09:36:01Z fehr $ */ { @@ -167,6 +167,7 @@ boolean proposal_lvm = false; boolean proposal_home = false; map cfg_xml = $[]; +string part_insts = ""; /* @@ -2083,11 +2084,23 @@ StorageMap[targets_backup_key] = $[]; StorageMap[targets_backup_l_key] = $[]; StorageMap[targets_backup_m_key] = $[]; - if( Mode::normal () ) + if( Mode::normal() ) { Storage::SetPartMode( "CUSTOM" ); Storage::SetPartProposalActive( false ); } + if( Stage::initial() ) + { + string inst = (string) SCR::Read( .etc.install_inf.Partition ); + if( inst!=nil && size(inst)>0 ) + { + part_insts = "/dev/" + inst; + y2milestone( "Storage .etc.install_inf.Partition \"%1\" part_insts:%2", + inst, part_insts ); + } + Storage::SetPartMode( "CUSTOM" ); + Storage::SetPartProposalActive( false ); + } InstallCallbacks(); } @@ -3215,13 +3228,15 @@ foreach(string disk, map data, targets, ``{ - if( data["used_by_type"]:`UB_NONE == `UB_NONE ) + if( !data["hotpluggable"]:false && + data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], true, data["max_primary"]:4, foreign_nr ); }); foreach(string disk, map data, targets, ``{ - if( data["used_by_type"]:`UB_NONE == `UB_NONE ) + if( !data["hotpluggable"]:false && + data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], false, data["max_primary"]:4, foreign_nr ); }); @@ -3607,6 +3622,106 @@ return( ret ); } +global boolean CanEdit( map p, boolean verbose ) + { + boolean ret = true; + if( Stage::initial() ) + { + if( !p["created"]:false && !p["inactive"]:false && + p["mount"]:""=="swap" ) + { + ret = false; + y2milestone( "CanEdit p:%1", p ); + if( verbose ) + { + string txt = sformat( _(" +Device %1 cannot be modified because it contains activated swap +that is needed to run the installation. +"), p["device"]:"" ); + Popup::Message( txt ); + } + } + if( size(part_insts)>0 && p["device"]:""==part_insts ) + { + ret = false; + y2milestone( "CanEdit part_insts:%1 p:%2", part_insts, p ); + if( verbose ) + { + string txt = sformat( _(" +Device %1 cannot be modified because it contains the installation +data needed to perform the installation. +"), p["device"]:"" ); + Popup::Message( txt ); + } + } + } + y2milestone( "CanEdit dev:%1 verbose:%2 ret:%3", p["device"]:"", + verbose, ret ); + return( ret ); + } + +global boolean CanDelete( map p, map disk, boolean verbose ) + { + string txt = ""; + boolean ret = CanEdit( p, false ); + if( !ret && verbose ) + { + if( p["mount"]:""=="swap" ) + { + txt = sformat( _(" +Device %1 cannot be removed because it contains activated swap +that is needed to run the installation. +"), p["device"]:"" ); + } + else + { + txt = sformat( _(" +Device %1 cannot be removed because it contains the installation +data needed to perform the installation. +"), p["device"]:"" ); + } + Popup::Message( txt ); + } + if( ret && (p["type"]:`unknown == `logical|| + p["type"]:`unknown == `extended) ) + { + integer num = p["type"]:`unknown == `extended ? 4 : p["nr"]:4; + list<map> pl = filter( map q, disk["partitions"]:[], + ``( q["type"]:`unknown==`logical && + q["nr"]:0 > num )); + y2milestone( "CanDelete pl:%1", pl ); + integer pos = 0; + while( ret && pos<size(pl) ) + { + ret = CanEdit( pl[pos]:$[], false ); + if( ret ) + pos = pos+1; + } + if( !ret && verbose ) + { + if( p["mount"]:""=="swap" ) + { + txt = sformat( _(" +Device %1 cannot be removed because this would indirectly change +device %2 which contains activated swap that is needed to run +the installation. +"), p["device"]:"", pl[pos,"device"]:"" ); + } + else + { + txt = sformat( _(" +Device %1 cannot be removed because this would indirectly change +device %2 which contains data needed to perform the installation. +"), p["device"]:"", pl[pos,"device"]:"" ); + } + Popup::Message( txt ); + } + } + y2milestone( "CanDelete dev:%1 verbose:%2 ret:%3", p["device"]:"", + verbose, ret ); + return( ret ); + } + global list ReadFstab( string dir ) { list ret = []; @@ -6129,19 +6244,7 @@ no_propose_disks = []; if( Stage::initial() && SCR::Read( .target.size, "/etc/install.inf" )>0 ) { - string inst = (string) SCR::Read( .etc.install_inf.Partition ); - y2milestone( "NoProposeDisks .etc.install_inf.Partition \"%1\"", - inst ); - if( inst!=nil && size(inst)>0 ) - { - if( search( inst, "/dev/" )!=0 ) - inst = "/dev/" + inst; - map d = GetDiskPartition( inst ); - y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d ); - if( size(d["disk"]:"")>0 ) - no_propose_disks = add( no_propose_disks, d["disk"]:"" ); - } - inst = (string) SCR::Read( .etc.install_inf.Cdrom ); + string inst = (string) SCR::Read( .etc.install_inf.Cdrom ); y2milestone( "NoProposeDisks .etc.install_inf.Cdrom \"%1\"", inst ); if( inst!=nil && size(inst)>0 ) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-storage-2.15.16/VERSION new/yast2-storage-2.15.17/VERSION --- old/yast2-storage-2.15.16/VERSION 2007-06-18 12:48:20.000000000 +0200 +++ new/yast2-storage-2.15.17/VERSION 2007-06-25 17:48:31.000000000 +0200 @@ -1 +1 @@ -2.15.16 +2.15.17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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