|
|
|
@ -124,31 +124,6 @@ class fillVars(object, varsShare):
|
|
|
|
|
else:
|
|
|
|
|
return cacheDir
|
|
|
|
|
|
|
|
|
|
reChroot = re.compile("^(?:_=.*bin/chroot|CHROOT=on)$",re.S)
|
|
|
|
|
|
|
|
|
|
def isChroot(self,pid):
|
|
|
|
|
"""Recursive detect chroot mode"""
|
|
|
|
|
if not os.access('/proc/%d/environ'%pid,R_OK):
|
|
|
|
|
return False
|
|
|
|
|
if filter(self.reChroot.match,
|
|
|
|
|
open('/proc/%d/environ'%pid,'r').read().split('\x00')):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
ppid = filter(lambda x:x.startswith('PPid:'),
|
|
|
|
|
open('/proc/%d/status'%pid,'r').readlines())[0]
|
|
|
|
|
ppid = int(ppid.strip().partition('\t')[2])
|
|
|
|
|
if ppid == 0:
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
return self.isChroot(ppid)
|
|
|
|
|
|
|
|
|
|
def get_cl_chroot_status(self):
|
|
|
|
|
"""Detect chroot mode by mtab content"""
|
|
|
|
|
try:
|
|
|
|
|
return "on" if self.isChroot(os.getpid()) else "off"
|
|
|
|
|
except:
|
|
|
|
|
return "off"
|
|
|
|
|
|
|
|
|
|
def get_cl_builder_iso_action(self):
|
|
|
|
|
"""Need perform templates for builder:iso"""
|
|
|
|
|
if self.Get('cl_action')=='iso':
|
|
|
|
|