summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 35053de368..ba0b701aff 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1196,6 +1196,15 @@ class BaseConfig(object):
self.fstype = self.fstype[4:]
rootfs_format = self.fstype if self.fstype in ('vmdk', 'vhd', 'vhdx', 'qcow2', 'vdi') else 'raw'
+ tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None)
+ if self.snapshot and tmpfsdir:
+ newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid())
+ shutil.copyfile(self.rootfs, newrootfs)
+ #print("Copying rootfs to tmpfs: %s" % newrootfs)
+ self.rootfs = newrootfs
+ # Don't need a second copy now!
+ self.snapshot = False
+
qb_rootfs_opt = self.get('QB_ROOTFS_OPT')
if qb_rootfs_opt:
self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs)