Android 5.1 vold模块ntfs扩展

2023-12-24 12:50
文章标签 模块 android 扩展 ntfs 5.1 vold

本文主要是介绍Android 5.1 vold模块ntfs扩展,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

准备

需要下载ntfs-3g驱动包,并做相应修改,这个网上已经可以下载到修改好的包,本文最后也会附加。

为什么要移植

在Android原生代码中,只支持了FAT格式的挂载,并未支持NTFS格式的存储设备挂载。一般来说,在手机上并不需要实现这种功能,但是在机顶盒上,USB挂载却是必须的。那为了达到这种目的,一种比较便捷的解决办法就是移植现有的驱动以支持当前的系统,NTFS-3G在Android上无疑是一个可以使用的方案。
【疑问】如果我们不移植,有没有办法使用NTFS功能?其实也是可以的,或者说部分可以,我们在源码中进入Kernel目录下去执行Make menuconfig(海思平台在:Hi3796MV100-2015-2-3-CP058\device\hisilicon\bigfish\sdk\source\kernel\linux-3.10.y,Broadcom平台:kernel位于源码根目录下android\kernel\private\97xxx-bcm\linux),
make menuconfig界面如下:
这里写图片描述
继续:
这里写图片描述
把这些功能打开:
这里写图片描述
然后打开ntfs支持选项,重新编译内核,会生成一个ko文件,将编译的内核文件重新烧写到盒子中,在进入到device目录下去使用Mount命令手动挂在插入的usb节点同样可以达到挂在上的目的,但是这个也只能说试试而已,实际离开串口调试没法用。

移植

我们将下载的这个驱动源码放到Android系统源码的external目录下(Broadcom\android\external\ntfs-3g),然后执行mm编译会生成ntfs-3g和ntfsfix两个bin文件,我们把它拷贝到/system/bin下并修改相应权限重启机顶盒,即可以使用该功能(只是有了驱动基础,具体要实现当U盘挂载,仍然需要修改系统源码,主要是VOLD模块,后面说明)。

1.在Broadcom\android-5.1\system\vold添加Ntfs.h

#ifndef _NTFS_H
#define _NTFS_H#include <unistd.h>class Ntfs {
public:static int check(const char *fsPath);static int doMount(const char *fsPath, const char *mountPoint, bool ro,bool remount, int ownerUid, int ownerGid, int permMask,bool createLost);static int format(const char *fsPath, unsigned int numSectors);
};#endif

2.接着实现头文件:

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/mount.h>#include <linux/kdev_t.h>#define LOG_TAG "Vold"#include <cutils/log.h>
#include <cutils/properties.h>
#include <logwrap/logwrap.h>
#include "Ntfs.h"extern "C" int logwrap(int argc, const char **argv, int background);
extern "C" int mount(const char *, const char *, const char *, unsigned long, const void *);#define NTFS_3G_PATH "/system/bin/ntfs-3g"int Ntfs::check(const char *fsPath) {// no NTFS file system check is performed, always return trueSLOGI("Ntfs filesystem: Skipping fs checks\n");return 0;}int Ntfs::doMount(const char *fsPath, const char *mountPoint,bool ro, bool remount, int ownerUid, int ownerGid,int permMask, bool createLost) {int rc;unsigned long flags;char mountData[255];flags = MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_DIRSYNC;flags |= (ro ? MS_RDONLY : 0);flags |= (remount ? MS_REMOUNT : 0);
#if 0/** Note: This is a temporary hack. If the sampling profiler is enabled,* we make the SD card world-writable so any process can write snapshots.** TODO: Remove this code once we have a drop box in system_server.*/char value[PROPERTY_VALUE_MAX];property_get("persist.sampling_profiler", value, "");if (value[0] == '1') {SLOGW("The SD card is world-writable because the"" 'persist.sampling_profiler' system property is set to '1'.");permMask = 0;}sprintf(mountData,"uid=%d,gid=%d,fmask=%o,dmask=%o,nls=utf8",ownerUid, ownerGid, permMask, permMask);rc = mount(fsPath, mountPoint, "ntfs", flags, "");#else   SLOGE("mount ntfs block by ntfs-3g", fsPath);sprintf(mountData,"uid=%d,gid=%d,fmask=%o,dmask=%o,nls=utf8",ownerUid, ownerGid, permMask, permMask);const char* args[16];       args[0] = NTFS_3G_PATH;args[1] = fsPath;args[2] = mountPoint;args[3] = "-o";args[4] = mountData;args[5] = NULL;rc = logwrap(5, args, 1);
#endifif(rc) {SLOGE("%s appears to be a read only filesystem - retrying mount RO", fsPath);flags |= MS_RDONLY;rc = mount(fsPath, mountPoint, "ntfs", flags, "");}return rc;
}int Ntfs::format(const char *fsPath, unsigned int numSectors) {SLOGE("Format ntfs filesystem not supported\n");errno = EIO;return -1;
}

