[yast-commit] r41000 - in /trunk/bootloader/src: modules/BootELILO.ycp modules/BootGRUB.ycp modules/BootLILO.ycp modules/BootPOWERLILO.ycp routines/lilolike.ycp

Author: odabrunz Date: Thu Sep 20 18:43:07 2007 New Revision: 41000 URL: http://svn.opensuse.org/viewcvs/yast?rev=41000&view=rev Log: - when bootloader_entry saved (during kernel postuninstall) a command in /boot/perl-BL_delayed_exec for delayed execution in the target system, run that script to remove old sections (#309837) Modified: trunk/bootloader/src/modules/BootELILO.ycp trunk/bootloader/src/modules/BootGRUB.ycp trunk/bootloader/src/modules/BootLILO.ycp trunk/bootloader/src/modules/BootPOWERLILO.ycp trunk/bootloader/src/routines/lilolike.ycp 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 Thu Sep 20 18:43:07 2007 @@ -391,6 +391,8 @@ BootCommon::globals["timeout"] = "8"; BootCommon::globals["append"] = BootArch::DefaultKernelParams (""); + // perl-BL delayed section removal + BootCommon::RunDelayedUpdates (); BootCommon::UpdateSections (true, CreateLinuxSection); // 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 Thu Sep 20 18:43:07 2007 @@ -957,6 +957,8 @@ */ global define void Update () { BootCommon::UpdateDeviceMap (); + // perl-BL delayed section removal + BootCommon::RunDelayedUpdates (); BootCommon::UpdateSections (true, CreateLinuxSection); 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 Thu Sep 20 18:43:07 2007 @@ -198,6 +198,8 @@ */ global void Update () { BootCommon::UpdateDeviceMap (); + // perl-BL delayed section removal + BootCommon::RunDelayedUpdates (); BootCommon::UpdateSections (true, BootCommon::CreateLinuxSection); BootCommon::UpdateGlobals (); BootCommon::loader_device Modified: trunk/bootloader/src/modules/BootPOWERLILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootPOWERL... ============================================================================== --- trunk/bootloader/src/modules/BootPOWERLILO.ycp (original) +++ trunk/bootloader/src/modules/BootPOWERLILO.ycp Thu Sep 20 18:43:07 2007 @@ -969,6 +969,9 @@ */ global void Update () { + // perl-BL delayed section removal + BootCommon::RunDelayedUpdates (); + /** * Firstly update sections of bootloader configuration and modify internal * structures as needed. This means right now: 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 Thu Sep 20 18:43:07 2007 @@ -364,6 +364,29 @@ /** + * Run delayed updates + * + * This is used by perl-Bootloader when it cannot remove sections from the + * bootloader configuration from the postuninstall-script of the kernel. It + * writes a command to a delayed update script that is then called here to + * remove these sections. + * + * The script is deleted after execution. + */ +global void RunDelayedUpdates () { + string scriptname = "/boot/perl-BL_delayed_exec"; + string cmd = sformat("test -x %1 && %1", scriptname); + + y2milestone ("running delayed update command: %1", cmd); + map out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone ("command returned %1", out); + + cmd = sformat("rm -f %1", scriptname); + out = (map)SCR::Execute (.target.bash_output, cmd); +} + + +/** * fallback list for kernel flavors (adapted from Kernel.ycp), used if we have * no better information * order is from special to general, but prefer "default" in favor of "xen" @@ -871,7 +894,8 @@ && ! contains (recreated, label)) || key == "chainloader") { - string device = s[key]:""; + string device = (string) s[key]:nil; + y2milestone ("Checking for update: device %1 of key %2, section %3", device, key, label); if (device != nil) { y2milestone ("Updating root/other device of section %1", -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
odabrunz@svn.opensuse.org