资源简介
android vold模块,支持多分区挂载,支持ntfs、exfat格式挂载,压缩包中的tools目录,是一些工具,就是为了支持ntfs、exfat格式的挂载,需要把这些可执行文件拷贝是小机的system/bin/目录下。
代码片段和文件信息
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LOG_TAG “VoldCmdListener“
#include
#include
#include
#include “CommandListener.h“
#include “VolumeManager.h“
#include “ResponseCode.h“
#include “Process.h“
#include “Xwarp.h“
#include “Loop.h“
#include “Devmapper.h“
#include “cryptfs.h“
CommandListener::CommandListener() :
frameworkListener(“vold“ true) {
registerCmd(new DumpCmd());
registerCmd(new VolumeCmd());
registerCmd(new AsecCmd());
registerCmd(new ObbCmd());
registerCmd(new StorageCmd());
registerCmd(new XwarpCmd());
registerCmd(new CryptfsCmd());
}
void CommandListener::dumpArgs(int argc char **argv int argObscure) {
char buffer[4096];
char *p = buffer;
memset(buffer 0 sizeof(buffer));
int i;
for (i = 0; i < argc; i++) {
unsigned int len = strlen(argv[i]) + 1; // Account for space
if (i == argObscure) {
len += 2; // Account for {}
}
if (((p - buffer) + len) < (sizeof(buffer)-1)) {
if (i == argObscure) {
*p++ = ‘{‘;
*p++ = ‘}‘;
*p++ = ‘ ‘;
continue;
}
strcpy(p argv[i]);
p+= strlen(argv[i]);
if (i != (argc -1)) {
*p++ = ‘ ‘;
}
}
}
SLOGD(“%s“ buffer);
}
CommandListener::DumpCmd::DumpCmd() :
VoldCommand(“dump“) {
}
int CommandListener::DumpCmd::runCommand(SocketClient *cli
int argc char **argv) {
cli->sendMsg(0 “Dumping loop status“ false);
if (Loop::dumpState(cli)) {
cli->sendMsg(ResponseCode::CommandOkay “Loop dump failed“ true);
}
cli->sendMsg(0 “Dumping DM status“ false);
if (Devmapper::dumpState(cli)) {
cli->sendMsg(ResponseCode::CommandOkay “Devmapper dump failed“ true);
}
cli->sendMsg(0 “Dumping mounted filesystems“ false);
FILE *fp = fopen(“/proc/mounts“ “r“);
if (fp) {
char line[1024];
while (fgets(line sizeof(line) fp)) {
line[strlen(line)-1] = ‘\0‘;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1000464 2012-12-26 20:17 tools\ntfs-3g.probe
文件 1170440 2012-12-26 20:17 tools\ntfs-3g
文件 1116992 2012-12-26 20:17 tools\mkntfs
文件 566264 2012-12-26 20:17 tools\mkfs.exfat
文件 553960 2012-12-26 20:17 tools\fsck.exfat
文件 734332 2012-12-26 20:17 tools\mount.exfat
文件 40656 2012-12-16 14:39 vold\VolumeManager.cpp
....... 2327 2012-11-12 20:40 vold\tests\VolumeManager_test.cpp
....... 832 2012-11-12 20:40 vold\tests\Android.mk
....... 2609 2012-11-12 20:40 vold\Netli
....... 839 2012-11-12 20:40 vold\VoldCommand.h
....... 1247 2012-11-12 20:40 vold\Netli
....... 20665 2012-11-20 17:16 vold\CommandListener.cpp
文件 1134 2012-12-04 11:08 vold\Fat.h
文件 1618 2013-01-05 18:34 vold\Netli
文件 2544 2012-11-14 20:26 vold\DirectVolume.h
文件 1321 2012-12-04 11:06 vold\Android.mk
....... 1049 2012-11-12 20:40 vold\Xwarp.h
....... 7519 2012-11-12 20:40 vold\Loop.cpp
....... 8515 2012-11-12 20:40 vold\Devmapper.cpp
文件 5076 2012-12-04 11:13 vold\VolumeManager.h
....... 4245 2012-11-12 20:40 vold\vdc.c
....... 1154 2012-11-12 20:40 vold\Asec.h
....... 732 2012-11-12 20:40 vold\VoldCommand.cpp
....... 6542 2012-11-12 20:40 vold\Process.cpp
....... 2239 2012-11-12 20:40 vold\Ext4.cpp
文件 441 2012-12-04 10:32 vold\Exfat.h
文件 3366 2012-12-04 10:32 vold\Ntfs.cpp
....... 4917 2012-11-12 20:40 vold\logwrapper.c
....... 2694 2012-11-12 20:40 vold\ResponseCode.h
............此处省略334个文件信息
评论
共有 条评论