Mailinglist Archive: yast-commit (322 mails)
| < Previous | Next > |
[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
- From: jreidinger@xxxxxxxxxxxxxxxx
- Date: Mon, 25 May 2009 14:24:53 -0000
- Message-id: <E1M8b6k-0002cJ-8U@xxxxxxxxxxxxxxxx>
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-bootloader.changes?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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@xxxxxxx
+
+- refactor Update code (update between products)
+
+-------------------------------------------------------------------
Wed May 20 14:20:57 CEST 2009 - juhliarik@xxxxxxx
- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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_API.pm?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
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-bootloader.changes?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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@xxxxxxx
+
+- refactor Update code (update between products)
+
+-------------------------------------------------------------------
Wed May 20 14:20:57 CEST 2009 - juhliarik@xxxxxxx
- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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_API.pm?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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.ycp?rev=57310&r1=57309&r2=57310&view=diff
==============================================================================
--- 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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |