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

26 lines
860 B
Diff
Raw Normal View History

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