本文整理汇总了Python中utils.process函数的典型用法代码示例。如果您正苦于以下问题:Python process函数的具体用法?Python process怎么用?Python process使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了process函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: build
def build(self):
"""
Append dmraid to initramfs from the host
@return: bool
"""
logging.debug('>>> entering initramfs.append.bin.dmraid')
dmraid_bin = '/usr/sbin/dmraid'
process('mkdir -p ' + self.temp['work']+'/initramfs-bin-dmraid-temp/bin', self.verbose)
# use from host
logging.debug('initramfs.append.bin_dmraid from %s' % white('host'))
process('cp %s %s/initramfs-bin-dmraid-temp/bin' % (dmraid_bin, self.temp['work']), self.verbose)
process('chmod +x %s/initramfs-bin-dmraid-temp/bin/dmraid' % self.temp['work'], self.verbose)
if not isstatic(dmraid_bin, self.verbose) and self.cli['dynlibs'] is True:
dmraid_libs = listdynamiclibs(dmraid_bin, self.verbose)
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-dmraid-temp/lib', self.verbose)
print(yellow(' * ') + '... ' + yellow('warning')+': '+dmraid_bin+' is dynamically linked, copying detected libraries')
for i in dmraid_libs:
print(green(' * ') + '... ' + i)
process('cp %s %s' % (i, self.temp['work']+'/initramfs-bin-dmraid-temp/lib'), self.verbose)
else:
logging.debug(dmraid_bin+' is statically linked nothing to do')
# FIXME ln -sf raid456.ko raid45.ko ?
# FIXME is it ok to have no raid456.ko? if so shouldn't we check .config for inkernel feat?
# or should we raise an error and make the user enabling the module manually? warning?
os.chdir(self.temp['work']+'/initramfs-bin-dmraid-temp')
return os.system('find . -print | cpio --quiet -o -H newc --append -F %s/initramfs-cpio' % self.temp['cache'])
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:33,代码来源:dmraid.py
示例2: source_disklabel
def source_disklabel(self):
"""
Append blkid binary to the initramfs
after compiling e2fsprogs
@return: bool
"""
logging.debug('>>> entering initramfs.append.source_disklabel')
blkid_sbin = '/sbin/blkid'
process('mkdir -p %s' % self.temp['work']+'/initramfs-source-disklabel-temp/bin', self.verbose)
logging.debug('initramfs.append.source_disklabel ' + self.version_conf['e2fsprogs-version'])
if os.path.isfile(self.temp['cache'] + '/blkid-e2fsprogs-' + self.version_conf['e2fsprogs-version']+'.bz2') and self.nocache is False:
# use cache
print(green(' * ') + '... '+'cache found: importing')
else:
# compile
from .sources.e2fsprogs import e2fsprogs
e2obj = e2fsprogs(self.master_conf, self.version_conf, self.url_conf, self.temp, self.verbose)
e2obj.build()
# extract cache
# FIXME careful with the >
os.system('/bin/bzip2 -dc %s/blkid-e2fsprogs-%s.bz2 > %s/initramfs-source-disklabel-temp/bin/blkid' % (self.temp['cache'], self.version_conf['e2fsprogs-version'], self.temp['work']))
process('chmod +x %s/initramfs-source-disklabel-temp/bin/blkid' % self.temp['work'], self.verbose)
os.chdir(self.temp['work']+'/initramfs-source-disklabel-temp')
return os.system(self.cpio())
开发者ID:r1k0,项目名称:kigen,代码行数:30,代码来源:append.py
示例3: build
def build(self):
"""
Append blkid binary from the host
@return: bool
"""
logging.debug('>>> entering initramfs.append.bin_disklabel')
blkid_sbin = '/sbin/blkid'
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-disklabel-temp/bin', self.verbose)
# use from host
logging.debug('initramfs.append.bin_disklabelfrom %s' % white('host'))
process('cp %s %s/initramfs-bin-disklabel-temp/bin' % (blkid_sbin, self.temp['work']), self.verbose)
process('chmod +x %s/initramfs-bin-disklabel-temp/bin/blkid' % self.temp['work'], self.verbose)
if not isstatic(blkid_sbin, self.verbose) and self.cli['dynlibs'] is True:
blkid_libs = listdynamiclibs(blkid_sbin, self.verbose)
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-blkid-temp/lib', self.verbose)
print(yellow(' * ') + '... ' + yellow('warning')+': '+blkid_sbin+' is dynamically linked, copying detected libraries')
for i in blkid_libs:
print(green(' * ') + '... ' + i)
process('cp %s %s' % (i, self.temp['work']+'/initramfs-bin-blkid-temp/lib'), self.verbose)
else:
logging.debug(blkid_sbin+' is statically linked nothing to do')
os.chdir(self.temp['work']+'/initramfs-bin-disklabel-temp')
return os.system('find . -print | cpio --quiet -o -H newc --append -F %s/initramfs-cpio' % self.temp['cache'])
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:28,代码来源:disklabel.py
示例4: build
def build(self):
"""
Append strace host binary to the initramfs
for debugging purposes
@return: bool
"""
logging.debug('>>> entering initramfs.append.bin.strace')
strace_bin = '/usr/bin/strace'
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-strace-temp/bin', self.verbose)
# use from host
logging.debug('initramfs.append.bin_strace from ' + white('host'))
process('cp %s %s/initramfs-bin-strace-temp/bin' % (strace_bin, self.temp['work']), self.verbose)
process('chmod +x %s/initramfs-bin-strace-temp/bin/strace' % self.temp['work'], self.verbose)
if not isstatic(strace_bin, self.verbose) and self.cli['dynlibs'] is True:
strace_libs = listdynamiclibs(strace_bin, self.verbose)
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-strace-temp/lib', self.verbose)
print(yellow(' * ') + '... ' + yellow('warning')+': '+strace_bin+' is dynamically linked, copying detected libraries')
for i in strace_libs:
print(green(' * ') + '... ' + i)
process('cp %s %s' % (i, self.temp['work']+'/initramfs-bin-strace-temp/lib'), self.verbose)
else:
logging.debug(strace_bin+' is statically linked nothing to do')
os.chdir(self.temp['work']+'/initramfs-bin-strace-temp')
return os.system('find . -print | cpio --quiet -o -H newc --append -F %s/initramfs-cpio' % self.temp['cache'])
开发者ID:r1k0,项目名称:kigen,代码行数:29,代码来源:strace.py
示例5: build
def build(self):
"""
e2fsprogs build sequence
@return bool
"""
ret = zero = int('0')
if os.path.isfile('%s/e2fsprogs-%s.tar.gz' % (get_distdir(self.temp), self.e2fsprogs_ver)) is not True:
print(green(' * ') + '... e2fsprogs.download')
if self.download() is not zero:
process('rm %s/e2fsprogs-%s.tar.gz' % (get_distdir(self.temp), self.e2fsprogs_ver), self.verbose)
self.fail('download')
print(green(' * ') + '... e2fsprogs.extract')
self.extract()
# grr, tar thing to not return 0 when success
print(green(' * ') + '... e2fsprogs.configure')
if self.configure() is not zero: self.fail('configure')
print(green(' * ') + '... e2fsprogs.make')
if self.make() is not zero: self.fail('make')
print(green(' * ') + '... e2fsprogs.strip')
if self.strip() is not zero: self.fail('strip')
print(green(' * ') + '... e2fsprogs.compress')
if self.compress() is not zero: self.fail('compress')
print(green(' * ') + '... e2fsprogs.cache')
if self.cache() is not zero: self.fail('cache')
开发者ID:r1k0,项目名称:kigen,代码行数:32,代码来源:e2fsprogs.py
示例6: build
def build(self):
"""
dropbear build sequence
@return: bool
"""
zero = int('0')
if os.path.isfile('%s/dropbear-%s.tar.gz' % (get_distdir(self.temp), str(self.dropbear_ver))) is not True:
if self.download() is not zero:
process('rm -v %s/dropbear-%s.tar.gz' % (get_distdir(self.temp), str(self.dropbear_ver)), self.verbose)
self.fail('download')
self.extract()
# grr, tar thing to not return 0 when success
# FIXME there is no need to patch for scp->dbscp
# FIXME because there is NO scp bin inside the initramfs
# FIXME the patch only applies for cases when openssh is already installed
# FIXME to make dropbear and openssh coexist
# FIXME if self.patch() is not zero: self.fail('patch')
if self.debugflag is True:
if self.patch_debug_header() is not zero: self.fail('patch_debug_header')
if self.configure() is not zero: self.fail('configure')
if self.make() is not zero: self.fail('make')
if self.strip() is not zero: self.fail('strip')
if self.dsskey() is not zero: self.fail('dsskey')
if self.rsakey() is not zero: self.fail('rsakey')
if self.compress() is not zero: self.fail('compress')
if self.cache() is not zero: self.fail('cache')
开发者ID:ac1965,项目名称:kigen,代码行数:31,代码来源:dropbear.py
示例7: build
def build(self):
"""
Append blkid binary from the host
@return: bool
"""
logging.debug(">>> entering initramfs.append.bin_disklabel")
blkid_sbin = "/sbin/blkid"
process("mkdir -p %s" % self.temp["work"] + "/initramfs-bin-disklabel-temp/bin", self.verbose)
# use from host
logging.debug("initramfs.append.bin_disklabelfrom %s" % white("host"))
process("cp %s %s/initramfs-bin-disklabel-temp/bin" % (blkid_sbin, self.temp["work"]), self.verbose)
process("chmod +x %s/initramfs-bin-disklabel-temp/bin/blkid" % self.temp["work"], self.verbose)
if not isstatic(blkid_sbin, self.verbose) and self.cli["dynlibs"] is True:
blkid_libs = listdynamiclibs(blkid_sbin, self.verbose)
process("mkdir -p %s" % self.temp["work"] + "/initramfs-bin-blkid-temp/lib", self.verbose)
print(
yellow(" * ")
+ "... "
+ yellow("warning")
+ ": "
+ blkid_sbin
+ " is dynamically linked, copying detected libraries"
)
for i in blkid_libs:
print(green(" * ") + "... " + i)
process("cp %s %s" % (i, self.temp["work"] + "/initramfs-bin-blkid-temp/lib"), self.verbose)
else:
logging.debug(blkid_sbin + " is statically linked nothing to do")
os.chdir(self.temp["work"] + "/initramfs-bin-disklabel-temp")
return os.system("find . -print | cpio --quiet -o -H newc --append -F %s/initramfs-cpio" % self.temp["cache"])
开发者ID:r1k0,项目名称:kigen,代码行数:35,代码来源:disklabel.py
示例8: build
def build(self):
"""
luks build sequence
@return: bool
"""
zero = int("0")
if os.path.isfile("%s/cryptsetup-%s.tar.bz2" % (get_distdir(self.temp), self.luks_ver)) is not True:
if self.download() is not zero:
process("rm -v %s/cryptsetup-%s.tar.bz2" % (get_distdir(self.temp), self.luks_ver), self.verbose)
self.fail("download")
self.extract()
# grr, tar thing to not return 0 when success
if self.configure() is not zero:
self.fail("configure")
if self.make() is not zero:
self.fail("make")
if self.strip() is not zero:
self.fail("strip")
if self.compress() is not zero:
self.fail("compress")
if self.cache() is not zero:
self.fail("cache")
开发者ID:ac1965,项目名称:kigen,代码行数:30,代码来源:luks.py
示例9: build
def build(self):
"""
screen build sequence
@return bool
"""
zero = int('0')
if os.path.isfile('%s/screen-%s.tar.gz' % (get_distdir(self.temp), self.screen_ver)) is not True:
if self.download() is not zero:
process('rm %s/screen-%s.tar.gz' % (get_distdir(self.temp), self.screen_ver), self.verbose)
self.fail('download')
self.extract()
# grr, tar thing to not return 0 when success
if self.configure() is not zero: self.fail('configure')
if self.make() is not zero: self.fail('make')
if self.strip() is not zero: self.fail('strip')
if self.compress() is not zero: self.fail('compress')
if self.cache() is not zero: self.fail('cache')
开发者ID:ac1965,项目名称:kigen,代码行数:25,代码来源:screen.py
示例10: build
def build(self):
"""
lvm2 build sequence
@return: bool
"""
zero = int('0')
if os.path.isfile('%s/LVM2.%s.tgz' % (get_distdir(self.temp), self.lvm2_ver)) is not True:
if self.download() is not zero:
process('rm -v %s/LVM2.%s.tgz' % (get_distdir(self.temp), self.lvm2_ver), self.verbose)
self.fail('download')
self.extract()
# grr, tar thing to not return 0 when success
if self.configure() is not zero: self.fail('configure')
if self.make() is not zero: self.fail('make')
if self.install() is not zero: self.fail('install')
if self.strip() is not zero: self.fail('strip')
if self.compress() is not zero: self.fail('compress')
if self.cache() is not zero: self.fail('cache')
开发者ID:ac1965,项目名称:kigen,代码行数:27,代码来源:lvm2.py
示例11: source_strace
def source_strace(self):
"""
Append strace from sources to the initramfs
for debugging purposes
@return: bool
"""
logging.debug('>>> entering initramfs.append.source_strace')
strace_bin = '/usr/bin/strace'
process('mkdir -p %s' % self.temp['work']+'/initramfs-source-strace-temp/bin', self.verbose)
logging.debug('initramfs.append.source_strace ' + self.version_conf['strace-version'])
if os.path.isfile(self.temp['cache'] + '/strace-' + self.version_conf['strace-version']+'.bz2') and self.nocache is False:
# use cache
print(green(' * ') + '... ' + 'cache found: importing')
else:
# compile
from .sources.strace import strace
strobj = strace(self.master_conf, self.version_conf, self.url_conf, self.temp, self.verbose)
strobj.build()
# extract cache
# FIXME careful with the >
logging.debug('/bin/bzip2 -dc %s/strace-%s.bz2 > %s/initramfs-source-strace-temp/bin/strace' % (self.temp['cache'], self.version_conf['strace-version'], self.temp['work']))
os.system('/bin/bzip2 -dc %s/strace-%s.bz2 > %s/initramfs-source-strace-temp/bin/strace' % (self.temp['cache'], self.version_conf['strace-version'], self.temp['work']))
process('chmod +x %s/initramfs-source-strace-temp/bin/strace' % self.temp['work'], self.verbose)
os.chdir(self.temp['work']+'/initramfs-source-strace-temp')
return os.system(self.cpio())
开发者ID:r1k0,项目名称:kigen,代码行数:30,代码来源:append.py
示例12: source_dmraid
def source_dmraid(self):
"""
Append dmraid to initramfs from sources
@return: bool
"""
logging.debug('>>> entering initramfs.append.source_dmraid')
dmraid_bin = '/usr/sbin/dmraid'
process('mkdir -p ' + self.temp['work']+'/initramfs-source-dmraid-temp/bin', self.verbose)
logging.debug('initramfs.append.source_dmraid '+ self.version_conf['dmraid-version']),
if os.path.isfile(self.temp['cache']+'/dmraid.static-'+self.version_conf['dmraid-version']+'.bz2') and self.nocache is False:
# use cache
print(green(' * ') + '... '+'cache found: importing')
else:
# compile
from .sources.dmraid import dmraid
dmraidobj = dmraid(self.master_conf, self.version_conf, self.url_conf, self.selinux, self.temp, self.verbose)
dmraidobj.build()
# extract cache
# FIXME careful with the >
logging.debug('/bin/bzip2 -dc %s/dmraid.static-%s.bz2 > %s/initramfs-source-dmraid-temp/bin/dmraid.static' % (self.temp['cache'], self.version_conf['dmraid-version'], self.temp['work']))
os.system('/bin/bzip2 -dc %s/dmraid.static-%s.bz2 > %s/initramfs-source-dmraid-temp/bin/dmraid.static' % (self.temp['cache'], self.version_conf['dmraid-version'], self.temp['work']))
# FIXME make symlink rather than cp
process('cp %s/initramfs-source-dmraid-temp/bin/dmraid.static %s/initramfs-source-dmraid-temp/bin/dmraid' % (self.temp['work'],self.temp['work']), self.verbose)
# FIXME ln -sf raid456.ko raid45.ko ?
# FIXME is it ok to have no raid456.ko? if so shouldn't we check .config for inkernel feat?
# or should we raise an error and make the user enabling the module manually? warning?
os.chdir(self.temp['work']+'/initramfs-source-dmraid-temp')
return os.system(self.cpio())
开发者ID:r1k0,项目名称:kigen,代码行数:35,代码来源:append.py
示例13: run
def run():
# example: --breach_compilation_folder /media/philippe/DATA/BreachCompilation/
# --max_num_files 100 --output_folder ~/BreachCompilationAnalysis2
arg_p = parser.parse_args()
process(breach_compilation_folder=arg_p.breach_compilation_folder,
num_files=arg_p.max_num_files,
output_folder=arg_p.output_folder,
on_file_read_call_back_class=ReducePasswordsOnSimilarEmailsCallback)
开发者ID:Porlockzzz,项目名称:tensorflow-1.4-billion-password-analysis,代码行数:8,代码来源:run_data_processing.py
示例14: hostsshkeys_dsa
def hostsshkeys_dsa(self):
"""
dropbear host dsa ssh key convertion
"""
self.chgdir(self.dropbeartmp)
process('mkdir -p %s/etc/dropbear' % self.dropbeartmp, self.verbose)
return process('./dropbearconvert openssh dropbear /etc/ssh/ssh_host_dsa_key %s/etc/dropbear/dropbear_dss_host_key' % self.dropbeartmp, self.verbose)
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:8,代码来源:dropbear.py
示例15: dsskey
def dsskey(self):
"""
dropbear dsskey creation
"""
self.chgdir(self.dropbeartmp)
process('mkdir -p %s/etc/dropbear' % self.dropbeartmp, self.verbose)
return process('./dropbearkey -t dss -f %s/etc/dropbear/dropbear_dss_host_key' % self.dropbeartmp, self.verbose)
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:8,代码来源:dropbear.py
示例16: rsakey
def rsakey(self):
"""
dropbear rsakey creation
"""
self.chgdir(self.dropbeartmp)
process('mkdir -p %s/etc/dropbear' % self.dropbeartmp, self.verbose)
return process('./dropbearkey -t rsa -s 4096 -f %s/etc/dropbear/dropbear_rsa_host_key' % self.dropbeartmp, self.verbose)
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:8,代码来源:dropbear.py
示例17: post
def post(self):
retry = self.request.get('retry')
failures = self.request.headers.get("X-AppEngine-TaskRetryCount")
eta_test = self.request.get('eta')
eta = self.request.headers.get("X-AppEngine-TaskETA")
if retry == 'true' and failures == "0":
raise Exception
elif eta_test == 'true':
utils.processEta(self.request.get('key'), eta)
else:
utils.process(self.request.get('key'))
开发者ID:briandrawert,项目名称:hawkeye,代码行数:11,代码来源:taskqueue.py
示例18: build
def build(self):
"""
Append host zlib libraries to the initramfs
@return: bool
"""
logging.debug('>>> entering initramfs.append.bin_zlib')
process('mkdir -p %s' % self.temp['work']+'/initramfs-bin-zlib-temp/lib', self.verbose)
print(green(' * ') + '... ' + '/lib/libz.so.1')
process('cp /lib/libz.so.1 %s' % self.temp['work']+'/initramfs-bin-zlib-temp/lib', self.verbose)
os.chdir(self.temp['work']+'/initramfs-bin-zlib-temp')
return os.system('find . -print | cpio --quiet -o -H newc --append -F %s/initramfs-cpio' % self.temp['cache'])
开发者ID:kungfoo-linux,项目名称:kigen,代码行数:14,代码来源:zlib.py
示例19: source_lvm2
def source_lvm2(self):
"""
Append lvm2 compiled binary to the initramfs
@return: bool
"""
logging.debug('>>> entering initramfs.append.source_lvm2')
lvm2_static_bin = '/sbin/lvm.static'
lvm2_bin = '/sbin/lvm'
process('mkdir -p ' + self.temp['work']+'/initramfs-source-lvm2-temp/etc/lvm', self.verbose)
process('mkdir -p ' + self.temp['work']+'/initramfs-source-lvm2-temp/bin', self.verbose)
logging.debug('initramfs.append.source_lvm2 ' + self.version_conf['lvm2-version'])
if os.path.isfile(self.temp['cache']+'/lvm.static-'+self.version_conf['lvm2-version']+'.bz2') and self.nocache is False:
# use cache
print(green(' * ') + '... '+'cache found: importing')
else:
# compile and cache
from .sources.lvm2 import lvm2
lvm2obj = lvm2(self.master_conf, self.version_conf, self.url_conf, self.temp, self.verbose)
lvm2obj.build()
# extract cache
os.system('bzip2 -dc %s > %s/initramfs-source-lvm2-temp/bin/lvm' % (self.temp['cache']+'/lvm.static-'+self.version_conf['lvm2-version']+'.bz2', self.temp['work']))
process('chmod a+x %s/initramfs-source-lvm2-temp/bin/lvm' % self.temp['work'], self.verbose)
# FIXME print something to the user about it so he knows and can tweak it before
if os.path.isfile(lvm2_static_bin) or os.path.isfile(lvm2_bin):
process('cp /etc/lvm/lvm.conf %s/initramfs-source-lvm2-temp/etc/lvm/' % self.temp['work'], self.verbose)
os.chdir(self.temp['work']+'/initramfs-source-lvm2-temp')
return os.system(self.cpio())
开发者ID:r1k0,项目名称:kigen,代码行数:35,代码来源:append.py
示例20: plugin
def plugin(self, dir):
"""
Append user generated file structure
@return: bool
"""
logging.debug('>>> entering initramfs.append.plugin')
print(green(' * ') + turquoise('initramfs.append.plugin ') + dir)
print(yellow(' * ') + '... ' + yellow('warning') +': plugin may overwrite kigen files')
process('mkdir -p ' + self.temp['work']+'/initramfs-plugin-temp/', self.verbose)
process('cp -ar %s/* %s' % (dir, self.temp['work']+'/initramfs-plugin-temp/'), self.verbose)
os.chdir(self.temp['work']+'/initramfs-plugin-temp')
return os.system(self.cpio())
开发者ID:r1k0,项目名称:kigen,代码行数:16,代码来源:append.py
注:本文中的utils.process函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论