2 # By Chih-Wei Huang <cwhuang@linux.org.tw>
3 # Last updated 2009/07/18
5 # License: GNU Public License
6 # We explicitely grant the right to use the scripts
7 # with Android-x86 project.
10 # An auto detect function provided by kinneko
14 echo 'dev2mod() { while read dev; do case $dev in' > $tmp
15 sort -r /lib/modules/`uname -r`/modules.alias | \
16 sed -n 's/^alias *\([^ ]*\) *\(.*\)/\1)modprobe \2;;/p' >> $tmp
17 echo 'esac; done; }' >> $tmp
19 cat /sys/bus/*/devices/*/modalias | dev2mod
22 # FB0DEV: framebuffer driver
25 # SNDDEV: sound driver
26 # CAMDEV: camera driver
27 # PREDEV: any module the drivers depend on but can't be loaded automatically
31 # common for all Eee PC models
32 [ -c /dev/fb0 ] || FB0DEV=i915
33 PREDEV=snd-hda-codec-realtek
37 board=`cat /sys/class/dmi/id/product_name`
38 # assume Eee PC models
58 UVESA_MODE=${UVESA_MODE:-1366x768}
64 UVESA_MODE=${UVESA_MODE:-1024x600}
78 SNDDEV="snd-sb16 isapnp=0 irq=5"
95 grep -q "$1" /sys/class/dmi/id/uevent
100 check_product ASUSTeK && get_asus_info && return 0
101 check_product Acer.*AO && get_ao_info && return 0
102 check_product VirtualBox && get_vbox_info && return 0
103 check_product QEMU && get_qemu_info && return 0
104 check_product VMware && get_vmware_info && return 0
110 if [ $? -eq 0 ]; then
114 [ -n "$FB0DEV" -a -z "$UVESA_MODE" ] && modprobe $FB0DEV
115 [ -n "$LANDEV" ] && modprobe $LANDEV
116 [ -n "$WIFDEV" ] && modprobe $WIFDEV
117 [ -n "$SNDDEV" ] && modprobe $SNDDEV
118 [ -n "$CAMDEV" ] && modprobe $CAMDEV
124 [ -d /proc/asound/card0 ] || modprobe snd-dummy
125 [ -c /dev/fb0 ] || modprobe uvesafb mode_option=${UVESA_MODE:-800x600}-16 ${UVESA_OPTION:-mtrr=3 scroll=ywrap}