tools: move useful tools from test dir to tools dir

move the dump utilities out of tests

Change-Id: I21d0550e09fde3b1feb078bde4e9b4dc7ca3614e
Reviewed-on: http://gerrit.openafs.org/7043
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Derrick Brashear 2012-04-03 13:51:38 -04:00
parent 72f5d88acc
commit 2982f8c5b1
36 changed files with 120 additions and 93 deletions

View File

@ -401,6 +401,9 @@ authtools: pam tsm41 sgistuff aklog
platform: config cmd vol
+${COMPILE_PART1} platform ${COMPILE_PART2}
tools: config audit volser vlserver
+${COMPILE_PART1} tools ${COMPILE_PART2}
man-pages: config
+if test -d "doc/man-pages" ; then \
cd doc/man-pages ${COMPILE_PART2} ; \
@ -650,7 +653,7 @@ finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs
dviced dvolser libafscp\
venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
platform kopenafs authtools $(DIR_roken)
tools platform kopenafs authtools $(DIR_roken)
+${COMPILE_PART1} finale ${COMPILE_PART2}
finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \
@ -658,7 +661,7 @@ finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth lo
dviced dvolser libafscp\
venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \
libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
platform kopenafs authtools $(DIR_roken)
tools platform kopenafs authtools $(DIR_roken)
+${COMPILE_PART1} finale ${COMPILE_PART2}
check test: finale
@ -749,13 +752,13 @@ clean2:
-${COMPILE_PART1} bucoord ${COMPILE_CLEAN}
-${COMPILE_PART1} xstat ${COMPILE_CLEAN}
-${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN}
-${COMPILE_PART1} tests ${COMPILE_CLEAN}
-${COMPILE_PART1} rxdebug ${COMPILE_CLEAN}
-${COMPILE_PART1} libafsrpc ${COMPILE_CLEAN}
-${COMPILE_PART1} libafsauthent ${COMPILE_CLEAN}
-${COMPILE_PART1} shlibafsrpc ${COMPILE_CLEAN}
-${COMPILE_PART1} shlibafsauthent ${COMPILE_CLEAN}
-${COMPILE_PART1} kopenafs ${COMPILE_CLEAN}
-${COMPILE_PART1} tools ${COMPILE_CLEAN}
-${COMPILE_PART1} platform ${COMPILE_CLEAN}
-${COMPILE_PART1} libadmin ${COMPILE_CLEAN}
-${COMPILE_PART1} libadmin/adminutil ${COMPILE_CLEAN}
@ -904,6 +907,7 @@ distclean: clean
src/tests/Makefile \
src/tests/run-tests \
src/tests/auth/Makefile \
src/tools/Makefile \
src/tsalvaged/Makefile \
src/tsm41/Makefile \
src/tvolser/Makefile \

View File

@ -227,6 +227,7 @@ src/sys/Makefile \
src/tbutc/Makefile \
src/tests/Makefile \
src/tests/run-tests \
src/tools/Makefile \
src/tsalvaged/Makefile \
src/tsm41/Makefile \
src/tvolser/Makefile \

View File