在上面的代码中,我们指定了ntfs-3g支持文件的目录:#define NTFS_3G_PATH "/system/bin/ntfs-3g"这个在前面已经说过了。
3.在Volume.cpp中添加:#include "Ntfs.h"
修改挂载和卸载的几个函数:

int Volume::mountVol(const char* devName) {//modify by dongqiang add paramdev_t deviceNodes[4];int n, i, rc = 0;char errmsg[255];int flags = getFlags();bool providesAsec = (flags & VOL_PROVIDES_ASEC) != 0;// TODO: handle "bind" style mounts, for emulated storagechar decrypt_state[PROPERTY_VALUE_MAX];char crypto_state[PROPERTY_VALUE_MAX];char encrypt_progress[PROPERTY_VALUE_MAX];property_get("vold.decrypt", decrypt_state, "");property_get("vold.encrypt_progress", encrypt_progress, "");/* Don't try to mount the volumes if we have not yet entered the disk password* or are in the process of encrypting.*/if ((getState() == Volume::State_NoMedia) ||((!strcmp(decrypt_state, "1") || encrypt_progress[0]) && providesAsec)) {snprintf(errmsg, sizeof(errmsg),"Volume %s %s mount failed - no media",getLabel(), getFuseMountpoint());mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeMountFailedNoMedia,errmsg, false);errno = ENODEV;return -1;} else if (getState() != Volume::State_Idle) {errno = EBUSY;if (getState() == Volume::State_Pending) {mRetryMount = true;}return -1;}n = getDeviceNodes((dev_t *) &deviceNodes, 4);if (!n) {SLOGE("Failed to get device nodes (%s)\n", strerror(errno));return -1;}/* If we're running encrypted, and the volume is marked as encryptable and nonremovable,* and also marked as providing Asec storage, then we need to decrypt* that partition, and update the volume object to point to it's new decrypted* block device*/property_get("ro.crypto.state", crypto_state, "");if (providesAsec &&((flags & (VOL_NONREMOVABLE | VOL_ENCRYPTABLE))==(VOL_NONREMOVABLE | VOL_ENCRYPTABLE)) &&!strcmp(crypto_state, "encrypted") && !isDecrypted()) {char new_sys_path[MAXPATHLEN];char nodepath[256];int new_major, new_minor;if (n != 1) {/* We only expect one device node returned when mounting encryptable volumes */SLOGE("Too many device nodes returned when mounting %s\n", getMountpoint());return -1;}if (cryptfs_setup_volume(getLabel(), MAJOR(deviceNodes[0]), MINOR(deviceNodes[0]),new_sys_path, sizeof(new_sys_path),&new_major, &new_minor)) {SLOGE("Cannot setup encryption mapping for %s\n", getMountpoint());return -1;}/* We now have the new sysfs path for the decrypted block device, and the* majore and minor numbers for it.  So, create the device, update the* path to the new sysfs path, and continue.*/snprintf(nodepath,sizeof(nodepath), "/dev/block/vold/%d:%d",new_major, new_minor);if (createDeviceNode(nodepath, new_major , new_minor)) {SLOGE("Error making device node '%s' (%s)", nodepath,strerror(errno));}// Todo: Either create sys filename from nodepath, or pass in bogus path so//       vold ignores state changes on this internal device.updateDeviceInfo(nodepath, new_major , new_minor);/* Get the device nodes again, because they just changed */n = getDeviceNodes((dev_t *) &deviceNodes, 4);if (!n) {SLOGE("Failed to get device nodes (%s)\n", strerror(errno));return -1;}}char finalPath[32] = {0x00};//add by dongqiang for (i = 0; i < n; i++) {char devicePath[255];sprintf(devicePath, "/dev/block/vold/%d:%d", /*major(deviceNodes[i])*/g_major,/*minor(deviceNodes[i])*/g_minor);//modify by dongqiang//add by dongqiang begin const char * path_prefix = "/mnt/media_rw/";const size_t len = strlen(path_prefix) + strlen(devName);char * path = new char[len+1];strcpy(path, path_prefix);strcat(path, devName);int errCode = mkdir(path, 0777);if(g_major == 179) {rmdir(path);}memset(finalPath, 0x00, sizeof(finalPath));if(strstr(devicePath, "179") != NULL) {strcpy(finalPath, "/mnt/media_rw/sdcard1/");} else {strcpy(finalPath, path);}delete(path);//add by dongqiang endSLOGI("%s being considered for volume %s\n", devicePath, getLabel());SLOGI("current mountpoint is %s, fuseMountPoint is %s", getMountpoint(), getFuseMountpoint());errno = 0;setState(Volume::State_Checking);
//add by dongqiang beginint permMask = providesAsec ? 0007 : 0002;bool isNtfsFS = true;        bool isFatFs = true;bool isExtFs = true;bool isExfatFs = true;if (isNtfsFS) {   SLOGI("devicePath:%s ,mountpoint:%s\n", devicePath, getMountpoint());if (Ntfs::doMount(devicePath, finalPath, false, false, AID_MEDIA_RW, AID_MEDIA_RW, permMask, true)) { SLOGE("%s failed to mount via NTFS (%s)\n", devicePath, strerror(errno));                isNtfsFS = false;            } else {                isFatFs = false;                isExtFs = false;                isExfatFs = false;            }        }if (isFatFs) { if (Fat::doMount(devicePath, finalPath, false, false, false,                AID_MEDIA_RW, AID_MEDIA_RW, permMask, true)) {                SLOGE("%s failed to mount via VFAT (%s)\n", devicePath, strerror(errno));                isFatFs = false; } else {                isExtFs = false;                isExfatFs = false;            }        }//add by dongqiang end      errno = 0;int gid;extractMetadata(devicePath);if (providesAsec && mountAsecExternal() != 0) {SLOGE("Failed to mount secure area (%s)", strerror(errno));umount(/*getMountpoint()*/finalPath);setState(Volume::State_Idle);return -1;}char service[64];snprintf(service, 64, "fuse_%s", getLabel());property_set("ctl.start", service);setState(Volume::State_Mounted);mCurrentlyMountedKdev = deviceNodes[i];return 0;}SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());setState(Volume::State_Idle);return -1;
}
int Volume::doUnmount(const char *path, bool force) {int retries = 10;if (mDebug) {SLOGD("Unmounting {%s}, force = %d", path, force);}while (retries--) {if (!umount(path) || errno == EINVAL || errno == ENOENT) {SLOGI("%s sucessfully unmounted", path);return 0;}int action = 0;if (force) {if (retries == 1) {action = 2; // SIGKILL} else if (retries == 2) {action = 1; // SIGHUP}}SLOGW("Failed to unmount %s (%s, retries %d, action %d)",path, strerror(errno), retries, action);Process::killProcessesWithOpenFiles(path, action);usleep(1000*1000);}errno = EBUSY;SLOGE("Giving up on unmount %s (%s)", path, strerror(errno));return -1;
}

移除挂载函数:

int Volume::unmountVol(bool force, bool revert, const char* devName) {//add the third param by dongqiangint i, rc;int flags = getFlags();bool providesAsec = (flags & VOL_PROVIDES_ASEC) != 0;
/*if (getState() != Volume::State_Mounted) {SLOGE("Volume %s unmount request when not mounted", getLabel());errno = EINVAL;return UNMOUNT_NOT_MOUNTED_ERR;}
*/setState(Volume::State_Unmounting);usleep(1000 * 1000); // Give the framework some time to reactchar service[64];snprintf(service, 64, "fuse_%s", getLabel());property_set("ctl.stop", service);/* Give it a chance to stop.  I wish we had a synchronous way to determine this... */sleep(3);// TODO: determine failure mode if FUSE times outif (providesAsec && doUnmount(Volume::SEC_ASECDIR_EXT, force) != 0) {SLOGE("Failed to unmount secure area on %s (%s)", getMountpoint(), strerror(errno));goto out_mounted;}//add by dongqiang beginif(strstr(devName, "mmcb")) {if (doUnmount(getFuseMountpoint(), force) != 0) {SLOGE("Failed to unmount %s (%s)", getFuseMountpoint(), strerror(errno));goto fail_remount_secure;}const char* path_pre = "/mnt/media_rw/";char* path = new char[strlen(path_pre) + strlen(devName)];strcpy(path, path_pre);strcat(path, devName);rmdir(path);delete(path);} else {const char* path_pre = "/mnt/media_rw/";char* path = new char[strlen(path_pre) + strlen(devName)];strcpy(path, path_pre);strcat(path, devName);if (doUnmount(path, force) != 0) {SLOGE("Failed to unmount %s (%s)", getFuseMountpoint(), strerror(errno));if(path != NULL) {delete(path);}goto fail_remount_secure;}int rtCode = rmdir(path);delete(path);}//add by dongqiang endif(strstr(devName, "mmcb")) {if (doUnmount(getMountpoint(), force) != 0) {SLOGE("Failed to unmount %s (%s)", getMountpoint(), strerror(errno));goto fail_remount_secure;}sleep(3);const char* path_pre = "/mnt/media_rw/";char* path = new char[strlen(path_pre) + strlen(devName)];strcpy(path, path_pre);strcat(path, devName);rmdir(path);delete(path);} else {const char* path_pre = "/mnt/media_rw/";char* path = new char[strlen(path_pre) + strlen(devName)];strcpy(path, path_pre);strcat(path, devName);if (doUnmount(path, force) != 0) {SLOGE("Failed to unmount %s (%s)", getMountpoint(), strerror(errno));if(path != NULL) {delete(path);}goto fail_remount_secure;}if(path != NULL) {rmdir(path);delete(path);}}SLOGI("%s unmounted successfully", getMountpoint());/* If this is an encrypted volume, and we've been asked to undo* the crypto mapping, then revert the dm-crypt mapping, and revert* the device info to the original values.*/if (revert && isDecrypted()) {cryptfs_revert_volume(getLabel());revertDeviceInfo();SLOGI("Encrypted volume %s reverted successfully", getMountpoint());}setUuid(NULL);setUserLabel(NULL);setState(Volume::State_Idle);mCurrentlyMountedKdev = -1;return 0;fail_remount_secure:if (providesAsec && mountAsecExternal() != 0) {SLOGE("Failed to remount secure area (%s)", strerror(errno));goto out_nomedia;}out_mounted:setState(Volume::State_Mounted);return -1;out_nomedia:setState(Volume::State_NoMedia);return -1;
}

如下函数中主要对全局变量g_major和g_minor进行初始化。

int Volume::createDeviceNode(const char *path, int major, int minor) {//add by dongqiang beging_major = major;g_minor = minor;//add by dongqiang endmode_t mode = 0660 | S_IFBLK;dev_t dev = (major << 8) | minor;if (mknod(path, mode, dev) < 0) {if (errno != EEXIST) {return -1;}}return 0;
}

4.在VolumeManager.cpp中做如下修改(2处):

int VolumeManager::mountVolume(const char *label) {Volume *v = lookupVolume(label);if (!v) {errno = ENOENT;return -1;}return v->mountVol(devName);//modify by dongqiang ---add param
}int VolumeManager::unmountVolume(const char *label, bool force, bool revert) {Volume *v = lookupVolume(label);if (!v) {errno = ENOENT;return -1;}if (v->getState() == Volume::State_NoMedia) {errno = ENODEV;return -1;}if (v->getState() != Volume::State_Mounted) {SLOGW("Attempt to unmount volume which isn't mounted (%d)\n",v->getState());errno = EBUSY;return UNMOUNT_NOT_MOUNTED_ERR;}cleanupAsec(v, force);return v->unmountVol(force, revert, NULL);//add the third param by dongqiang
}

5.在DirectVolume.cpp中修改如下:
①定义全局变量数组char nameForRm[32] = {0x00};


int DirectVolume::handleBlockEvent(NetlinkEvent *evt) {const char *dp = evt->findParam("DEVPATH");PathCollection::iterator  it;for (it = mPaths->begin(); it != mPaths->end(); ++it) {if ((*it)->match(dp)) {/* We can handle this disk */int action = evt->getAction();const char *devtype = evt->findParam("DEVTYPE");if (action == NetlinkEvent::NlActionAdd) {int major = atoi(evt->findParam("MAJOR"));int minor = atoi(evt->findParam("MINOR"));char nodepath[255];snprintf(nodepath,sizeof(nodepath), "/dev/block/vold/%d:%d",major, minor);if (createDeviceNode(nodepath, major, minor)) {SLOGE("Error making device node '%s' (%s)", nodepath,strerror(errno));}if (!strcmp(devtype, "disk")) {handleDiskAdded(dp, evt);} else handlePartitionAdded(dp, evt);}/* Send notification iff disk is ready (ie all partitions found) */if (getState() == Volume::State_Idle) {char msg[255];snprintf(msg, sizeof(msg),"Volume %s %s disk inserted (%d:%d)", getLabel(),getFuseMountpoint(), mDiskMajor, mDiskMinor);mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeDiskInserted,msg, false);}} else if (action == NetlinkEvent::NlActionRemove) {if (!strcmp(devtype, "disk")) {handleDiskRemoved(dp, evt);} else {handlePartitionRemoved(dp, evt);}} else if (action == NetlinkEvent::NlActionChange) {if (!strcmp(devtype, "disk")) {handleDiskChanged(dp, evt);} else {handlePartitionChanged(dp, evt);}} else {SLOGW("Ignoring non add/remove/change event");}return 0;}}errno = ENODEV;return -1;
}

处理分区添加:

void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt) {int major = atoi(evt->findParam("MAJOR"));int minor = atoi(evt->findParam("MINOR"));int part_num;const char *tmp = evt->findParam("PARTN");if (tmp) {part_num = atoi(tmp);} else {SLOGW("Kernel block uevent missing 'PARTN'");part_num = 1;}if (part_num > MAX_PARTITIONS || part_num < 1) {SLOGE("Invalid 'PARTN' value");return;}if (part_num > mDiskNumParts) {mDiskNumParts = part_num;}if (major != mDiskMajor) {SLOGE("Partition '%s' has a different major than its disk!", devpath);return;}
#ifdef PARTITION_DEBUGSLOGD("Dv:partAdd: part_num = %d, minor = %d\n", part_num, minor);
#endifif (part_num >= MAX_PARTITIONS) {SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS-1);} else {if ((mPartMinors[part_num - 1] == -1) && mPendingPartCount)mPendingPartCount--;mPartMinors[part_num -1] = minor;}if (!mPendingPartCount) {
#ifdef PARTITION_DEBUGSLOGD("Dv:partAdd: Got all partitions - ready to rock!");
#endifif (getState() != Volume::State_Formatting) {setState(Volume::State_Idle);if (mRetryMount == true) {mRetryMount = false;mountVol(evt->findParam("DEVNAME"));//modify by dongqiang ----add param}}} else {
#ifdef PARTITION_DEBUGSLOGD("Dv:partAdd: pending %d disk", mPendingPartCount);
#endif}
}

