usbmon for Android

跟風遠走 提交于 2019-12-10 19:23:14

问题


I want to analyze usb communication out of my device: SGS4. I see everywhere that the usbmon is needed to be configured and compiled into the kernel. Afaik, this module is not built in the android linux system.

I don't have much experience in compiling a kernel but if this is necessary I would do it.

Can you tell what are the steps of doing so? i.e. how to compile the linux kernel for android such that it would include the usbmon module.


回答1:


I suppose you have access to:

  • the sources of the version of Linux currently running on your device. It could be available on Samsung repository if you haven't changed the ROM. Or some custom kernels if you use an alternative ROM (CyanogenMod, Clockwork, ...).
  • an ARM toolchain that is proven suited to compile this kernel.
  • the version of AOSP currently running on your device (e.g. 4.1.2). You need it to build the new boot.img out of the newly compiled kernel image zImage.

You need to enable CONFIG_USB_MON in linux:

$ make CROSS_COMPILE=your/armeabi/toolchain/path menuconfig

type / to search then enter USB_MON. The flag is located in:

-> Device Drivers
  -> USB support (USB_SUPPORT [=n])
    -> Support for Host-side USB (USB [=n])

Then rebuild:

$ make CROSS_COMPILE=your/armeabi/toolchain/path zImage

Then please read Documentation/usb/usbmon.txt directly from your kernel sources. It should teach you everything you need to know.



来源:https://stackoverflow.com/questions/24117094/usbmon-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!