Author: thardeck
Date: Tue Aug 16 15:11:51 2011
New Revision: 65355
URL: http://svn.opensuse.org/viewcvs/yast?rev=65355&view=rev
Log:
- extended dump module to support dasd multi-volume dump devices
(fate#304024)
- added onpanic module - a fronted for dumpconf
Added:
trunk/s390/agents/cfg_dumpconf.scr
trunk/s390/src/clients/onpanic.desktop
trunk/s390/src/clients/onpanic.ycp
trunk/s390/src/dump/ui.ycp
trunk/s390/src/modules/OnPanic.ycp
trunk/s390/src/onpanic/
trunk/s390/src/onpanic/Makefile.am
trunk/s390/src/onpanic/Makefile.in
trunk/s390/src/onpanic/ui.ycp
Removed:
trunk/s390/src/dump/dialogs.ycp
trunk/s390/src/dump/helps.ycp
trunk/s390/src/dump/wizards.ycp
Modified:
trunk/s390/VERSION
trunk/s390/package/yast2-s390.changes
trunk/s390/src/Makefile.am
trunk/s390/src/clients/Makefile.am
trunk/s390/src/clients/dump.ycp
trunk/s390/src/dump/Makefile.am
trunk/s390/src/modules/Dump.ycp
trunk/s390/src/modules/Makefile.am
Modified: trunk/s390/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/VERSION?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/VERSION (original)
+++ trunk/s390/VERSION Tue Aug 16 15:11:51 2011
@@ -1 +1 @@
-2.21.2
+2.21.3
Added: trunk/s390/agents/cfg_dumpconf.scr
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/agents/cfg_dumpconf.scr?rev=65355&view=auto
==============================================================================
--- trunk/s390/agents/cfg_dumpconf.scr (added)
+++ trunk/s390/agents/cfg_dumpconf.scr Tue Aug 16 15:11:51 2011
@@ -0,0 +1,17 @@
+/**
+ * File:
+ * cfg_dumpconf.scr
+ * Summary:
+ * SCR Agent for reading/writing /etc/sysconfig/dumpconf
+ * using the sysconfig-agent
+ *
+ * $Id: cfg_dumpconf.scr 18211 2011-08-04 12:59:57Z thardeck $
+ *
+ * Read/Sets the values defined in <tt>/etc/sysconfig/dumpconf</tt>
+ * in an easy manner.
+ */
+.sysconfig.dumpconf
+
+`ag_ini(
+ `SysConfigFile("/etc/sysconfig/dumpconf")
+)
Modified: trunk/s390/package/yast2-s390.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/package/yast2-s390.changes?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/package/yast2-s390.changes (original)
+++ trunk/s390/package/yast2-s390.changes Tue Aug 16 15:11:51 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Aug 9 14:06:43 UTC 2011 - thardeck@novell.com
+
+- extended dump module to support dasd multi-volume dump devices (fate#304024)
+- added onpanic module - a fronted for dumpconf
+
+-------------------------------------------------------------------
Fri Aug 5 12:34:53 CEST 2011 - tgoettlicher@suse.de
- fixed .desktop file (bnc #681249)
Modified: trunk/s390/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/Makefile.am?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/src/Makefile.am (original)
+++ trunk/s390/src/Makefile.am Tue Aug 16 15:11:51 2011
@@ -1 +1 @@
-SUBDIRS = zfcp dasd xpram dump modules clients config
+SUBDIRS = zfcp dasd xpram dump onpanic modules clients config
Modified: trunk/s390/src/clients/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/Makefile.am?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/src/clients/Makefile.am (original)
+++ trunk/s390/src/clients/Makefile.am Tue Aug 16 15:11:51 2011
@@ -10,6 +10,7 @@
s390-disk-controller.ycp\
xpram.ycp \
dump.ycp \
+ onpanic.ycp \
inst_dasd.ycp \
inst_zfcp.ycp \
dasd_proposal.ycp \
@@ -19,7 +20,8 @@
zfcp.desktop \
dasd.desktop \
xpram.desktop \
- dump.desktop
+ dump.desktop \
+ onpanic.desktop
EXTRA_DIST = $(client_DATA) $(desktop_DATA)
Modified: trunk/s390/src/clients/dump.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/dump.ycp?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/src/clients/dump.ycp (original)
+++ trunk/s390/src/clients/dump.ycp Tue Aug 16 15:11:51 2011
@@ -1,18 +1,16 @@
/**
- * File: clients/controller.ycp
- * Package: Configuration of controller
+ * File: clients/dump.ycp
+ * Package: Creation of s390 dump devices
* Summary: Main file
- * Authors: Jiri Srain
+ * Authors: Tim Hardeck
*
- * $Id$
- *
- * Main file for controller configuration. Uses all other files.
+ * Main file for s390 dump devices creation. Uses all other files.
*/
{
/***
- * <h3>Configuration of controller</h3>
+ * <h3>Creation of s390 dump devices</h3>
*/
textdomain "s390";
@@ -21,36 +19,29 @@
y2milestone ("----------------------------------------");
y2milestone ("Dump module started");
-import "Progress";
-import "Report";
-import "Summary";
-
import "CommandLine";
-include "s390/dump/wizards.ycp";
+include "s390/dump/ui.ycp";
map cmdline_description = $[
- "id" : "controller",
- // Command line help text for the Xcontroller module
- "help" : _("Configuration of controller"),
- "guihandler" : DumpSequence,
- "initialize" : Dump::Read,
- "finish" : Dump::Write,
- "actions" : $[
+ "id" : "dumpdevices",
+ // Command line help text for the Xcontroller module
+ "help" : _("Creation of s390 dump devices"),
+ "guihandler" : DumpSequence,
+ "actions" : $[
// FIXME TODO: fill the functionality description here
- ],
- "options" : $[
+ ],
+ "options" : $[
// FIXME TODO: fill the option descriptions here
- ],
- "mapping" : $[
+ ],
+ "mapping" : $[
// FIXME TODO: fill the mappings of actions and options here
- ]
+ ]
];
/* main ui function */
-any ret = nil;
+any ret = CommandLine::Run(cmdline_description);
-ret = CommandLine::Run(cmdline_description);
//ret = DumpSequence ();
y2debug("ret=%1", ret);
Added: trunk/s390/src/clients/onpanic.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/onpanic.desktop?rev=65355&view=auto
==============================================================================
--- trunk/s390/src/clients/onpanic.desktop (added)
+++ trunk/s390/src/clients/onpanic.desktop Tue Aug 16 15:11:51 2011
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Hardware;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=onpanic
+
+X-SuSE-YaST-Group=Hardware
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=
+
+Icon=yast-onpanic
+Exec=/sbin/yast2 onpanic
+
+Name=On Panic
+GenericName=Configures the actions which should be performed after a kernel panic
+StartupNotify=true
Added: trunk/s390/src/clients/onpanic.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/onpanic.ycp?rev=65355&view=auto
==============================================================================
--- trunk/s390/src/clients/onpanic.ycp (added)
+++ trunk/s390/src/clients/onpanic.ycp Tue Aug 16 15:11:51 2011
@@ -0,0 +1,58 @@
+/**
+ * File: clients/onpanic.ycp
+ * Package: Configuration of onpanic
+ * Summary: Main file
+ * Authors: Tim Hardeck
+ *
+ * $Id: irda.ycp 22889 2005-04-01 09:12:51Z jsuchome $
+ *
+ * Main file for onpanic configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of onpanic</h3>
+ */
+
+textdomain "s390";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("OnPanic module started");
+
+import "CommandLine";
+import "OnPanic";
+
+include "s390/onpanic/ui.ycp";
+
+map cmdline_description = $[
+ "id" : "onpanic",
+ /* Command line help text for the Xirda module */
+ "help" : _("Configuration of OnPanic"),
+ "guihandler" : OnPanicSequence,
+ "initialize" : OnPanic::Read,
+ "finish" : OnPanic::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+];
+
+
+/* main ui function */
+any ret = CommandLine::Run (cmdline_description);
+
+//ret = OnPanicSequence ();
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("OnPanic module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Modified: trunk/s390/src/dump/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dump/Makefile.am?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/src/dump/Makefile.am (original)
+++ trunk/s390/src/dump/Makefile.am Tue Aug 16 15:11:51 2011
@@ -3,9 +3,7 @@
yncludedir = @yncludedir@/s390/dump
ynclude_DATA = \
- helps.ycp \
- wizards.ycp \
- dialogs.ycp
+ ui.ycp
EXTRA_DIST = $(ynclude_DATA)
Added: trunk/s390/src/dump/ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dump/ui.ycp?rev=65355&view=auto
==============================================================================
--- trunk/s390/src/dump/ui.ycp (added)
+++ trunk/s390/src/dump/ui.ycp Tue Aug 16 15:11:51 2011
@@ -0,0 +1,172 @@
+/**
+ * File: include/s390/dump/ui.ycp
+ * Package: Creation of s390 dump devices
+ * Summary: Dialogs definitions
+ * Authors: Tim Hardeck
+ *
+ */
+
+{
+
+textdomain "s390";
+
+import "Dump";
+import "Label";
+import "Popup";
+import "Wizard";
+
+/**
+ * Run the dialog for Dump
+ * @param what symbol a
+ * @return symbol EditDumpDialog that was edited
+ */
+symbol DumpDialog () {
+ string caption = _("Create Dump Device");
+ string help = _("
+<p><b>Prepare one or more volumes for use as S/390 dump device.</b></p>
+<p>Supported devices are ECKD DASD and ZFCP disks, while multi-volumes are limited to DASD.<br>
+Only whole disks can be used, no partitions! If the device is incompatible formatted/partioned, activate the checkbox
+<b>Force overwrite of disk</b></p>
+<p>Devices which are in use or have mounted partitions will not be shown.<br>
+The mentioning of <b>dumpdevice</b> after a disk indicates that it is an already usable dump device. Additionally multi-volume dump devices are indicated by the list of including DASD ids. </p>
+<p>ZFCP columns: Device, Size, ID, WWPN, LUN, Dump<br>
+DASD columns: Device, Size, ID, Dump</p>");
+
+ list<string> dasd_disks = Dump::dasd_disks;
+ list<string> zfcp_disks = Dump::zfcp_disks;
+
+ // define default active selection (`dasd, `zfcp)
+ symbol type = `zfcp;
+
+
+ /* Dialog content */
+ term content = `HBox( `VBox(
+ `RadioButtonGroup(`id(`disk),
+ `VBox(
+ `Frame("", `VBox(
+ `Left(`RadioButton(`id(`zfcp), `opt(`notify), _("&ZFCP"), type == `zfcp)),
+ `ComboBox (`id(`zfcp_disks), `opt (`hstretch), "",
+ zfcp_disks
+ ))),
+ `VSpacing (0.3),
+ `Frame("", `VBox(
+ `Left(`RadioButton(`id(`dasd), `opt(`notify), _("&DASD"), type == `dasd)),
+ `MultiSelectionBox( `id( `dasd_disks ), "",
+ dasd_disks
+ )))
+ )
+ ),
+ `VSpacing (0.3),
+ `Left (`CheckBox (`id (`force), `opt(`notify), _("&Force overwrite of disk")))
+ ));
+
+ /* Apply the settings */
+ Wizard::SetContentsButtons (caption, content, help, Label::BackButton (), Label::CreateButton());
+ Wizard::HideBackButton();
+ Wizard::SetAbortButton(`cancel, Label::CancelButton());
+
+ UI::ChangeWidget(`id(`dasd_disks), `Enabled, type == `dasd);
+ UI::ChangeWidget(`id(`zfcp_disks), `Enabled, type == `zfcp);
+
+ boolean force = false;
+ symbol ret = nil;
+
+ do
+ {
+ ret = (symbol) UI::UserInput();
+
+ if (ret == `force)
+ {
+ force = (boolean)UI::QueryWidget (`id (`force), `Value);
+ }
+
+ // disable inactive area
+ if (ret == `dasd || ret == `zfcp)
+ {
+ UI::ChangeWidget(`id(`dasd_disks), `Enabled, ret == `dasd);
+ UI::ChangeWidget(`id(`zfcp_disks), `Enabled, ret == `zfcp);
+ }
+
+ if (contains ([`create, `ok, `next, `finish], ret))
+ {
+ string device = "";
+ type = (symbol) UI::QueryWidget(`id(`disk), `CurrentButton);
+
+ // gather selected device[s]
+ list<string> entries = [ ];
+ if (type == `zfcp) { //zfcp
+ string dev_line = (string)UI::QueryWidget (`id (`zfcp_disks), `Value);
+ entries = splitstring (dev_line, "\t");
+ device = entries[0]:"";
+ }
+ else // dasd
+ {
+ list<string> selected_items = (list<string>)UI::QueryWidget( `id(`dasd_disks), `SelectedItems );
+ foreach (string dev_line, selected_items,
+ {
+ entries = splitstring (dev_line, "\t");
+ // prevent leading space
+ if (device != "")
+ {
+ device = device + " " + entries[0]:"";
+ }
+ else
+ {
+ device = entries[0]:"";
+ }
+ });
+ }
+
+ if (size(device) == 0)
+ {
+ Popup::Notify (_("You haven't selected any device."));
+ }
+ else
+ {
+ // warn only in case of force
+ if (!force || Popup::YesNo (sformat (_("The disk[s] %1 will be formatted as a dump device. All data on this device[s] will be lost! Continue?"), device)))
+ {
+ boolean success = Dump::FormatDisk (device, force);
+ // don't quit in case of failures, error messages are reported by FormatDisk()
+ if (success && !Popup::YesNo (_("Operation successful. Initialize another dump device?")))
+ {
+ ret = `cancel;
+ }
+ else
+ {
+ // reinitialize devices
+ ret = `again;
+ }
+ }
+ }
+ }
+ } while (!contains ([`abort, `cancel, `again], ret));
+ return (symbol) ret;
+}
+
+
+/**
+ * The whole squence
+ * @return sequence result
+ */
+symbol DumpSequence() {
+ symbol ret = nil;
+ // reset dialog if required
+ do
+ {
+ // recreate dialog everytime to show the read progress bar after the creation progress bar
+ Wizard::CreateDialog();
+ Wizard::SetDesktopIcon("dump");
+ Dump::Read ();
+
+ ret = DumpDialog ();
+ UI::CloseDialog();
+ } while (ret == `again);
+
+ return ret;
+}
+
+/* EOF */
+}
+
+
Modified: trunk/s390/src/modules/Dump.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/Dump.ycp?rev=65355&r1=65354&r2=65355&view=diff
==============================================================================
--- trunk/s390/src/modules/Dump.ycp (original)
+++ trunk/s390/src/modules/Dump.ycp Tue Aug 16 15:11:51 2011
@@ -1,10 +1,8 @@
/**
* File: modules/Dump.ycp
- * Package: Configuration of S/390 specific stuff
+ * Package: Creation of s390 dump devices
* Summary: Creating dump devices for S/390
- * Authors: Jiri Srain
- *
- * $Id$
+ * Authors: Tim Hardeck
*
*/
@@ -13,92 +11,66 @@
module "Dump";
textdomain "s390";
-import "Mode";
-import "Progress";
import "Report";
-import "Stage";
-import "Summary";
-import "Arch";
-//import "Bootloader";
-
-
-global map > devices = $[];
-
-global map current_device = $[];
-
-/**
- * Prototypes
- */
-global boolean Modified();
-
-/**
- * Data was modified?
- */
-global boolean modified = false;
+import "String";
+import "Progress";
/**
- */
-global boolean proposal_valid = false;
-
+ * DASD devices list of mkdump
+ */
+global define list<string> dasd_disks = [ ];
/**
- * Write only, used during autoinstallation.
- * Don't run services and SuSEconfig, it's all done at one place.
- */
-global boolean write_only = false;
+ * ZFCP devices list of mkdump
+ */
+global define list<string> zfcp_disks = [ ];
/**
- * Abort function
- * return boolean return true if abort
+ * Get a List of available Disks of type
+ * @return list<string> of disks
*/
-global boolean() AbortFunction = Modified;
+define list<string> GetAvailableDisks (string type) {
+ list<string> device_list = nil;
+ if (type == "dasd" || type == "zfcp")
+ {
+ string cmd = "mkdump --list-" + type;
+ y2milestone ("Running command %1", cmd);
+ map output = (map) SCR::Execute(.target.bash_output, cmd);
+ y2milestone ("Command return code: %1", (integer)output["exit"]:0);
+ y2milestone ("Command output:\n%1\n%2", output["stdout"]:"", output["stderr"]:"");
+ device_list = String::NewlineItems (output["stdout"]:"");
+ }
+ return device_list;
-/**
- * Abort function
- * @return blah blah lahjk
- */
-global define boolean Abort() ``{
- if(AbortFunction != nil)
- return AbortFunction ();
- return false;
}
-/**
- * Data was modified?
- * @return true if modified
- */
-global boolean Modified() {
- y2debug("modified=%1",modified);
- return modified;
-}
+global define boolean Read () {
+ string caption = _("Checking Disks");
+ integer steps = 2;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Checking DASD disks"),
+ /* Progress stage 2/2 */
+ _("Checking ZFCP disks")
+ ], [
+ /* Progress step 1/2 */
+ _("Checking DASD disks..."),
+ /* Progress step 2/2 */
+ _("Checking ZFCP disks..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
-/**
- * Is this kind of disk controller available?
- * @return boolean true if it is
- */
-global boolean Available () {
- return true;
-}
+ Progress::NextStage();
+ dasd_disks = Dump::GetAvailableDisks ("dasd");
-/**
- * Read all controller settings
- * @return true on success
- */
-global boolean Read() {
- list