RK3399更改U盘挂载路径

需求是多个U盘插入只识别第一个插入的,SD卡除外
先参考RK提供的补丁

https://download.csdn.net/download/qq_26571463/12497672

vim device/rockchip/rk3399/fstab.rk30board.bootmode.emmc

#sdcard
-#/devices/platform/fe320000.dwmmc/mmc_host* auto auto +defaults voldmanaged=sdcard1:auto,encryptable=userdata
/devices/platform/fe320000.dwmmc/mmc_host* /mnt/external_sd vfat defaults voldmanaged=external_sd:auto
#for usb2.0
-#/devices/platform/.usb auto vfat defaults voldmanaged=usb:auto

-#/devices/platform/fe380000.usb /mnt/usb_storage vfat defaults voldmanaged=usb_storage:auto
-#/devices/platform/fe3c0000.usb /mnt/usb_storage2 vfat defaults voldmanaged=usb_storage2:auto

+/devices/platform/fe380000.usb/* /mnt/usb_storage vfat defaults voldmanaged=usb:auto
-#/devices/platform/fe380000.usb/usb2/2-1/2-1.1/2-1.1:1.0/* +/mnt/usb_storage vfat defaults voldmanaged=usb:auto
/devices/platform/fe3c0000.usb/* /mnt/usb_storage2 vfat defaults voldmanaged=usb:auto

vim system/vold/VolumeManager.cpp
U盘插拔的事件上来的eventPath此变量会是以sda sdb sdc这种结尾,sd卡上传的事件是mmc这种结尾的
void VolumeManager::handleBlockEvent(NetlinkEvent *evt)
case NetlinkEvent::Action::kAdd: {
for (auto source : mDiskSources) {
if (source->matches(eventPath)
增加判断

        if (source->matches(eventPath) && (path.find("sda")!= path.npos || path.find("mmc")!= path.npos)) {

OVER

你可能感兴趣的:(RK3399更改U盘挂载路径)