Harald Hoyer 55891e
From 59f288ce631a7793755d16ee26fef0355098d33a Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 55891e
Date: Fri, 2 Sep 2011 09:01:47 +0200
Harald Hoyer 55891e
Subject: [PATCH] dracut: cp with sparse
Harald Hoyer 55891e
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut           |    2 +-
Harald Hoyer 55891e
 dracut-functions |    2 +-
Harald Hoyer 55891e
 2 files changed, 2 insertions(+), 2 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut b/dracut
Harald Hoyer 55891e
index fd36805..0e930c7 100755
Harald Hoyer 55891e
--- a/dracut
Harald Hoyer 55891e
+++ b/dracut
Harald Hoyer 55891e
@@ -650,7 +650,7 @@ if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
Harald Hoyer 55891e
     done
Harald Hoyer 55891e
 fi
Harald Hoyer 55891e
 
Harald Hoyer 55891e
-if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
Harald Hoyer 55891e
+if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \
Harald Hoyer 55891e
     $compress > "$outfile"; ); then
Harald Hoyer 55891e
     dfatal "dracut: creation of $outfile failed"
Harald Hoyer 55891e
     exit 1
Harald Hoyer 55891e
diff --git a/dracut-functions b/dracut-functions
Harald Hoyer 55891e
index 507f0c3..b11e37c 100755
Harald Hoyer 55891e
--- a/dracut-functions
Harald Hoyer 55891e
+++ b/dracut-functions
Harald Hoyer 55891e
@@ -317,7 +317,7 @@ inst_simple() {
Harald Hoyer 55891e
         inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
Harald Hoyer 55891e
     fi
Harald Hoyer 55891e
     ddebug "Installing $_src"
Harald Hoyer 55891e
-    cp -pfL "$_src" "${initdir}$target" 
Harald Hoyer 55891e
+    cp --sparse=always -pfL "$_src" "${initdir}$target" 
Harald Hoyer 55891e
 }
Harald Hoyer 55891e
 
Harald Hoyer 55891e
 # find symlinks linked to given library file