Blame 0079-explicitly-verify-bash-version.patch

Harald Hoyer 55891e
From d239b550ce9e6a80342965974c4503cfde736fbe Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: Michal Soltys <soltys@ziu.info>
Harald Hoyer 55891e
Date: Mon, 10 Oct 2011 23:58:05 +0200
Harald Hoyer 55891e
Subject: [PATCH] explicitly verify bash version
Harald Hoyer 55891e
Harald Hoyer 55891e
A simple check in main dracut script.
Harald Hoyer 55891e
Harald Hoyer 55891e
Signed-off-by: Michal Soltys <soltys@ziu.info>
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut |    7 +++++++
Harald Hoyer 55891e
 1 files changed, 7 insertions(+), 0 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut b/dracut
Harald Hoyer 55891e
index 63d4ea6..205f5d1 100755
Harald Hoyer 55891e
--- a/dracut
Harald Hoyer 55891e
+++ b/dracut
Harald Hoyer 55891e
@@ -418,6 +418,13 @@ else
Harald Hoyer 55891e
     exit 1
Harald Hoyer 55891e
 fi
Harald Hoyer 55891e
 
Harald Hoyer 55891e
+# Verify bash version, curret minimum is 3.1
Harald Hoyer 55891e
+if (( ${BASH_VERSINFO[0]} < 3 ||
Harald Hoyer 55891e
+    ( ${BASH_VERSINFO[0]} == 3 && ${BASH_VERSINFO[1]} < 1 ) )); then
Harald Hoyer 55891e
+    dfatal 'You need at least Bash 3.1 to use dracut, sorry.'
Harald Hoyer 55891e
+    exit 1
Harald Hoyer 55891e
+fi
Harald Hoyer 55891e
+
Harald Hoyer 55891e
 dracutfunctions=$dracutbasedir/dracut-functions
Harald Hoyer 55891e
 export dracutfunctions
Harald Hoyer 55891e