Learn Android 4.0.3 source code, SD card, USB flash drive, and other automatic mounting configurations together with cainiao

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.