dracut/0005-dracut-functions.sh-instmods-replace-egrep-with-shel.patch

27 lines
938 B
Diff
Raw Normal View History

From 86191581d125b1373532593371fde767a56728a0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Sat, 25 Feb 2012 16:08:30 +0100
Subject: [PATCH] dracut-functions.sh: instmods(): replace egrep with shell
code
---
dracut-functions.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 9e9ee4e..81801e1 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1167,9 +1167,10 @@ instmods() {
return $_ret
}
+ local _filter_not_found='FATAL: Module .* not found.'
# Capture all stderr from modprobe to _fderr. We could use {var}>...
# redirections, but that would make dracut require bash4 at least.
eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \
- | egrep -v 'FATAL: Module .* not found.' | derror
+ | while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
return $?
}