diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 8317352..5bc4b15 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -1040,10 +1040,17 @@ class VariableClUpdateKernelSrcPath(ReadonlyVariable): Каталог содержащий исходный код текущего ядра """ def get(self): - module_build_path = ( - "/lib/modules/%s/build" % self.Get('cl_update_kernel_version')) - if path.exists(module_build_path): - return os.readlink(module_build_path) + kernel_ver = self.Get('cl_update_kernel_version') + for template_path in ("/lib/modules/%s/build", + "/usr/src/linux-%s"): + src_path = template_path % kernel_ver + if path.exists(src_path): + if path.islink(src_path): + return os.readlink(src_path) + else: + return src_path + else: + return "" class VariableClUpdateKernelPkg(ReadonlyVariable): @@ -1051,12 +1058,12 @@ class VariableClUpdateKernelPkg(ReadonlyVariable): Пакет текущего ядра """ def get(self): - qfile = process('/usr/bin/qfile', '-vC', - self.Get('cl_update_kernel_src_path')) - if qfile.success(): - return qfile.read().partition(" ")[0] - else: - return "" + src_path = self.Get('cl_update_kernel_src_path') + if src_path: + qfile = process('/usr/bin/qfile', '-vC', src_path) + if qfile.success(): + return qfile.read().partition(" ")[0] + return "" class VariableClUpdateLinesLimit(Variable):