[Lunar-commits] CVS: moonbase/kernel/modutils/profile.d modutils-completion.rc, NONE, 1.1

Jaime Buffery nestu at lunar-linux.org
Thu Jan 13 12:59:18 UTC 2005


Update of /var/cvs/lunar/moonbase/kernel/modutils/profile.d
In directory espresso.foo-projects.org:/tmp/cvs-serv18556/modutils/profile.d

Added Files:
	modutils-completion.rc 
Log Message:
Moving modutils here to kernel with the new script wrappers scheme


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

UNAMER=`uname -r`

case $UNAMER in 
	2.4.* ) ;;
	* ) 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 '*.o' -exec basename {} \; | sed 's:.o$::'`" $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

# Not only does it set PATH, but also from here the mans set their search path, to the mans are automagically added too.
export PATH=$PATH:/lib/modutils/sbin/



More information about the Lunar-commits mailing list