From 297a572069cb66459147da87c518d57cea7d8ded Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 5 Aug 2011 17:25:08 -0400 Subject: [PATCH] copy config_dir into root, rather than linking workdir might be on a different device, and then hardlinks fail --- src/pylorax/treebuilder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index ed3b0092..2a1aca48 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -24,7 +24,8 @@ import os, re from os.path import basename, isdir from subprocess import check_call, check_output -from sysutils import joinpaths, remove, linktree +from sysutils import joinpaths, remove +from shutil import copytree from base import DataHolder from ltmpl import LoraxTemplateRunner import imgutils @@ -81,12 +82,12 @@ class RuntimeBuilder(object): def postinstall(self, configdir="/usr/share/lorax/config_files"): '''Do some post-install setup work with runtime-postinstall.tmpl''' - # link configdir into runtime root beforehand + # copy configdir into runtime root beforehand configdir_path = "tmp/config_files" fullpath = joinpaths(self.vars.root, configdir_path) if os.path.exists(fullpath): remove(fullpath) - linktree(configdir, fullpath) + copytree(configdir, fullpath) self._runner.run("runtime-postinstall.tmpl", configdir=configdir_path) def cleanup(self):