]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
use cp --reflink=auto
authorHarald Hoyer <harald@redhat.com>
Wed, 13 May 2015 09:49:38 +0000 (11:49 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 13 May 2015 10:02:10 +0000 (12:02 +0200)
saves some space, if the destination is on the same filesystem on some
filesystems

50-dracut.install
51-dracut-rescue-postinst.sh
51-dracut-rescue.install

index d05abb9a577922ddffac5740bda8fa63c2b5a729..38e672f72ac75b517ee27edd7adfa1bd6063acc7 100755 (executable)
@@ -12,7 +12,7 @@ case "$COMMAND" in
         if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
             # we found an initrd at the same place as the kernel
             # use this and don't generate a new one
-            cp "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
+            cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
                 && chown root:root "$BOOT_DIR_ABS/initrd" \
                 && chmod 0600 "$BOOT_DIR_ABS/initrd" \
                 && exit 0
index 23158552f55f7215cded5a6359790a9c2a03d389..67f5b7174b790f51bc092d3f878cc5b50bbf0eaf 100755 (executable)
@@ -57,7 +57,7 @@ if [[ ! -f $INITRDFILE ]]; then
 fi
 
 if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
-    cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
+    cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
     ((ret+=$?))
 fi
 
index 9abd9d73ecba64ec7dd5011b1ce6109742d064ef..9152218424df00de87511cf4b47d85d0f5901423 100755 (executable)
@@ -71,7 +71,7 @@ case "$COMMAND" in
 
         [[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
 
-        if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
+        if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
             echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
         fi