return VFS_Mount(tpath, mountpoint, "", "");
}
+int DiskTool_MkDir(const char *Directory)
+{
+ return -1;
+}
+
int DiskTool_Copy(const char *Source, const char *Destination)
{
int src = DiskTool_int_TranslateOpen(Source, VFS_OPENFLAG_READ);
if( Path[0] == '#' )
{
- if(Buffer)
+ len = strlen(Path+1);
+ if(Buffer) {
strcpy(Buffer, Path+1);
- return strlen(Path) - 1;
+ }
}
-
- if( colon )
+ else if( Path[0] == ':' )
+ {
+ len = strlen("/Devices/LVM/");
+ len += strlen(Path+1);
+ if(Buffer) {
+ strcpy(Buffer, "/Devices/LVM/");
+ strcat(Buffer, Path+1);
+ }
+ }
+ else if( colon )
{
const char *pos;
for(pos = Path; pos < colon; pos ++)
strncat(Buffer+strlen("/Mount/"), Path, colon - Path);
strcat(Buffer, colon + 1);
}
- return len;
}
+ else
+ {
+ native_path:
+ if( !gsWorkingDirectory[0] ) {
+ getcwd(gsWorkingDirectory, 1024);
+ }
-native_path:
-
- if( !gsWorkingDirectory[0] ) {
- getcwd(gsWorkingDirectory, 1024);
- }
-
- len = strlen("/Native");
- len += strlen( gsWorkingDirectory ) + 1;
- len += strlen(Path);
- if( Buffer ) {
- strcpy(Buffer, "/Native");
- strcat(Buffer, gsWorkingDirectory);
- strcat(Buffer, "/");
- strcat(Buffer, Path);
+ len = strlen("/Native");
+ len += strlen( gsWorkingDirectory ) + 1;
+ len += strlen(Path);
+ if( Buffer ) {
+ strcpy(Buffer, "/Native");
+ strcat(Buffer, gsWorkingDirectory);
+ strcat(Buffer, "/");
+ strcat(Buffer, Path);
+ }
}
return len;
}
if( strcmp("mount", argv[i]) == 0 || strcmp("-i", argv[i]) == 0 ) {
// Mount an image
if( argc - i < 3 ) {
- fprintf(stderr, "--image/-i takes 2 arguments (ident and path)\n");
+ fprintf(stderr, "mount takes 2 arguments (image and mountpoint)\n");
exit(-1);
}
- if( DiskTool_MountImage(argv[i+1], argv[i+2]) ) {
- fprintf(stderr, "Unable to mount '%s' as '%s'\n", argv[i+2], argv[i+1]);
+ if( DiskTool_MountImage(argv[i+2], argv[i+1]) ) {
+ fprintf(stderr, "Unable to mount '%s' as '%s'\n", argv[i+1], argv[i+2]);
break;
}
if( strcmp("mountlvm", argv[i]) == 0 ) {
if( argc - i < 3 ) {
- fprintf(stderr, "mountlvm takes 2 arguments (ident and path)\n");
+ fprintf(stderr, "mountlvm takes 2 arguments (iamge and ident)\n");
exit(-1);
}
- if( DiskTool_RegisterLVM(argv[i+1], argv[i+2]) ) {
- fprintf(stderr, "Unable to register '%s' as LVM '%s'\n", argv[i+2], argv[i+1]);
+ if( DiskTool_RegisterLVM(argv[i+2], argv[i+1]) ) {
+ fprintf(stderr, "Unable to register '%s' as LVM '%s'\n", argv[i+1], argv[i+2]);
break;
}