mirror of https://github.com/apache/cloudstack.git
either mkisofs or genisoimage are detected. Graft points (thus rename()) support added to waf create ISO feature. Proper cross-platform support in waf create ISO feature.
Give option to use genisoimage if mkisofs is not present, fixes compile on windows as long as user has cygwin Fix mkisofs to work on windows well put files in root directory of systemvm ISO put the rename func in the task generator constructor for the isos Add graft point support to tools/mkisofs
This commit is contained in:
parent
985ff79f18
commit
073e1b0a29
|
|
@ -1,12 +1,14 @@
|
|||
import Utils
|
||||
from TaskGen import feature, before
|
||||
from Configure import ConfigurationError
|
||||
import Task
|
||||
import os
|
||||
|
||||
# fixme: this seems to hang waf with 100% CPU
|
||||
|
||||
def detect(conf):
|
||||
conf.find_program("mkisofs",mandatory=True,var='MKISOFS')
|
||||
conf.find_program("mkisofs",var='MKISOFS')
|
||||
if not conf.env.MKISOFS: conf.find_program("genisoimage",mandatory=True,var='MKISOFS')
|
||||
|
||||
def iso_up(task):
|
||||
tgt = task.outputs[0].bldpath(task.env)
|
||||
|
|
@ -16,21 +18,22 @@ def iso_up(task):
|
|||
if inp.id&3==Node.BUILD:
|
||||
src = inp.bldpath(task.env)
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off default/
|
||||
srcname = sep.join(srcname.split(sep)[1:]) # chop off default/
|
||||
else:
|
||||
src = inp.srcpath(task.env)
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off ../
|
||||
inps.append(src)
|
||||
srcname = sep.join(srcname.split(sep)[1:]) # chop off ../
|
||||
if task.generator.rename: srcname = task.generator.rename(srcname)
|
||||
inps.append(srcname+'='+src)
|
||||
ret = Utils.exec_command(
|
||||
[
|
||||
task.generator.env.MKISOFS,
|
||||
"-quiet",
|
||||
"-r",
|
||||
"-graft-points",
|
||||
"-o",tgt,
|
||||
] + inps, shell=False)
|
||||
if ret != 0: return ret
|
||||
if task.chmod: os.chmod(tgt,task.chmod)
|
||||
|
||||
def apply_iso(self):
|
||||
Utils.def_attrs(self,fun=iso_up)
|
||||
|
|
|
|||
|
|
@ -268,17 +268,19 @@ def iso_up(task):
|
|||
if inp.id&3==Node.BUILD:
|
||||
src = inp.bldpath(task.env)
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off default/
|
||||
srcname = sep.join(srcname.split(sep)[1:]) # chop off default/
|
||||
else:
|
||||
src = inp.srcpath(task.env)
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off ../
|
||||
inps.append(src)
|
||||
srcname = sep.join(srcname.split(sep)[1:]) # chop off ../
|
||||
if task.generator.rename: srcname = task.generator.rename(srcname)
|
||||
inps.append(srcname+'='+src)
|
||||
ret = Utils.exec_command(
|
||||
[
|
||||
task.generator.env.MKISOFS,
|
||||
"-quiet",
|
||||
"-r",
|
||||
"-graft-points",
|
||||
"-o",tgt,
|
||||
] + inps, shell=False)
|
||||
if ret != 0: return ret
|
||||
|
|
@ -291,6 +293,7 @@ if bld.env.DISTRO not in ["Windows","Mac"]:
|
|||
target = 'target/oss/systemvm.iso',
|
||||
name = 'systemvm_iso',
|
||||
after = 'systemvm_zip patch_tgz',
|
||||
rename = lambda x: x.split(sep)[-1],
|
||||
)
|
||||
bld.process_after(tgen)
|
||||
bld.install_as("${AGENTLIBDIR}/vms/systemvm.iso", "target/oss/systemvm.iso")
|
||||
|
|
@ -302,6 +305,7 @@ if buildpremium:
|
|||
target = 'target/premium/systemvm.iso',
|
||||
name = 'systemvm-premium_iso',
|
||||
after = 'systemvm-premium_zip patch_tgz',
|
||||
rename = lambda x: x.split(sep)[-1],
|
||||
)
|
||||
bld.process_after(tgen)
|
||||
bld.install_as("${AGENTLIBDIR}/vms/systemvm-premium.iso", "target/premium/systemvm.iso")
|
||||
|
|
|
|||
Loading…
Reference in New Issue