Blame 0017-51-dracut-rescue.install-create-directory-if-it-does.patch

Harald Hoyer 22a1cb
From c0c6c74d99a06a4ccdc2ddc8849bbe073e5bcbce Mon Sep 17 00:00:00 2001
Harald Hoyer 22a1cb
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 22a1cb
Date: Wed, 13 Mar 2013 08:04:08 +0100
Harald Hoyer 22a1cb
Subject: [PATCH] 51-dracut-rescue.install: create directory, if it does not
Harald Hoyer 22a1cb
 exist
Harald Hoyer 22a1cb
Harald Hoyer 22a1cb
---
Harald Hoyer 22a1cb
 51-dracut-rescue.install | 4 +++-
Harald Hoyer 22a1cb
 1 file changed, 3 insertions(+), 1 deletion(-)
Harald Hoyer 22a1cb
Harald Hoyer 22a1cb
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
Harald Hoyer 22a1cb
index 94f064c..1c0a6e1 100755
Harald Hoyer 22a1cb
--- a/51-dracut-rescue.install
Harald Hoyer 22a1cb
+++ b/51-dracut-rescue.install
Harald Hoyer 22a1cb
@@ -61,7 +61,9 @@ case "$COMMAND" in
Harald Hoyer 22a1cb
 
Harald Hoyer 22a1cb
         [[ $dracut_rescue_image != "yes" ]] && exit 0
Harald Hoyer 22a1cb
 
Harald Hoyer 22a1cb
-        if ! cp --preserve "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
Harald Hoyer 22a1cb
+        [[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
Harald Hoyer 22a1cb
+
Harald Hoyer 22a1cb
+        if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
Harald Hoyer 22a1cb
             echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
Harald Hoyer 22a1cb
         fi
Harald Hoyer 22a1cb