Preserve timestamps when building fs image

Even when FS do not support owner/modes, preserve timestamps.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-05 04:48:09 +02:00 committed by Brian C. Lane
parent 876ec52215
commit e7f45d333f
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ def copytree(src, dest, preserve=True):
If preserve is False, uses cp -R (useful for modeless filesystems)
raises CalledProcessError if copy fails.'''
logger.debug("copytree %s %s", src, dest)
cp = ["cp", "-a"] if preserve else ["cp", "-R", "-L"]
cp = ["cp", "-a"] if preserve else ["cp", "-R", "-L", "--preserve=timestamps"]
cp += [join(src, "."), os.path.abspath(dest)]
runcmd(cp)