Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,666 Members 39,930 Now Online
XDA Developers Android and Mobile Development Forum

Best way to get USB host mass storage working?

Tip us?
 
alvinhochun
Old
#1  
alvinhochun's Avatar
Senior Member - OP
Thanks Meter 180
Posts: 160
Join Date: Oct 2010
Default Best way to get USB host mass storage working?

I am using Neo V official build 4.1.B.0.431 (ICS 4.0.4), rooted, unlocked bootloader (doesn't seem to matter)

I've downloaded the kernel source code, compiled the `usb-storage.ko` module, and placed it on `/system/lib/modules/drivers/usb/storage/`.

I've also changed `/system/etc/vold.fstab`, added this line:
Code:
dev_mount usb /mnt/usbstor auto /devices/platform/msm_hsusb_host.0
Then I restarted the phone.

After that, I typed the commands (using root) in shell:
Code:
mount -o remount,rw /
insmod /system/lib/modules/drivers/usb/storage/usb-storage.ko
cd /mnt
mkdir usbstor
Then I plugged in the OTG cable with a USB Flash Drive.


The storage is successfully mounted (by vold, I think), as I can verify in Root Explorer. I don't have photos so can't verify whether media scanner can detect it.

But in Settings->Storage it didn't appear. Seems that the Settings app don't support. I cannot unmount it using GUI, so when I remove the storage it warns me about that.

Are there any ways to get the Settings app to show my USB storage so that I can unmount via GUI?

Also how to automatically `insmod` and create `/mnt/usbstor` when startup? I won't bother editing ramdisk, but anything under `/system` is fine. I saw a few shell scripts under `/system`, are they fine to use?
kadukarashutosh7 Old
#2  
Guest
Thanks Meter 0
Posts: n/a
Download USB otg from market. It's for both, arc s & neo/ neo v.

Use it with caution it may burn your motherboard.... o_O

Sent from my MT11i using xda app-developers app
 
alvinhochun
Old
#3  
alvinhochun's Avatar
Senior Member - OP
Thanks Meter 180
Posts: 160
Join Date: Oct 2010
Fine. I didn't use any piece of compiled binary anywhere else, but I've done the following:

1. insmod and create mountpoint using `/system/etc/pre_hw_config.sh`
2. edited `res/xml/storage_list.xml` in `framework-res.apk`.

Now the USB storage shows up in system storage settings. The name showed "USB storage" though it still shows "mount USB". I can normally use it now.

It seems to be better than using 3rd-party applications.
 
Pretorian187
Old
#4  
Pretorian187's Avatar
Member
Thanks Meter 37
Posts: 73
Join Date: Nov 2012
Location: Beamtown

 
DONATE TO ME
Quote:
Originally Posted by alvinhochun View Post
I am using Neo V official build 4.1.B.0.431 (ICS 4.0.4), rooted, unlocked bootloader (doesn't seem to matter)

I've downloaded the kernel source code, compiled the `usb-storage.ko` module, and placed it on `/system/lib/modules/drivers/usb/storage/`.

I've also changed `/system/etc/vold.fstab`, added this line:
Code:
dev_mount usb /mnt/usbstor auto /devices/platform/msm_hsusb_host.0
Then I restarted the phone.

After that, I typed the commands (using root) in shell:
Code:
mount -o remount,rw /
insmod /system/lib/modules/drivers/usb/storage/usb-storage.ko
cd /mnt
mkdir usbstor
Then I plugged in the OTG cable with a USB Flash Drive.


The storage is successfully mounted (by vold, I think), as I can verify in Root Explorer. I don't have photos so can't verify whether media scanner can detect it.

But in Settings->Storage it didn't appear. Seems that the Settings app don't support. I cannot unmount it using GUI, so when I remove the storage it warns me about that.

Are there any ways to get the Settings app to show my USB storage so that I can unmount via GUI?

Also how to automatically `insmod` and create `/mnt/usbstor` when startup? I won't bother editing ramdisk, but anything under `/system` is fine. I saw a few shell scripts under `/system`, are they fine to use?

Hi Alvin,

Im having big issues with enabling USB Host mode as well (phone does not find any usb devices such as usb mouse or a pendrive), so I would greatly appreciate your help in finding the root of this problem. Here are the details and what I tried so far:

1. Im running on a rooted GT-i8530, leaked 4.1.2 rom with busybox installed
2. android.hardware.usb.host.xml permissions xml file exists in etc/permissions and just mentiones the apache license
3. Running USB host diagnostics I got:

Android API
Claims support yes
classes found yes
device detected no

Rooted API

Claims support N/A
Device detected N/A

Kernel
Claims support Yes
Device detected No

Verdict OS support No
3rd party apps No

4. I tried 3 different USB cables (original samsung one with female to female connector), another original micro usb to female plug, and a no name one,
5. No mouse nor usb sticks (fat32) seem to be recognized (below 200 ma)
6. Had a look into the storage folder and I can see a folder for external sd, sdcard and UsbA-UsbF. These Usb folders have no permissions set ( like rwx). Looking into the mnt folder I can see the same but in there the Usb folders have rwx permissions set.
7. I was thinking to manually mount the pendrive but when type into terminal as su: ls /dev/block there are no devices (like sda, sdb, sdc) or partitions ( sda1...) mentioned. So I didnt even try commands such as mount -t vfat /dev/block/sda1 /mnt/sdcard/usb...Only mmccblk, loop, dm, ram, vold, param is mentioned on dev/block
8. In vold.fstab all usb(a-f) folders including paths are visible

Now I read your post regarding the usb-storage.ko module and I guess thats whats missing for the phone in order to recognize any usb devices. Reason why I think that is because once I connect a usb device I cant even see any sdas or sda1s...In system/lib/modules the folder driver is non existent but I found in sys/module/usb_storage/drivers a usb-storage file but its not a .ko What do you think? I would appreciate your thoughts on that one..
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes