|
|
|
@ -94,8 +94,8 @@ int ensure_path_mounted(const std::string& path) {
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
printf("ensure_path_mounted sdcard, path=%s \n", path.c_str());
|
|
|
|
|
v = volume_for_mount_point(path);
|
|
|
|
|
if (!v) {
|
|
|
|
|
v = volume_for_mount_point(path);
|
|
|
|
|
if (!v) {
|
|
|
|
|
printf("ensure_path_mounted No fstab entry for path=%s \n", path.c_str());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
@ -135,17 +135,24 @@ int ensure_path_mounted(const std::string& path) {
|
|
|
|
|
if(NULL == blk_device){
|
|
|
|
|
blk_device = (v->blk_device).c_str();
|
|
|
|
|
}
|
|
|
|
|
int result = mount((v->blk_device).c_str(), (v->mount_point).c_str(), (v->fs_type).c_str(),
|
|
|
|
|
|
|
|
|
|
LOG(ERROR) << "trying mount "<< v->blk_device << " to exfat.";
|
|
|
|
|
int result = mount((v->blk_device).c_str(), (v->mount_point).c_str(), (char*)"exfat",
|
|
|
|
|
MS_NOATIME | MS_NODEV | MS_NODIRATIME, (char*)"");
|
|
|
|
|
if (result == 0) return 0;
|
|
|
|
|
|
|
|
|
|
result = mount((v->blk_device).c_str(), (v->mount_point).c_str(), (v->fs_type).c_str(),
|
|
|
|
|
MS_NOATIME | MS_NODEV | MS_NODIRATIME, (char*)"shortname=mixed,utf8");
|
|
|
|
|
if (result == 0) return 0;
|
|
|
|
|
printf("v->blk_device is %s\n",(v->blk_device).c_str());
|
|
|
|
|
printf("v->blk_device is %s to vfat.\n",(v->blk_device).c_str());
|
|
|
|
|
LOG(ERROR) << "trying mount fs"<< blk_device << " to vfat.";
|
|
|
|
|
LOG(ERROR) << "trying mount "<< blk_device << " to vfat.";
|
|
|
|
|
if (blk_device !=nullptr){
|
|
|
|
|
result = mount(blk_device, (v->mount_point).c_str(), (v->fs_type).c_str(),
|
|
|
|
|
MS_NOATIME | MS_NODEV | MS_NODIRATIME, (char*)"shortname=mixed,utf8");
|
|
|
|
|
if (result == 0) return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("blk_device is %s\n",blk_device);
|
|
|
|
|
LOG(ERROR) << "trying mount "<< v->blk_device << " to ntfs.";
|
|
|
|
|
printf("v->blk_device is %s to ntfs.\n",(v->blk_device).c_str());
|
|
|
|
@ -168,7 +175,7 @@ int ensure_path_mounted(const std::string& path) {
|
|
|
|
|
MS_NOATIME | MS_NODEV | MS_NODIRATIME, (char*)"shortname=mixed,utf8");
|
|
|
|
|
if (result == 0) return 0;
|
|
|
|
|
|
|
|
|
|
LOG(ERROR) << "tring mount " << sec_dev << " ntfs.";
|
|
|
|
|
LOG(ERROR) << "trying mount " << sec_dev << " ntfs.";
|
|
|
|
|
printf("v->blk_device is %s to ntfs.\n",sec_dev);
|
|
|
|
|
result = mount(sec_dev, (v->mount_point).c_str(), (char*)"ntfs",
|
|
|
|
|
MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
|
|
|
|
|