|
|
|
@ -360,8 +360,32 @@ class VariableOsInstallClockType(Variable):
|
|
|
|
|
self.label = _("Hardware clock type")
|
|
|
|
|
self.help = _("set hardware clock type")
|
|
|
|
|
|
|
|
|
|
def exclude_value(self):
|
|
|
|
|
"""
|
|
|
|
|
Исключения
|
|
|
|
|
"""
|
|
|
|
|
root_type = self.Get('os_root_type')
|
|
|
|
|
hr_virtual = self.Get('hr_virtual')
|
|
|
|
|
# oracle virtualbox по умолчанию для linux систем выставляет
|
|
|
|
|
# использование UTC
|
|
|
|
|
if root_type == "livecd" and hr_virtual == "virtualbox":
|
|
|
|
|
return "UTC"
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
"""type of clock (UTC or local)"""
|
|
|
|
|
# в первую очередь смотрим на параметры загрузки системы
|
|
|
|
|
cmdtype = getValueFromCmdLine(CmdlineParams.Calculate,
|
|
|
|
|
CmdlineParams.Clock)
|
|
|
|
|
if cmdtype and cmdtype in self.choice():
|
|
|
|
|
return cmdtype
|
|
|
|
|
|
|
|
|
|
# во вторую очередь исключения (например для livecd и virtualbox)
|
|
|
|
|
clocktype = self.exclude_value()
|
|
|
|
|
if clocktype:
|
|
|
|
|
return clocktype
|
|
|
|
|
|
|
|
|
|
# получаем значение из конфигурационных файлов hwclock
|
|
|
|
|
clockTypeFile = ['/etc/conf.d/clock', '/etc/conf.d/hwclock']
|
|
|
|
|
for f in clockTypeFile:
|
|
|
|
|
clock = getValueFromConfig(f, "clock")
|
|
|
|
@ -370,6 +394,7 @@ class VariableOsInstallClockType(Variable):
|
|
|
|
|
return clock.upper()
|
|
|
|
|
elif clock.lower() == 'local':
|
|
|
|
|
return clock.lower()
|
|
|
|
|
# запасное значение
|
|
|
|
|
return self.fallback_value
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
|