@ -2,97 +2,11 @@ srcdir = @srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.lwp
SHELL = /bin/sh
INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR}
INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR}
LIBS=\
libdumpscan.a \
libxfiles.a \
${TOP_LIBDIR}/libauth.a \
${TOP_LIBDIR}/libaudit.a \
${TOP_LIBDIR}/libvolser.a \
${TOP_LIBDIR}/libvldb.a \
${TOP_LIBDIR}/libubik.a \
${TOP_LIBDIR}/librxkad.a \
${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/librx.a \
${TOP_LIBDIR}/liblwp.a \
${TOP_LIBDIR}/util.a \
${TOP_LIBDIR}/libafscom_err.a \
$(LIB_roken) \
${XLIBS}
OBJS_afsdump_scan = afsdump_scan.o repair.o
OBJS_afsdump_xsed = afsdump_xsed.o repair.o
OBJS_libxfiles.a = xfiles.o xf_errs.o xf_printf.o int64.o \
xf_files.o xf_rxcall.o xf_profile.o
OBJS_libdumpscan.a = primitive.o util.o dumpscan_errs.o parsetag.o \
parsedump.o parsevol.o parsevnode.o dump.o \
directory.o pathname.o backuphdr.o stagehdr.o
TARGETS = libxfiles.a libdumpscan.a \
afsdump_scan afsdump_dirlist afsdump_extract dumptool
all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
afsdump_scan afsdump_dirlist afsdump_extract dumptool OpenAFS/Dirpath.sh
all: run-tests OpenAFS/Dirpath.pm $(TEST_PROGRAMS) OpenAFS/Dirpath.sh
@chmod +x run-tests
generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h
afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan)
$(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS)
afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed)
$(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS)
afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o
$(AFS_LDRULE) afsdump_dirlist.o $(LIBS)
afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o
$(AFS_LDRULE) afsdump_extract.o $(LIBS)
null-search: libxfiles.a libdumpscan.a null-search.c
$(AFS_LDRULE) null-search.c $(LIBS)
dumptool: dumptool.c
$(AFS_LDRULE) dumptool.c
libxfiles.a: $(OBJS_libxfiles.a)
-rm -f libxfiles.a
$(AR) r libxfiles.a $(OBJS_libxfiles.a)
$(RANLIB) libxfiles.a
libdumpscan.a: $(OBJS_libdumpscan.a)
-rm -f libdumpscan.a
$(AR) r libdumpscan.a $(OBJS_libdumpscan.a)
$(RANLIB) libdumpscan.a
xf_errs.c xf_errs.h: xf_errs.et
$(COMPILE_ET) xf_errs.et
dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et
$(COMPILE_ET) dumpscan_errs.et
util.o xfiles.o xf_files.o: xf_errs.h
backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h
parsevnode.o parsevol.o pathname.o stagehdr.o: dumpscan_errs.h
util.o: dumpscan_errs.h
# repair addresses the same storage as two different types of structs at the
# same time.
CFLAGS_repair.o = @CFLAGS_NOSTRICT@
repair.o: repair.c dumpscan_errs.h
${TOP_LIBDIR}/libxfiles.a: libxfiles.a
${INSTALL_DATA} $? $@
${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a
${INSTALL_DATA} $? $@
SYS_LIBS = ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a
AUTH_LIBS = ${TOP_LIBDIR}/libauth.a ${SYS_LIBS}
@ -345,8 +259,8 @@ install:
uninstall:
clean:
-rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
$(TARGETS) run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm OpenAFS/Dirpath.sh
-rm -f *.o run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm \
OpenAFS/Dirpath.sh
include ../config/Makefile.version

107
src/tools/Makefile.in Normal file
View File

@ -0,0 +1,107 @@
srcdir = @srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.lwp
SHELL = /bin/sh
INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR}
INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR}
LIBS=\
libdumpscan.a \
libxfiles.a \
${TOP_LIBDIR}/libauth.a \
${TOP_LIBDIR}/libaudit.a \
${TOP_LIBDIR}/libvolser.a \
${TOP_LIBDIR}/libvldb.a \
${TOP_LIBDIR}/libubik.a \
${TOP_LIBDIR}/librxkad.a \
${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/librx.a \
${TOP_LIBDIR}/liblwp.a \
${TOP_LIBDIR}/util.a \
$(TOP_LIBDIR)/libopr.a \
${TOP_LIBDIR}/libafscom_err.a \
$(LIB_roken) \
${XLIBS}
OBJS_afsdump_scan = afsdump_scan.o repair.o
OBJS_afsdump_xsed = afsdump_xsed.o repair.o
OBJS_libxfiles.a = xfiles.o xf_errs.o xf_printf.o int64.o \
xf_files.o xf_rxcall.o xf_profile.o
OBJS_libdumpscan.a = primitive.o util.o dumpscan_errs.o parsetag.o \
parsedump.o parsevol.o parsevnode.o dump.o \
directory.o pathname.o backuphdr.o stagehdr.o
TARGETS = libxfiles.a libdumpscan.a \
afsdump_scan afsdump_dirlist afsdump_extract dumptool
all: libxfiles.a libdumpscan.a \
afsdump_scan afsdump_dirlist afsdump_extract dumptool
generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h
afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan)
$(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS)
afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed)
$(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS)
afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o
$(AFS_LDRULE) afsdump_dirlist.o $(LIBS)
afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o
$(AFS_LDRULE) afsdump_extract.o $(LIBS)
null-search: libxfiles.a libdumpscan.a null-search.c
$(AFS_LDRULE) null-search.c $(LIBS)
dumptool: dumptool.c
$(AFS_LDRULE) dumptool.c
libxfiles.a: $(OBJS_libxfiles.a)
-rm -f libxfiles.a
$(AR) r libxfiles.a $(OBJS_libxfiles.a)
$(RANLIB) libxfiles.a
libdumpscan.a: $(OBJS_libdumpscan.a)
-rm -f libdumpscan.a
$(AR) r libdumpscan.a $(OBJS_libdumpscan.a)
$(RANLIB) libdumpscan.a
xf_errs.c xf_errs.h: xf_errs.et
$(COMPILE_ET) xf_errs.et
dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et
$(COMPILE_ET) dumpscan_errs.et
util.o xfiles.o xf_files.o: xf_errs.h
backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h
parsevnode.o parsevol.o pathname.o stagehdr.o: dumpscan_errs.h
util.o: dumpscan_errs.h
# repair addresses the same storage as two different types of structs at the
# same time.
CFLAGS_repair.o = @CFLAGS_NOSTRICT@
repair.o: repair.c dumpscan_errs.h
${TOP_LIBDIR}/libxfiles.a: libxfiles.a
${INSTALL_DATA} $? $@
${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a
${INSTALL_DATA} $? $@
dest:
install:
uninstall:
clean:
-rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
$(TARGETS)
include ../config/Makefile.version
.PHONY: all install clean realclean distclean mostlyclean install uninstall

View File

@ -287,6 +287,7 @@ int ShutdownInProgress = 0;
* Our local function prototypes
*/
static int DirHash(char *string);
static int ReadDumpHeader(FILE *, struct DumpHeader *);
static int ReadVolumeHeader(FILE *, VolumeDiskData *);
static int ScanVnodes(FILE *, VolumeDiskData *, int);
@ -2426,7 +2427,7 @@ ReadByteString(FILE * f, void *s, int size)
* The directory hashing algorithm used by AFS
*/
int
static int
DirHash(char *string)
{
/* Hash a string to a number between 0 and NHASHENT. */