ISO/configs/syslinux-iso/overlay/etc/archiso/functions
Gerardo Exequiel Pozzi 90981fa285 [syslinux-iso] fix regression in kernel_cmdline helper function
Fix FS#24203.

Regression introduced at commit b171f8f11f

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-05-10 20:43:53 -03:00

21 lines
536 B
Bash

# vim: set ft=sh:
# 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 $(/bin/cat /proc/cmdline); do
case "${param}" in
$1=*) echo "${param##*=}"; return 0 ;;
$1) return 0 ;;
*) continue ;;
esac
done
[ -n "${2}" ] && echo "${2}"
return 1
}