From babf23f303df6cff35c698a64733b529d9bff978 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 6 May 2016 13:15:10 +0200 Subject: [PATCH] Let the init system guess "stratus1.mapppingName" value. * Change: In Bootstrap, in coriolisEnv.py no longer sets the environment variable STRATUS_MAPPING_NAME (guessed by init). * Change: In CRL Core, in System CTOR sets the default value for "stratus1.mappingName" to "not_set" so the init can known it is not set. In etc/coriolis2/*/stratus1.conf, do not set "stratus1.mappingName". In coriolisInit.py, now guess the value of "stratus1.mappingName" if it has not already been set by the user. The complete setting process is as follow (decreasing priority): 1. Setup by the user in his ".coriolis2/setting.py". 2. A "stratus.xml" file is detected in the current technological directory (example: etc/coriolis2/65/cmos065/setting.xml). 3. Fallback value to "etc/coriolis2/stratus2sxlib.xml". --- bootstrap/coriolisEnv.py | 8 +++++--- crlcore/etc/cmos/stratus1.conf | 4 +--- crlcore/etc/ispd05/stratus1.conf | 4 +--- crlcore/etc/scmos_deep_018/stratus1.conf | 4 +--- crlcore/etc/vsc200/stratus1.conf | 4 +--- crlcore/python/coriolisInit.py | 10 ++++++++++ crlcore/src/ccore/Utilities.cpp | 2 +- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index b336757d..b6ba9261 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -172,16 +172,18 @@ if __name__ == "__main__": 'PATH="%(PATH)s";' \ 'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";' \ 'CORIOLIS_TOP="%(CORIOLIS_TOP)s";' \ - 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";' \ 'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;' +# 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";' \ + shellScriptCsh = \ 'echo "%(MESSAGE)s";' \ 'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \ 'setenv PATH "%(PATH)s";' \ 'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";' \ - 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";' \ - 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";' + 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";' + +# 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";' \ buildDir = buildType + "." + linkType scriptDir = os.path.dirname ( os.path.abspath(__file__) ) diff --git a/crlcore/etc/cmos/stratus1.conf b/crlcore/etc/cmos/stratus1.conf index 8b434647..b4e6e23a 100644 --- a/crlcore/etc/cmos/stratus1.conf +++ b/crlcore/etc/cmos/stratus1.conf @@ -5,9 +5,7 @@ import helpers # Status1 parameters. parametersTable = \ - ( ("stratus1.mappingName", TypeString, helpers.sysConfDir+"/stratus2sxlib.xml", - { 'flags':Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist } ) - , ("stratus1.format" , TypeString, "vst") + ( ("stratus1.format" , TypeString, "vst") , ("stratus1.simulator" , TypeString, "asimut") ,) diff --git a/crlcore/etc/ispd05/stratus1.conf b/crlcore/etc/ispd05/stratus1.conf index 8b434647..b4e6e23a 100644 --- a/crlcore/etc/ispd05/stratus1.conf +++ b/crlcore/etc/ispd05/stratus1.conf @@ -5,9 +5,7 @@ import helpers # Status1 parameters. parametersTable = \ - ( ("stratus1.mappingName", TypeString, helpers.sysConfDir+"/stratus2sxlib.xml", - { 'flags':Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist } ) - , ("stratus1.format" , TypeString, "vst") + ( ("stratus1.format" , TypeString, "vst") , ("stratus1.simulator" , TypeString, "asimut") ,) diff --git a/crlcore/etc/scmos_deep_018/stratus1.conf b/crlcore/etc/scmos_deep_018/stratus1.conf index 338bc34c..4f4ce74d 100644 --- a/crlcore/etc/scmos_deep_018/stratus1.conf +++ b/crlcore/etc/scmos_deep_018/stratus1.conf @@ -5,9 +5,7 @@ import helpers # Status1 parameters. parametersTable = \ - ( ("stratus1.mappingName", TypeString, helpers.sysConfDir+"/stratus2sxlib.xml", - { 'flags':Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist } ) - , ("stratus1.format" , TypeString, "vst") + ( ("stratus1.format" , TypeString, "vst") , ("stratus1.simulator" , TypeString, "asimut") ,) diff --git a/crlcore/etc/vsc200/stratus1.conf b/crlcore/etc/vsc200/stratus1.conf index 2237bee5..126b291a 100644 --- a/crlcore/etc/vsc200/stratus1.conf +++ b/crlcore/etc/vsc200/stratus1.conf @@ -5,9 +5,7 @@ import helpers # Status1 parameters. parametersTable = \ - ( ("stratus1.mappingName", TypeString, helpers.sysConfDir+"/stratus2sxlib.xml", - { 'flags':Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist } ) - , ("stratus1.format" , TypeString, "vst") + ( ("stratus1.format" , TypeString, "vst") , ("stratus1.simulator" , TypeString, "asimut") ,) diff --git a/crlcore/python/coriolisInit.py b/crlcore/python/coriolisInit.py index 0cc65a0c..11b243f5 100644 --- a/crlcore/python/coriolisInit.py +++ b/crlcore/python/coriolisInit.py @@ -160,4 +160,14 @@ def coriolisConfigure(): #sys.stdout.write(CRL.AllianceFramework.get().getEnvironment().getPrint()) + if Cfg.getParamString('stratus1.mappingName').asString() == 'not_set': + vendorTech = helpers.realTechno.split('/')[-1] + mappingFile = os.path.join( helpers.realDir, 'stratus.xml' ) + if not os.path.isfile(mappingFile): + mappingFile = os.path.join( helpers.sysConfDir, 'stratus2sxlib.xml' ) + + parameter = Cfg.getParamString('stratus1.mappingName') + parameter.setString( mappingFile ) + parameter.flags = Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist + return diff --git a/crlcore/src/ccore/Utilities.cpp b/crlcore/src/ccore/Utilities.cpp index 852faa73..0ddccf24 100644 --- a/crlcore/src/ccore/Utilities.cpp +++ b/crlcore/src/ccore/Utilities.cpp @@ -330,7 +330,7 @@ namespace CRL { Cfg::getParamBool ("misc.bug" ,false)->registerCb ( this, bugChanged ); Cfg::getParamBool ("misc.logMode" ,false)->registerCb ( this, logModeChanged ); Cfg::getParamInt ("misc.traceLevel" ,1000 )->registerCb ( this, traceLevelChanged ); - Cfg::getParamString("stratus1.mappingName","./stratus2sxlib.xml")->registerCb ( this, stratus1MappingNameChanged ); + Cfg::getParamString("stratus1.mappingName","not_set")->registerCb ( this, stratus1MappingNameChanged ); // Immediate update from the configuration. //catchCoreChanged ( Cfg::getParamBool("misc.catchCore" ) );