summaryrefslogtreecommitdiff
path: root/overlay/etc/archiso/functions
diff options
context:
space:
mode:
Diffstat (limited to 'overlay/etc/archiso/functions')
-rw-r--r--overlay/etc/archiso/functions14
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
}