Mailinglist Archive: yast-commit (815 mails)

< Previous Next >
[yast-commit] r40321 - in /trunk/kdump: src/Kdump.ycp src/dialogs.ycp src/uifunctions.ycp yast2-kdump.spec.in
  • From: juhliarik@xxxxxxxxxxxxxxxx
  • Date: Thu, 16 Aug 2007 14:51:17 -0000
  • Message-id: <20070816145118.0501823AC9@xxxxxxxxxxxxxxxx>
Author: juhliarik
Date: Thu Aug 16 16:51:17 2007
New Revision: 40321

URL: http://svn.opensuse.org/viewcvs/yast?rev=40321&view=rev
Log:
adding corection for Kdump Command Line/Append
added correction for enable kdump
added patch for default allocate memory


Modified:
    trunk/kdump/src/Kdump.ycp
    trunk/kdump/src/dialogs.ycp
    trunk/kdump/src/uifunctions.ycp
    trunk/kdump/yast2-kdump.spec.in

Modified: trunk/kdump/src/Kdump.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/Kdump.ycp?rev=40321&r1=40320&r2=40321&view=diff
==============================================================================
--- trunk/kdump/src/Kdump.ycp (original)
+++ trunk/kdump/src/Kdump.ycp Thu Aug 16 16:51:17 2007
@@ -88,7 +88,13 @@
 global integer total_memory =0;
 
 /**
- * Boolean option indicates kernel parameter
+ * Number of cpus
+ * 
+ * integer
+ */
+integer number_of_cpus = 1;
+
+/** Boolean option indicates kernel parameter
  * "crashkernel"
  *
  * boolean true if kernel parameter is set
@@ -118,7 +124,7 @@
  *
  * string value number of alocate memory
  */
-global string alocated_memory = "128";
+global string alocated_memory = "0";
 
 /**
  * Write only, used during autoinstallation.
@@ -280,9 +286,38 @@
 }
 
 /**
+ * Read available cpu
+ *
+ * 
+ *  @return boolean successfull
+ */
+
+boolean ReadAvailableCPU () {
+
+  list <map> output =  (list<map>)SCR::Read(.probe.cpu);
+
+  number_of_cpus = size(output);
+  y2milestone("[kdump] (ReadAvailableCPU) SCR::Read(.probe.cpu): %1", output);
+  y2milestone("[kdump] number of CPUs: %1", number_of_cpus);
+  //alocated_memory = "0";
+  if (alocated_memory == "0") {     
+     if ((number_of_cpus > 16) || ((total_memory/1024) > 16))
+        alocated_memory = "256";
+     else if ((number_of_cpus > 4) || ((total_memory/1024) > 4))
+        alocated_memory = "128";
+     else
+        alocated_memory = "64";
+     y2milestone("[kdump] allocated memory if not set in \"crashkernel\" param: %1", alocated_memory);
+  }
+
+  
+  return true;
+}
+
+/**
  * Read available memory
  *
- * read kernel parameter "crashkernel"
+ * 
  *  @return boolean successfull
  */
 
@@ -307,9 +342,14 @@
   //resor = (map)range;
   total_memory = tointeger(temp[0]:nil)/1048576;
   y2milestone("[kdump] (ReadAvailableMemory) total phys. memory [MB]: %1", tostring(total_memory));
-  
+  ReadAvailableCPU ();
   return true;
 }
