
Author: jsuchome Date: Wed Apr 30 15:57:48 2008 New Revision: 47234 URL: http://svn.opensuse.org/viewcvs/yast?rev=47234&view=rev Log: - extended help text if no partition was found (bnc#366856) - initialize target before source to get correct name of kernel - patterns now only recommend packages - handle encrypted partitions separately during fstab check - 2.16.9 (+ added some more debug messages for beta developement) Modified: trunk/repair/VERSION trunk/repair/package/yast2-repair.changes trunk/repair/src/OSRFstab.ycp trunk/repair/src/OSRPkg.ycp trunk/repair/src/OSRPkgVerify.ycp trunk/repair/src/OSRPtbl.ycp trunk/repair/src/osr_module_partition.ycp Modified: trunk/repair/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/VERSION?rev=47234&r1=47233... ============================================================================== --- trunk/repair/VERSION (original) +++ trunk/repair/VERSION Wed Apr 30 15:57:48 2008 @@ -1 +1 @@ -2.16.8 +2.16.9 Modified: trunk/repair/package/yast2-repair.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/package/yast2-repair.chang... ============================================================================== --- trunk/repair/package/yast2-repair.changes (original) +++ trunk/repair/package/yast2-repair.changes Wed Apr 30 15:57:48 2008 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Tue Apr 22 11:58:58 CEST 2008 - jsuchome@suse.cz + +- extended help text if no partition was found (bnc#366856) +- initialize target before source to get correct name of kernel +- patterns now only recommend packages +- handle encrypted partitions separately during fstab check +- 2.16.9 + +------------------------------------------------------------------- Mon Apr 14 13:43:27 CEST 2008 - jsuchome@suse.cz - solver needs to be run before reading product info (bnc#368104) Modified: trunk/repair/src/OSRFstab.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/src/OSRFstab.ycp?rev=47234... ============================================================================== --- trunk/repair/src/OSRFstab.ycp (original) +++ trunk/repair/src/OSRFstab.ycp Wed Apr 30 15:57:48 2008 @@ -117,6 +117,11 @@ list<string> checked_partitions = []; /** + * Encrypted partitions (actually not checked) + */ + list<string> encrypted_partitions = []; + + /** @example of map describing /etc/fstab: $[ @@ -302,6 +307,7 @@ integer i = 0; foreach (string partition_item, linux_partition_list, ``{ +y2internal ("partition to check: %1", partition_item); if ((boolean) WFM::Execute (.local.mount, [ partition_item, m_point, OSRExecute::OutputFile() ])) { @@ -573,6 +579,8 @@ */ define map devname2part(string dev_name)``{ + y2milestone ("device name %1", dev_name); + if (substring (dev_name, 0,1) != "/") return $[]; map ret = StorageDevices::GetCdromEntry( dev_name); @@ -622,6 +630,13 @@ if (ret == $[] || ret == nil) { ret = Storage::GetPartition( Storage::GetTargetMap(), dev_name ); + if (ret == $[] && substring (dev_name, 0, 15) == "/dev/mapper/cr_") + { + // encrypted partition does not show the real device name + dev_name = "/dev/" + substring (dev_name, 15); + y2milestone ("transforming device name to %1", dev_name); + ret = Storage::GetPartition (Storage::GetTargetMap(), dev_name); + } if (ret != $[] && ret != nil) { /* dev name might be: /dev/disk/by-id/scsi-SATA_ST340016A_3HS8YAL0-part6 @@ -661,6 +676,7 @@ define boolean check_dev_entry(string p)``{ map part = devname2part(p); +y2internal ("part map for device %1: %2", p, part); map lines = filter (integer lnr, map line, fstab["l"]:$[], ``( (line["fields",0]:"!" == p) || @@ -867,6 +883,8 @@ { list<string> special_freq = []; list<string> special_passno = []; + string dev_name = part["dev_name"]:""; + string device = part["device"]:""; // cdrom floppy zip if (part["found"]:"" == "floppy" || @@ -880,8 +898,10 @@ fs_mntops = check_fs_mntops( line); } else if ((part["found"]:"" == "dev") && - (contains (checked_partitions, part["dev_name"]:"") || - contains (checked_partitions, part["device"]:"")) + (contains (checked_partitions, dev_name) || + contains (checked_partitions, device) || + contains (encrypted_partitions, dev_name) || + contains (encrypted_partitions, device)) ) { // check root first with CheckRootEntry!! @@ -899,8 +919,8 @@ part["mount"] = line[1]:""; Storage::ChangeVolumeProperties(part); } - else if ((contains (swapable_partition_list, part["dev_name"]:"") || - contains (swapable_partition_list, part["device"]:"")) && + else if ((contains (swapable_partition_list, dev_name) || + contains (swapable_partition_list, device)) && part["found"]:"" == "swap") { type = "swap"; @@ -1007,16 +1027,18 @@ * Check if all entries in the fstab are valid and * if all found devices have an entry in the fstab. */ - global define boolean Check(list<string> tswapable_partition_list, - list<string> tchecked_partitions) ``{ - - ResetSettings(); - swapable_partition_list = tswapable_partition_list; - checked_partitions = tchecked_partitions; + global define boolean Check (list<string> tswapable_partition_list, + list<string> tchecked_partitions, + list<string> tencrypted_partitions) + { + ResetSettings(); + swapable_partition_list = tswapable_partition_list; + checked_partitions = tchecked_partitions; + encrypted_partitions = tencrypted_partitions; map fstab2part = $[]; - // check all lines in existing fstab file + // check all lines in existing fstab file foreach (integer lnr, map line, fstab["l"]:$[], ``{ y2milestone("----check fstab line %1 ", lnr); if (! contains (valid_lines, lnr)) Modified: trunk/repair/src/OSRPkg.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/src/OSRPkg.ycp?rev=47234&r... ============================================================================== --- trunk/repair/src/OSRPkg.ycp (original) +++ trunk/repair/src/OSRPkg.ycp Wed Apr 30 15:57:48 2008 @@ -15,7 +15,6 @@ textdomain "repair"; import "DefaultDesktop"; - import "Kernel"; import "Mode"; import "Report"; import "Wizard"; @@ -207,8 +206,8 @@ list<map> descrs = Pkg::ResolvableDependencies (p,`pattern, ""); foreach (map descr, descrs, { foreach (map dep, (list<map>)descr["dependencies"]:[], { - if (dep["res_kind"]:"" == "package" && - dep["dep_kind"]:"" == "requires") + if (dep["res_kind"]:"" == "package" && contains ( + ["requires", "recommends"], dep["dep_kind"]:"")) { minimal_selection = add (minimal_selection, dep["name"]:""); @@ -232,6 +231,18 @@ y2milestone("Open pkg database with target system -%1-", root ); if (root != "" && root != nil ) root_mountpoint = root; + // open target system for Pkg access + if (!target_initialized) + { + if (first_time_openpkg) + { + y2milestone ("first time initializig -> finish target before"); + Pkg::TargetFinish (); + first_time_openpkg = false; + } + target_initialized = Pkg::TargetInit ( root, false); + } + // open the package source if (! Stage::initial () ) { @@ -260,19 +271,6 @@ } } - // open target system for Pkg access - if (!target_initialized) - { - if (first_time_openpkg) - { - y2milestone ("first time initializig -> finish target before"); - Pkg::TargetFinish (); - first_time_openpkg = false; - } - target_initialized = Pkg::TargetInit ( root, false); - get_minimal_selection (); - } - // something failed if (! target_initialized || ! source_initialized ) { @@ -706,10 +704,7 @@ else if (what == "base") { list<string> minimal = get_minimal_selection (); - list<string> special = []; - - minimal = filter (string p, minimal, ``( Pkg::IsAvailable(p))); - ret = (list<string>) union (minimal, special) ; + ret = filter (string p, minimal, ``( Pkg::IsAvailable(p))); } else { Modified: trunk/repair/src/OSRPkgVerify.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/src/OSRPkgVerify.ycp?rev=4... ============================================================================== --- trunk/repair/src/OSRPkgVerify.ycp (original) +++ trunk/repair/src/OSRPkgVerify.ycp Wed Apr 30 15:57:48 2008 @@ -14,7 +14,6 @@ textdomain "repair"; - import "Kernel"; import "OSRExecute"; import "OSRLogFile"; import "OSRMode"; Modified: trunk/repair/src/OSRPtbl.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/src/OSRPtbl.ycp?rev=47234&... ============================================================================== --- trunk/repair/src/OSRPtbl.ycp (original) +++ trunk/repair/src/OSRPtbl.ycp Wed Apr 30 15:57:48 2008 @@ -1336,13 +1336,16 @@ r_button = add( r_button, rd["default"]:false ); r_options = add( r_options , `Left( r_button )); }); - //%1 is device label, such as /dev/hda + // %1 is device label, such as /dev/hda + // sometimes it is not a problem (see bug 366856) => calm user with the + // last sentence string error_text = sformat(_(" No partition table was found for hard disk %1. If at least one partition should exist for %1, select one of the following repair methods. If no partition ever existed on this hard disk, skip the repair. +If in doubt, skip the repair. "), target); Modified: trunk/repair/src/osr_module_partition.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/repair/src/osr_module_partition.y... ============================================================================== --- trunk/repair/src/osr_module_partition.ycp (original) +++ trunk/repair/src/osr_module_partition.ycp Wed Apr 30 15:57:48 2008 @@ -393,10 +393,11 @@ OSRCommon::RequireList("fsck_partitions"); list<map> mounted_partitions = (list<map>) OSRCommon::RequireList("mounted_partitions"); - list<string> checked_partitions = []; + list<string> checked_partitions = []; + list<string> encrypted_partitions = []; foreach(map p, fsck_partitions, { - +y2internal ("partition to check %1", p); string dev_name = p["device"]:""; // summary header string summary_header = sformat(_("Executing file system check for partition %1..."), dev_name ); @@ -412,6 +413,7 @@ OSRSummary::DetectOmit (summary_header, // summary text _("Partition is encrypted: check not supported")); + encrypted_partitions = add (encrypted_partitions, dev_name); } else { @@ -458,6 +460,7 @@ } }); OSRCommon::ProvideList( "checked_partitions", checked_partitions ); + OSRCommon::ProvideList( "encrypted_partitions", encrypted_partitions ); return true; } @@ -849,9 +852,11 @@ string root_partition = OSRCommon::RequireString("root_partition"); - if ( OSRFstab::Check ( + if (OSRFstab::Check ( (list<string>)OSRCommon::RequireList("swapable_partitions"), - (list<string>)OSRCommon::RequireList("checked_partitions"))) + (list<string>)OSRCommon::RequireList("checked_partitions"), + (list<string>)OSRCommon::RequireList("encrypted_partitions")) + ) { // summary text OSRSummary::DetectOK("", _("fstab entries valid")); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org