I always thought that the automatic mounting of Android SD card is implemented in Vold, and its configuration file is easily found on the Internet which is system/etc/vold. in fstab, the configuration file is Mount, which is generally as follows:
Dev_mount sdcard/mnt/sdcard 3/devices/platform/sc65-sdhci.0/mmc_host/mmc0/mmc0: 0001/block/mmcblk0 nonremovable, encryptable
For android4.0.3, the automatic mounting seems to be different. You only need to find the node, mmcblk0, or the SDA of the USB flash disk, which is much simpler. You only need to change the above configuration to the following one and then it will be automatically mounted.
Dev_mount sdcard/mnt/sdcard Auto/block/mmcblk0 nonremovable, encryptabledev_mount sdcard/NT/sdcard/mnt/sdcard Auto/block/SDA/sda1
In this example, android4.0.3 source code only supports mobile disks and SD cards in the fat format. You can find a fat. cpp in the system/vold directory. There is one sentence.
Rc = Mount (fapath, mountpoint, "vfat", flags, mountdata );
In fact, you can modify the source code on the Internet to support mounting in other formats, that is, read the super block first, and then correspond to different formats based on the characteristics of the format, and then mount it.