Fixed cmdline_param(), used in rc.conf

Turns out /proc gets mounted after rc.conf is sourced for the first time,
so /proc/cmdline isn't such a great place to be getting parameters from
in rc.conf. Use CMDLINE env variable instead, which is set to mostly the
same thing (well the part we care about, at the least).

Also cmdline_param wasn't breaking out of the loop properly.

Signed-off-by: Simo Leone <simo@archlinux.org>
This commit is contained in:
Simo Leone 2007-10-06 21:13:17 -05:00 committed by Dan McGee
parent 5fa747b6cb
commit 8dea2b65fc

View File

@ -2,10 +2,9 @@
cmdline_param ()
{
read cmdline < /proc/cmdline
for param in ${cmdline}; do
for param in ${CMDLINE}; do
case "${param}" in
$1=*) echo "${param##*=}"; break ;;
$1=*) echo "${param##*=}"; return ;;
*) continue ;;
esac
done