Author: aschnell
Date: Mon Feb 20 18:15:21 2012
New Revision: 67489
URL: http://svn.opensuse.org/viewcvs/yast?rev=67489&view=rev
Log:
- work on getting zfcp modules working with autoyast editor
Modified:
trunk/s390/src/clients/dasd.ycp
trunk/s390/src/clients/dasd_auto.ycp
trunk/s390/src/clients/zfcp.ycp
trunk/s390/src/dasd/dialogs.ycp
trunk/s390/src/dasd/wizards.ycp
trunk/s390/src/modules/ZFCPController.ycp
trunk/s390/src/zfcp/dialogs.ycp
trunk/s390/src/zfcp/helps.ycp
trunk/s390/src/zfcp/wizards.ycp
Modified: trunk/s390/src/clients/dasd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/dasd.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/clients/dasd.ycp (original)
+++ trunk/s390/src/clients/dasd.ycp Mon Feb 20 18:15:21 2012
@@ -8,16 +8,9 @@
*
* Main file for controller configuration. Uses all other files.
*/
-
{
-
-/***
- * <h3>Configuration of controller</h3>
- */
-
textdomain "s390";
-/* The main () */
y2milestone ("----------------------------------------");
y2milestone ("DASD module started");
@@ -29,7 +22,7 @@
include "s390/dasd/wizards.ycp";
map cmdline_description = $[
- "id" : "controller",
+ "id" : "DASD",
// Command line help text for the Xcontroller module
"help" : _("Configuration of DASD"),
"guihandler" : DASDSequence,
@@ -46,19 +39,11 @@
]
];
-
-/* main ui function */
-any ret = nil;
-
-ret = CommandLine::Run(cmdline_description);
-//ret = DASDSequence ();
+any ret = CommandLine::Run(cmdline_description);
y2debug("ret=%1", ret);
-/* Finish */
y2milestone("DASD module finished");
y2milestone("----------------------------------------");
return ret;
-
-/* EOF */
}
Modified: trunk/s390/src/clients/dasd_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/dasd_auto.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/clients/dasd_auto.ycp (original)
+++ trunk/s390/src/clients/dasd_auto.ycp Mon Feb 20 18:15:21 2012
@@ -121,5 +121,4 @@
y2milestone("----------------------------------------");
return ret;
-
}
Modified: trunk/s390/src/clients/zfcp.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/zfcp.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/clients/zfcp.ycp (original)
+++ trunk/s390/src/clients/zfcp.ycp Mon Feb 20 18:15:21 2012
@@ -8,16 +8,9 @@
*
* Main file for controller configuration. Uses all other files.
*/
-
{
-
-/***
- * <h3>Configuration of controller</h3>
- */
-
textdomain "s390";
-/* The main () */
y2milestone ("----------------------------------------");
y2milestone ("ZFCP module started");
@@ -31,8 +24,8 @@
map cmdline_description = $[
"id" : "ZFCP",
// Command line help text for the Xcontroller module
- "help" : _("ZFCP configuration"),
- "guihandler" : ZFCPSequence, //ControllerSequence,
+ "help" : _("Configuration of ZFCP"),
+ "guihandler" : ZFCPSequence,
"initialize" : ZFCPController::Read,
"finish" : ZFCPController::Write,
"actions" : $[
@@ -46,20 +39,11 @@
]
];
-
-/* main ui function */
-any ret = nil;
-
-//ret = CommandLine::Run(cmdline_description);
-//ret = ZFCPSequence ();
-ret = CommandLine::Run(cmdline_description);
+any ret = CommandLine::Run(cmdline_description);
y2debug("ret=%1", ret);
-/* Finish */
y2milestone("ZFCP module finished");
y2milestone("----------------------------------------");
return ret;
-
-/* EOF */
}
Modified: trunk/s390/src/dasd/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dasd/dialogs.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/dasd/dialogs.ycp (original)
+++ trunk/s390/src/dasd/dialogs.ycp Mon Feb 20 18:15:21 2012
@@ -38,9 +38,9 @@
* Read settings dialog
* @return `abort if aborted and `next otherwise
*/
-symbol ReadDialog() {
+symbol ReadDialog()
+{
Wizard::RestoreHelp(DASD_HELPS["read"]:"");
- // Controller::AbortFunction = PollAbort;
boolean ret = DASDController::Read();
return ret ? `next : `abort;
}
@@ -49,9 +49,9 @@
* Write settings dialog
* @return `abort if aborted and `next otherwise
*/
-symbol WriteDialog() {
+symbol WriteDialog()
+{
Wizard::RestoreHelp(DASD_HELPS["write"]:"");
- // Controller::AbortFunction = PollAbort;
boolean ret = DASDController::Write();
return ret ? `next : `abort;
}
@@ -273,7 +273,7 @@
}
foreach (integer id, selected, {
- string channel = DASDController::devices[id,"channel"]:"";
+ string channel = DASDController::devices[id, "channel"]:"";
boolean diag = DASDController::diag[channel]:false;
DASDController::ActivateDisk(channel, diag);
});
@@ -295,7 +295,7 @@
}
foreach (integer id, selected, {
- string channel = DASDController::devices[id,"channel"]:"";
+ string channel = DASDController::devices[id, "channel"]:"";
boolean diag = DASDController::diag[channel]:false;
DASDController::DeactivateDisk(channel, diag);
});
@@ -461,12 +461,6 @@
*/
symbol AddDASDDiskDialog()
{
- if (!Mode::config())
- {
- y2error("DASD Add Disk dialog shouldn't be run in Mode::config()");
- return `back;
- }
-
/* Minimal text for the help */
string help = DASD_HELPS["disk_add_config"]:"";
@@ -559,12 +553,6 @@
*/
symbol DeleteDASDDiskDialog()
{
- if (!Mode::config())
- {
- y2error("DASD Delete Disk dialog shouldn't be run in Mode::config()");
- return `back;
- }
-
list<integer> selected = ListSelectedDASD();
if (isempty(selected))
{
Modified: trunk/s390/src/dasd/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dasd/wizards.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/dasd/wizards.ycp (original)
+++ trunk/s390/src/dasd/wizards.ycp Mon Feb 20 18:15:21 2012
@@ -42,7 +42,7 @@
"delete" : $[
`abort : `abort,
`next : "main"
- ],
+ ]
];
return Sequencer::Run(aliases, sequence);
Modified: trunk/s390/src/modules/ZFCPController.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/ZFCPController.ycp?rev=67489&r1=67488&r2=67489&view=diff
==============================================================================
--- trunk/s390/src/modules/ZFCPController.ycp (original)
+++ trunk/s390/src/modules/ZFCPController.ycp Mon Feb 20 18:15:21 2012
@@ -14,12 +14,10 @@
textdomain "s390";
import "Mode";
-import "Progress";
import "Report";
-import "Stage";
-import "Summary";
import "Popup";
+
global map > devices = $[];
global string filter_min = "0.0.0000";
@@ -36,6 +34,7 @@
global void ProbeDisks();
global boolean GetModified();
+
boolean disk_configured = false;
/**
@@ -136,39 +135,77 @@
}
+ global string GetNextLUN(string fcp_lun)
+ {
+ if (fcp_lun == nil || fcp_lun == "")
+ fcp_lun = "0";
+
+ integer old_lun = tointeger(fcp_lun);
+ integer new_lun = old_lun;
+
+ foreach (integer k, map v, devices, {
+ if (old_lun == tointeger(v["detail", "fcp_lun"]:""))
+ {
+ if (v["vendor"]:"" == "IBM" && v["device"]:"" == "25f03")
+ new_lun = old_lun + 0x100000000;
+ else
+ new_lun = old_lun + 1;
+ }
+ });
+
+ return tohexstring(new_lun, 16);
+ }
+
+
/**
* Read all controller settings
* @return true on success
*/
global boolean Read()
{
+ ProbeDisks();
+
disk_configured = false;
return true;
}
+
/**
* Write all controller settings
* @return true on success
*/
global boolean Write()
{
- if (disk_configured && Mode::normal ())
+ if (!Mode::normal())
+ {
+ foreach (integer index, map device, devices, {
+ string channel = device["controller_id"]:"";
+ string wwpn = device["wwpn"]:"";
+ string lun = device["fcp_lun"]:"";
+ ActivateDisk(channel, wwpn, lun);
+ });
+ }
+
+ if (!Mode::installation())
{
- // popup label
- UI::OpenDialog(`Label(_("Running mkinitrd and zipl.")));
+ if (disk_configured)
+ {
+ // popup label
+ UI::OpenDialog(`Label(_("Running mkinitrd and zipl.")));
- string command = "/sbin/mkinitrd && /sbin/zipl";
- y2milestone ("Running command %1", command);
- any ret = SCR::Execute(.target.bash, command);
- y2milestone("Exit code: %1", ret);
+ string command = "/sbin/mkinitrd && /sbin/zipl";
+ y2milestone ("Running command %1", command);
+ any ret = SCR::Execute(.target.bash, command);
+ y2milestone("Exit code: %1", ret);
- UI::CloseDialog();
+ UI::CloseDialog();
+ }
}
return true;
-
}
+
/**
* Get all controller settings from the first parameter
* (For use by autoinstallation.)
@@ -177,12 +214,10 @@
*/
global boolean Import(map settings)
{
- if (Mode::config ())
- {
integer index = -1;
devices = listmap (map d, settings["devices"]:[], {
index = index + 1;
- map m = $[
+ map m = $[
"detail" : $[
"controller_id" : d["controller_id"]:"",
"wwpn" : d["wwpn"]:"",
@@ -191,16 +226,11 @@
];
return $[ index : m ];
});
- }
- else if (Stage::initial ())
- {
- foreach (map d, settings["devices"]:[], {
- ActivateDisk (d["controller_id"]:"", d["wwpn"]:"", d["fcp_lun"]:"");
- });
- }
+
return true;
}
+
/**
* Dump the controller settings to a single map
* (For use by autoinstallation.)
@@ -208,19 +238,14 @@
*/
global map Export()
{
-ProbeDisks();
- list