[Lunar-commits] CVS: moonbase/kernel/module-init-tools/profile.d module_init_tools-completion.rc, NONE, 1.1

Jaime Buffery nestu at lunar-linux.org
Thu Jan 13 13:06:44 UTC 2005


Update of /var/cvs/lunar/moonbase/kernel/module-init-tools/profile.d
In directory espresso.foo-projects.org:/tmp/cvs-serv19884/module-init-tools/profile.d

Added Files:
	module_init_tools-completion.rc 
Log Message:
Moved this here from utils. Now it is using the modutils-wrappers script
way of working


--- NEW FILE: module_init_tools-completion.rc ---
# Per kernel running:
# this is 2.6 code. If 2.6 is not running, just quit

UNAMER=`uname -r`

case $UNAMER in 
	2.6.* ) ;;
	* ) return 0;;
esac

# Turn on extended globbing
shopt -s extglob

_modprobe ()
{
	local cur
	cur=${COMP_WORDS[COMP_CWORD]}
	COMPREPLY=( $( compgen -W "`find /lib/modules/${UNAMER}/kernel/ -type f -name '*.ko' -exec basename {} \; | sed 's:.ko$::'`" $cur ))
}

complete -F _modprobe modprobe insmod

_rmmod ()
{
	local cur
	cur=${COMP_WORDS[COMP_CWORD]}
	COMPREPLY=( $( compgen -W "`cat /proc/modules | awk '{print $1}'`" $cur ))
}

complete -F _rmmod rmmod

# Doing this not only includes the binaries in the PATH but also makes the man automagically accesible too
export PATH="$PATH:/lib/module-init-tools/sbin:/lib/module-init-tools/bin"

return 0



More information about the Lunar-commits mailing list