aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-05-26 22:15:16 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-24 11:05:26 +0100
commitf8c0359edc2ce740e13e874ea189770ff99d1525 (patch)
treeff4d10dd979bf3cf3f0964de00baca1b3030dfd4
parent9f9bcad51381887819d58ffdde2e41307d342473 (diff)
downloadopenembedded-core-f8c0359edc2ce740e13e874ea189770ff99d1525.zip
openembedded-core-f8c0359edc2ce740e13e874ea189770ff99d1525.tar.gz
openembedded-core-f8c0359edc2ce740e13e874ea189770ff99d1525.tar.bz2
populate-extfs.sh: keep file timestamps
Fix populate-extfs.sh to keep file timestamps while generating the ext file systems. [YOCTO #6348] Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
index 23d97d3..26a8d89 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
@@ -36,7 +36,7 @@ DEBUGFS="debugfs"
fi
# Only stat once since stat is a time consuming command
- STAT=$(stat -c "TYPE=\"%F\";DEVNO=\"0x%t 0x%T\";MODE=\"%f\";U=\"%u\";G=\"%g\"" "$FILE")
+ STAT=$(stat -c "TYPE=\"%F\";DEVNO=\"0x%t 0x%T\";MODE=\"%f\";U=\"%u\";G=\"%g\";AT=\"%x\";MT=\"%y\";CT=\"%z\"" "$FILE")
eval $STAT
case $TYPE in
@@ -70,6 +70,14 @@ DEBUGFS="debugfs"
# Set uid and gid
echo "sif \"$TGT\" uid $U"
echo "sif \"$TGT\" gid $G"
+
+ # Set atime, mtime and ctime
+ AT=`echo $AT | cut -d'.' -f1 | sed -e 's#[- :]##g'`
+ MT=`echo $MT | cut -d'.' -f1 | sed -e 's#[- :]##g'`
+ CT=`echo $CT | cut -d'.' -f1 | sed -e 's#[- :]##g'`
+ echo "sif \"$TGT\" atime $AT"
+ echo "sif \"$TGT\" mtime $MT"
+ echo "sif \"$TGT\" ctime $CT"
done
# Handle the hard links.