From 34650259da55ff562a2117d3a4a20753a3d767b1 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Fri, 18 Sep 2009 12:28:54 +0300 Subject: [PATCH] Default values for container directories determined by container type expression Resolved CML2 language issues such that now default parameters for containers can be set by expressions on their type. --- config/cml/arm.cml | 10 ++++------ config/configuration.py | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/config/cml/arm.cml b/config/cml/arm.cml index d081b0b..5ec750a 100644 --- a/config/cml/arm.cml +++ b/config/cml/arm.cml @@ -135,7 +135,7 @@ CONFIG_CONT0_PHYS_START 'Container 0 physical start address' CONFIG_CONT0_PHYS_END 'Container 0 physical end address' CONFIG_CONT0_VIRT_START 'Container 0 virtual start address' CONFIG_CONT0_VIRT_END 'Container 0 virtual end address' -CONFIG_CONT0_OPT_DIRNAME 'Containers directory name under conts/' +CONFIG_CONT0_OPT_DIRNAME 'Containers directory name under conts' CONFIG_CONT1_TYPE_LINUX 'Linux Container' CONFIG_CONT1_TYPE_BARE 'Bare Container' @@ -144,8 +144,7 @@ CONFIG_CONT1_PHYS_START 'Container 1 physical start address' CONFIG_CONT1_PHYS_END 'Container 1 physical end address' CONFIG_CONT1_VIRT_START 'Container 1 virtual start address' CONFIG_CONT1_VIRT_END 'Container 1 virtual end address' -CONFIG_CONT1_OPT_DIRNAME 'Containers directory name under conts/' - +CONFIG_CONT1_OPT_DIRNAME 'Containers directory name under conts' default CONFIG_CONTAINERS from 2 default CONFIG_CONT0_PHYS_START from 0x40000 @@ -158,9 +157,8 @@ default CONFIG_CONT1_PHYS_END from 0x2000000 default CONFIG_CONT1_VIRT_START from 0 default CONFIG_CONT1_VIRT_END from 0 - -default CONFIG_CONT0_OPT_DIRNAME from "Linux" -default CONFIG_CONT1_OPT_DIRNAME from "Linux" +default CONFIG_CONT0_OPT_DIRNAME from (CONFIG_CONT0_TYPE_LINUX==y) ? "Linux" : ((CONFIG_CONT0_TYPE_BARE==y) ? "Bare" : "Noname") +default CONFIG_CONT1_OPT_DIRNAME from (CONFIG_CONT1_TYPE_LINUX==y) ? "Linux" : ((CONFIG_CONT1_TYPE_BARE==y) ? "Bare" : "Noname") unless CONFIG_CONTAINERS > 1 suppress cont1_menu diff --git a/config/configuration.py b/config/configuration.py index 6ef1f08..75215db 100644 --- a/config/configuration.py +++ b/config/configuration.py @@ -1,6 +1,6 @@ #! /usr/bin/env python2.6 # -*- mode: python; coding: utf-8; -*- -import os, sys, shelve, shutil, re, string +import os, sys, shelve, shutil, re from projpaths import * class Container: @@ -68,7 +68,7 @@ class configuration: elif param[:len("PHYS_END")] == "PHYS_END": self.containers[id].lma_end = val else: - param1, param2 = param.split("_", 2) + param1, param2 = param.split("_", 1) if param1 == "TYPE": if param2 == "LINUX": self.containers[id].type = "linux"