use cp --reflink=auto

saves some space, if the destination is on the same filesystem on some
filesystems
master
Harald Hoyer 2015-05-13 11:49:38 +02:00
parent 471439f564
commit 8cd8820547
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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


View File

@ -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