处理disk移除:

void DirectVolume::handleDiskRemoved(const char * /*devpath*/,NetlinkEvent *evt) {int major = atoi(evt->findParam("MAJOR"));int minor = atoi(evt->findParam("MINOR"));char msg[255];bool enabled;if (mVm->shareEnabled(getLabel(), "ums", &enabled) == 0 && enabled) {mVm->unshareVolume(getLabel(), "ums");}SLOGD("handleDiskRemoved, volume %s %s disk %d:%d removed\n", getLabel(), getMountpoint(), major, minor);snprintf(msg, sizeof(msg), "Volume %s %s disk removed (%d:%d)",getLabel(), getFuseMountpoint(), major, minor);mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeDiskRemoved,msg, false);setState(Volume::State_NoMedia);if(strstr(nameForRm, evt->findParam("DEVNAME"))) {const char * path_prefix = "/mnt/media_rw/";const size_t len = strlen(path_prefix) + strlen(nameForRm);char * path = new char[len+1];strcpy(path, path_prefix);strcat(path, nameForRm);SLOGD("dq>---------handleDiskRemoved-----path to remove: %s, name=%s", path, nameForRm);Volume::unmountVol(true, false, nameForRm);sleep(3);int code = rmdir(path);SLOGD("handleDiskRemoved,  now remove path: %s, error: %s", path, strerror(code));}
}

