Author: ug Date: Tue Jul 3 16:43:51 2007 New Revision: 39141 URL: http://svn.opensuse.org/viewcvs/yast?rev=39141&view=rev Log: execution of chroot scripts fixed (#205090) Modified: branches/SuSE-SLE-10-SP2-Branch/autoinstallation/package/autoyast2.changes branches/SuSE-SLE-10-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp Modified: branches/SuSE-SLE-10-SP2-Branch/autoinstallation/package/autoyast2.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/autoinstallation/package/autoyast2.changes?rev=39141&r1=39140&r2=39141&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/autoinstallation/package/autoyast2.changes (original) +++ branches/SuSE-SLE-10-SP2-Branch/autoinstallation/package/autoyast2.changes Tue Jul 3 16:43:51 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jul 3 16:42:42 CEST 2007 - ug@suse.de + +- post SP1 +- execution of chroot scripts fixed (#205090) + +------------------------------------------------------------------- Fri Apr 20 14:30:30 CEST 2007 - ug@suse.de - fix for EVMS creation (#266313) Modified: branches/SuSE-SLE-10-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp?rev=39141&r1=39140&r2=39141&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp (original) +++ branches/SuSE-SLE-10-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp Tue Jul 3 16:43:51 2007 @@ -419,11 +419,19 @@ } else if (type == "chroot-scripts") { - tmpdirString = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::scripts_dir); - SCR::Execute (.target.mkdir, tmpdirString); + if( !special ) { + tmpdirString = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::scripts_dir); + SCR::Execute (.target.mkdir, tmpdirString); + + current_logdir = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::logs_dir); + SCR::Execute (.target.mkdir, current_logdir); + } else { + tmpdirString = sformat("%1", AutoinstConfig::scripts_dir); + SCR::Execute (.target.mkdir, tmpdirString); - current_logdir = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::logs_dir); - SCR::Execute (.target.mkdir, current_logdir); + current_logdir = sformat("%1", AutoinstConfig::logs_dir); + SCR::Execute (.target.mkdir, current_logdir); + } } else { @@ -479,8 +487,14 @@ { //scriptPath = sformat("%1%2/%3", (special) ? "" : AutoinstConfig::destdir, AutoinstConfig::scripts_dir, scriptName); - // write always to /mnt/.... - scriptPath = sformat("%1%2/%3",AutoinstConfig::destdir, AutoinstConfig::scripts_dir, scriptName); + map toks = URL::Parse(s["location"]:""); + if( toks["scheme"]:"" == "nfs" || !special ) { + scriptPath = sformat("%1%2/%3",AutoinstConfig::destdir, AutoinstConfig::scripts_dir, scriptName); + } else { + scriptPath = sformat("%1/%2",AutoinstConfig::scripts_dir, scriptName); + } + + y2milestone("Writing chroot script into %1", scriptPath); if (s["location"]:""!="") { @@ -491,6 +505,9 @@ } else { SCR::Write(.target.string, scriptPath, s["source"]:"echo Empty script!"); } + if( special && toks["scheme"]:"" == "nfs" ) { + scriptPath = substring (scriptPath, 4); // cut off the /mnt for later execution + } } else { @@ -517,21 +534,25 @@ string executionString = ""; boolean showFeedback = s["feedback"]:false; + if (scriptInterpreter == "shell") { string debug = ( s["debug"]:true ? "-x" : "" ); executionString = sformat("/bin/sh %1 %2 2&> %3/%4.log ", debug, scriptPath, current_logdir, scriptName); + y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); } else if (scriptInterpreter == "perl") { string debug = ( s["debug"]:true ? "-w" : "" ); executionString = sformat("/usr/bin/perl %1 %2 2&> %3/%4.log ", debug, scriptPath, current_logdir, scriptName); + y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); } else if (scriptInterpreter == "python") { executionString = sformat("/usr/bin/python %1 2&> %2/%3.log ", scriptPath, current_logdir, scriptName ); + y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); } else @@ -545,7 +566,6 @@ if( size(feedback) > 0 ) { Popup::LongText(type, `RichText(`opt(`plainText), feedback), 50, 20 ); } - y2milestone("Script Execution command: %1", executionString ); } }); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org