# config-modules
#
# This service only runs on the 1st boot. It queries
# the hardware configuration to determine what
# hardware-specific modules need to be loaded.

start on runlevel 2

script

if [ `lspci | grep -ci poulsbo` -eq 0 ]; then
   	
	/usr/sbin/update-upstart enable agp-modules

	# Explicitly run now since upstart won't know about the
	# task until next boot
	start agp-modules
else

	/usr/sbin/update-upstart enable psb-modules
	
	# Explicitly run now since upstart won't know about the
	# task until next boot
	start psb-modules
fi

if [ `lspci | grep -ci Broadcom` -eq 0 ]; then
	/usr/sbin/update-upstart enable atheros-modules
	
	# Explicitly run now since upstart won't know about the
	# task until next boot
	start atheros-modules
	
else
	/usr/sbin/update-upstart enable broadcom-modules
	
	# Explicitly run now since upstart won't know about the
	# task until next boot
	start broadcom-modules
fi

initctl emit modules-configured -n

end script
