Author: lslezak Date: Tue Aug 2 17:54:29 2011 New Revision: 65144 URL: http://svn.opensuse.org/viewcvs/yast?rev=65144&view=rev Log: - fixed biosdevname package installation (bnc#709797) - 2.17.86 Modified: branches/SuSE-Code-11-SP2-Branch/packager/VERSION branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp Modified: branches/SuSE-Code-11-SP2-Branch/packager/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packager/VERSION?rev=65144&r1=65143&r2=65144&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/packager/VERSION (original) +++ branches/SuSE-Code-11-SP2-Branch/packager/VERSION Tue Aug 2 17:54:29 2011 @@ -1 +1 @@ -2.17.85 +2.17.86 Modified: branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes?rev=65144&r1=65143&r2=65144&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes Tue Aug 2 17:54:29 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Aug 2 15:41:35 UTC 2011 - lslezak@suse.cz + +- fixed biosdevname package installation (bnc#709797) +- 2.17.86 + +------------------------------------------------------------------- Mon Jul 25 08:33:29 UTC 2011 - lslezak@suse.cz - do not skip package proposal when the partitioner has changed Modified: branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp?rev=65144&r1=65143&r2=65144&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp Tue Aug 2 17:54:29 2011 @@ -745,17 +745,111 @@ return packages; } + /* + * check whether there is a bios name for a network interface + */ + boolean detectBiosDevNames() + { + boolean ret = false; + list<map> netifs = (list<map>)SCR::Read(.probe.netif); + + foreach(map netif, netifs, { + string dev_name = netif["dev_name"]:"unknown"; + string command = sformat("/sbin/biosdevname --policy all_names -i '%1'", String::Quote(dev_name)); + y2milestone("Executing: %1", command); + + map out = (map)SCR::Execute(.target.bash_output, command); + y2milestone("Result: %1", out); + + if (out["exit"]:-1 == 0) + { + string bios_name = String::FirstChunk(out["stdout"]:"", "\n"); + + if (bios_name != nil && bios_name != "" && bios_name != dev_name) + { + y2milestone("Found BIOS name for %1: %2", netif, bios_name); + ret = true; + } + } + } + ); + + y2milestone("Detected BIOS name: %1", ret); + + return ret; + } + + /* + * CHeck whether this is a Dell system + */ + boolean DellSystem() + { + boolean ret = false; + string command = "/usr/sbin/hwinfo --bios"; + y2milestone("Executing: %1", command); + + map out = (map)SCR::Execute(.target.bash_output, command); + y2milestone("Result: %1", out); + + if (out["exit"]:-1 == 0) + { + list<string> lines = splitstring(out["stdout"]:"", "\n"); + + foreach(string line, lines, { + if (regexpmatch(line, "Vendor:.*Dell Inc.*")) + { + y2milestone("Found matching line: %1", line); + ret = true; + } + } + ); + } + + if (ret) + { + y2milestone("Detected a Dell system"); + } + + return ret; + } + define list<string> kernelCmdLinePackages() { list<string> ret = []; - foreach (string part, splitstring (Kernel::GetCmdLine (), "\t "), { - if (part == "biosdevname=1") + string biosdevname = (string)SCR::Read(.etc.install_inf.biosdevname); + y2milestone("read biosdevname option: %1", biosdevname); + boolean add_biosdevname = false; + + if (biosdevname == "1") + { + y2milestone("Found biosdevname=1 kernel option, selecting biosdevname package to install"); + add_biosdevname = true; + } + else + { + string cmdline = (string)SCR::Read(.target.string, "/proc/cmdline"); + + if (!issubstring(cmdline, "biosdevname")) + { + y2milestone("Missing biosdevname option, autodetecting..."); + if (DellSystem()) + { + add_biosdevname = detectBiosDevNames(); + } + } + else { - y2milestone("Found biosdevname=1 kernel option, selecting biosdevname package to install"); - ret = add(ret, "biosdevname"); + y2milestone("biosdevname disabled via kernel option, NOT selecting biosdevname package to install"); } - }); + } + + if (add_biosdevname) + { + ret = add(ret, "biosdevname"); + } + + y2milestone("Packages added by kernel command line: %1", ret); return ret; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org