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>
(cherry picked from commit e7f45d333f)
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-05 04:48:09 +02:00 committed by Brian C. Lane
parent 376eda543c
commit d04d176cb4

View File

@ -271,7 +271,7 @@ def copytree(src, dest, preserve=True):
If preserve is False, uses cp -R (useful for modeless filesystems) If preserve is False, uses cp -R (useful for modeless filesystems)
raises CalledProcessError if copy fails.''' raises CalledProcessError if copy fails.'''
logger.debug("copytree %s %s", src, dest) 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)] cp += [join(src, "."), os.path.abspath(dest)]
runcmd(cp) runcmd(cp)