Author: aschnell Date: Wed May 9 11:48:09 2012 New Revision: 68113 URL: http://svn.opensuse.org/viewcvs/yast?rev=68113&view=rev Log: - do not allow mount-by methods not available (bnc#758639) Modified: branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-dialogs.ycp branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp Modified: branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes?rev=68113&r1=68112&r2=68113&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes Wed May 9 11:48:09 2012 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu May 03 16:52:12 CEST 2012 - aschnell@suse.de + +- do not allow mount-by methods not available (bnc#758639) + +------------------------------------------------------------------- Mon Mar 12 16:42:36 CET 2012 - aschnell@suse.de - removed deactivation of MD RAIDs using DM during installation Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=68113&r1=68112&r2=68113&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_dialogs.ycp Wed May 9 11:48:09 2012 @@ -684,21 +684,26 @@ { list no_mountby_type = [ `loop ]; list mountby_id_path_type = [ `primary, `logical ]; + map enab = $[]; + boolean tmp = !contains( no_mountby_type, new["type"]:`primary ); + enab[`label] = tmp && FileSystems::MountLabel( new["used_fs"]:`unknown ) && + new["enc_type"]:`none==`none; + enab[`uuid] = tmp && (new["format"]:false || size(new["uuid"]:"")>0) && + FileSystems::MountUuid( new["used_fs"]:`unknown ) && + new["enc_type"]:`none==`none; + tmp = contains(mountby_id_path_type, new["type"]:`none); + enab[`id] = tmp && size(new["udev_id"]:[])>0; + enab[`path] = tmp && size(new["udev_path"]:"")>0; + y2milestone( "FstabOptions enab %1", enab ); + UI::ChangeWidget( `id(`label), `Enabled, enab[`label]:false ); + UI::ChangeWidget( `id(`uuid), `Enabled, enab[`uuid]:false ); + UI::ChangeWidget( `id(`id), `Enabled, enab[`id]:false ); + UI::ChangeWidget( `id(`path), `Enabled, enab[`path]:false ); symbol defmb = !Mode::config() ? Storage::GetMountBy( new["device"]:"" ) - : `device; + : `device; y2milestone( "FstabOptions defmb %1", defmb ); - UI::ChangeWidget( `id(`mt_group), `CurrentButton, - new["mountby"]:defmb ); - UI::ChangeWidget( `id(`label), `Enabled, - FileSystems::MountLabel( new["used_fs"]:`unknown ) && - new["enc_type"]:`none==`none && - !contains( no_mountby_type, new["type"]:`primary ) ); - UI::ChangeWidget( `id(`uuid), `Enabled, - (new["format"]:false || size(new["uuid"]:"")>0) && - FileSystems::MountUuid( new["used_fs"]:`unknown ) && - !contains( no_mountby_type, new["type"]:`primary ) ); - UI::ChangeWidget( `id(`id), `Enabled, contains(mountby_id_path_type, new["type"]:`none) ); - UI::ChangeWidget( `id(`path), `Enabled, contains(mountby_id_path_type, new["type"]:`none) ); + if( haskey( enab, defmb ) && !enab[defmb]:false ) + defmb = `device; } if( UI::WidgetExists( `id(`vol_label) )) Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-dialogs.ycp?rev=68113&r1=68112&r2=68113&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-dialogs.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-dialogs.ycp Wed May 9 11:48:09 2012 @@ -68,6 +68,18 @@ map r = Storage::NextPartition(data["disk_device"]:"", data["type"]:`none); data["device"] = r["device"]:""; + if (haskey(data, "disk_udev_id")) + { + data["udev_id"] = maplist(string s, data["disk_udev_id"]:[], { + return sformat("%1-part%2", s, r["nr"]:0); + }); + } + + if (haskey(data, "disk_udev_path")) + { + data["udev_path"] = sformat("%1-part%2", data["disk_udev_path"]:"", r["nr"]:0); + } + if (data["type"]:`unknown == `extended) { data["fsid"] = Partitions::fsid_extended_win; @@ -299,6 +311,18 @@ { map r = Storage::NextPartition(data["disk_device"]:"", data["type"]:`none); data["device"] = r["device"]:""; + + if (haskey(data, "disk_udev_id")) + { + data["udev_id"] = maplist(string s, data["disk_udev_id"]:[], { + return sformat("%1-part%2", s, r["nr"]:0); + }); + } + + if (haskey(data, "disk_udev_path")) + { + data["udev_path"] = sformat("%1-part%2", data["disk_udev_path"]:"", r["nr"]:0); + } } // dialog title Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp?rev=68113&r1=68112&r2=68113&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp Wed May 9 11:48:09 2012 @@ -202,6 +202,12 @@ "cyl_count" : disk["cyl_count"]:0, "slots" : slots ]; + if (haskey(disk, "udev_id")) + data["disk_udev_id"] = disk["udev_id"]:[]; + + if (haskey(disk, "udev_path")) + data["disk_udev_path"] = disk["udev_path"]:""; + if (DlgCreatePartition(data)) { string device = data["device"]:"error"; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org