copy config_dir into root, rather than linking
workdir might be on a different device, and then hardlinks fail
This commit is contained in:
		
							parent
							
								
									e90082e43e
								
							
						
					
					
						commit
						297a572069
					
				| @ -24,7 +24,8 @@ import os, re | |||||||
| from os.path import basename, isdir | from os.path import basename, isdir | ||||||
| from subprocess import check_call, check_output | 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 base import DataHolder | ||||||
| from ltmpl import LoraxTemplateRunner | from ltmpl import LoraxTemplateRunner | ||||||
| import imgutils | import imgutils | ||||||
| @ -81,12 +82,12 @@ class RuntimeBuilder(object): | |||||||
| 
 | 
 | ||||||
|     def postinstall(self, configdir="/usr/share/lorax/config_files"): |     def postinstall(self, configdir="/usr/share/lorax/config_files"): | ||||||
|         '''Do some post-install setup work with runtime-postinstall.tmpl''' |         '''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" |         configdir_path = "tmp/config_files" | ||||||
|         fullpath = joinpaths(self.vars.root, configdir_path) |         fullpath = joinpaths(self.vars.root, configdir_path) | ||||||
|         if os.path.exists(fullpath): |         if os.path.exists(fullpath): | ||||||
|             remove(fullpath) |             remove(fullpath) | ||||||
|         linktree(configdir, fullpath) |         copytree(configdir, fullpath) | ||||||
|         self._runner.run("runtime-postinstall.tmpl", configdir=configdir_path) |         self._runner.run("runtime-postinstall.tmpl", configdir=configdir_path) | ||||||
| 
 | 
 | ||||||
|     def cleanup(self): |     def cleanup(self): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user