[PATCH] use /var/tmp instead of /tmp

Brian C. Lane bcl at redhat.com
Tue Oct 2 18:36:34 UTC 2012


From: "Brian C. Lane" <bcl at redhat.com>

Also add a --tmp option so users can specify a top level tmp dir.
---
 src/pylorax/treebuilder.py | 2 +-
 src/sbin/lorax             | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index b6e5527..3ff0e6f 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 1754e95..f3aa9c3 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("/"):
-- 
1.7.11.4



More information about the anaconda-patches mailing list