Commit 9e24030a authored by KyungWoon Cho's avatar KyungWoon Cho
Browse files

Remove obsolete and autotools files and add a simple README for driver

- add cezanne to AUTHORS and change its path
- add LICENSE into the top folder
parent 47bdcda3
KyungWoon Cho
------------------
Takahiro Hirofuchi
Robert Leibl
This diff is collapsed.
.PHONY: clean all
#CC:=i586-mingw32msvc-gcc
#LD:=i586-mingw32msvc-ld
#STRIP:=i586-mingw32msvc-strip
CC=gcc
LD=ld
STRIP=strip
ALL_TARGET:=output/usbip.exe #driver.sys
all:$(ALL_TARGET)
source:=busenum.c buspdo.c pnp.c power.c Wmi.c
usbip_source:=usbip.c usbip_network.c usbip_common.c usbip_vbus_ui.c
usbip_include:=public.h usbip_protocol.h usbip_network.h usbip_common.h usbip_vbus_ui.h win_stub.h
output/usbip.exe:$(usbip_source) $(usbip_include)
$(CC) -Wall -o $@ $(usbip_source) -lsetupapi -lws2_32
driver.sys:$(source) busenum.h driver.h public.h
$(CC) -D__USE_DIRECT__ -DDBG -Wall -Wl,-subsystem,native -Wl,-entry,_DriverEntry@8 -shared -nostartfiles -nostdlib -o $@ $(source) -lntoskrnl
# $(LD) entry.o functions.o -mdll --subsystem,native --image-base=0x10000 --file-alignment=0x1000 --section-alignment=0x1000 --entry=_DriverEntry -nostartfiles -nostdlib -L/usr/i586-mingw32msvc/lib/ -lntoskrnl -o $@
# $(STRIP) $@
clean:
rm -f $(ALL_TARGET)
cscope:
cscope -b -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include/ddk
\ No newline at end of file
$(OBJ_PATH)\$(O)\busenum.bmf : busenum.mof
mofcomp -B:$@ busenum.mof
wmimofck $@
# Build
Build is tested on Win10, Visual studio 2017 Community, Windows Driver Kit 10.0.17134 and
Windows SDK 10.0.17134.
- Open USBIPEnum.vcxproj
- Build Project
- x86/x64 platforms are supported
- Driver file(USBIPEnum.sys), INF(USBIPEnum.inf), Test Certificate(USBIPEnum.cer) are created
under Debug/x64 folder. A driver catalog file(USBIPEnum.cat) is in Debug/x64/USBIPEnum.
# Install Driver
Test driver certificate can be generated via VS 2017.
- Install a test certificate(USBIPEnum.cer) on a target machine.
- It should be installed into "Trusted Root Certification Authority"
- Copy USBIPEnum.sys, USBIPEnum.inf, USBIPEnum.cat to a target.
- Start a device manager
- Choose "Add Legacy Hrdware" from the "Action" menu.
- Select 'Install the hardware that I manually select from the list'.
- Click 'Next'.
- Click 'Have Disk', click 'Browse', choose the copied folder, and click OK.
- Click on the 'USB/IP Enumerator', and then click Next.
- Click Finish at 'Completing the Add/Remove Hardware Wizard.'
To install the virtual usb bus driver on Windows XP:
1. Uncompress the downloaded binary package to a directory.
2. Double-click the 'Add Hardware' wizard in Control Panel.
3. At the 'Welcome to the Add Hardware Wizard', click 'Next'.
4. Select 'Yes, I have already connected the hardware', then click Next.
5. Select 'Add a new hardware device' from the list, then click Next.
6. Select 'Install the hardware that I manually select from a list(Advanced)', and then click next.
7. Select 'System Devices', then click Next.
8. Click 'Have Disk', click 'Browse', choose the uncompressed directory, and click OK.
9. Click on the 'USB/IP Enumerator', and then click Next.
10. At 'The wizard is ready to install your hardware', click Next.
11. Click Finish at 'Completing the Add/Remove Hardware Wizard.'
For Window 7 :
1. (Only necessary for custom builds: For x64 allow unsigned drivers: Enter "bcdedit /set testsigning on" in an administrative cmd window)
2. Uncompress the downloaded binary package to a directory.
3. Start a the Device Manager
4. Click Any hardware node
5. Choose "Add Legacy Hardware" from the "Action" menu
6. At the 'Welcome to the Add Hardware Wizard', click 'Next'.
7. Select 'Install the hardware that I manually select from the list'
8. click 'Next'
9. Click 'Have Disk', click 'Browse', choose the uncompressed directory, and click OK.
10. Click on the 'USB/IP Enumerator', and then click Next.
11. At 'The wizard is ready to install your hardware', click Next.
12. Click Finish at 'Completing the Add/Remove Hardware Wizard.'
To use it:
1. open a command prompt window, cd to the uncompressed directory.
2. run usbip -l 192.168.2.1 to list the exported devices from ip 192.168.2.1
3. run usbip -a 192.168.2.1 2-1 to imported the device.
(Of course, you should change 192.168.2.1 and 2-1 to something else)
rem batch file to build complete drivers: output will be put in output directory
rem build 32-bit version in XP environment
rem build 64-bit version in Windows Server 2003 environment
set OCD=%CD%
set TYPE=chk
IF "%BASEDIR%"=="" (
set BASEDIR=D:\WinDDK\7600.16385.1
CALL D:\WinDDK\7600.16385.1\bin\setenv.bat D:\WinDDK\7600.16385.1 %TYPE% WLH
cd /d %OCD%
)
cmd /C "set DDKBUILDENV=&& %BASEDIR%\bin\setenv.bat %BASEDIR% %TYPE% WLH && cd /d %OCD% && build"
cmd /C "set DDKBUILDENV=&& %BASEDIR%\bin\setenv.bat %BASEDIR% %TYPE% x64 WLH && cd /d %OCD% && build"
rem copy files to output folder
rem del /Q output
mkdir output
copy USBIPEnum.inf output
copy obj%TYPE%_wlh_x86\i386\USBIPEnum.sys output\USBIPEnum_x86.sys
copy obj%TYPE%_wlh_amd64\amd64\USBIPEnum.sys output\USBIPEnum_x64.sys
rem sign files and create catalog file
signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum_x86.sys
signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum_x64.sys
inf2cat /driver:output /os:XP_x86,XP_x64,Server2003_X86,Server2003_X64,Vista_X86,Vista_X64,Server2008_X86,Server2008_X64,7_X86,7_X64,Server2008R2_X64
signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum.cat
makecert -r -pe -n "CN=USB/IP Test Certificate" -ss CA -sr CurrentUser -a sha1 -sky signature -sv USBIP_TestCert.pvk USBIP_TestCert.cer
pvk2pfx -pvk USBIP_TestCert.pvk -spc USBIP_TestCert.cer -pfx USBIP_TestCert.pfx
rem certutil -user -addstore Root USBIP_TestCert.cer
rem Bcdedit.exe /set TESTSIGNING ON
rem bcdedit /set testsigning on
rem certutil -enterprise -addstore Root USBIP_TestCert.cer
rem certutil -enterprise -addstore TrustedPublisher USBIP_TestCert.cer
cd output
..\devcon install USBIPEnum.inf "root\USBIPEnum"
cd ..
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def
devcon remove "root\USBIPEnum"
TARGETNAME=USBIPEnum
TARGETTYPE=DRIVER
INCLUDES = ..\inc
NTTARGETFILE0=$(OBJ_PATH)\$(O)\busenum.bmf
TARGETLIBS= $(DDK_LIB_PATH)\wdmsec.lib \
$(DDK_LIB_PATH)\ntstrsafe.lib
SOURCES= busenum.rc \
busenum.c \
pnp.c \
power.c \
buspdo.c \
wmi.c
#_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
SUBDIRS := libsrc src
includedir := @includedir@/usbip
include_HEADERS := $(addprefix libsrc/, \
usbip.h usbip_common.h vhci_driver.h stub_driver.h)
dist_man_MANS := $(addprefix doc/, usbip.8 usbipd.8 usbip_bind_driver.8)
if INSTALL_USBIDS
pkgdata_DATA := usb.ids
EXTRA_DIST := $(pkgdata_DATA)
endif
#!/bin/sh -x
#aclocal
#autoheader
#libtoolize --copy --force
#automake-1.9 -acf
#autoconf
autoreconf -i -f -v
#!/bin/sh -x
if [ -r Makefile ]; then
make distclean
fi
FILES="configure cscope.out Makefile.in depcomp compile config.guess config.sub config.h.in~ config.log config.status ltmain.sh libtool config.h.in autom4te.cache missing aclocal.m4 install-sh cmd/Makefile.in lib/Makefile.in Makefile lib/Makefile cmd/Makefile"
rm -Rf $FILES
dnl Process this file with autoconf to produce a configure script.
dnl Keep this file in sync with config_windows.h.
AC_PREREQ(2.59)
AC_INIT([usbip], [1.0.0], [usbip-devel@lists.sourceforge.net])
AC_DEFINE([USBIP_VERSION], [0x00000100], [binary-coded decimal version number])
CURRENT=0
REVISION=1
AGE=0
AC_SUBST([LIBUSBIP_VERSION], [$CURRENT:$REVISION:$AGE], [library version])
AC_CONFIG_SRCDIR([src/usbipd.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign])
LT_INIT
# Silent build for automake >= 1.11
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_SUBST([EXTRA_CFLAGS], ["-Wall -Werror -Wextra -std=gnu99"])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h dnl
string.h sys/socket.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset mkdir regcomp socket strchr strerror strstr dnl
strtoul])
AC_CHECK_HEADER([sysfs/libsysfs.h],
[AC_CHECK_LIB([sysfs], [sysfs_open_directory_list],
[LIBS="$LIBS -lsysfs"],
[AC_MSG_ERROR([Missing sysfs2 library!])])],
[AC_MSG_ERROR([Missing /usr/include/sysfs/libsysfs.h])])
# Checks for libwrap library.
AC_MSG_CHECKING([whether to use the libwrap (TCP wrappers) library])
AC_ARG_WITH([tcp-wrappers],
[AS_HELP_STRING([--with-tcp-wrappers],
[use the libwrap (TCP wrappers) library])],
dnl [ACTION-IF-GIVEN]
[saved_LIBS="$LIBS"
if test "$withval" = "yes"; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for hosts_access in -lwrap])
LIBS="-lwrap $LIBS"
AC_TRY_LINK(
[int hosts_access(); int allow_severity, deny_severity;],
[hosts_access()],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_LIBWRAP], [1],
[use tcp wrapper]) wrap_LIB="-lwrap"],
[AC_MSG_RESULT([not found]); exit 1])
else
AC_MSG_RESULT([no])
fi
LIBS="$saved_LIBS"],
dnl [ACTION-IF-NOT-GIVEN]
[AC_MSG_RESULT([(default)])
AC_MSG_CHECKING([for hosts_access in -lwrap])
saved_LIBS="$LIBS"
LIBS="-lwrap $saved_LIBS"
AC_TRY_LINK(
[int hosts_access(); int allow_severity, deny_severity;],
[hosts_access()],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_LIBWRAP], [1], [use tcp wrapper])],
[AC_MSG_RESULT([no]); LIBS="$saved_LIBS"])])
# Sets directory containing usb.ids.
USBIDS_DIR='${datadir}/usbip'
AC_ARG_WITH([usbids-dir],
[AS_HELP_STRING([--with-usbids-dir=DIR],
[where usb.ids is found (default ${datadir}/usbip)])],
[USBIDS_DIR=$withval])
AC_SUBST([USBIDS_DIR])
dnl FIXME: when disabled, empty directry is created
usbids=install
AC_ARG_ENABLE([usbids-install],
[AS_HELP_STRING([--enable-usbids-install],
[install usb.ids (default)])],
[AS_CASE([$enableval],
[yes], [usbids=install],
[no], [usbids=notinstall],
[AC_MSG_ERROR(
[bad value ${enableval} for --enable-usbids-install])]
)])
AM_CONDITIONAL([INSTALL_USBIDS], [test x$usbids = xinstall])
GLIB2_REQUIRED=2.6.0
PKG_CHECK_MODULES([PACKAGE], [glib-2.0 >= $GLIB2_REQUIRED])
AC_SUBST([PACKAGE_CFLAGS])
AC_SUBST([PACKAGE_LIBS])
AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile])
AC_OUTPUT
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment