[yast-commit] r67337 - in /branches/SuSE-Code-11-SP1-Branch/bootloader: VERSION package/yast2-bootloader.changes src/modules/BootCommon.ycp src/modules/Bootloader.ycp src/routines/misc.ycp
![](https://seccdn.libravatar.org/avatar/069dd76e4da9aa365cb99f7683ae04b7.jpg?s=120&d=mm&r=g)
Author: snwint Date: Wed Feb 1 11:48:50 2012 New Revision: 67337 URL: http://svn.opensuse.org/viewcvs/yast?rev=67337&view=rev Log: - fix default menu entry detection in zipl.conf (bnc #740324) Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/Bootloader.ycp branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootlo... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION Wed Feb 1 11:48:50 2012 @@ -1 +1 @@ -2.17.85 +2.17.86 Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootlo... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes Wed Feb 1 11:48:50 2012 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Jan 27 14:58:43 CET 2012 - snwint@suse.de + +- fix default menu entry detection (bnc #740324) +- 2.17.86 + +------------------------------------------------------------------- Fri Jan 13 15:48:55 CET 2012 - snwint@suse.de - really update bootloader sections after device renaming (bnc #727310) Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootlo... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp Wed Feb 1 11:48:50 2012 @@ -440,6 +440,8 @@ global string addMDSettingsToGlobals (); global boolean VerifyMDArray (); +// zipl.conf has its own idiosyncrasies when it comes to default entries +global string checkZiplDefault (string def); // // FIXME: the select and selectdevice seem to be broken: the default value of @@ -1555,6 +1557,69 @@ return ret; } +/** bnc #364904 + * Function parse zipl list names if default section is menu + * + * @param string (string) list of names + * @param string position of default name in list + * @return string name of default section from list + */ +string parseListDefault(string names, string position) +{ + string ret = ""; + + y2milestone("section names (string) list: %1 and default name position in list: %2", names, position); + if ((names == "") || (position == "")) + return ret; + + if (search(names, ",") != nil) + { + string tmp_names = deletechars(names, " "); + list <string> list_names = splitstring(tmp_names, ","); + ret = list_names[(tointeger(position)-1)]:""; + } else { + ret = names; + } + + return ret; +} + +/** bnc #364904 + * Function check if default section is menu + * if yes it tries to find default section in + * list of names from menu section + * + * @param string name of default BootCommon::globals["default"]:"" + * @return string name of default section + */ + +global string checkZiplDefault(string def) +{ + string def_section_name = def; + + if (getLoaderType (false) == "zipl") + { + foreach(map<string,any> section, BootCommon::sections, + { + if (section["name"]:"" == def_section_name) + { + if (section["type"]:"" == "menu") + { + string def_position = section["default"]:""; + def_section_name = parseListDefault(section["list"]:"", def_position); + + } else { + break; + } + } + }); + + } + + y2milestone("name of default section: %1", def_section_name); + return def_section_name; +} + } /* Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/Bootloader.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootlo... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/Bootloader.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/Bootloader.ycp Wed Feb 1 11:48:50 2012 @@ -1035,76 +1035,13 @@ y2milestone("sections after remapping: %1", BootCommon::sections); } -/** bnc #364904 - * Function parse zipl list names if default section is menu - * - * @param string (string) list of names - * @param string position of default name in list - * @return string name of default section from list - */ -string parseListDefault(string names, string position) -{ - string ret = ""; - - y2milestone("section names (string) list: %1 and default name position in list: %2", names, position); - if ((names == "") || (position == "")) - return ret; - - if (search(names, ",") != nil) - { - string tmp_names = deletechars(names, " "); - list <string> list_names = splitstring(tmp_names, ","); - ret = list_names[(tointeger(position)-1)]:""; - } else { - ret = names; - } - - return ret; -} - -/** bnc #364904 - * Function check if default section is menu - * if yes it tries to find default section in - * list of names from menu section - * - * @param string name of default BootCommon::globals["default"]:"" - * @return string name of default section - */ - -string checkZiplDefault(string def) -{ - string def_section_name = def; - - if (getLoaderType () == "zipl") - { - foreach(map<string,any> section, BootCommon::sections, - { - if (section["name"]:"" == def_section_name) - { - if (section["type"]:"" == "menu") - { - string def_position = section["default"]:""; - def_section_name = parseListDefault(section["list"]:"", def_position); - - } else { - break; - } - } - }); - - } - - y2milestone("name of default section: %1", def_section_name); - return def_section_name; -} - /** * return default section label * @return string default section label */ global define string getDefaultSection () { ReadOrProposeIfNeeded (); - string default_name = checkZiplDefault(BootCommon::globals["default"]:""); + string default_name = BootCommon::checkZiplDefault(BootCommon::globals["default"]:""); return default_name; } Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootlo... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp Wed Feb 1 11:48:50 2012 @@ -2431,10 +2431,11 @@ // fix for bnc #440125 - default boot section with failsafe args // it is not possible create exact algoritmus but I hope it helps in // mostly cases. - if (isDefaultBootSectioLinux(BootCommon::globals["default"]:"")) - default_boot_section_name = BootCommon::globals["default"]:""; - else + default_boot_section_name = BootCommon::checkZiplDefault(BootCommon::globals["default"]:""); + if (!isDefaultBootSectioLinux(default_boot_section_name)) + { default_boot_section_name = findRelativeDefaultLinux (); + } // get the default and failsafe append + vga parameters; if section with // appropriate original name not found, just use any Linux section -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
snwint@svn2.opensuse.org