projects
/
platform
/
upstream
/
dracut.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f47478b
)
dracut-lib add getargs()
author
Harald Hoyer
<harald@redhat.com>
Wed, 15 Jul 2009 16:24:01 +0000
(18:24 +0200)
committer
Harald Hoyer
<harald@redhat.com>
Wed, 15 Jul 2009 16:27:20 +0000
(18:27 +0200)
getargs returns a space seperated list with all values found for a key
on the kernel command line
modules.d/99base/dracut-lib.sh
patch
|
blob
|
history
diff --git
a/modules.d/99base/dracut-lib.sh
b/modules.d/99base/dracut-lib.sh
index
96ecbb0
..
a26949c
100644
(file)
--- a/
modules.d/99base/dracut-lib.sh
+++ b/
modules.d/99base/dracut-lib.sh
@@
-8,6
+8,20
@@
getarg() {
return 1
}
+getargs() {
+ local o line found
+ [ "$CMDLINE" ] || read CMDLINE </proc/cmdline;
+ for o in $CMDLINE; do
+ [ "$o" = "$1" ] && return 0
+ if [ "${o%%=*}" = "${1%=}" ]; then
+ echo -n "${o#*=} ";
+ found=1;
+ fi
+ done
+ [ -n "$found" ] && return 0
+ return 1
+}
+
source_all() {
local f
[ "$1" ] && [ -d "/$1" ] || return