处理分区移除:

void DirectVolume::handlePartitionRemoved(const char * /*devpath*/,NetlinkEvent *evt) {int major = atoi(evt->findParam("MAJOR"));int minor = atoi(evt->findParam("MINOR"));char msg[255];int state;const char* devName = evt->findParam("DEVNAME");//modify by dongqiang begin const char * path_prefix = "/mnt/media_rw/";const size_t len = strlen(path_prefix) + strlen(devName);char * path = new char[len+1];strcpy(path, path_prefix);strcat(path, devName);memset(nameForRm, 0x00, sizeof(nameForRm));strcpy(nameForRm, devName);if(major == 179) {//179 sdcardSLOGD("Volume %s %s partition %d:%d removed\n", getLabel(), getMountpoint(), major, minor);} else {//usbSLOGD("Volume %s %s partition %d:%d removed\n", getLabel(), /*getMountpoint()*/path, major, minor);}
//modify by dongqiang end /** The framework doesn't need to get notified of* partition removal unless it's mounted. Otherwise* the removal notification will be sent on the Disk* itself*/state = getState();SLOGD("dq------current state: %d",state);if (state != Volume::State_Mounted && state != Volume::State_Shared) {SLOGE("state !=State_Mounted && state != State_Shared");Volume::unmountVol(true, false, devName);sleep(3);int code = rmdir(path);SLOGD("we now remove path: %s, error: %s", path, strerror(code));delete(path);return;}
//add by dongqiang beginif(path != NULL) {delete(path);}
//add by dongqiang end    if ((dev_t) MKDEV(major, minor) == mCurrentlyMountedKdev) {/** Yikes, our mounted partition is going away!*/bool providesAsec = (getFlags() & VOL_PROVIDES_ASEC) != 0;if (providesAsec && mVm->cleanupAsec(this, true)) {SLOGE("Failed to cleanup ASEC - unmount will probably fail!");}snprintf(msg, sizeof(msg), "Volume %s %s bad removal (%d:%d)",getLabel(), getFuseMountpoint(), major, minor);mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval,msg, false);if (Volume::unmountVol(true, false, evt->findParam("DEVNAME"))) {//add the third param by dongqiangSLOGE("Failed to unmount volume on bad removal (%s)", strerror(errno));// XXX: At this point we're screwed for now} else {SLOGD("Crisis averted");}} else if (state == Volume::State_Shared) {/* removed during mass storage */snprintf(msg, sizeof(msg), "Volume %s bad removal (%d:%d)",getLabel(), major, minor);mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval,msg, false);if (mVm->unshareVolume(getLabel(), "ums")) {SLOGE("Failed to unshare volume on bad removal (%s)",strerror(errno));} else {SLOGD("Crisis averted");}}
}

