Android 的shell真是鳥到不行.功能超陽春.
現在教各位安裝busybox到Android的環境中來解決這個問題
1.Download BusyBox -> 這個不用偶教吧 :)
2.
cd busybox-1.15.1
make menuconfig
設定BusyBox為Static link
BusyBox Settings -> Build Options -> Build BusyBox as a static binary (no shared libs)
設定安裝路徑到Android root file system
BusyBox Settings -> Installation Options -> BusyBox Installation Prefix
${HOME}/S3C6410/android_cupcake_smdk6410/opensource_cupcake_0424_opencore203/out/target/product/smdk6410/system/busybox
Config functions you need...
make
make install
3.Go to Android root file system
cd ${HOME}/S3C6410/android_cupcake_smdk6410/opensource_cupcake_0424_opencore203/out/target/product/smdk6410/root
修改 init.rc 使busybox正常運作
# export PATH /sbin:/system/sbin:/system/bin:/system/xbin
export PATH /bin:/system/busybox/sbin:/system/busybox/usr/bin:/system/busybox/usr/sbin:/sbin:/system/sbin:/system/bin:/system/xbin
使用busybox提供的shell
## Daemon processes to be run by init.
##
#service console /system/bin/sh
service console /system/busybox/bin/sh
console
4.編輯 /etc/inittab
cd ${HOME}/S3C6410/android_cupcake_smdk6410/opensource_cupcake_0424_opencore203/out/target/product/smdk6410/
產生 system/etc/inittab 內容如下
::sysinit:/etc/init.d/rcS
ttySAC0::askfirst:/system/busybox/bin/sh
5.編輯 /etc/init.d/rcS
mkdir system/etc/init.d
產生 system/etc/init.d/rcS 內容如下
#!/bin/sh
echo "Processing etc/init.d/rc.S"
echo "Starting mdevd"
echo /system/busybox/sbin/mdev > /proc/sys/kernel/hotplug
/system/busybox/sbin/mdev -s
/system/busybox/sbin/ifconfig eth0 192.168.168.209 netmask 255.255.255.0
/system/busybox/usr/sbin/inetd
/system/busybox/usr/sbin/telnetd -l /bin/login
echo "Start Android ..."
/init
設定權限為可執行
chmod 755 system/etc/init.d/rcS
5.1 Create device node
sudo mknod root/dev/tty1 c 4 1
sudo mknod root/dev/tty2 c 4 2
sudo mknod root/dev/tty3 c 4 3
sudo mknod root/dev/tty4 c 4 4
sudo mknod root/dev/tty5 c 4 5
sudo mknod root/dev/null c 1 3
sudo mknod root/dev/ttySAC0 c 204 64
cd root/dev
ln -s ttySAC0 console
cd ../..
5.2 Symbolic link
為了讓busybox啟動時找的到 /etc 目錄
cd root
ln -s system/etc etc
cd ..
為了讓busybox啟動時找的到 /bin 目錄
cd root
ln -s system/busybox/bin bin
cd ..
建立linuxrc
cd root
ln -s system/busybox/linuxrc linuxrc
cd ..
6.busybox ftpd
編輯 system/etc/inetd.conf
21 stream tcp nowait root ftpd ftpd -w -v /
產生 system/etc/passwd
system/etc/group
system/etc/services
system/etc/resolv.conf
7.複製system目錄到root file system
8.重新打包Android root file system放到target就可以了
9.kernel param fix
修改 init=/init 為 init=/linuxrc
使得busybox會先被系統執行
10.附記
Android support busybox有點小複雜因為Android本身就有shell.
目前這樣的作法不會覆蓋到Android binary code.是比較好的作法.
system boot會先run busybox,大致流程是
/linuxrc -> /etc/inittab -> /etc/init.d/rcS -> Run ash -> Run /init to start Android -> /init.rc
透過init.rc設定PATH環境變數讓busybox command為優先.
2010年4月15日 星期四
2010年4月14日 星期三
OMAP3530 USB Wifi - RALINK RT73
1.Download 2009_0713_RT73_Linux_STA_Drv1.1.0.3 from ralink web site
2.Build driver.
cp Makefile.6 Makefile
Patch Makefile (Fix LINUX_SRC as yours)
--- Makefile.6 2009-07-13 02:32:22.000000000 +0800
+++ Makefile 2010-04-14 19:41:21.000000000 +0800
@@ -2,8 +2,9 @@
# Module Name: Makefile
# Abstract: Makefile for rt73 linux driver on kernel series 2.6
######################################################################
-PLATFORM=PC
+#PLATFORM=PC
#PLATFORM=CMPC
+PLATFORM=BeagleBoard
#Enable for wpa_supplicant's spcific driver "driver_ralink.c", default enabled.
HAS_RALINK_WPA_SUPPLICANT_SUPPORT=y
@@ -40,6 +41,9 @@
ifeq ($(PLATFORM),CMPC)
LINUX_SRC = /home/fonchi/vendor/kernel-default-2.6.21/linux-2.6.21
endif
+ifeq ($(PLATFORM),BeagleBoard)
+LINUX_SRC = ${HOME}/BeagleBoard/kernel
+endif
EXTRA_CFLAGS += -I$(LINUX_SRC)/include
3.make all
4.Copy rt73.ko to root file system /etc/Wireless/RT73STA/rt73.ko
5.Booting target
6.Get it work
# insmod /etc/Wireless/RT73STA/rt73.ko
usbcore: registered new interface driver rt73
#
# usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=148f, idProduct=2573
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: 802.11 bg WLAN
usb 1-2: Manufacturer: Ralink
usb 1-2: configuration #1 chosen from 1 choice
idVendor = 0x148f, idProduct = 0x2573
rausb0 (rt73): not using net_device_ops yet
# iwconfig
lo no wireless extensions.
usb0 no wireless extensions.
rausb0 RT73 WLAN ESSID:off/any Nickname:""
Mode:Auto Frequency=2.412 GHz
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=0/100 Signal level:-121 dBm Noise level:-111 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
# iwpriv
lo no private ioctls.
usb0 no private ioctls.
rausb0 Available private ioctls :
set (8BE2) : set 1024 char & get 0
show (8BF3) : set 1024 char & get 0
stat (8BE9) : set 1024 char & get 1024 char
get_site_survey (8BED) : set 1024 char & get 1024 char
get_RaAP_Cfg (8BEF) : set 1024 char & get 0
auth (8BE7) : set 1 int & get 0
enc (8BE8) : set 1 int & get 0
wpapsk (8BEA) : set 64 char & get 0
psm (8BEB) : set 1 int & get 0
# ifconfig rausb0 up
=> usb_rtusb_open
# iwlist rausb0 scan
rausb0 Scan completed :
Cell 01 - Address: 00:24:01:41:CA:97
Mode:Managed
ESSID:"Bendi"
Channel:1
Encryption key:on
Bit Rates:0 kb/s
Cell 02 - Address: 00:90:CC:DD:6E:AC
Mode:Managed
ESSID:"3F_S/W_AP"
Channel:4
Encryption key:on
Bit Rates:0 kb/s
Cell 03 - Address: 00:19:5B:25:7E:BE
Mode:Managed
ESSID:"26962315"
Channel:6
Encryption key:on
Bit Rates:4 Mb/s
Cell 04 - Address: 00:26:5A:40:C6:EE
Mode:Managed
ESSID:"dlink"
Channel:11
Encryption key:on
Bit Rates:4 Mb/s
# iwconfig rausb0 essid 3F_S/W_AP
# iwconfig rausb0 mode managed
# iwpriv rausb0 set AuthMode=WPAPSK
# iwpriv rausb0 set EncrypType=TKIP
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
iwpriv rausb0 set WPAPSK=MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
0289131323
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
7.USB EHCI with USB hub Problem...
hub 1-0:1.0: port 2 disabled by hub (EMI?), re-enabling...
usb 1-2: USB disconnect, address 5
usb 1-2.1: USB disconnect, address 6
usb 1-2.1.3: USB disconnect, address 8
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
unregister_netdev()
usb 1-2.3: USB disconnect, address 7
ehci-omap ehci-omap.0: force halt; handhake d8064814 0000c000 00000000 -> -110
http://markmail.org/message/og4ts5gcn7if4v4l#query:disabled%20by%20hub%20(EMI%3F)%20beagleboard+page:1+mid:xl2txfnz7gvar65u+state:results
確定是H/W issue. BeagleBoard C2/C3都中
2.Build driver.
cp Makefile.6 Makefile
Patch Makefile (Fix LINUX_SRC as yours)
--- Makefile.6 2009-07-13 02:32:22.000000000 +0800
+++ Makefile 2010-04-14 19:41:21.000000000 +0800
@@ -2,8 +2,9 @@
# Module Name: Makefile
# Abstract: Makefile for rt73 linux driver on kernel series 2.6
######################################################################
-PLATFORM=PC
+#PLATFORM=PC
#PLATFORM=CMPC
+PLATFORM=BeagleBoard
#Enable for wpa_supplicant's spcific driver "driver_ralink.c", default enabled.
HAS_RALINK_WPA_SUPPLICANT_SUPPORT=y
@@ -40,6 +41,9 @@
ifeq ($(PLATFORM),CMPC)
LINUX_SRC = /home/fonchi/vendor/kernel-default-2.6.21/linux-2.6.21
endif
+ifeq ($(PLATFORM),BeagleBoard)
+LINUX_SRC = ${HOME}/BeagleBoard/kernel
+endif
EXTRA_CFLAGS += -I$(LINUX_SRC)/include
3.make all
4.Copy rt73.ko to root file system /etc/Wireless/RT73STA/rt73.ko
5.Booting target
6.Get it work
# insmod /etc/Wireless/RT73STA/rt73.ko
usbcore: registered new interface driver rt73
#
# usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=148f, idProduct=2573
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: 802.11 bg WLAN
usb 1-2: Manufacturer: Ralink
usb 1-2: configuration #1 chosen from 1 choice
idVendor = 0x148f, idProduct = 0x2573
rausb0 (rt73): not using net_device_ops yet
# iwconfig
lo no wireless extensions.
usb0 no wireless extensions.
rausb0 RT73 WLAN ESSID:off/any Nickname:""
Mode:Auto Frequency=2.412 GHz
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=0/100 Signal level:-121 dBm Noise level:-111 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
# iwpriv
lo no private ioctls.
usb0 no private ioctls.
rausb0 Available private ioctls :
set (8BE2) : set 1024 char & get 0
show (8BF3) : set 1024 char & get 0
stat (8BE9) : set 1024 char & get 1024 char
get_site_survey (8BED) : set 1024 char & get 1024 char
get_RaAP_Cfg (8BEF) : set 1024 char & get 0
auth (8BE7) : set 1 int & get 0
enc (8BE8) : set 1 int & get 0
wpapsk (8BEA) : set 64 char & get 0
psm (8BEB) : set 1 int & get 0
# ifconfig rausb0 up
=> usb_rtusb_open
# iwlist rausb0 scan
rausb0 Scan completed :
Cell 01 - Address: 00:24:01:41:CA:97
Mode:Managed
ESSID:"Bendi"
Channel:1
Encryption key:on
Bit Rates:0 kb/s
Cell 02 - Address: 00:90:CC:DD:6E:AC
Mode:Managed
ESSID:"3F_S/W_AP"
Channel:4
Encryption key:on
Bit Rates:0 kb/s
Cell 03 - Address: 00:19:5B:25:7E:BE
Mode:Managed
ESSID:"26962315"
Channel:6
Encryption key:on
Bit Rates:4 Mb/s
Cell 04 - Address: 00:26:5A:40:C6:EE
Mode:Managed
ESSID:"dlink"
Channel:11
Encryption key:on
Bit Rates:4 Mb/s
# iwconfig rausb0 essid 3F_S/W_AP
# iwconfig rausb0 mode managed
# iwpriv rausb0 set AuthMode=WPAPSK
# iwpriv rausb0 set EncrypType=TKIP
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
iwpriv rausb0 set WPAPSK=MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
0289131323
# MlmeAssocReqAction(): WPA/WPAPSK, Fill the ReqVarIEs with CipherTmp!
7.USB EHCI with USB hub Problem...
hub 1-0:1.0: port 2 disabled by hub (EMI?), re-enabling...
usb 1-2: USB disconnect, address 5
usb 1-2.1: USB disconnect, address 6
usb 1-2.1.3: USB disconnect, address 8
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
uvcvideo: Failed to resubmit video URB (-19).
unregister_netdev()
usb 1-2.3: USB disconnect, address 7
ehci-omap ehci-omap.0: force halt; handhake d8064814 0000c000 00000000 -> -110
http://markmail.org/message/og4ts5gcn7if4v4l#query:disabled%20by%20hub%20(EMI%3F)%20beagleboard+page:1+mid:xl2txfnz7gvar65u+state:results
確定是H/W issue. BeagleBoard C2/C3都中
訂閱:
文章 (Atom)