+
+
+
+
+
 /**
  * Read current kdump configuration
  *
@@ -321,8 +361,12 @@
        string val = (string) SCR::Read(add(.sysconfig.kdump, key));
         if (val != nil) KDUMP_SETTINGS[key] = val;
     });
+
+    map <string, string > debug_KDUMP_SETTINGS = KDUMP_SETTINGS;
+
+    debug_KDUMP_SETTINGS["KDUMP_SAVEDIR"] = "";
     y2milestone("-------------KDUMP_SETTINGS-------------------");  
-    y2milestone("kdump configuration has been read: %1", KDUMP_SETTINGS);
+    y2milestone("kdump configuration has been read without value \"KDUMP_SAVEDIR\": %1", debug_KDUMP_SETTINGS);
     y2milestone("---------------------------------------------");
 
     
@@ -338,9 +382,10 @@
  *  @return boolean successfull
  */
 boolean WriteKdumpSettings () {
-
+    map <string, string > debug_KDUMP_SETTINGS = KDUMP_SETTINGS;
+    debug_KDUMP_SETTINGS["KDUMP_SAVEDIR"] = "";
     y2milestone("-------------KDUMP_SETTINGS-------------------");  
-    y2milestone("Writing kdump configuration: %1", KDUMP_SETTINGS);
+    y2milestone("Writing kdump configuration without value \"KDUMP_SAVEDIR\": %1", debug_KDUMP_SETTINGS);
     y2milestone("---------------------------------------------");
 
 
@@ -385,6 +430,7 @@
         if (!Mode::commandline())
            Popup::Message(_("For applying changes is necessary reboot."));
 
+        Service::Enable("kdump");
         return result;
      }
 

Modified: trunk/kdump/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/dialogs.ycp?rev=40321&r1=40320&r2=40321&view=diff
==============================================================================
--- trunk/kdump/src/dialogs.ycp (original)
+++ trunk/kdump/src/dialogs.ycp Thu Aug 16 16:51:17 2007
@@ -89,7 +89,7 @@
              `Left(`Label(`id("usable_memory"),"0123456789")),
              `HStretch ()
            )),
-          `Left(`IntField(`id("memory_buffer"), `opt(`notify), _("Kdump Memor&y [MB]"),128,1048576,128))
+          `Left(`IntField(`id("memory_buffer"), `opt(`notify), _("Kdump Memor&y [MB]"),32,1048576,128))
      )),
      "init"          : InitKdumpMemory,
      "handle"                : HandleKdumpMemory,
