Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15310039
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类:

2008-09-17 11:57:23

《让blob成功执行tftp下载zImage》
不使用串口作为console登录手机,使用adb shell作为登录手机的console,
我们连接手机的usb线,上电默认为usb net功能,其ip地址为192.168.100.2,
1.添加自动枚举usbnet在pc端对应的ip地址
add IP addr auto-config in /etc/network/interfaces:
●luther@gliethttp:~$ sudo vim /etc/network/interfaces 添加如下内容
 auto usb0
 iface usb0 inet static
        address 192.168.100.1
        netmask 255.255.255.0
        network 192.168.0.0
        up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &
        up echo 1 > /proc/sys/net/ipv4/ip_forward &
        up iptables -P FORWARD ACCEPT &
        down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &
●luther@gliethttp:~$ sudo vim /etc/hosts 添加如下内容
192.168.100.2 phone
●luther@gliethttp:~$ sudo vim /etc/udev/rules.d/85-ifupdown.rules 将最后几行改成这样修正ubuntu8.04的bug
 # Bring devices up and down only if they're marked auto.
 # Use start-stop-daemon so we don't wait on dhcp
 ACTION=="add",          RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"
 LABEL="net_end"
 ACTION=="remove",       RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}"
如果tftp数据传输不能正常进行了,那么可以执行
luther@gliethttp:~$ sudo /etc/init.d/xinetd restart
luther@gliethttp:~$ lsusb 这样显示一下usb设备,usb设备就重新被识别了
之后tftp就又可以正常使用了.
如果还不行,那么重新拔插一次usb cable就一定ok了.
另外
lsmod看是否加载了g_ether.ko,如果没有,那么先把rmmod g_file_storage,然后
insmod g_ether.ko就可以了[luther.gliethttp].

2.使用adb作为登录手机的shell,这样就可以不用再单独接串口线了
in Ubuntu Host PC:
$ export ADBHOST=
And then run adb in ADB folder:
$ adb kill-server
$ adb start-server
$ adb shell
可以写一个脚本,把上面的东西都放进去,
比如:
luther@gliethttp:~$ sudo vim 
lsusb >/dev/null
export ADBHOST=192.168.100.2
adb kill-server
adb start-server
adb shell

3.好了,可以通过一跟usb线登录到手机shell,进行各种操作了,很方便[luther.gliethttp]

对于usb连接的android2.2
如果你是user编译需要在开发板上执行start adbd,然后sudo adb shell
如果你是eng那么直接sudo adb shell即可(第一次使用sudo,之后就可以不用sudo了,或者sudo adb root,然后就可以直接adb shell了,但是公司的usb480Mbps发现,只能使用sudo adb shell或者sudo adb root,以前在~/.android/adb_usb添加vid然后sudo adb usb正统的方式竟然不能用了,不知道杂整的)
阅读(6808) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

wqhl.mark2009-01-06 17:04:27

主机端是windows的不知道有没有过尝试,我现在主机端是windows的,用的RNDIS,终端用的g_ether,双方能ping通。要把android移到目标板上,想使用adb跟踪android启动过程以解决移植过程中的问题,板上运行adbd,但 adb总是不行,说找不到激活的设备或没有server在运行。不知道你遇到此种情况没?大家可以交流下!