2 # By Chih-Wei Huang <cwhuang@linux.org.tw>
3 # Last updated 2009/12/10
5 # License: GNU Public License
6 # We explicitely grant the right to use the scripts
7 # with Android-x86 project.
16 # An auto detect function provided by kinneko
20 echo 'dev2mod() { while read dev; do case $dev in' > $tmp
21 sort -r /lib/modules/`uname -r`/modules.alias | \
22 sed -n 's/^alias *\([^ ]*\) *\(.*\)/\1)modprobe \2;;/p' >> $tmp
23 echo 'esac; done; }' >> $tmp
25 cat /sys/bus/*/devices/*/modalias | dev2mod
28 find_network_dev_name()
31 rmline=`grep -n "#REMOVE FROM HERE" init.rc|cut -d':' -f1`
32 rmline=`expr $rmline + 1`
33 sed -i -e "$rmline,\$d" init.rc
34 for netdev in `ls /sys/class/net`; do
35 if [ $netdev = "lo" -o $netdev = "wmaster0" ]; then
38 w=/sys/class/net/$netdev
39 if [ -d $w/wireless -o -d $w/phy80211 ]; then
40 if [ $wififound -eq 0 ]; then
41 sed -i "s|\(^ *service wpa_supplicant .*\)\(-i.*\)\( -c.*$\)|\1-i $netdev\3|g" init.rc
45 echo "service dhcpcd$netdev /system/bin/dhcpcd $netdev" >> init.rc
46 echo " group system dhcp" >> init.rc
47 echo " disabled" >>init.rc
48 echo " oneshot" >> init.rc
54 if [ -n "$FOUND" ]; then
55 BTDEV="bnep rfcomm sco btusb"
56 for m in $PREDEV $EXTMOD $BTDEV; do
59 [ -n "$FB0DEV" -a -z "$UVESA_MODE" ] && modprobe $FB0DEV
60 [ -n "$LANDEV" ] && modprobe $LANDEV
61 [ -n "$WIFDEV" ] && modprobe $WIFDEV
62 [ -n "$SNDDEV" ] && modprobe $SNDDEV
63 [ -n "$CAMDEV" ] && modprobe $CAMDEV
69 [ -c /dev/video0 ] || modprobe vivi
70 [ -d /proc/asound/card0 ] || modprobe snd-dummy
71 [ -c /dev/fb0 ] || modprobe uvesafb mode_option=${UVESA_MODE:-800x600}-16 ${UVESA_OPTION:-mtrr=3 scroll=redraw}