diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index b6e5527d..3ff0e6f2 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -146,7 +146,7 @@ class RuntimeBuilder(object): runcmd(["depmod", "-a", "-F", ksyms, "-b", root, kver]) generate_module_info(moddir+kver, outfile=moddir+"module-info") - def create_runtime(self, outfile="/tmp/squashfs.img", compression="xz", compressargs=[], size=1): + def create_runtime(self, outfile="/var/tmp/squashfs.img", compression="xz", compressargs=[], size=1): # make live rootfs image - must be named "LiveOS/rootfs.img" for dracut workdir = joinpaths(os.path.dirname(outfile), "runtime-workdir") if size: diff --git a/src/sbin/lorax b/src/sbin/lorax index 1754e958..f3aa9c3c 100755 --- a/src/sbin/lorax +++ b/src/sbin/lorax @@ -109,6 +109,8 @@ def main(args): action="store_false", default=True, dest="domacboot") optional.add_option("--logfile", default="./lorax.log", help="Path to logfile") + optional.add_option("--tmp", default="/var/tmp", + help="Top level temporary directory" ) # add the option groups to the parser parser.add_option_group(required) @@ -142,6 +144,8 @@ def main(args): setup_logging(opts) + tempfile.tempdir = opts.tmp + # create the temporary directory for lorax tempdir = tempfile.mkdtemp(prefix="lorax.", dir=tempfile.gettempdir()) @@ -169,7 +173,7 @@ def main(args): def get_yum_base_object(installroot, repositories, mirrorlists=[], - tempdir="/tmp", proxy=None, excludepkgs=[]): + tempdir="/var/tmp", proxy=None, excludepkgs=[]): def sanitize_repo(repo): if repo.startswith("/"):