diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-23 06:48:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-26 06:19:41 +0000 |
commit | bcc5a38b9849411a880d8b65771b30042aa7ce62 (patch) | |
tree | 622fe753005caeb20e589a4de881d07659d69b43 | |
parent | 6bf18b127f96ec98cc603ecf36c24313cf028c97 (diff) | |
download | mkinitfs-bcc5a38b9849411a880d8b65771b30042aa7ce62.tar.bz2 mkinitfs-bcc5a38b9849411a880d8b65771b30042aa7ce62.tar.xz |
init: improbe boot param parsing
We need to support things like acpi_osi="!Windows 2006"
-rwxr-xr-x | initramfs-init.in | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/initramfs-init.in b/initramfs-init.in index 572d0e2..f8827a0 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -98,18 +98,22 @@ unpack_apkovl() { # 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 |