背景

  • Platform: IMX6Q
  • OS: Android5.1
  • Kernel: 3.14.52

Android5.1支持多个U盘挂载:

  1. device/xx/init.rc, 增加挂载点文件夹
    mkdir /mnt/media_rw/udisk1 0755 system system
    symlink /mnt/media_rw/udisk1 /storage/udisk1
    mkdir /mnt/media_rw/udisk2 0755 system system
    symlink /mnt/media_rw/udisk2 /storage/udisk2
  2. device/xx/overlay/frameworks/base/core/res/res/xml/storage_list.xml,增加storage元素:
    <storage android:mountPoint="/storage/udisk1"
    	android:storageDescription="@string/storage_usb"
    	android:primary="false"
    	android:removable="true" />
    <storage android:mountPoint="/storage/udisk2"
    	android:storageDescription="@string/storage_usb"
    	android:primary="false"
    	android:removable="true" />
  3. device/xx/fstab.freescale, 增加自动挂载:
    /devices/soc0/soc.0/2100000.aips-bus/2184000.usb/ci_hdrc.0 /mnt/media_rw/udisk1 vfat defaults voldmanaged=udisk1:auto
    /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1 /mnt/media_rw/udisk2 vfat defaults voldmanaged=udisk2:auto