summaryrefslogtreecommitdiffstats
path: root/genimage.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2018-07-19 11:43:29 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2018-07-19 13:29:39 +0200
commit297a9c6300a5ced0547488688de3a07a11a629c7 (patch)
tree9a76e0185779bd2645a77961a5d7fe8c97fc54e8 /genimage.c
parent3452533c825121d2d6b2b80cd27758df1c51c610 (diff)
downloadgenimage-297a9c6300a5ced0547488688de3a07a11a629c7.tar.gz
genimage-297a9c6300a5ced0547488688de3a07a11a629c7.tar.xz
genimage: fix timestamp of mountpoint directories
After the mv/mkdir of the mountpoints the timestamps of the mountpoint and all parent dirs are changed. This patch adds a find/touch loop to fix the timestamp of all directories. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'genimage.c')
-rw-r--r--genimage.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/genimage.c b/genimage.c
index fadfc07..d7014cf 100644
--- a/genimage.c
+++ b/genimage.c
@@ -432,6 +432,16 @@ static int collect_mountpoints(void)
return ret;
}
+ /*
+ * After the mv/mkdir of the mountpoints the timestamps of the
+ * mountpoint and all parent dirs are changed. Fix that here.
+ */
+ ret = systemp(NULL,
+ "find '%s/root' -depth -type d -printf '%%P\\0' | xargs -0 -I {} touch -r '%s/{}' '%s/root/{}'",
+ tmppath(), rootpath(), tmppath());
+ if (ret)
+ return ret;
+
return 0;
}