summaryrefslogtreecommitdiffstats
path: root/meta/classes
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-06 08:41:26 +0100
commitad3879eb614cb0559d58685c66b86123c09e71e5 (patch)
tree8830604b056acd1bb58412c39e6e3ce9eec5b400 /meta/classes
parentc8e1aeebd854c3517db4a483f729424f10235e40 (diff)
downloadpoky-ad3879eb614cb0559d58685c66b86123c09e71e5.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: 15c65f90a3aa1e98c2beab2539403157df1fca08) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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 013455f492..353cc67175 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -657,7 +657,7 @@ reproducible_final_image_task () {
657 fi 657 fi
658 # Set mtime of all files to a reproducible value 658 # Set mtime of all files to a reproducible value
659 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS" 659 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
660 find ${IMAGE_ROOTFS} -exec touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS {} \; 660 find ${IMAGE_ROOTFS} -print0 | xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS
661 fi 661 fi
662} 662}
663 663