6.在Volume.h中修改如下:

//modify by dongqiang, add parameter
int mountVol(const char* devName);
//modify by dongqiang
int unmountVol(bool force, bool revert, const char* devName);//add the third param by dongqiang 

然后对代码进行重新编译,将生成的vold文件拷贝到/system/bin下运行。

附件

ntfs-3g驱动支持源码:
http://download.csdn.net/detail/foreversunshine/9616676
编译生成的bin文件:
ntfs-3g
http://download.csdn.net/detail/foreversunshine/9616678
ntfsfix
http://download.csdn.net/detail/foreversunshine/9616731

这篇关于Android 5.1 vold模块ntfs扩展的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/531843

相关文章

python: 多模块(.py)中全局变量的导入

文章目录 global关键字可变类型和不可变类型数据的内存地址单模块(单个py文件)的全局变量示例总结 多模块(多个py文件)的全局变量from x import x导入全局变量示例 import x导入全局变量示例 总结 global关键字 global 的作用范围是模块(.py)级别: 当你在一个模块(文件)中使用 global 声明变量时,这个变量只在该模块的全局命名空

深入探索协同过滤:从原理到推荐模块案例

文章目录 前言一、协同过滤1. 基于用户的协同过滤(UserCF)2. 基于物品的协同过滤(ItemCF)3. 相似度计算方法 二、相似度计算方法1. 欧氏距离2. 皮尔逊相关系数3. 杰卡德相似系数4. 余弦相似度 三、推荐模块案例1.基于文章的协同过滤推荐功能2.基于用户的协同过滤推荐功能 前言     在信息过载的时代,推荐系统成为连接用户与内容的桥梁。本文聚焦于

