Harald Hoyer 53e990
From 8e41fb1dfd47f99d374bf7190344400e6bb1d018 Mon Sep 17 00:00:00 2001
Harald Hoyer 53e990
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 53e990
Date: Fri, 22 Jun 2012 15:13:47 +0200
Harald Hoyer 53e990
Subject: [PATCH] dracut.sh: speedup "strip"
Harald Hoyer 53e990
Harald Hoyer 53e990
---
Harald Hoyer 53e990
 dracut.sh |   12 +++++-------
Harald Hoyer 53e990
 1 file changed, 5 insertions(+), 7 deletions(-)
Harald Hoyer 53e990
Harald Hoyer 53e990
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 53e990
index 5600ec0..cc3669a 100755
Harald Hoyer 53e990
--- a/dracut.sh
Harald Hoyer 53e990
+++ b/dracut.sh
Harald Hoyer 53e990
@@ -844,7 +844,7 @@ fi
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 # strip binaries
Harald Hoyer 53e990
 if [[ $do_strip = yes ]] ; then
Harald Hoyer 53e990
-    for p in strip grep find; do
Harald Hoyer 53e990
+    for p in strip xargs find; do
Harald Hoyer 53e990
         if ! type -P $p >/dev/null; then
Harald Hoyer 53e990
             derror "Could not find '$p'. You should run $0 with '--nostrip'."
Harald Hoyer 53e990
             do_strip=no
Harald Hoyer 53e990
@@ -853,12 +853,10 @@ if [[ $do_strip = yes ]] ; then
Harald Hoyer 53e990
 fi
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 if [[ $do_strip = yes ]] ; then
Harald Hoyer 53e990
-    for f in $(find "$initdir" -type f \
Harald Hoyer 53e990
-        \( -perm -0100 -or -perm -0010 -or -perm -0001 \
Harald Hoyer 53e990
-           -or -path '*/lib/modules/*.ko' \) ); do
Harald Hoyer 53e990
-        dinfo "Stripping $f"
Harald Hoyer 53e990
-        strip -g "$f" 2>/dev/null|| :
Harald Hoyer 53e990
-    done
Harald Hoyer 53e990
+    find "$initdir" -type f \
Harald Hoyer 53e990
+         \( -perm -0100 -or -perm -0010 -or -perm -0001 \
Harald Hoyer 53e990
+        -or -path '*/lib/modules/*.ko' \) -print0 \
Harald Hoyer 53e990
+        | xargs -0 strip -g 2>/dev/null
Harald Hoyer 53e990
 fi
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 type hardlink &>/dev/null && {