From: Simo Leone <leone.simo@gmail.com> - Rename cmdline_param to kernel_cmdline - Move to /etc/rc.d/functions.d where it belongs --- configs/syslinux-iso/overlay/etc/archiso/functions | 12 ------------ configs/syslinux-iso/overlay/etc/rc.d/archiso | 1 - .../overlay/etc/rc.d/functions.d/archiso | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 13 deletions(-) delete mode 100644 configs/syslinux-iso/overlay/etc/archiso/functions create mode 100644 configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso diff --git a/configs/syslinux-iso/overlay/etc/archiso/functions b/configs/syslinux-iso/overlay/etc/archiso/functions deleted file mode 100644 index fdd48f4..0000000 --- a/configs/syslinux-iso/overlay/etc/archiso/functions +++ /dev/null @@ -1,12 +0,0 @@ -# vim: set ft=sh: - -cmdline_param () -{ - for param in ${CMDLINE}; do - case "${param}" in - $1=*) echo "${param##*=}"; return ;; - *) continue ;; - esac - done - [ -n "${2}" ] && echo "${2}" -} diff --git a/configs/syslinux-iso/overlay/etc/rc.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/archiso index 435152a..6f26f98 100755 --- a/configs/syslinux-iso/overlay/etc/rc.d/archiso +++ b/configs/syslinux-iso/overlay/etc/rc.d/archiso @@ -1,7 +1,6 @@ # vim: set ft=sh: . /etc/rc.conf . /etc/rc.d/functions -. /etc/archiso/functions scan_network () diff --git a/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso new file mode 100644 index 0000000..02b41cf --- /dev/null +++ b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso @@ -0,0 +1,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 +} -- 1.7.4.1