summaryrefslogtreecommitdiff
path: root/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso
blob: 02b41cf4aa363b080b4bc67bd860b03d2d95a978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# vim: set ft=sh:

# kernel_cmdline <param>
# 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
#
kernel_cmdline ()
{
    for param in $(/bin/cat /proc/cmdline); do
        case "${param}" in
            $1=*) echo "${param##*=}"; return 0 ;;
            $1) return 0 ;;
            *) continue ;;
        esac
    done

    return 1
}