Blame 0018-dracut-functions.sh-create-initdir-if-it-does-not-ex.patch

Harald Hoyer c4a5a0
From eaa924b69ed10c49ab99ed2f064337dff1ce41b7 Mon Sep 17 00:00:00 2001
Harald Hoyer c4a5a0
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer c4a5a0
Date: Sat, 30 Jun 2012 12:46:55 +0200
Harald Hoyer c4a5a0
Subject: [PATCH] dracut-functions.sh: create $initdir, if it does not exist
Harald Hoyer c4a5a0
Harald Hoyer c4a5a0
---
Harald Hoyer c4a5a0
 dracut-functions.sh |    4 ++++
Harald Hoyer c4a5a0
 1 file changed, 4 insertions(+)
Harald Hoyer c4a5a0
Harald Hoyer c4a5a0
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer c4a5a0
index 80b022f..eabbb0d 100755
Harald Hoyer c4a5a0
--- a/dracut-functions.sh
Harald Hoyer c4a5a0
+++ b/dracut-functions.sh
Harald Hoyer c4a5a0
@@ -28,6 +28,10 @@ if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then
Harald Hoyer c4a5a0
     DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
Harald Hoyer c4a5a0
 fi
Harald Hoyer c4a5a0
 
Harald Hoyer c4a5a0
+if [[ $initdir ]] && ! [[ -d $initdir ]]; then
Harald Hoyer c4a5a0
+    mkdir -p "$initdir"
Harald Hoyer c4a5a0
+fi
Harald Hoyer c4a5a0
+
Harald Hoyer c4a5a0
 # Generic substring function.  If $2 is in $1, return 0.
Harald Hoyer c4a5a0
 strstr() { [[ $1 = *$2* ]]; }
Harald Hoyer c4a5a0