@@ -197,31 +197,23 @@
      //TRANSLATORS: TextEntry Label
      "label"                 : _("Kdump Co&mmand Line"),
      "widget"                : `textentry,
-     //"init"                : init is hadled by "SwitchKdumpComLine"
+     "init"          : InitKdumpCommandLine,
      //"handle"              : 
-     //"store"               : store is hadled by "SwitchKdumpComLine"
+     "store"         : StoreKdumpCommandLine,
      "help"          : HelpKdump("KdumpCommandLine"),
   ],
 
-
-  "SwitchKdumpComLine"       : $[
-
-     "widget"                : `custom,
-     "custom_widget" : `VBox(
-           `RadioButtonGroup(`id("switch_kdum_comm_line"),
-             `HBox(`HSpacing(1),`VBox(
-             `Left(`Label("")),
-             `Left(`CheckBox(`id("enable_append"), `opt(`notify), "A&ppend Kdump Commandline"))
-             ))
-           )
-     ),
-     "init"          : InitSwitchKdumpComLine,
-     "handle"                : HandleSwitchKdumpComLine,
-     "store"         : StoreSwitchKdumpComLine,
-     "help"          : HelpKdump("SwitchKdumpComLine"),
-
+  "KdumpCommandLineAppend"   : $[
+     //TRANSLATORS: TextEntry Label
+     "label"                 : _("Kdump Command &Line Append"),
+     "widget"                : `textentry,
+     "init"          : InitKdumpCommandLineAppend,
+     //"handle"              : 
+     "store"         : StoreKdumpCommandLineAppend,
+     "help"          : HelpKdump("KdumpCommandLine"),
   ],
 
+
   "RunLevel"                 : $[
      //TRANSLATORS: ComboBox Label
      "label"                 : _("&The Run-level to Boot the Kdump Kernel"),
@@ -332,13 +324,8 @@
         ))),
        `VSpacing(1),
        `Frame ( _("Command Line"),`HBox(`HSpacing(1),`VBox(
-          //`Left("KernelCommandLine"),
-         `Left(`HBox(
-            `Left("KdumpCommandLine"),
-           `Left("SwitchKdumpComLine"),
-
-           `HStretch ()
-         ))         
+          `Left("KdumpCommandLine"),
+         `Left("KdumpCommandLineAppend")      
         ))),
         `VSpacing(1),
         `Frame ( _("The Run-level to Boot"),`HBox(`HSpacing(1),`VBox(
@@ -366,8 +353,8 @@
      "caption"               : _("Kdump Expert Settings"),
      "tree_item_label"       : _("Expert Settings"),
      "widget_names"  : [
-        "DisBackButton","KdumpCommandLine",
-        "SwitchKdumpComLine", "RunLevel",
+        "DisBackButton", "KdumpCommandLine",
+        "KdumpCommandLineAppend", "RunLevel",
         "EnableDeleteImages", "NumberDumps", 
         "InitrdKernel", "SelectKernel", "EnableReboot"
      ]    

Modified: trunk/kdump/src/uifunctions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/uifunctions.ycp?rev=40321&r1=40320&r2=40321&view=diff
==============================================================================
--- trunk/kdump/src/uifunctions.ycp (original)
+++ trunk/kdump/src/uifunctions.ycp Thu Aug 16 16:51:17 2007
@@ -13,6 +13,7 @@
 
 import "Popup";
 import "Kdump";
+import "Service";
 
 
     // EXAMPLE FUNCTIONS
@@ -140,7 +141,7 @@
   * Function initializes option "Enable/Disable kdump"
   */
 void InitEnableDisalbeKdump (string key) {
-  if (Kdump::add_crashkernel_param) {
+  if ((Kdump::add_crashkernel_param) && (Service::Enabled("kdump"))) {
      UI::ChangeWidget(`id("EnableDisalbeKdump"),`Value,"enable_kdump");
 
   } else {
@@ -235,9 +236,11 @@
       }
 
    }
-
+ map <string, string > debug_KDUMP_SAVE_TARGET = KDUMP_SAVE_TARGET;
+ if (debug_KDUMP_SAVE_TARGET["password"]:nil != "")
+    debug_KDUMP_SAVE_TARGET["password"] = "**********";
  y2milestone("--------------KDUMP_SAVE_TARGET---------------");
- y2milestone("%1",KDUMP_SAVE_TARGET);
+ y2milestone("%1",debug_KDUMP_SAVE_TARGET);
  y2milestone("--------------KDUMP_SAVE_TARGET---------------");
 
    return true;
@@ -295,9 +298,9 @@
  
  //Popup::Message(result);
 
- y2milestone("-----------------KDUMP_SAVEDIR--------------------");
- y2milestone("%1",result);
- y2milestone("-----------------KDUMP_SAVEDIR--------------------");
+ //y2milestone("-----------------KDUMP_SAVEDIR--------------------");
+ //y2milestone("%1",result);
+ //y2milestone("-----------------KDUMP_SAVEDIR--------------------");
 
  return result;
 }
@@ -745,65 +748,43 @@
 
 /**
   * Function initializes option "Kdump Command Line"
-  * or "Kdump Command Line Append"
+  * 
   */
 
-void InitSwitchKdumpComLine (string key) {
+void InitKdumpCommandLine(string key) {  
   string value = "";
-  //Popup::Message("InitSwitchKdumpComLine");
-  if (!set_kdump_append) {
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Label, "Kdump Co&mmand Line");
-     UI::ChangeWidget(`id("enable_append"), `Value, false);
-     value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"]:nil;
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Value, ((value == nil) ? "":value));
-  } else {
-     UI::ChangeWidget(`id("enable_append"), `Value, true);
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Label, "Kdump Co&mmand Line Append");
-     value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"]:nil;
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Value, ((value == nil) ? "":value));
-  }  
+  value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"]:nil;
+  UI::ChangeWidget(`id("KdumpCommandLine"), `Value, ((value == nil) ? "":value));
+
 }
 
+/**
+  * Function stores option "Kdump Command Line"
+  * 
+  */
+void StoreKdumpCommandLine (string key, map event) {
+  Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"] = tostring(UI::QueryWidget(`id("KdumpCommandLine"), `Value));
+}
 
 
 /**
-  * Function handles switching between "Kdump Command Line"
-  * and "Kdump Command Line Append"
-  * also saves values for both options from config file
+  * Function initializes option "Kdump Command Line Append"
+  * 
   */
-symbol HandleSwitchKdumpComLine (string key, map event) {
-  boolean checkbox = (boolean) UI::QueryWidget(`id("enable_append"), `Value);
+
+void InitKdumpCommandLineAppend(string key) {  
   string value = "";
-  //Popup::Message("HandleSwitchKdumpComLine");
-  if ((checkbox) && (!set_kdump_append)) {
-     set_kdump_append = true;
-     Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"] = tostring(UI::QueryWidget(`id("KdumpCommandLine"), `Value));
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Label, "Kdump Co&mmand Line Append");
-     value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"]:nil;
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Value, ((value == nil) ? "":value));
-  } else if ((!checkbox)&&(set_kdump_append)){
-     set_kdump_append = false;
-     Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"] = tostring(UI::QueryWidget(`id("KdumpCommandLine"), `Value));
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Label, "Kdump Co&mmand Line");
-     value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"]:nil;
-     UI::ChangeWidget(`id("KdumpCommandLine"), `Value, ((value == nil) ? "":value));
-  }
+  value = Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"]:nil;
+  UI::ChangeWidget(`id("KdumpCommandLineAppend"), `Value, ((value == nil) ? "":value));
 
-  return nil;
 }
 
