Author: odabrunz Date: Fri Aug 10 19:14:43 2007 New Revision: 40208 URL: http://svn.opensuse.org/viewcvs/yast?rev=40208&view=rev Log: - part of feature #301313: - added front-end function and infrastructure in switcher.ycp for FlagOnetimeBoot() - added FlagOnetimeBoot() implementation for POWERLILO Modified: trunk/bootloader/src/modules/BootPOWERLILO.ycp trunk/bootloader/src/modules/Bootloader.ycp trunk/bootloader/src/routines/switcher.ycp Modified: trunk/bootloader/src/modules/BootPOWERLILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootPOWERLILO.ycp?rev=40208&r1=40207&r2=40208&view=diff ============================================================================== --- trunk/bootloader/src/modules/BootPOWERLILO.ycp (original) +++ trunk/bootloader/src/modules/BootPOWERLILO.ycp Fri Aug 10 19:14:43 2007 @@ -1170,6 +1170,18 @@ ]; } +/** + * Set section to boot on next reboot + * @param section string section to boot + * @return boolean true on success + */ +global define boolean FlagOnetimeBoot (string section) { + map result = (map)SCR::Execute (.target.bash_output, sformat ( + "/sbin/lilo -R \"%1\"", section)); + y2milestone ("lilo returned %1", result); + return (result["exit"]:-1 == 0); +} + /** * Return map of provided functions @@ -1190,6 +1202,7 @@ "wizard_sequencer" : WizardSequenzer, "dialogs" : Dialogs, "section_types" : section_types, + "flagonetimeboot" : FlagOnetimeBoot, ]; } Modified: trunk/bootloader/src/modules/Bootloader.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Bootloader.ycp?rev=40208&r1=40207&r2=40208&view=diff ============================================================================== --- trunk/bootloader/src/modules/Bootloader.ycp (original) +++ trunk/bootloader/src/modules/Bootloader.ycp Fri Aug 10 19:14:43 2007 @@ -38,6 +38,7 @@ import "BootGRUB"; import "BootPOWERLILO"; // The ppc-LILO File + // interface for clients global define map Export (); global define boolean Import (map settings); global define void Propose (); @@ -45,6 +46,9 @@ global define void Reset (); global define boolean Write (); + global define boolean FlagOnetimeBoot (string section); + + // additional interfaces, mostly for other modules global define void ReadOrProposeIfNeeded (); global define string getDefaultSection (); global define string getKernelParam (string section, string key); @@ -908,6 +912,15 @@ } /** + * Set section to boot on next reboot + * @param section string section to boot + * @return boolean true on success + */ + global define boolean FlagOnetimeBoot (string section) { + return blFlagOnetimeBoot (string section); + } + + /** * Check whether settings were read or proposed, if not, decide * what to do and read or propose settings */ Modified: trunk/bootloader/src/routines/switcher.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/switcher.ycp?rev=40208&r1=40207&r2=40208&view=diff ============================================================================== --- trunk/bootloader/src/routines/switcher.ycp (original) +++ trunk/bootloader/src/routines/switcher.ycp Fri Aug 10 19:14:43 2007 @@ -190,5 +190,18 @@ return $[]; } +/** + * Set section to boot on next reboot for this type of bootloader + * @return boolean true on success + */ +global boolean blFlagOnetimeBoot () { + map functions = getFunctions (BootCommon::getLoaderType (false)); + boolean() toEval = (boolean()) functions["flagonetimeboot"]:nil; + if (toEval != nil) + return toEval (); + else + return false; +} + } // EOF -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org