[yast-commit] r57310 - in /trunk/bootloader: package/yast2-bootloader.changes src/modules/BootELILO.ycp src/modules/BootGRUB.ycp src/modules/BootLILO.ycp src/modules/Bootloader_API.pm src/routines/lilolike.ycp

Author: jreidinger Date: Mon May 25 16:24:53 2009 New Revision: 57310 URL: http://svn.opensuse.org/viewcvs/yast?rev=57310&view=rev Log: refactor update code Modified: trunk/bootloader/package/yast2-bootloader.changes trunk/bootloader/src/modules/BootELILO.ycp trunk/bootloader/src/modules/BootGRUB.ycp trunk/bootloader/src/modules/BootLILO.ycp trunk/bootloader/src/modules/Bootloader_API.pm trunk/bootloader/src/routines/lilolike.ycp Modified: trunk/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootload... ============================================================================== --- trunk/bootloader/package/yast2-bootloader.changes (original) +++ trunk/bootloader/package/yast2-bootloader.changes Mon May 25 16:24:53 2009 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 25 16:23:55 CEST 2009 - jreidinger@suse.cz + +- refactor Update code (update between products) + +------------------------------------------------------------------- Wed May 20 14:20:57 CEST 2009 - juhliarik@suse.cz - fixed additional options for memory test section (bnc#396150) Modified: trunk/bootloader/src/modules/BootELILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootELILO.... ============================================================================== --- trunk/bootloader/src/modules/BootELILO.ycp (original) +++ trunk/bootloader/src/modules/BootELILO.ycp Mon May 25 16:24:53 2009 @@ -419,7 +419,7 @@ BootCommon::globals["timeout"] = "8"; BootCommon::globals["append"] = BootArch::DefaultKernelParams (""); - BootCommon::UpdateSections (true, CreateLinuxSection); + BootCommon::UpdateSections (); // FIXME EFI entry name } Modified: trunk/bootloader/src/modules/BootGRUB.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.y... ============================================================================== --- trunk/bootloader/src/modules/BootGRUB.ycp (original) +++ trunk/bootloader/src/modules/BootGRUB.ycp Mon May 25 16:24:53 2009 @@ -706,7 +706,7 @@ BootCommon::SetDeviceMap (BootStorage::device_mapping); Read (true, true); - BootCommon::UpdateSections (true, CreateLinuxSection); + BootCommon::UpdateSections (); BootCommon::UpdateGlobals (); } Modified: trunk/bootloader/src/modules/BootLILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootLILO.y... ============================================================================== --- trunk/bootloader/src/modules/BootLILO.ycp (original) +++ trunk/bootloader/src/modules/BootLILO.ycp Mon May 25 16:24:53 2009 @@ -214,7 +214,7 @@ BootCommon::SetDeviceMap (BootStorage::device_mapping); Read (true, true); - BootCommon::UpdateSections (true, BootCommon::CreateLinuxSection); + BootCommon::UpdateSections (); BootCommon::UpdateGlobals (); BootCommon::loader_device = BootCommon::UpdateDevice (BootCommon::loader_device); Modified: trunk/bootloader/src/modules/Bootloader_API.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Bootloader... ============================================================================== --- trunk/bootloader/src/modules/Bootloader_API.pm (original) +++ trunk/bootloader/src/modules/Bootloader_API.pm Mon May 25 16:24:53 2009 @@ -326,6 +326,15 @@ return $ret; } +BEGIN { $TYPEINFO{splitPath} = ["function", ["list","string"],"string"]; } +sub splitPath($) { + my ($pass) = @_; + my @ret = $lib_ref->SplitPath($pass); + + DumpLog(); + return @ret; +} + #MBR utilities BEGIN { $TYPEINFO{detectThinkpadMBR} = ["function", "boolean","string"]; } sub detectThinkpadMBR($) { Modified: trunk/bootloader/src/routines/lilolike.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/lilolike.... ============================================================================== --- trunk/bootloader/src/routines/lilolike.ycp (original) +++ trunk/bootloader/src/routines/lilolike.ycp Mon May 25 16:24:53 2009 @@ -673,13 +673,51 @@ } /** - * Update sections of bootloader menu + * Update in section old devices to new kernel format + * @param section section to modify + */ +void UpdateDeviceForSection(map<string,any> section){ + if (section["type"]:"" == "image" || section["type"]:"" == "xen") + { + //check if we update correct image and if update is needed + if (BootCommon::UpdateDevice(section["root"]:"nonexisted") + == BootStorage::RootPartitionDevice + && section["root"]:""!=(BootCommon::UpdateDevice(section["root"]:""))) + { + y2milestone ("Updating device of section %1", section["name"]:"name"); + section["root"]= BootCommon::UpdateDevice(section["root"]:""); + string resume + = BootCommon::getKernelParamFromLine ( + section["append"]:"", "resume"); + if (resume != "false") + { + y2milestone ("Updating resume device of section %1", section["name"]:"name"); + resume = BootCommon::UpdateDevice (resume); + section["append"] = BootCommon::setKernelParamToLine ( + section["append"]:"", "resume", BootStorage::Dev2MountByDev(resume)); + } + section["__modified"] = "1"; + } + } +} + +/** + * Update sections of bootloader menu (removes obsolete thinks and + * place for ugly hacks (but doesn't efect zypper dup)) * modifies internal structures - * @param replace boolean true if old sectinos shall be replaced - * @param create_linux_section a reference to a function to create linux - * section anew + * label update is done in perl-Bootloader during updating kernel + * Purpose is don't break anything, but expect that previous state is + * working */ -global void UpdateSections (boolean replace, +global void UpdateSections () +{ + foreach (map<string,any> section, BootCommon::sections,{ + //remap device names from hd* to sd* + UpdateDeviceForSection(section); + }); +} + +/*global void UpdateSections (boolean replace, map<string,any>(string) create_linux_section) { list<map<string,any> > out = BootCommon::sections; @@ -812,7 +850,6 @@ } else return s; - }); } @@ -932,7 +969,7 @@ return s; }); sections = out; -} +}*/ /** * Update global options of bootloader -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jreidinger@svn.opensuse.org