dracut-lib: read multiple lines from $init/etc/cmdline

master
Harald Hoyer 2010-01-15 12:33:41 +01:00
parent 1b3bdcc1a6
commit 2dfdcbf4e7
2 changed files with 13 additions and 2 deletions

View File

@ -369,6 +369,9 @@ debug network scripts in dracut. Output is written to /tmp/
Any files found in /conf/conf.d/ will be sourced in the initramfs to Any files found in /conf/conf.d/ will be sourced in the initramfs to
set initial values. Command line options will override these values set initial values. Command line options will override these values
set in the configuration files. set in the configuration files.
.TP
.B /etc/cmdline
Can contain additional command line options.


.SH FILES .SH FILES
.TP .TP

View File

@ -2,7 +2,11 @@ getarg() {
set +x set +x
local o line local o line
if [ -z "$CMDLINE" ]; then if [ -z "$CMDLINE" ]; then
[ -e /etc/cmdline ] && read CMDLINE_ETC </etc/cmdline; if [ -e /etc/cmdline ]; then
while read line; do
CMDLINE_ETC="$CMDLINE_ETC $line";
done </etc/cmdline;
fi
read CMDLINE </proc/cmdline; read CMDLINE </proc/cmdline;
CMDLINE="$CMDLINE $CMDLINE_ETC" CMDLINE="$CMDLINE $CMDLINE_ETC"
fi fi
@ -32,7 +36,11 @@ getargs() {
set +x set +x
local o line found local o line found
if [ -z "$CMDLINE" ]; then if [ -z "$CMDLINE" ]; then
[ -e /etc/cmdline ] && read CMDLINE_ETC </etc/cmdline; if [ -e /etc/cmdline ]; then
while read line; do
CMDLINE_ETC="$CMDLINE_ETC $line";
done </etc/cmdline;
fi
read CMDLINE </proc/cmdline; read CMDLINE </proc/cmdline;
CMDLINE="$CMDLINE $CMDLINE_ETC" CMDLINE="$CMDLINE $CMDLINE_ETC"
fi fi