-
 /**
-  * Function stores option "Kdump Command Line"
-  * or "Kdump Command Line Append"
+  * Function stores option "Kdump Command Line Append"
+  * 
   */
-void StoreSwitchKdumpComLine (string key, map event) {
-  //Popup::Message("StoreSwitchKdumpComLine");
-  if (!set_kdump_append) {    
-     Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE"] = tostring(UI::QueryWidget(`id("KdumpCommandLine"), `Value));
-  } else {
-     Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"] = tostring(UI::QueryWidget(`id("KdumpCommandLine"), `Value));
-  }
+void StoreKdumpCommandLineAppend (string key, map event) {
+  Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"] = tostring(UI::QueryWidget(`id("KdumpCommandLineAppend"), `Value));
 }
 
 
@@ -1013,7 +994,7 @@
 void InitKdumpMemory (string key) {
   if (Kdump::total_memory > 0) {
     UI::ChangeWidget(`id("total_memory"), `Value, tostring(Kdump::total_memory));
-    UI::ChangeWidget(`id("memory_buffer"), `Value, tointeger(Kdump::alocated_memory));
+    UI::ChangeWidget(`id("memory_buffer"), `Value, tointeger(Kdump::alocated_memory));    
     UI::ChangeWidget(`id("usable_memory"), `Value, 
       tostring((Kdump::total_memory - (integer) UI::QueryWidget(`id("memory_buffer"), `Value))));
   } else {

Modified: trunk/kdump/yast2-kdump.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/yast2-kdump.spec.in?rev=40321&r1=40320&r2=40321&view=diff
==============================================================================
--- trunk/kdump/yast2-kdump.spec.in (original)
+++ trunk/kdump/yast2-kdump.spec.in Thu Aug 16 16:51:17 2007
@@ -4,8 +4,6 @@
 Requires:      yast2 yast2-storage yast2-bootloader
 BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite yast2-storage yast2-bootloader
 
-BuildArchitectures:    noarch
-
 Summary:       Configuration of kdump
 
 %description

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages