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 dhcpcdopts="-o domain_name_servers -BKL"
35 for netdev in `ls /sys/class/net`; do
36 if [ $netdev = "lo" -o $netdev = "wmaster0" ]; then
39 w=/sys/class/net/$netdev
40 if [ -d $w/wireless -o -d $w/phy80211 ]; then
41 if [ $wififound -eq 0 ]; then
42 sed -i "s|\(^ *service wpa_supplicant .*\)\(-i.*\)\( -c.*$\)|\1-i $netdev\3|g" init.rc
46 echo "service dhcpcd$netdev /system/bin/dhcpcd $dhcpcdopts $netdev" >> init.rc
47 echo -e " group system dhcp\n disabled\n oneshot\n" >> init.rc
53 if [ -n "$FOUND" ]; then
54 BTDEV="bnep rfcomm sco btusb"
55 for m in $PREDEV $EXTMOD $BTDEV; do
58 [ -n "$FB0DEV" -a -z "$UVESA_MODE" ] && modprobe $FB0DEV
59 [ -n "$LANDEV" ] && modprobe $LANDEV
60 [ -n "$WIFDEV" ] && modprobe $WIFDEV
61 [ -n "$SNDDEV" ] && modprobe $SNDDEV
62 [ -n "$CAMDEV" ] && modprobe $CAMDEV
68 [ -c /dev/video0 ] || modprobe vivi
69 [ -d /proc/asound/card0 ] || modprobe snd-dummy
70 [ -c /dev/fb0 ] || modprobe uvesafb mode_option=${UVESA_MODE:-800x600}-16 ${UVESA_OPTION:-mtrr=3 scroll=redraw}