ref: bcc5a38b9849411a880d8b65771b30042aa7ce62
parent: 6bf18b127f96ec98cc603ecf36c24313cf028c97
author: Natanael Copa <ncopa@alpinelinux.org>
date: Sat May 23 01:48:09 CDT 2009
init: improbe boot param parsing We need to support things like acpi_osi="!Windows 2006"
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -98,18 +98,22 @@
# gotta start from somewhere :)
echo "Alpine Init $VERSION"
-# read the kernel options
-for i in `cat /proc/cmdline` ; do
- case $i in
+# read the kernel options. We use eval set so we can handle things like
+# acpi_osi="!Windows 2006"
+eval set -- `cat /proc/cmdline`
+
+while [ $# -gt 0 ]; do
+ case "$1" in
s|single|1)
SINGLEMODE=yes ;;
modules=*)
- MODULES="`echo ${i#modules=} | tr ',' ' '`";;
+ MODULES="`echo ${1#modules=} | tr ',' ' '`";;
noautodetect)
AUTODETECT=no;;
- *=*) eval KOPT_$i ;;
- *) eval KOPT_$i=yes ;;
+ *=*) eval "KOPT_${1%%=*}='${1#*=}'" ;;
+ *) eval "KOPT_$(echo $1 | sed 's: :_:g')=yes" ;;
esac
+ shift
done
# start bootcharting if wanted