Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2012-05-07 22:53:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2012-04-23 16:14:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes   
2012-05-07 22:53:48.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Apr 24 15:06:19 CEST 2012 - [email protected]
+
+- don't do kexec on hyper-v (bnc#732693)
+- 2.23.3
+
+-------------------------------------------------------------------

Old:
----
  yast2-bootloader-2.23.2.tar.bz2

New:
----
  yast2-bootloader-2.23.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.PE9243/_old  2012-05-07 22:53:49.000000000 +0200
+++ /var/tmp/diff_new_pack.PE9243/_new  2012-05-07 22:53:49.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        2.23.2
+Version:        2.23.3
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-2.23.2.tar.bz2 -> yast2-bootloader-2.23.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-2.23.2/VERSION 
new/yast2-bootloader-2.23.3/VERSION
--- old/yast2-bootloader-2.23.2/VERSION 2012-04-23 12:40:21.000000000 +0200
+++ new/yast2-bootloader-2.23.3/VERSION 2012-04-24 15:06:13.000000000 +0200
@@ -1 +1 @@
-2.23.2
+2.23.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-2.23.2/src/modules/Bootloader.ycp 
new/yast2-bootloader-2.23.3/src/modules/Bootloader.ycp
--- old/yast2-bootloader-2.23.2/src/modules/Bootloader.ycp      2012-03-05 
15:09:25.000000000 +0100
+++ new/yast2-bootloader-2.23.3/src/modules/Bootloader.ycp      2012-04-30 
11:10:06.000000000 +0200
@@ -12,7 +12,7 @@
  *      Jiri Srain <[email protected]>
  *      Olaf Dabrunz <[email protected]>
  *
- * $Id: Bootloader.ycp 61621 2010-04-08 14:45:52Z juhliarik $
+ * $Id: Bootloader.ycp 68045 2012-04-30 09:10:05Z snwint $
  *
  */
 
@@ -1372,7 +1372,6 @@
  * @param map<string,any> boot section
  * @return map<string,any> updated boot section
  */
-
 map<string,any> updateAppend(map<string,any> section)
 {
        map<string,any> ret = section;
@@ -1386,6 +1385,64 @@
        }
        return ret;
 }
+
+
+/**
+ * Get entry from DMI data returned by .probe.bios.
+ *
+ * @param list<map> bios_data: result of SCR::Read(.probe.bios)
+ * @param string section: section name
+ * @param string key: key in section
+ * @return string: entry
+ */
+string DMIRead (list<map> bios_data, string section, string key) {
+       string result = "";
+
+       foreach (map x, bios_data[0, "smbios"]:[], {
+               if (x["type"]:"" == section) {
+                       result = x[key]:"";
+                       break;
+               }
+       });
+
+       y2milestone ("Bootloader::DMIRead(%1, %2) = %3", section, key, result);
+
+       return result;
+}
+
+
+/**
+ * Check if we run in a vbox vm.
+ *
+ * @param list<map> bios_data: result of SCR::Read(.probe.bios)
+ * @return boolean: true if yast runs in a vbox vm
+ */
+boolean IsVirtualBox (list<map> bios_data) {
+       boolean r = DMIRead(bios_data, "sysinfo", "product") == "VirtualBox";
+
+       y2milestone("Bootloader::IsVirtualBox = %1", r);
+
+       return r;
+}
+
+
+/**
+ * Check if we run in a hyperv vm.
+ *
+ * @param list<map> bios_data: result of SCR::Read(.probe.bios)
+ * @return boolean: true if yast runs in a hyperv vm
+ */
+boolean IsHyperV (list<map> bios_data) {
+       boolean r =
+               DMIRead(bios_data, "sysinfo", "manufacturer") == "Microsoft 
Corporation" &&
+               DMIRead(bios_data, "sysinfo", "product") == "Virtual Machine";
+
+       y2milestone("Bootloader::IsHyperV = %1", r);
+
+       return r;
+}
+
+
 /**
  * Copy initrd and kernel on the end of instalation
  * (1st stage)
@@ -1418,20 +1475,21 @@
                return true;
        }
 
+       list<map> bios_data = (list<map>) SCR::Read(.probe.bios);
 
-       // checking if installation run on VirtualBox
-        string cmd = sformat("hwinfo --bios |grep Product");
-        y2milestone("Checking if installation run on VirtualBox command: %1", 
cmd);
+       y2milestone("CopyKernelInird::bios_data = %1", bios_data);
 
-       map out = (map)WFM::Execute(.local.bash_output, cmd);
+       if (IsVirtualBox(bios_data)) {
+               y2milestone ("Installation run on VirtualBox, skip kexec 
loading");
+               return false;
+       }
 
-       if (search(out["stdout"]:"", "VirtualBox") != nil)
-       {
-               y2milestone ("Installation run on VirtualBox, skip kexec 
loading: %1", out);
+       if (IsHyperV(bios_data)) {
+               y2milestone ("Installation run on HyperV, skip kexec loading");
                return false;
        }
 
-       // create defualt sections
+       // create default sections
        map<string,any> linux_default = BootCommon::CreateLinuxSection 
("linux");
 
        y2milestone("linux_default: %1", linux_default);
@@ -1455,7 +1513,7 @@
        WFM::Execute(.local.mkdir, "/var/lib/YaST2");
        
        // build command for copy kernel and initrd to /var/lib/YaST during 
instalation
-       cmd = nil;
+       string cmd = nil;
 
        default_section = updateAppend(default_section);
 
@@ -1463,7 +1521,7 @@
                tostring(default_section["initrd"]:""), Directory::vardir);
 
        y2milestone("Command for copy: %1", cmd);
-       out = (map) WFM::Execute (.local.bash_output, cmd);
+       map out = (map) WFM::Execute (.local.bash_output, cmd);
        if (out["exit"]:nil != 0)
        {
                y2error ("Copy kernel and initrd failed, output: %1", out);

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to