dracut/0079-explicitly-verify-bash-version.patch
2011-10-19 15:30:00 +02:00

31 lines
795 B
Diff

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