csu 1446 Problem J Modified LCS (扩展欧几里得算法的简单应用)

这是一道扩展欧几里得算法的简单应用题,这题是在湖南多校训练赛中队友ac的一道题,在比赛之后请教了队友,然后自己把它a掉 这也是自己独自做扩展欧几里得算法的题目 题意:把题意转变下就变成了:求d1*x - d2*y = f2 - f1的解,很明显用exgcd来解 下面介绍一下exgcd的一些知识点:求ax + by = c的解 一、首先求ax + by = gcd(a,b)的解 这个

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

Android平台播放RTSP流的几种方案探究(VLC VS ExoPlayer VS SmartPlayer)

技术背景 好多开发者需要遴选Android平台RTSP直播播放器的时候,不知道如何选的好,本文针对常用的方案,做个大概的说明: 1. 使用VLC for Android VLC Media Player(VLC多媒体播放器),最初命名为VideoLAN客户端,是VideoLAN品牌产品,是VideoLAN计划的多媒体播放器。它支持众多音频与视频解码器及文件格式,并支持DVD影音光盘,VCD影

科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl

Spring框架5 - 容器的扩展功能 (ApplicationContext)

private static ApplicationContext applicationContext;static {applicationContext = new ClassPathXmlApplicationContext("bean.xml");} BeanFactory的功能扩展类ApplicationContext进行深度的分析。ApplicationConext与 BeanF

