livemedia-creator: Copy fsimage if hardlink fails
If the user supplies a fsimage to use for the iso it may not be on the same filesystem as the working directory. Try to hardlink first, but if that fails copy the image.
This commit is contained in:
parent
08d8f3b2fc
commit
b3e80b7564
@ -701,8 +701,11 @@ def make_squashfs(disk_img, work_dir, compression="xz"):
|
||||
liveos_dir = joinpaths(work_dir, "runtime/LiveOS")
|
||||
os.makedirs(liveos_dir)
|
||||
os.makedirs(os.path.dirname(joinpaths(work_dir, RUNTIME)))
|
||||
execWithRedirect("/bin/ln", [disk_img,
|
||||
joinpaths(liveos_dir, "rootfs.img")])
|
||||
|
||||
rc = execWithRedirect("/bin/ln", [disk_img, joinpaths(liveos_dir, "rootfs.img")])
|
||||
if rc != 0:
|
||||
shutil.copy2(disk_img, joinpaths(liveos_dir, "rootfs.img"))
|
||||
|
||||
mksquashfs(joinpaths(work_dir, "runtime"),
|
||||
joinpaths(work_dir, RUNTIME), compression)
|
||||
remove(joinpaths(work_dir, "runtime"))
|
||||
|
Loading…
Reference in New Issue
Block a user