# Before udev is started, parse kernel command word for module params of
# the form module.param=value and register them so they will be used when
# modules are loaded. Also check for modules to be blacklisted.

for word in $(cat /proc/cmdline); do
	var="${word%%=*}"
	val="${word#[!=]*=}"
	# grep out the normal variables with no dots
	varnodot="${var##*.*}"

	if [ "$var" ] && [ -z "$varnodot" ]; then
		module="${var%.*}"
		param="${var#[!.]*.}"
		if [ "$module" ] && [ "$param" ]; then
			if [ "$param" = blacklist ]; then
				register-module -b "$module"
			else
				register-module -p -a "$module" "$param=$val"
			fi
		fi
	fi
done
