Chinaunix首页 | 论坛 | 博客
  • 博客访问: 481539
  • 博文数量: 51
  • 博客积分: 1056
  • 博客等级: 少尉
  • 技术积分: 676
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-10 22:53
文章存档

2018年(2)

2017年(1)

2013年(2)

2012年(9)

2011年(36)

2010年(1)

分类: 嵌入式

2011-08-13 15:14:59

闲来无事,不如加班,顺手解决一个bug
没啥技术含量,所以才放心写篇blog

公司自制android手机不能模拟成gadget u盘,报错
  1. D/VoldCmdListener( 981): volume share /mnt/sdcard ums
  2. E/Vold ( 981): Unable to open ums lunfile (No such file or directory)
  3. D/VoldConnector( 1046): RCV <- {406 volume operation failed (No such file or directory)}
  4. D/VoldConnector( 1046): RSP <- {406 volume operation failed (No such file or directory)}
  5. E/MountService( 1046): Failed to share/unshare
  6. E/MountService( 1046): com.android.server.NativeDaemonConnectorException: Cmd {volume share /mnt/sdcard ums} failed with code 406 : {volume operation failed (No such file or directory)}
  7. E/MountService( 1046): at com.android.server.NativeDaemonConnector.doCommand(NativeDaemonConnector.java:247)
  8. E/MountService( 1046): at com.android.server.MountService.doShareUnshareVolume(MountService.java:366)
  9. E/MountService( 1046): at com.android.server.MountService.access$100(MountService.java:51)
  10. E/MountService( 1046): at com.android.server.MountService$UmsEnableCallBack.handleFinished(MountService.java:167)
  11. E/MountService( 1046): at com.android.server.MountService$MountServiceHandler.handleMessage(MountService.java:270)
  12. E/MountService( 1046): at android.os.Handler.dispatchMessage(Handler.java:99)
  13. E/MountService( 1046): at android.os.Looper.loop(Looper.java:123)
  14. E/MountService( 1046): at android.os.HandlerThread.run(HandlerThread.java:60)
  15. ^C
跟踪到./system/vold/VolumeManager.cpp 中有2处
  1. if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file",
  2.                    O_WRONLY)) < 0) {
  3.         SLOGE("Unable to open ums lunfile (%s)", strerror(errno));
  4.         return -1;
  5.     }
检查发现/sys/devices/platform/usb_mass_storage/lun0/file 这玩意还真没有
折腾一圈,觉得生成这个文件的USB_ANDROID_ADB_UMS驱动不会有问题
在/sys下执行find . -name  lun0 ,揪出来真正的位置
/sys/devices/platform/s3c-hsotg/gadget/lun0/file

修改VolumeManager.cpp ,收工


阅读(3141) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~