Mailing Lists
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2023
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
List overview
Download
YaST Commits
April 2012
----- 2023 -----
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
yast-commit@lists.opensuse.org
14 participants
215 discussions
Start a n
N
ew thread
[yast-commit] r68054 - in /trunk/ruby-bindings: src/ruby/Y2RubyTypeConv.cc tests/ycp/ruby_from_ycp.ycp
by jreidinger@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jreidinger Date: Mon Apr 30 16:48:01 2012 New Revision: 68054 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68054&view=rev
Log: optimalize and simplify hash to map conversion ( use to_a method and fast pointer aritmetic ) Modified: trunk/ruby-bindings/src/ruby/Y2RubyTypeConv.cc trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Modified: trunk/ruby-bindings/src/ruby/Y2RubyTypeConv.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/src/ruby/Y2RubyTyp…
============================================================================== --- trunk/ruby-bindings/src/ruby/Y2RubyTypeConv.cc (original) +++ trunk/ruby-bindings/src/ruby/Y2RubyTypeConv.cc Mon Apr 30 16:48:01 2012 @@ -66,13 +66,12 @@ static YCPMap rbhash_2_ycpmap( VALUE value ) { YCPMap map; - VALUE keys = rb_funcall(value, rb_intern("keys"), 0); - int n = NUM2LONG(rb_funcall(keys, rb_intern("size"), 0)); - for ( int i=0; i<n; ++i) + VALUE list = rb_funcall(value, rb_intern("to_a"), 0); //get array of two items array, first is key and second is value + for ( unsigned i=0; i<RARRAY_LEN(list); ++i) { - VALUE rkey = rb_funcall(keys, rb_intern("at"), 1, INT2NUM(i)); - YCPValue ykey = rbvalue_2_ycpvalue(rkey); - YCPValue yvalue = rbvalue_2_ycpvalue( rb_funcall(value, rb_intern("[]"), 1, rkey) ); + VALUE kv_list = *(RARRAY_PTR(list)+i); + YCPValue ykey = rbvalue_2_ycpvalue(*RARRAY_PTR(kv_list)); + YCPValue yvalue = rbvalue_2_ycpvalue(*(RARRAY_PTR(kv_list)+1)); map.add(ykey, yvalue); } return map; Modified: trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/ruby_fro…
============================================================================== --- trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp (original) +++ trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Mon Apr 30 16:48:01 2012 @@ -17,7 +17,8 @@ return false; } map h = tomap(InRuby::get_hash()); - if ( tostring(h["a"]:"") != "b") + y2milestone("get hash: %1",h); + if ( tostring(h["a"]:"") != "b" || tostring(h["b"]:"") != "c" ) { y2error("map is not properly returned: %1",result); return false; -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68053 - in /trunk/ruby-bindings/tests/ycp: InRuby.rb ruby_from_ycp.ycp
by jreidinger@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jreidinger Date: Mon Apr 30 15:55:12 2012 New Revision: 68053 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68053&view=rev
Log: add test for map conversion ( preparation for refactoring) Modified: trunk/ruby-bindings/tests/ycp/InRuby.rb trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Modified: trunk/ruby-bindings/tests/ycp/InRuby.rb URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/InRuby.r…
============================================================================== --- trunk/ruby-bindings/tests/ycp/InRuby.rb (original) +++ trunk/ruby-bindings/tests/ycp/InRuby.rb Mon Apr 30 15:55:12 2012 @@ -6,4 +6,8 @@ def self.raising_code raise "Wow exception!" end + + def self.get_hash + return { "a" => "b", "b" => "c" } + end end Modified: trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/ruby_fro…
============================================================================== --- trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp (original) +++ trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Mon Apr 30 15:55:12 2012 @@ -16,7 +16,14 @@ y2error("exception completely ignored result: %1",result); return false; } + map h = tomap(InRuby::get_hash()); + if ( tostring(h["a"]:"") != "b") + { + y2error("map is not properly returned: %1",result); + return false; + } import "CamelCase"; result = tostring(CamelCase::inc(10)); y2milestone("result: %1", result); + return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68052 - /trunk/ruby-bindings/src/ruby/YRubyNamespace.cc
by jreidinger@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jreidinger Date: Mon Apr 30 15:04:51 2012 New Revision: 68052 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68052&view=rev
Log: simplify creating signature for yc[ Modified: trunk/ruby-bindings/src/ruby/YRubyNamespace.cc Modified: trunk/ruby-bindings/src/ruby/YRubyNamespace.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/src/ruby/YRubyName…
============================================================================== --- trunk/ruby-bindings/src/ruby/YRubyNamespace.cc (original) +++ trunk/ruby-bindings/src/ruby/YRubyNamespace.cc Mon Apr 30 15:04:51 2012 @@ -37,17 +37,6 @@ #include "Y2RubyUtils.h" /** - * using this instead of plain strcmp - * enables embedding argument names into the typeinfo - */ -static bool firstWordIs (const char *where, const char *what) -{ - size_t n = strlen (what); - return !strncmp (where, what, n) && - (where[n] == '\0' || isspace (where[n])); -} - -/** * The definition of a function that is implemented in Ruby */ class Y2RubyFunctionCall : public Y2Function @@ -207,38 +196,26 @@ VALUE current = RARRAY(methods)->ptr[i]; y2milestone("New method: '%s'", RSTRING(current)->ptr); - constTypePtr sym_tp = Type::Unspec; - //sym_tp = parseTypeinfo (*sym_ti) - if (sym_tp->isError ()) + // figure out arity. + Check_Type(module,T_MODULE); + VALUE methodobj = rb_funcall( module, rb_intern("method"), 1, current ); + if ( methodobj == Qnil ) { - y2error ("Cannot parse $TYPEINFO{%s}", RSTRING(current)->ptr); + y2error ("Cannot access method object '%s'", RSTRING(current)->ptr); continue; } - if (sym_tp->isUnspec ()) + string signature = "any( "; + VALUE rbarity = rb_funcall( methodobj, rb_intern("arity"), 0); + int arity = NUM2INT(rbarity); + for ( int k=0; k < arity; ++k ) { - //sym_tp = new FunctionType (Type::Any, new FunctionType(Type::Any) ); - // figure out arity. - Check_Type(module,T_MODULE); - VALUE methodobj = rb_funcall( module, rb_intern("method"), 1, current ); - //VALUE methodobj = rb_funcall( module, rb_intern("send"), 2, rb_str_new2("method"), current ); - if ( methodobj == Qnil ) - { - y2error ("Cannot access method object '%s'", RSTRING(current)->ptr); - continue; - } - string signature = "any( "; - VALUE rbarity = rb_funcall( methodobj, rb_intern("arity"), 0); - int arity = NUM2INT(rbarity); - for ( int k=0; k < arity; ++k ) - { - signature += "any"; - if ( k < (arity - 1) ) - signature += ","; - } - signature += ")"; - y2internal("going to parse signature: '%s'", signature.c_str()); - sym_tp = Type::fromSignature(signature); + signature += "any"; + if ( k < (arity - 1) ) + signature += ","; } + signature += ")"; + y2internal("going to parse signature: '%s'", signature.c_str()); + constTypePtr sym_tp = Type::fromSignature(signature); constFunctionTypePtr fun_tp = (constFunctionTypePtr) sym_tp; -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68051 - in /trunk/ruby-bindings: src/ruby/YRuby.cc tests/ycp/run_ycp_test.sh
by jreidinger@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jreidinger Date: Mon Apr 30 14:20:45 2012 New Revision: 68051 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68051&view=rev
Log: cleaning up ruby bindings Modified: trunk/ruby-bindings/src/ruby/YRuby.cc trunk/ruby-bindings/tests/ycp/run_ycp_test.sh Modified: trunk/ruby-bindings/src/ruby/YRuby.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/src/ruby/YRuby.cc?…
============================================================================== --- trunk/ruby-bindings/src/ruby/YRuby.cc (original) +++ trunk/ruby-bindings/src/ruby/YRuby.cc Mon Apr 30 14:20:45 2012 @@ -67,30 +67,12 @@ rb_funcall(module, rb_intern("eval"), 1, rb_str_new2(code.c_str())); } -static void prependModulePath() -{ - YCPPathSearch::initialize (); - - list<string>::const_iterator - b = YCPPathSearch::searchListBegin (YCPPathSearch::Module), - e = YCPPathSearch::searchListEnd (YCPPathSearch::Module), - i; - - // count the number of directories to prepend -// int n = 0; -// for (i = b; i != e; ++i) -// { -// // do something -// } -} - YRuby * YRuby::_yRuby = 0; YRuby::YRuby() { y2milestone( "Initializing ruby interpreter." ); ruby_init(); - //ruby_options(argc - 1, ++argv); ruby_script("yast"); ruby_init_loadpath(); @@ -102,13 +84,13 @@ { refcount_map_t * vrby = (refcount_map_t *) object; - y2internal("mark: map size is %u", vrby->size()); + y2milestone("mark: map size is %u", vrby->size()); refcount_map_t::iterator b = vrby->begin(), e = vrby->end(), it; for (it = b; it != e; ++it) { - y2internal("marking: value %ld refcount %d", it->first, it->second); + y2milestone("marking: value %ld refcount %d", it->first, it->second); rb_gc_mark(it->first); } } @@ -117,7 +99,7 @@ { refcount_map_t * vrby = (refcount_map_t *) object; - y2internal("free: map size is %u", vrby->size()); + y2milestone("free: map size is %u", vrby->size()); y2internal("should happen quite last or we are in trouble FIXME"); } @@ -142,9 +124,10 @@ YRuby::destroy() { if ( _yRuby ) + { delete _yRuby; - - _yRuby = 0; + _yRuby = 0; + } return YCPVoid(); } @@ -156,48 +139,15 @@ YRuby::loadModule( YCPList argList ) { YRuby::yRuby(); - //y2milestone("loadModule 1"); if ( argList->size() != 2 || ! argList->value(0)->isString() || ! argList->value(1)->isString() ) return YCPError( "Ruby::loadModule() / Ruby::Use() : Bad arguments: String expected!" ); - //y2milestone("loadModule 2"); - string module_name = argList->value(0)->asString()->value(); string module_path = argList->value(1)->asString()->value(); - //y2milestone("loadModule 3: '%s'", module_name.c_str()); VALUE result = rb_require(module_path.c_str()); if ( result == Qfalse ) return YCPError( "Ruby::loadModule() / Can't load ruby module '" + module_path + "'" ); - //y2milestone("loadModule 4"); return YCPVoid(); } - -// snprintf into a temp string -static char * -fmtstr(const char* fmt, ...) -{ - va_list ap; - int len; - char* str; - - va_start(ap, fmt); - len = vsnprintf(NULL, 0, fmt, ap); - va_end(ap); - if (len <= 0) - { - return NULL; - } - str = (char*)malloc(len+1); - if (str == NULL) - { - return NULL; - } - va_start(ap, fmt); - vsnprintf(str, len+1, fmt, ap); - va_end(ap); - return str; -} - - // rb_protect-enabled rb_funcall, see below static VALUE protected_call(VALUE args) @@ -250,10 +200,7 @@ VALUE reason = rb_funcall(exception, rb_intern("message"), 0 ); VALUE trace = rb_gv_get("$@"); /* get last exception trace */ VALUE backtrace = rb_funcall(trace, rb_intern("join"), 1, rb_str_new("\n\t", 2)); - - char* tmp = fmtstr("%s\n\t%s", StringValuePtr(reason), StringValuePtr(backtrace)); - y2error("%s.%s failed\n%s", module_name.c_str(), function.c_str(), tmp); - free(tmp); + y2error("%s.%s failed\n%s\n\t%s", module_name.c_str(), function.c_str(), StringValuePtr(reason),StringValuePtr(backtrace)); //workaround if last_exception failed, then return always string with message if(function == "last_exception") //TODO constantify last_exception { @@ -264,7 +211,6 @@ } else { - //VALUE result = rb_funcall( module, rb_intern(function.c_str()), 2, INT2NUM(2), INT2NUM(3) ); y2milestone( "Called function '%s' in module '%s'", function.c_str(), module_name.c_str()); } return rbvalue_2_ycpvalue(result); Modified: trunk/ruby-bindings/tests/ycp/run_ycp_test.sh URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/run_ycp_…
============================================================================== --- trunk/ruby-bindings/tests/ycp/run_ycp_test.sh (original) +++ trunk/ruby-bindings/tests/ycp/run_ycp_test.sh Mon Apr 30 14:20:45 2012 @@ -1,5 +1,10 @@ #!/bin/sh # $1 is the test case +if [ -z "$1" ]; then + echo "Missing file to run" >&2 + echo "Usage: run_ycp_test.sh <test file>" >&2 + exit 1 +fi DIR=${1%/*} # RPM_BUILD_ROOT will hold the YCP Ruby plugin at rpm build time if [ -d $RPM_BUILD_ROOT/usr/lib64 ]; then #we are on 64bit -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68050 - in /trunk/lxc: VERSION package/yast2-lxc.changes src/Lxc.ycp src/dialogs.ycp src/helps.ycp src/wizards.ycp
by jsuchome@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jsuchome Date: Mon Apr 30 13:53:28 2012 New Revision: 68050 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68050&view=rev
Log: - updated help texts - cleaned debugging code, added comments - 2.22.1 Modified: trunk/lxc/VERSION trunk/lxc/package/yast2-lxc.changes trunk/lxc/src/Lxc.ycp trunk/lxc/src/dialogs.ycp trunk/lxc/src/helps.ycp trunk/lxc/src/wizards.ycp Modified: trunk/lxc/VERSION URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/VERSION?rev=68050&r1=68049&r…
============================================================================== --- trunk/lxc/VERSION (original) +++ trunk/lxc/VERSION Mon Apr 30 13:53:28 2012 @@ -1 +1 @@ -2.22.0 +2.22.1 Modified: trunk/lxc/package/yast2-lxc.changes URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/package/yast2-lxc.changes?re…
============================================================================== --- trunk/lxc/package/yast2-lxc.changes (original) +++ trunk/lxc/package/yast2-lxc.changes Mon Apr 30 13:53:28 2012 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Apr 30 13:47:47 CEST 2012 - jsuchome(a)suse.cz + +- updated help texts +- cleaned debugging code, added comments +- 2.22.1 + +------------------------------------------------------------------- Fri Apr 27 14:48:38 CEST 2012 - jsuchome(a)suse.cz - openSUSE version Modified: trunk/lxc/src/Lxc.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/Lxc.ycp?rev=68050&r1=680…
============================================================================== --- trunk/lxc/src/Lxc.ycp (original) +++ trunk/lxc/src/Lxc.ycp Mon Apr 30 13:53:28 2012 @@ -36,6 +36,7 @@ textdomain "lxc"; import "Directory"; +import "FileUtils"; import "Progress"; import "Security"; @@ -65,7 +66,9 @@ return ret; } -// encrypt given password using current method +/** + * Encrypt given password using current method + */ global string CryptPassword (string pw) { if (method == "md5") @@ -79,34 +82,40 @@ return crypt (pw); } +/** + * Read list of available bridges + */ global list<string> ReadBridgesIds () { - map out = (map) SCR::Execute (.target.bash_output, "brctl show | tail -n +2 | cut -f 1"); list<string> ret = []; - - if (out["stdout"]:"" != "") + if (FileUtils::Exists ("/sbin/brctl")) { - ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line)); + map out = (map) SCR::Execute (.target.bash_output, "/sbin/brctl show | tail -n +2 | cut -f 1"); + + if (out["stdout"]:"" != "") + { + ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line)); + } } return ret; } -global list<term> GetContainers () { +/** + * Read list of containers and their states + */ +global map<string,boolean> GetContainers () { - list<term> ret = []; - map lxc_index = $[]; + map<string,boolean> ret = $[]; map out = (map) SCR::Execute (.target.bash_output, "lxc-ls -1"); foreach (string line, sort (splitstring (out["stdout"]:"", "\n")), { - if (line != "" && !haskey (lxc_index, line)) + if (line != "" && !haskey (ret, line)) { string cmd= sformat ("lxc-info -n %1 | grep state", line); out = (map) SCR::Execute (.target.bash_output, cmd, $[ "LANG" : "C" ]); list<string> state = splitstring (deletechars (out["stdout"]:"", " \t\n"), ":"); - ret = add (ret, `item (line, state[1]:"")); - // FIXME translate - lxc_index[line] = true; + ret[line] = state[1]:"" == "RUNNING"; } }); return ret; @@ -118,14 +127,13 @@ boolean CheckLXCConfiguration () { boolean problem = false; - // zgrep does not seem to work with .target.bash_output -> grep uncompressed config FIXME + // zgrep does not seem to work with .target.bash_output -> grep uncompressed config string tmpdir = Directory::tmpdir; SCR::Execute (.target.bash_output, sformat ( "cp /proc/config.gz %1/ && gunzip %1/config.gz", tmpdir)); map out = (map) SCR::Execute (.target.bash_output, sformat ( -// "GREP=grep CONFIG=%1/config /usr/bin/lxc-checkconfig", tmpdir)); - "GREP=grep /usr/bin/lxc-checkconfig")); + "GREP=grep CONFIG=%1/config /usr/bin/lxc-checkconfig", tmpdir)); list<string> rt = []; map<string,string> colors = $[ Modified: trunk/lxc/src/dialogs.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/dialogs.ycp?rev=68050&r1…
============================================================================== --- trunk/lxc/src/dialogs.ycp (original) +++ trunk/lxc/src/dialogs.ycp Mon Apr 30 13:53:28 2012 @@ -46,6 +46,10 @@ map<string,integer> console_pids = $[]; +/** + * Create configuration file for a container + * @return success + */ boolean CreateContainerConfig (string name, string ip, string subnet, string bridge, string template) { // busy message @@ -76,16 +80,15 @@ cmd = cmd + " -t " + template; } - y2internal ("cmd: %1", cmd); - map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("cmd: %1", cmd); + y2milestone ("lxc-createconfig output: %1", out); + // error message Report::Error (sformat (_("Error occured during configuration: @@ -253,16 +256,16 @@ { cmd = cmd + " -t " + template; } - y2internal ("cmd: %1", cmd); map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("cmd: %1", cmd); + y2milestone ("lxc-create output: %1", out); + Report::Error (sformat (_("Error occured during container creation: %1"), out["stdout"]:"")); @@ -295,6 +298,7 @@ /** * Start selected container + * @return success */ boolean StartContainer (string name) { @@ -324,7 +328,7 @@ */ void StopContainer (string name) { - y2internal ("lxc-stop: %1", + y2milestone ("result of lxc-stop: %1", SCR::Execute (.target.bash_output, "lxc-stop -n " + name) ); if (console_pids[name]:nil != nil) @@ -336,27 +340,28 @@ /** * Delete given container + * @return success */ -void DestroyContainer (string name) +boolean DestroyContainer (string name) { // busy message Popup::ShowFeedback ("", sformat ("Destroying Container '%1'...", name)); string cmd = "lxc-destroy -n " + name; -// string cmd = "lxc-destroy -f -n " + name; map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("lxc-destroy output: %1", out); // error message Report::Error (sformat (_("Error while destroying: %1"), out["stdout"]:"")); + return false; } + return true; } /** @@ -384,6 +389,9 @@ // current container string selected = ""; + // mapping of containers to their state + map<string,boolean> lxc_map = $[]; + // update status of the buttons according to current item void update_buttons (string selected) { @@ -392,8 +400,7 @@ return; } - term line = (term) UI::QueryWidget (`id (`table), `Item (selected)); - boolean running = line[2]:"" == "RUNNING"; // TODO do some better test + boolean running = lxc_map[selected]:false; UI::ChangeWidget (`id (`start), `Enabled, !running); UI::ChangeWidget (`id (`stop), `Enabled, running); if (Lxc::textmode) @@ -420,7 +427,15 @@ // update table with fresh items void update_table () { - list<term> lxc_list = Lxc::GetContainers ();; + lxc_map = Lxc::GetContainers (); + list<term> lxc_list = maplist (string name, boolean status, lxc_map, { + return `item (name, status ? + // container status + _("Running") : + // container status + _("Stopped") + ); + }); UI::ChangeWidget (`id (`table), `Items, lxc_list); if (size (lxc_list) == 0) @@ -466,6 +481,7 @@ Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"", Label::BackButton(), Label::FinishButton()); + Wizard::HideBackButton (); update_table (); Modified: trunk/lxc/src/helps.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/helps.ycp?rev=68050&r1=6…
============================================================================== --- trunk/lxc/src/helps.ycp (original) +++ trunk/lxc/src/helps.ycp Mon Apr 30 13:53:28 2012 @@ -55,13 +55,13 @@ "create" : _("<p><b><big>Creating New Container</big></b></p>") + // Create dialog help, part 2 -_("<p>Choose a <b>Name</b>, <b>Template</b> and enter network settings for the new container.</p>") + +_("<p>Choose a <b>Name</b> for your container, select a base <b>Template</b>, and enter desired network settings.</p>") + // Create dialog help, part 3 -_("<p>Use the value <tt>0.0.0.0</tt> as <b>IP Address</b> to have dynamic address assigned by DHCP. If there's no bridge device configured yet, use <b>Configure Network</b> button and create one.</p>") + +_("<p>Use the value <tt>0.0.0.0</tt> as <b>IP Address</b> to have dynamic address assigned by DHCP. If there's no bridge device configured yet, use the <b>Configure Network</b> button and create one.</p>") + // Create dialog help, part 4 -_("<p>Select a root password to use in the container. If no password is entered, the default value <tt>root</tt> will be used.</p>") + +_("<p>Select a password to use for a system administrator ('root') in the container. If no password is entered, the default value <tt>root</tt> will be used.</p>") + // Create dialog help, part 5 _("<p>Use <b>Create</b> to start the creation process.</p>") Modified: trunk/lxc/src/wizards.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/wizards.ycp?rev=68050&r1…
============================================================================== --- trunk/lxc/src/wizards.ycp (original) +++ trunk/lxc/src/wizards.ycp Mon Apr 30 13:53:28 2012 @@ -102,6 +102,7 @@ ]; Wizard::CreateDialog(); + Wizard::HideBackButton (); Wizard::HideAbortButton (); any ret = Sequencer::Run(aliases, sequence); -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68049 - /tags/branch-Code-11-SP2-2_17_6/lxc/
by jsuchome@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jsuchome Date: Mon Apr 30 13:53:18 2012 New Revision: 68049 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68049&view=rev
Log: Created tag branch-Code-11-SP2-2_17_6 for lxc Added: tags/branch-Code-11-SP2-2_17_6/lxc/ - copied from r68048, branches/SuSE-Code-11-SP2-Branch/lxc/ -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68048 - in /branches/SuSE-Code-11-SP2-Branch/lxc: VERSION package/yast2-lxc.changes src/Lxc.ycp src/dialogs.ycp src/helps.ycp src/wizards.ycp yast2-lxc.spec.in
by jsuchome@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jsuchome Date: Mon Apr 30 13:53:09 2012 New Revision: 68048 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68048&view=rev
Log: - updated help texts - cleaned debugging code, added comments - 2.17.6 Modified: branches/SuSE-Code-11-SP2-Branch/lxc/VERSION branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp branches/SuSE-Code-11-SP2-Branch/lxc/src/helps.ycp branches/SuSE-Code-11-SP2-Branch/lxc/src/wizards.ycp branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in Modified: branches/SuSE-Code-11-SP2-Branch/lxc/VERSION URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/V…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/VERSION (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/VERSION Mon Apr 30 13:53:09 2012 @@ -1 +1 @@ -2.17.5 +2.17.6 Modified: branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/p…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes Mon Apr 30 13:53:09 2012 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Apr 30 13:46:10 CEST 2012 - jsuchome(a)suse.cz + +- updated help texts +- cleaned debugging code, added comments +- 2.17.6 + +------------------------------------------------------------------- Fri Apr 27 13:21:01 CEST 2012 - jsuchome(a)suse.cz - updated help texts Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/s…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp Mon Apr 30 13:53:09 2012 @@ -36,6 +36,7 @@ textdomain "lxc"; import "Directory"; +import "FileUtils"; import "Progress"; import "Security"; @@ -65,7 +66,9 @@ return ret; } -// encrypt given password using current method +/** + * Encrypt given password using current method + */ global string CryptPassword (string pw) { if (method == "md5") @@ -79,34 +82,40 @@ return crypt (pw); } +/** + * Read list of available bridges + */ global list<string> ReadBridgesIds () { - map out = (map) SCR::Execute (.target.bash_output, "brctl show | tail -n +2 | cut -f 1"); list<string> ret = []; - - if (out["stdout"]:"" != "") + if (FileUtils::Exists ("/sbin/brctl")) { - ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line)); + map out = (map) SCR::Execute (.target.bash_output, "/sbin/brctl show | tail -n +2 | cut -f 1"); + + if (out["stdout"]:"" != "") + { + ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line)); + } } return ret; } -global list<term> GetContainers () { +/** + * Read list of containers and their states + */ +global map<string,boolean> GetContainers () { - list<term> ret = []; - map lxc_index = $[]; + map<string,boolean> ret = $[]; map out = (map) SCR::Execute (.target.bash_output, "lxc-ls -1"); foreach (string line, sort (splitstring (out["stdout"]:"", "\n")), { - if (line != "" && !haskey (lxc_index, line)) + if (line != "" && !haskey (ret, line)) { string cmd= sformat ("lxc-info -n %1 | grep state", line); out = (map) SCR::Execute (.target.bash_output, cmd, $[ "LANG" : "C" ]); list<string> state = splitstring (deletechars (out["stdout"]:"", " \t\n"), ":"); - ret = add (ret, `item (line, state[1]:"")); - // FIXME translate - lxc_index[line] = true; + ret[line] = state[1]:"" == "RUNNING"; } }); return ret; @@ -118,14 +127,13 @@ boolean CheckLXCConfiguration () { boolean problem = false; - // zgrep does not seem to work with .target.bash_output -> grep uncompressed config FIXME + // zgrep does not seem to work with .target.bash_output -> grep uncompressed config string tmpdir = Directory::tmpdir; SCR::Execute (.target.bash_output, sformat ( "cp /proc/config.gz %1/ && gunzip %1/config.gz", tmpdir)); map out = (map) SCR::Execute (.target.bash_output, sformat ( -// "GREP=grep CONFIG=%1/config /usr/bin/lxc-checkconfig", tmpdir)); - "GREP=grep /usr/bin/lxc-checkconfig")); + "GREP=grep CONFIG=%1/config /usr/bin/lxc-checkconfig", tmpdir)); list<string> rt = []; map<string,string> colors = $[ Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/s…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp Mon Apr 30 13:53:09 2012 @@ -46,6 +46,10 @@ map<string,integer> console_pids = $[]; +/** + * Create configuration file for a container + * @return success + */ boolean CreateContainerConfig (string name, string ip, string subnet, string bridge, string template) { // busy message @@ -76,16 +80,15 @@ cmd = cmd + " -t " + template; } - y2internal ("cmd: %1", cmd); - map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("cmd: %1", cmd); + y2milestone ("lxc-createconfig output: %1", out); + // error message Report::Error (sformat (_("Error occured during configuration: @@ -253,16 +256,16 @@ { cmd = cmd + " -t " + template; } - y2internal ("cmd: %1", cmd); map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("cmd: %1", cmd); + y2milestone ("lxc-create output: %1", out); + Report::Error (sformat (_("Error occured during container creation: %1"), out["stdout"]:"")); @@ -295,6 +298,7 @@ /** * Start selected container + * @return success */ boolean StartContainer (string name) { @@ -324,7 +328,7 @@ */ void StopContainer (string name) { - y2internal ("lxc-stop: %1", + y2milestone ("result of lxc-stop: %1", SCR::Execute (.target.bash_output, "lxc-stop -n " + name) ); if (console_pids[name]:nil != nil) @@ -336,27 +340,28 @@ /** * Delete given container + * @return success */ -void DestroyContainer (string name) +boolean DestroyContainer (string name) { // busy message Popup::ShowFeedback ("", sformat ("Destroying Container '%1'...", name)); string cmd = "lxc-destroy -n " + name; -// string cmd = "lxc-destroy -f -n " + name; map out = (map) SCR::Execute (.target.bash_output, cmd); - y2internal ("out: %1", out); - Popup::ClearFeedback (); if (out["exit"]:0 != 0) { + y2milestone ("lxc-destroy output: %1", out); // error message Report::Error (sformat (_("Error while destroying: %1"), out["stdout"]:"")); + return false; } + return true; } /** @@ -384,6 +389,9 @@ // current container string selected = ""; + // mapping of containers to their state + map<string,boolean> lxc_map = $[]; + // update status of the buttons according to current item void update_buttons (string selected) { @@ -392,8 +400,7 @@ return; } - term line = (term) UI::QueryWidget (`id (`table), `Item (selected)); - boolean running = line[2]:"" == "RUNNING"; // TODO do some better test + boolean running = lxc_map[selected]:false; UI::ChangeWidget (`id (`start), `Enabled, !running); UI::ChangeWidget (`id (`stop), `Enabled, running); if (Lxc::textmode) @@ -420,7 +427,15 @@ // update table with fresh items void update_table () { - list<term> lxc_list = Lxc::GetContainers ();; + lxc_map = Lxc::GetContainers (); + list<term> lxc_list = maplist (string name, boolean status, lxc_map, { + return `item (name, status ? + // container status + _("Running") : + // container status + _("Stopped") + ); + }); UI::ChangeWidget (`id (`table), `Items, lxc_list); if (size (lxc_list) == 0) @@ -466,6 +481,7 @@ Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"", Label::BackButton(), Label::FinishButton()); + Wizard::HideBackButton (); update_table (); Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/helps.ycp URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/s…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/src/helps.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/src/helps.ycp Mon Apr 30 13:53:09 2012 @@ -55,13 +55,13 @@ "create" : _("<p><b><big>Creating New Container</big></b></p>") + // Create dialog help, part 2 -_("<p>Choose a <b>Name</b>, <b>Template</b> and enter network settings for the new container.</p>") + +_("<p>Choose a <b>Name</b> for your container, select a base <b>Template</b>, and enter desired network settings.</p>") + // Create dialog help, part 3 -_("<p>Use the value <tt>0.0.0.0</tt> as <b>IP Address</b> to have dynamic address assigned by DHCP. If there's no bridge device configured yet, use <b>Configure Network</b> button and create one.</p>") + +_("<p>Use the value <tt>0.0.0.0</tt> as <b>IP Address</b> to have dynamic address assigned by DHCP. If there's no bridge device configured yet, use the <b>Configure Network</b> button and create one.</p>") + // Create dialog help, part 4 -_("<p>Select a root password to use in the container. If no password is entered, the default value <tt>root</tt> will be used.</p>") + +_("<p>Select a password to use for a system administrator ('root') in the container. If no password is entered, the default value <tt>root</tt> will be used.</p>") + // Create dialog help, part 5 _("<p>Use <b>Create</b> to start the creation process.</p>") Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/wizards.ycp URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/s…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/src/wizards.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/src/wizards.ycp Mon Apr 30 13:53:09 2012 @@ -102,6 +102,7 @@ ]; Wizard::CreateDialog(); + Wizard::HideBackButton (); Wizard::HideAbortButton (); any ret = Sequencer::Run(aliases, sequence); Modified: branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/y…
============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in Mon Apr 30 13:53:09 2012 @@ -6,7 +6,7 @@ BuildArchitectures: noarch -Summary: Configuration of lxc +Summary: Management tool for Linux Containers (LXC) %description - -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68047 - in /trunk/ruby-bindings: README modules/
by jreidinger@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: jreidinger Date: Mon Apr 30 13:14:06 2012 New Revision: 68047 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68047&view=rev
Log: document exception handling in ruby bindidings and remove unused code Removed: trunk/ruby-bindings/modules/ Modified: trunk/ruby-bindings/README Modified: trunk/ruby-bindings/README URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/README?rev=68047&r…
============================================================================== --- trunk/ruby-bindings/README (original) +++ trunk/ruby-bindings/README Mon Apr 30 13:14:06 2012 @@ -15,3 +15,8 @@ Based on yast2-perl-bindings by Martin Vidner <mvidner(a)suse.cz> Stefan Hundhammer <sh(a)suse.de> + + +Exception handling +================= +When ruby code raise exception, then method return `nil` in YCP and add method last_exception, that returns message of exception. Also exception details are logged. -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68046 - /trunk/gtk/yast2-gtk.spec.in
by tgoettlicher@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: tgoettlicher Date: Mon Apr 30 11:28:06 2012 New Revision: 68046 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68046&view=rev
Log: fixed typo Modified: trunk/gtk/yast2-gtk.spec.in Modified: trunk/gtk/yast2-gtk.spec.in URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/yast2-gtk.spec.in?rev=68046&…
============================================================================== --- trunk/gtk/yast2-gtk.spec.in (original) +++ trunk/gtk/yast2-gtk.spec.in Mon Apr 30 11:28:06 2012 @@ -16,7 +16,7 @@ %if 0%{?suse_version} < 1220 BuildRequires: libxcrypt-devel %endif -if 0%{?force_gcc_46} +%if 0%{?force_gcc_46} BuildRequires: gcc46 BuildRequires: gcc46-c++ %else -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r68045 - in /trunk/bootloader: VERSION package/yast2-bootloader.changes src/modules/Bootloader.ycp
by snwint@svn2.opensuse.org
30 Apr '12
30 Apr '12
Author: snwint Date: Mon Apr 30 11:10:05 2012 New Revision: 68045 URL:
http://svn.opensuse.org/viewcvs/yast?rev=68045&view=rev
Log: - don't do kexec on hyper-v (bnc#732693) - 2.23.3 Modified: trunk/bootloader/VERSION trunk/bootloader/package/yast2-bootloader.changes trunk/bootloader/src/modules/Bootloader.ycp Modified: trunk/bootloader/VERSION URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/VERSION?rev=68045&r1=…
============================================================================== --- trunk/bootloader/VERSION (original) +++ trunk/bootloader/VERSION Mon Apr 30 11:10:05 2012 @@ -1 +1 @@ -2.23.2 +2.23.3 Modified: trunk/bootloader/package/yast2-bootloader.changes URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloa…
============================================================================== --- trunk/bootloader/package/yast2-bootloader.changes (original) +++ trunk/bootloader/package/yast2-bootloader.changes Mon Apr 30 11:10:05 2012 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Apr 24 15:06:19 CEST 2012 - snwint(a)suse.de + +- don't do kexec on hyper-v (bnc#732693) +- 2.23.3 + +------------------------------------------------------------------- Mon Apr 23 12:40:24 CEST 2012 - mchang(a)suse.com - add "Boot Loader Options" dialog for grub2-efi that provides widgets for Modified: trunk/bootloader/src/modules/Bootloader.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/Bootloade…
============================================================================== --- trunk/bootloader/src/modules/Bootloader.ycp (original) +++ trunk/bootloader/src/modules/Bootloader.ycp Mon Apr 30 11:10:05 2012 @@ -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: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
← Newer
1
2
3
4
...
22
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Results per page:
10
25
50
100
200