diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-05-18 17:15:13 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-05-18 17:15:13 -0300 |
commit | 3a6288aaf80c172c2559e7623bb314a7e5d96db5 (patch) | |
tree | 8d0c694d0562441555054d4f120fd376d228d754 /overlay/etc/archiso/functions | |
parent | 9de4af841974c542bdb519b09633063a64c75391 (diff) |
This is the one (I hope...)
Diffstat (limited to 'overlay/etc/archiso/functions')
-rw-r--r-- | overlay/etc/archiso/functions | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/overlay/etc/archiso/functions b/overlay/etc/archiso/functions index fdd48f4..9fffdcb 100644 --- a/overlay/etc/archiso/functions +++ b/overlay/etc/archiso/functions @@ -1,12 +1,20 @@ # vim: set ft=sh: -cmdline_param () +# kernel_cmdline <param> <default> +# Looks for a parameter on the kernel's boot-time command line. +# +# returns: 0 if param was found. Also prints its value if it was a K=V param. +# 1 if it was not. Also prints value passed as <default> +# +kernel_cmdline () { - for param in ${CMDLINE}; do + for param in $(/bin/cat /proc/cmdline); do case "${param}" in - $1=*) echo "${param##*=}"; return ;; + $1=*) echo "${param##*=}"; return 0 ;; + $1) return 0 ;; *) continue ;; esac done [ -n "${2}" ] && echo "${2}" + return 1 } |