* Removed obsolete disk_scanner test app.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34380 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
805b96da98
commit
beef46972c
@ -1,121 +0,0 @@
|
||||
// DiskScannerTest.cpp
|
||||
// run that program from the current/ top directory
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <disk_scanner.h>
|
||||
|
||||
// include the implementation if the disk_scanner functions
|
||||
#include "disk_scanner.cpp"
|
||||
|
||||
// the test code starts here
|
||||
|
||||
// print_session_info
|
||||
static
|
||||
void
|
||||
print_session_info(const char *prefix, const session_info &info)
|
||||
{
|
||||
printf("%soffset: %lld\n", prefix, info.offset);
|
||||
printf("%ssize: %lld\n", prefix, info.size);
|
||||
printf("%sblock size: %ld\n", prefix, info.logical_block_size);
|
||||
printf("%sindex: %ld\n", prefix, info.index);
|
||||
printf("%sflags: %lx\n", prefix, info.flags);
|
||||
}
|
||||
|
||||
// print_partition_info
|
||||
static
|
||||
void
|
||||
print_partition_info(const char *prefix, const extended_partition_info &info)
|
||||
{
|
||||
printf("%soffset: %lld\n", prefix, info.info.offset);
|
||||
printf("%ssize: %lld\n", prefix, info.info.size);
|
||||
printf("%sblock size: %ld\n", prefix, info.info.logical_block_size);
|
||||
printf("%ssession ID: %ld\n", prefix, info.info.session);
|
||||
printf("%spartition ID: %ld\n", prefix, info.info.partition);
|
||||
printf("%sdevice: `%s'\n", prefix, info.info.device);
|
||||
printf("%sflags: %lx\n", prefix, info.flags);
|
||||
printf("%spartition name: `%s'\n", prefix, info.partition_name);
|
||||
printf("%spartition type: `%s'\n", prefix, info.partition_type);
|
||||
printf("%sFS short name: `%s'\n", prefix, info.file_system_short_name);
|
||||
printf("%sFS long name: `%s'\n", prefix, info.file_system_long_name);
|
||||
printf("%svolume name: `%s'\n", prefix, info.volume_name);
|
||||
printf("%sFS flags: 0x%lx\n", prefix, info.file_system_flags);
|
||||
}
|
||||
|
||||
// main
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char buffer[B_FILE_NAME_LENGTH];
|
||||
const char *deviceName = "/dev/disk/ide/ata/0/master/0/raw";
|
||||
|
||||
if (argc > 1) {
|
||||
bool atapi = false;
|
||||
int32 controller = 0;
|
||||
bool master = true;
|
||||
|
||||
if (argv[1][0] == '/') {
|
||||
deviceName = argv[1];
|
||||
} else if (strstr(argv[1], "virtual") != NULL) {
|
||||
deviceName = "/dev/disk/virtual/0/raw";
|
||||
} else {
|
||||
if (strstr(argv[1], "cd") != NULL || strstr(argv[1], "atapi") != NULL)
|
||||
atapi = true;
|
||||
if (strstr(argv[1], "slave") != NULL)
|
||||
master = false;
|
||||
if (char *digit = strpbrk(argv[1], "0123456789"))
|
||||
controller = atol(digit);
|
||||
|
||||
sprintf(buffer, "/dev/disk/ide/ata%s/%ld/%s/0/raw", atapi ? "pi" : "",
|
||||
controller, master ? "master" : "slave");
|
||||
|
||||
deviceName = buffer;
|
||||
}
|
||||
}
|
||||
|
||||
int device = open(deviceName, 0);
|
||||
if (device < 0) {
|
||||
fprintf(stderr, "Could not open device \"%s\": %s\n", deviceName, strerror(device));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("device: `%s'\n", deviceName);
|
||||
|
||||
session_info sessionInfo;
|
||||
for (int32 i = 0; ; i++) {
|
||||
status_t status = get_nth_session_info(device, i, &sessionInfo);
|
||||
if (status < B_OK) {
|
||||
if (status != B_ENTRY_NOT_FOUND)
|
||||
fprintf(stderr, "get_nth_session_info() failed: %s\n", strerror(status));
|
||||
break;
|
||||
}
|
||||
|
||||
printf("session %ld\n", i);
|
||||
print_session_info(" ", sessionInfo);
|
||||
|
||||
for (int32 k = 0; ; k++) {
|
||||
extended_partition_info partitionInfo;
|
||||
char partitionMapName[B_FILE_NAME_LENGTH];
|
||||
status = get_nth_partition_info(device, i, k, &partitionInfo,
|
||||
partitionMapName);
|
||||
if (status < B_OK) {
|
||||
if (status != B_ENTRY_NOT_FOUND)
|
||||
fprintf(stderr, "get_nth_partition_info() failed: %s\n", strerror(status));
|
||||
break;
|
||||
}
|
||||
|
||||
if (k == 0)
|
||||
printf(" partition map: `%s'\n", partitionMapName);
|
||||
|
||||
printf(" partition %ld_%ld\n", i, k);
|
||||
print_partition_info(" ", partitionInfo);
|
||||
}
|
||||
}
|
||||
close(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,48 +0,0 @@
|
||||
SubDir HAIKU_TOP src tests add-ons kernel disk_scanner ;
|
||||
|
||||
#UsePrivateHeaders $(DOT) ;
|
||||
#
|
||||
# the test app
|
||||
#
|
||||
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system libroot os ] ;
|
||||
#SimpleTest DiskScannerTest : DiskScannerTest.cpp
|
||||
# : <boot!home!config!lib>libkernelland_emu.so be stdc++.r4 ;
|
||||
#LOCATE on <installed>DiskScannerTest = [ on DiskScannerTest return $(LOCATE) ] ;
|
||||
#Depends <installed>DiskScannerTest : DiskScannerTest ;
|
||||
#
|
||||
# the add-on
|
||||
#
|
||||
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel disk_scanner ] ;
|
||||
#
|
||||
#{
|
||||
# local defines = [ FDefines USERLAND ] ;
|
||||
# SubDirCcFlags $(defines) ;
|
||||
# SubDirC++Flags $(defines) ;
|
||||
#}
|
||||
#
|
||||
#Addon <userland>disk_scanner :
|
||||
# disk_scanner.c
|
||||
#;
|
||||
#LinkAgainst <userland>disk_scanner : libkernelland_emu.so ;
|
||||
#
|
||||
# for convenience: this target builds all userland modules
|
||||
#
|
||||
#NotFile userland_disk_scanner_modules ;
|
||||
#Depends userland_disk_scanner_modules :
|
||||
# # the main module
|
||||
# <userland>disk_scanner
|
||||
#
|
||||
# # FS modules
|
||||
# <userland>bfs
|
||||
# <userland>iso9660
|
||||
#
|
||||
# # partition modules
|
||||
# <userland>intel
|
||||
#
|
||||
# # session modules
|
||||
# <userland>cdrom
|
||||
#;
|
||||
#
|
||||
#SubInclude HAIKU_TOP src tests add-ons kernel disk_scanner fs ;
|
||||
#SubInclude HAIKU_TOP src tests add-ons kernel disk_scanner partition ;
|
||||
#SubInclude HAIKU_TOP src tests add-ons kernel disk_scanner session ;
|
@ -1,27 +0,0 @@
|
||||
SubDir HAIKU_TOP src tests add-ons kernel disk_scanner fs ;
|
||||
|
||||
SEARCH_SOURCE
|
||||
+= [ FDirName $(HAIKU_TOP) src add-ons kernel disk_scanner fs ] ;
|
||||
|
||||
UsePrivateHeaders $(DOT) ;
|
||||
|
||||
{
|
||||
local defines = [ FDefines USERLAND ] ;
|
||||
SubDirCcFlags $(defines) ;
|
||||
SubDirC++Flags $(defines) ;
|
||||
}
|
||||
|
||||
# bfs
|
||||
|
||||
Addon <userland>bfs :
|
||||
bfs.c
|
||||
: libkernelland_emu.so
|
||||
;
|
||||
|
||||
# iso9660
|
||||
|
||||
Addon <userland>iso9660 :
|
||||
iso9660.cpp
|
||||
: libkernelland_emu.so
|
||||
;
|
||||
|
@ -1,19 +0,0 @@
|
||||
SubDir HAIKU_TOP src tests add-ons kernel disk_scanner partition ;
|
||||
|
||||
SEARCH_SOURCE
|
||||
+= [ FDirName $(HAIKU_TOP) src add-ons kernel disk_scanner partition ] ;
|
||||
|
||||
UsePrivateHeaders $(DOT) ;
|
||||
|
||||
{
|
||||
local defines = [ FDefines USERLAND ] ;
|
||||
SubDirCcFlags $(defines) ;
|
||||
SubDirC++Flags $(defines) ;
|
||||
}
|
||||
|
||||
# intel
|
||||
|
||||
Addon <userland>intel :
|
||||
intel.cpp intel_parameters.cpp intel_partition_map.cpp
|
||||
: libkernelland_emu.so
|
||||
;
|
@ -1,19 +0,0 @@
|
||||
SubDir HAIKU_TOP src tests add-ons kernel disk_scanner session ;
|
||||
|
||||
SEARCH_SOURCE
|
||||
+= [ FDirName $(HAIKU_TOP) src add-ons kernel disk_scanner session ] ;
|
||||
|
||||
UsePrivateHeaders $(DOT) ;
|
||||
|
||||
{
|
||||
local defines = [ FDefines USERLAND ] ;
|
||||
SubDirCcFlags $(defines) ;
|
||||
SubDirC++Flags $(defines) ;
|
||||
}
|
||||
|
||||
# cdrom
|
||||
|
||||
Addon <userland>cdrom :
|
||||
cdrom.cpp
|
||||
: libkernelland_emu.so
|
||||
;
|
Loading…
x
Reference in New Issue
Block a user