Add variable for kernel cmd suffix.

Fix func name. Fix param check.
Add error message for -l.
master
Mike Hiretsky 13 years ago
parent 5c4016dbc7
commit ecdc908458

@ -828,9 +828,10 @@ class cl_builder(color_print):
self.clVars.Set('os_builder_clock_timezone',timezone,force=True) self.clVars.Set('os_builder_clock_timezone',timezone,force=True)
return True return True
def setAllLocaleByLang(self,lang): def setLang(self,lang):
"""Set all locale variable by specified lang""" """Set all locale variable by specified lang"""
if not lang in self.clVars.Get('os_lang'): if not lang in self.clVars.Get('os_lang'):
self.printERROR(_("specified language %s is unsupported")%lang)
return False return False
self.clVars.Set('os_builder_locale_lang',lang, True) self.clVars.Set('os_builder_locale_lang',lang, True)
return True return True

@ -400,6 +400,7 @@ class fillVars(object, varsShare):
return "0" return "0"
def get_cl_builder_image_path(self): def get_cl_builder_image_path(self):
"""Path which contains images"""
imagePath = ['/var/calculate/linux', imagePath = ['/var/calculate/linux',
'/var/calculate/remote/linux', '/var/calculate/remote/linux',
'/usr/calculate/share/linux'] '/usr/calculate/share/linux']
@ -408,3 +409,17 @@ class fillVars(object, varsShare):
self.Get('os_builder_profile').replace('/','-'), self.Get('os_builder_profile').replace('/','-'),
"linux")) "linux"))
return imagePath return imagePath
def get_cl_builder_kernel_cmd(self):
"""Suffix for kernel cmdline"""
suffix = ""
timezone = self.Get('os_builder_clock_timezone')
lang = self.Get('os_builder_locale_lang')
if timezone and lang:
suffix = "calculate=lang:%s,keymap:%s,timezone:%s" % \
(lang,lang,timezone)
elif timezone:
suffix = "calculate=,,timezone:%s"%(timezone)
elif lang:
suffix = "calculate=lang:%s,keymap:%s" % (lang,lang)
return suffix

@ -178,8 +178,10 @@ class image_cmd(share_cmd):
if args and args[0] == "squash": if args and args[0] == "squash":
self.logicObj.clVars.Set('cl_builder_iso_path','/mnt/flash',True) self.logicObj.clVars.Set('cl_builder_iso_path','/mnt/flash',True)
self.logicObj.setTimezone(values.timezone) if not self.logicObj.setTimezone(values.timezone):
self.logicObj.setLang(values.l) sys.exit(1)
if not self.logicObj.setLang(values.l):
sys.exit(1)
self.optobj.checkVarSyntax(values) self.optobj.checkVarSyntax(values)
return (values, args) return (values, args)

@ -158,6 +158,9 @@ class Data:
os_builder_locale_lang = {'mode':'w','value':''} os_builder_locale_lang = {'mode':'w','value':''}
os_builder_clock_timezone = {'mode':'w','value':''} os_builder_clock_timezone = {'mode':'w','value':''}
cl_builder_kernel_cmd = {'mode':'w'}
# lib vars # lib vars
cl_chroot_path = {} cl_chroot_path = {}
cl_env_path = {} cl_env_path = {}

Loading…
Cancel
Save