summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-05-05 16:40:06 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-13 22:10:06 +0100
commit5c1a6a8f81212f9e53291842f2fab66fbf4b8681 (patch)
treede13b9d1fbe367957c1bdf9094b95e13eb249e33
parenta51996d6846033285951b91c730b586ede7bc6b7 (diff)
downloadpoky-5c1a6a8f81212f9e53291842f2fab66fbf4b8681.tar.gz
classes/image: Use xargs to set file timestamps
Instead of having find directly invoke touch for each file in the root file system, pass a list to xargs for batching. This significantly reduces the number of times the touch program is invoked and speeds up the do_image task time: PKG TASK ABSDIFF RELDIFF CPUTIME1 -> CPUTIME2 my-image do_image -45.3s -94.2% 48.1s -> 2.8s Cumulative cputime: -44.3s -92.3% 00:48.1 (48.1s) -> 00:03.7 (3.7s) (From OE-Core rev: 2538a566f01f79537f8a94d93ac02588d6c239ec) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 15c65f90a3aa1e98c2beab2539403157df1fca08) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 79c487ea18..98513ddf08 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -662,7 +662,7 @@ reproducible_final_image_task () {
662 fi 662 fi
663 # Set mtime of all files to a reproducible value 663 # Set mtime of all files to a reproducible value
664 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS" 664 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
665 find ${IMAGE_ROOTFS} -exec touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS {} \; 665 find ${IMAGE_ROOTFS} -print0 | xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS
666 fi 666 fi
667} 667}
668 668