[yast-commit] r38243 - in /trunk/kdump/src: Kdump.ycp dialogs.ycp uifunctions.ycp
Author: juhliarik Date: Fri Jun 1 15:14:24 2007 New Revision: 38243 URL: http://svn.opensuse.org/viewcvs/yast?rev=38243&view=rev Log: added handle function for starting kdump Modified: trunk/kdump/src/Kdump.ycp trunk/kdump/src/dialogs.ycp trunk/kdump/src/uifunctions.ycp Modified: trunk/kdump/src/Kdump.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/Kdump.ycp?rev=38243&r1=38242&r2=38243&view=diff ============================================================================== --- trunk/kdump/src/Kdump.ycp (original) +++ trunk/kdump/src/Kdump.ycp Fri Jun 1 15:14:24 2007 @@ -42,6 +42,7 @@ import "BootCommon"; import "Storage"; import "Map"; +import "Bootloader"; /** * Prototypes @@ -59,6 +60,7 @@ /** * List of available partiotions + * with known partition * * list <string> */ @@ -73,6 +75,14 @@ */ global list <string> uknown_fs_partitions =[]; +/** + * Boolean option indicates kernel parameter + * "crashkernel" + * + * boolean true if kernel parameter is set + */ +global boolean crashkernel_param = false; + /** * Write only, used during autoinstallation. @@ -207,6 +217,25 @@ /** * Read current kdump configuration * + * read kernel parameter "crashkernel" + * @return boolean successfull + */ + +boolean ReadKdumpKernelParam () { + + string result = Bootloader::getKernelParam (Bootloader::getDefaultSection (), "crashkernel"); + if (result == "true") { + crashkernel_param = true; + } else { + crashkernel_param = false; + } + return true; +} + + +/** + * Read current kdump configuration + * * @return boolean successfull */ boolean ReadKdumpSettings () { @@ -219,7 +248,7 @@ y2milestone("kdump configuration has been read: %1", KDUMP_SETTINGS); y2milestone("---------------------------------------------"); - + return true; } @@ -233,36 +262,49 @@ /* Kdump read dialog caption */ string caption = _("Initializing kdump Configuration"); - integer steps = 2; + integer steps = 3; sleep(sl); Progress::New( caption, " ", steps, [ - /* Progress stage 1/2 */ + /* Progress stage 1/3 */ _("Read the config file"), - /* Progress stage 2/2 */ + /* Progress stage 2/3 */ _("Read disk partitions"), + /* Progress stage 3/3 */ + _("Read kernel boot options"), ], [ - /* Progress step 1/2 */ + /* Progress step 1/3 */ _("Reading the config file..."), - /* Progress finished 2/2*/ - _("Finished") + /* Progress step 2/3*/ + _("Reading partitions of disks..."), + /* Progress finished 3/3*/ + Message::Finished() ], "" ); + sleep(sl); // read database if(Abort()) return false; Progress::NextStage(); /* Error message */ if(!ReadKdumpSettings ()) Report::Error(_("Cannot read config file /etc/sysconfig/kdump")); - sleep(sl); + //sleep(sl); // read another database if(Abort()) return false; Progress::NextStep(); /* Error message */ if(!ReadDiskPartitions ()) Report::Error(_("Cannot read disk partitions.")); - sleep(sl); + //sleep(sl); + + // read another database + if(Abort()) return false; + Progress::NextStep(); + /* Error message */ + if(!ReadKdumpKernelParam ()) Report::Error(_("Cannot read kernel boot options")); + //sleep(sl); + if(Abort()) return false; /* Progress finished */ Modified: trunk/kdump/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/dialogs.ycp?rev=38243&r1=38242&r2=38243&view=diff ============================================================================== --- trunk/kdump/src/dialogs.ycp (original) +++ trunk/kdump/src/dialogs.ycp Fri Jun 1 15:14:24 2007 @@ -66,9 +66,9 @@ ["disable_kdump", _("&Disable kdump") ], ], "orientation" : `horizontal, - //"init" : - //"handle" : - //"store" : + "init" : InitEnableDisalbeKdump, + //"handle" : HandleEnableDisalbeKdump, + "store" : StoreEnableDisalbeKdump, "help" : HelpKdump("StartRadioBut"), ], Modified: trunk/kdump/src/uifunctions.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/kdump/src/uifunctions.ycp?rev=38243&r1=38242&r2=38243&view=diff ============================================================================== --- trunk/kdump/src/uifunctions.ycp (original) +++ trunk/kdump/src/uifunctions.ycp Fri Jun 1 15:14:24 2007 @@ -35,19 +35,6 @@ */ -list local_partitions_list = [ - "/dev/sda2", - "/dev/sda5", - "/dev/sda7", -]; - - -list raw_partitions_list = [ - "/dev/sda2", - "/dev/sda5", - "/dev/sda7", -]; - boolean set_network = false; boolean set_kdump_append = false; @@ -133,8 +120,31 @@ ); +/** + * Function initializes option "Enable/Disable kdump" + */ +void InitEnableDisalbeKdump (string key) { + if (Kdump::crashkernel_param) { + UI::ChangeWidget(`id("EnableDisalbeKdump"),`Value,"enable_kdump"); + + } else { + UI::ChangeWidget(`id("EnableDisalbeKdump"),`Value,"disable_kdump"); + } +} +/** + * Function stores option "Enable/Disable kdump" + * + */ +void StoreEnableDisalbeKdump (string key, map event) { + string radiobut = (string) UI::QueryWidget(`id("EnableDisalbeKdump"), `Value); + if (radiobut == "enable_kdump") { + Kdump::crashkernel_param = true; + } else { + Kdump::crashkernel_param = false; + } +} /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
juhliarik@svn.opensuse.org