android-opencv-jni

//------------------start opencv--------------------@Override public void onResume(){ super.onResume(); //通过OpenCV引擎服务加载并初始化OpenCV类库,所谓OpenCV引擎服务即是 //OpenCV_2.4.3.2_Manager_2.4_*.apk程序包,存

从状态管理到性能优化:全面解析 Android Compose

文章目录 引言一、Android Compose基本概念1.1 什么是Android Compose?1.2 Compose的优势1.3 如何在项目中使用Compose 二、Compose中的状态管理2.1 状态管理的重要性2.2 Compose中的状态和数据流2.3 使用State和MutableState处理状态2.4 通过ViewModel进行状态管理 三、Compose中的列表和滚动

Android 10.0 mtk平板camera2横屏预览旋转90度横屏拍照图片旋转90度功能实现

1.前言 在10.0的系统rom定制化开发中,在进行一些平板等默认横屏的设备开发的过程中,需要在进入camera2的 时候,默认预览图像也是需要横屏显示的,在上一篇已经实现了横屏预览功能,然后发现横屏预览后,拍照保存的图片 依然是竖屏的,所以说同样需要将图片也保存为横屏图标了,所以就需要看下mtk的camera2的相关横屏保存图片功能, 如何实现实现横屏保存图片功能 如图所示: 2.mtk