[yast-commit] r55344 - in /trunk/reipl: package/yast2-reipl.changes src/Reipl.ycp src/inst_reiplauto.ycp src/reipl_bootloader_finish.ycp src/reipl_finish.ycp
Author: jsrain Date: Mon Feb 9 13:10:57 2009 New Revision: 55344 URL: http://svn.opensuse.org/viewcvs/yast?rev=55344&view=rev Log: Final fix for reboot (bnc#471522) Modified: trunk/reipl/package/yast2-reipl.changes trunk/reipl/src/Reipl.ycp trunk/reipl/src/inst_reiplauto.ycp trunk/reipl/src/reipl_bootloader_finish.ycp trunk/reipl/src/reipl_finish.ycp Modified: trunk/reipl/package/yast2-reipl.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/package/yast2-reipl.changes?rev=55344&r1=55343&r2=55344&view=diff ============================================================================== --- trunk/reipl/package/yast2-reipl.changes (original) +++ trunk/reipl/package/yast2-reipl.changes Mon Feb 9 13:10:57 2009 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Feb 9 09:38:05 CET 2009 - hare@suse.de + +- Final fix for reboot (bnc#471522) + +------------------------------------------------------------------- Fri Feb 6 11:28:36 CET 2009 - jsrain@suse.cz - fixed rebooting (bnc #471522) Modified: trunk/reipl/src/Reipl.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/src/Reipl.ycp?rev=55344&r1=55343&r2=55344&view=diff ============================================================================== --- trunk/reipl/src/Reipl.ycp (original) +++ trunk/reipl/src/Reipl.ycp Mon Feb 9 13:10:57 2009 @@ -137,7 +137,8 @@ // "method": "ccw", // "ccw": $[ // "device": "0.0.4711", -// "loadparm": "" +// "loadparm": "", +// "parm": "" /* SLES 11 and z/VM only */ // ], // "fcp": $[ // "device": "0.0.4711", @@ -184,6 +185,7 @@ y2error ("Missing loadparm under %1", ccw_directory); return false; } + // don't check for "parm" since it might not be there under zLPAR } if (fcp_exists) { @@ -363,12 +365,13 @@ } /** - * Modifys the reipl configuration passed in with what it should be for the detected + * Returns the reipl configuration passed in with what it should be for the detected * boot partition. - * @param configuration the current configuration. - * @return a map of the new configuration. + * @param configuration an old configuration. + * @return a map of the new target configuration. */ global map <string, any> ModifyReiplWithBootPartition (map <string, any> configuration) { + // get target information list<string> uParts = FindBootPartition (); if (uParts == nil) { @@ -380,12 +383,7 @@ if (size (uParts) == 2) { if (uParts[0]:"" == "ccw") { - if (ccw_exists) { fCCW = true; - } - else { - y2error ("ModifyReiplWithBootPartition: udevPath uses ccw but ccw is not implemented!"); - } } else { y2error ("ModifyReiplWithBootPartition: size of uParts is 2, but first word is not ccw!"); @@ -393,12 +391,7 @@ } else if (size (uParts) == 4) { if (uParts[0]:"" == "zfcp") { - if (fcp_exists) { fFCP = true; - } - else { - y2error ("ModifyReiplWithBootPartition: udevPath uses fcp but fcp is not implemented!"); - } } else { y2error ("ModifyReiplWithBootPartition: size of uParts is 4, but format is not what we expect"); @@ -409,44 +402,29 @@ } if (fCCW) { - configuration["method"] = "ccw"; + configuration["method"] = "ccw"; map ccw_map = (map)configuration["ccw"]:nil; - if (ccw_map == nil) { - y2error ("ModifyReiplWithBootPartition: ccw does not exist in configuration"); - - configuration = nil; - } - else { - ccw_map["device"] = uParts[1]:""; - ccw_map["loadparm"] = ""; - - configuration["ccw"] = ccw_map; - } + ccw_map["device"] = uParts[1]:""; + ccw_map["loadparm"] = ""; + //ccw_map["parm"] = ""; /* SLES 11 and z/VM only */ // read only + configuration["ccw"] = ccw_map; + y2milestone ("ModifyReiplWithBootPartition: modified ccw map"); } else if (fFCP) { configuration["method"] = "fcp"; map fcp_map = (map)configuration["fcp"]:nil; - if (fcp_map == nil) { - y2error ("ModifyReiplWithBootPartition: ccw does not exist in configuration"); - - configuration = nil; - } - else { - fcp_map["device"] = uParts[1]:""; - fcp_map["wwpn"] = uParts[2]:""; - fcp_map["lun"] = uParts[3]:""; - fcp_map["bootprog"] = ""; - fcp_map["br_lba"] = ""; - - configuration["fcp"] = fcp_map; - } + fcp_map["device"] = uParts[1]:""; + fcp_map["wwpn"] = uParts[2]:""; + fcp_map["lun"] = uParts[3]:""; + fcp_map["bootprog"] = "0"; + fcp_map["br_lba"] = "0"; + configuration["fcp"] = fcp_map; + y2milestone ("ModifyReiplWithBootPartition: modified fcp map"); } else { - y2error ("ModifyReiplWithBootPartition: Should not be here!"); - - configuration = nil; + y2error ("ModifyReiplWithBootPartition: Should not be here, configuration unmodified!"); } return configuration; @@ -458,6 +436,18 @@ */ global map <string, any> ReadState () { map <string, any> configuration = $[]; + configuration["ccw"] = $[ + "device": "", + "loadparm": "", + "parm": "" /* SLES 11 and z/VM only */ + ]; + configuration["fcp"] = $[ + "device": "", + "wwpn": "", + "lun": "", + "bootprog": "", + "br_lba": "" + ]; if (!SanityCheck ()) { y2error ("Reipl::Read: SanityCheck failed!"); @@ -467,41 +457,23 @@ Especially, since this would currently popup three times during installation. */ - return nil; + return configuration; } if (ccw_exists) { - if (configuration["ccw"]:nil == nil) { - configuration["ccw"] = $[ - "device": "", - "loadparm": "" - ]; - } - map ccw_map = (map)configuration["ccw"]:nil; ccw_map["device"] = deletechars ((string)SCR::Read (.target.string, ccw_directory + "/device"), "\n\r"); ccw_map["loadparm"] = deletechars ((string)SCR::Read (.target.string, ccw_directory + "/loadparm"), "\n\r"); + ccw_map["parm"] = deletechars ((string)SCR::Read (.target.string, ccw_directory + "/parm"), "\n\r"); /* SLES 11 and z/VM only */ configuration["ccw"] = ccw_map; } else { - y2error ("Reipl::Read: ccw is not configured."); - - configuration["ccw"] = nil; + y2warning ("Reipl::Read: ccw is not configured."); } if (fcp_exists) { - if (configuration["fcp"]:nil == nil) { - configuration["fcp"] = $[ - "device": "", - "wwpn": "", - "lun": "", - "bootprog": "", - "br_lba": "" - ]; - } - map fcp_map = (map)configuration["fcp"]:nil; fcp_map["device"] = deletechars ((string)SCR::Read (.target.string, fcp_directory + "/device"), "\n\r"); @@ -513,7 +485,7 @@ configuration["fcp"] = fcp_map; } else { - configuration["fcp"] = nil; + y2warning ("Reipl::Read: fcp is not configured."); } configuration["method"] = deletechars ((string)SCR::Read (.target.string, reipl_directory + "/reipl_type"), "\n\r"); @@ -590,6 +562,7 @@ rc = false; } + } else { y2error ("Reipl::WriteState: ccw_map is nil!"); @@ -695,7 +668,8 @@ map ccwIn = (map)settings["ccw"]:$[]; map ccwOut = $[ "device": "", - "loadparm": "" + "loadparm": "", + "parm": "" /* SLES 11 and z/VM only */ ]; if (ccwIn["device"]:nil != nil) { @@ -704,6 +678,10 @@ if (ccwIn["loadparm"]:nil != nil) { ccwOut["loadparm"] = ccwIn["loadparm"]:nil; } + /* SLES 11 and z/VM only */ + if (ccwIn["parm"]:nil != nil) { + ccwOut["parm"] = ccwIn["parm"]:nil; + } imported["ccw"] = ccwOut; } Modified: trunk/reipl/src/inst_reiplauto.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/src/inst_reiplauto.ycp?rev=55344&r1=55343&r2=55344&view=diff ============================================================================== --- trunk/reipl/src/inst_reiplauto.ycp (original) +++ trunk/reipl/src/inst_reiplauto.ycp Mon Feb 9 13:10:57 2009 @@ -65,14 +65,13 @@ boolean rc = true; - map <string, any> oldConfiguration = Reipl::ReadState (); - map <string, any> newConfiguration = nil; + map <string, any> configuration = Reipl::ReadState (); - if (oldConfiguration != nil) { - newConfiguration = Reipl::ModifyReiplWithBootPartition (oldConfiguration); + if (configuration != nil) { + configuration = Reipl::ModifyReiplWithBootPartition (configuration); - if (newConfiguration != nil) { - Reipl::WriteState (newConfiguration); + if (configuration != nil) { + Reipl::WriteState (configuration); } else { y2error ("Could not modify reipl configuration"); Modified: trunk/reipl/src/reipl_bootloader_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/src/reipl_bootloader_finish.ycp?rev=55344&r1=55343&r2=55344&view=diff ============================================================================== --- trunk/reipl/src/reipl_bootloader_finish.ycp (original) +++ trunk/reipl/src/reipl_bootloader_finish.ycp Mon Feb 9 13:10:57 2009 @@ -20,42 +20,58 @@ textdomain "reipl"; - boolean different = false; + boolean different = true; string ipl_msg = ""; // Other architectures do not support it if (Arch::s390 ()) { map <string, any> oldConfiguration = Reipl::ReadState (); - map <string, any> newConfiguration = oldConfiguration; + map <string, any> newConfiguration = Reipl::ReadState (); if (oldConfiguration != nil) { - newConfiguration = Reipl::ModifyReiplWithBootPartition (oldConfiguration); + newConfiguration = Reipl::ModifyReiplWithBootPartition (newConfiguration); map oldCcwMap = (map)oldConfiguration["ccw"]:nil; map newCcwMap = (map)newConfiguration["ccw"]:nil; map oldFcpMap = (map)oldConfiguration["fcp"]:nil; map newFcpMap = (map)newConfiguration["fcp"]:nil; - different = oldConfiguration["method"]:"a" != newConfiguration["method"]:"b" - && oldCcwMap["device"]:"a" != newCcwMap["device"]:"b" - && oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b" - && oldFcpMap["device"]:"a" != newFcpMap["device"]:"b" - && oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b" - && oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b" - && oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b" - && oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b"; + different = (oldConfiguration["method"]:"a" != newConfiguration["method"]:"b") + || (oldCcwMap["device"]:"a" != newCcwMap["device"]:"b") + || (oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b") + || (oldCcwMap["parm"]:"a" != newCcwMap["parm"]:"b") + || (oldFcpMap["device"]:"a" != newFcpMap["device"]:"b") + || (oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b") + || (oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b") + || (oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b") + || (oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b"); + + y2milestone("(oldConfiguration['method']:'a' != newConfiguration['method']:'b') = %1", (oldConfiguration["method"]:"a" != newConfiguration["method"]:"b")); + y2milestone("(oldCcwMap['device']:'a' != newCcwMap['device']:'b') = %1", (oldCcwMap["device"]:"a" != newCcwMap["device"]:"b")); + y2milestone("(oldCcwMap['loadparm']:'a' != newCcwMap['loadparm']:'b') = %1", (oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b")); + y2milestone("(oldCcwMap['parm']:'a' != newCcwMap['parm']:'b') = %1", (oldCcwMap["parm"]:"a" != newCcwMap["parm"]:"b")); + y2milestone("(oldFcpMap['device']:'a' != newFcpMap['device']:'b') = %1", (oldFcpMap["device"]:"a" != newFcpMap["device"]:"b")); + y2milestone("(oldFcpMap['wwpn']:'a' != newFcpMap['wwpn']:'b') = %1", (oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b")); + y2milestone("(oldFcpMap['lun']:'a' != newFcpMap['lun']:'b') = %1", (oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b")); + y2milestone("(oldFcpMap['bootprog']:'a' != newFcpMap['bootprog']:'b') = %1", (oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b")); + y2milestone("(oldFcpMap['br_lba']:'a' != newFcpMap['br_lba']:'b') = %1", (oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b")); + y2milestone("different = %1", different); + y2milestone("newConfiguration['method'] : %1", newConfiguration["method"]:"ERROR"); if (newConfiguration["method"]:"ERROR" == "ccw") { + y2milestone("making ccw ipl text"); string dev = substring (newCcwMap["device"]:"", 4, 4); // TRANSLATORS: part of a shutdown message // %1 is replaced with a device name // Newline at the end is required - ipl_msg = sformat (_("After shutdown, reload the system + ipl_msg = sformat (_(" +After shutdown, reload the system with an IPL from DASD '%1'. "), dev); } else if (newConfiguration["method"]:"ERROR" == "fcp") { + y2milestone("making fcp ipl text"); string dev = substring (newFcpMap["device"]:"", 4, 4); string wwpn = newFcpMap["wwpn"]:""; string lun = newFcpMap["lun"]:""; @@ -65,13 +81,24 @@ // %2 is replaced with a WWPN name // %3 is replaced with a LUN name // Newline at the end is required - ipl_msg = sformat (_("After shutdown, reload the system -with an IPL from FCP '%1' with WWPN '%2' + ipl_msg = sformat (_(" +After shutdown, reload the system +with an IPL from FCP '%1' +with WWPN '%2' and LUN '%3'. "), dev, wwpn, lun); + } else { + y2warning("cannot make ipl text for unknown method"); } } } - return $["different":different, "ipl_msg":ipl_msg]; -} \ No newline at end of file + y2milestone ("Configuration (reIPL) has been changed: %1", different); + y2milestone ("Configuration (reIPL) generated shutdown dialog box message: %1", ipl_msg); + + map <string, any> ret = $["different":different, "ipl_msg":ipl_msg]; + + y2milestone("ret = %1", ret); + + return ret; +} Modified: trunk/reipl/src/reipl_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/src/reipl_finish.ycp?rev=55344&r1=55343&r2=55344&view=diff ============================================================================== --- trunk/reipl/src/reipl_finish.ycp (original) +++ trunk/reipl/src/reipl_finish.ycp Mon Feb 9 13:10:57 2009 @@ -16,33 +16,46 @@ import "Arch"; import "Reipl"; - boolean different = false; + boolean different = true; // Other architectures do not support it if (Arch::s390 ()) { map <string, any> oldConfiguration = Reipl::ReadState (); - map <string, any> newConfiguration = oldConfiguration; + map <string, any> newConfiguration = Reipl::ReadState (); if (oldConfiguration != nil) { - newConfiguration = Reipl::ModifyReiplWithBootPartition (oldConfiguration); + newConfiguration = Reipl::ModifyReiplWithBootPartition (newConfiguration); map oldCcwMap = (map)oldConfiguration["ccw"]:nil; map newCcwMap = (map)newConfiguration["ccw"]:nil; map oldFcpMap = (map)oldConfiguration["fcp"]:nil; map newFcpMap = (map)newConfiguration["fcp"]:nil; - different = oldConfiguration["method"]:"a" != newConfiguration["method"]:"b" - && oldCcwMap["device"]:"a" != newCcwMap["device"]:"b" - && oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b" - && oldFcpMap["device"]:"a" != newFcpMap["device"]:"b" - && oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b" - && oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b" - && oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b" - && oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b"; + different = (oldConfiguration["method"]:"a" != newConfiguration["method"]:"b") + || (oldCcwMap["device"]:"a" != newCcwMap["device"]:"b") + || (oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b") + || (oldCcwMap["parm"]:"a" != newCcwMap["parm"]:"b") + || (oldFcpMap["device"]:"a" != newFcpMap["device"]:"b") + || (oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b") + || (oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b") + || (oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b") + || (oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b"); + + y2milestone("(oldConfiguration['method']:'a' != newConfiguration['method']:'b') = %1", (oldConfiguration["method"]:"a" != newConfiguration["method"]:"b")); + y2milestone("(oldCcwMap['device']:'a' != newCcwMap['device']:'b') = %1", (oldCcwMap["device"]:"a" != newCcwMap["device"]:"b")); + y2milestone("(oldCcwMap['loadparm']:'a' != newCcwMap['loadparm']:'b') = %1", (oldCcwMap["loadparm"]:"a" != newCcwMap["loadparm"]:"b")); + y2milestone("(oldCcwMap['parm']:'a' != newCcwMap['parm']:'b') = %1", (oldCcwMap["parm"]:"a" != newCcwMap["parm"]:"b")); + y2milestone("(oldFcpMap['device']:'a' != newFcpMap['device']:'b') = %1", (oldFcpMap["device"]:"a" != newFcpMap["device"]:"b")); + y2milestone("(oldFcpMap['wwpn']:'a' != newFcpMap['wwpn']:'b') = %1", (oldFcpMap["wwpn"]:"a" != newFcpMap["wwpn"]:"b")); + y2milestone("(oldFcpMap['lun']:'a' != newFcpMap['lun']:'b') = %1", (oldFcpMap["lun"]:"a" != newFcpMap["lun"]:"b")); + y2milestone("(oldFcpMap['bootprog']:'a' != newFcpMap['bootprog']:'b') = %1", (oldFcpMap["bootprog"]:"a" != newFcpMap["bootprog"]:"b")); + y2milestone("(oldFcpMap['br_lba']:'a' != newFcpMap['br_lba']:'b') = %1", (oldFcpMap["br_lba"]:"a" != newFcpMap["br_lba"]:"b")); + y2milestone("different = %1", different); + } y2milestone ("Configuration (reIPL) has been changed: %1", different); } return different; -} \ No newline at end of file +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org