Цитата Сообщение от Shaaarnir Посмотреть сообщение
Решил причесать инструкцию.
Для Ubuntu 18.04 x64
Команды на основе данных из темы. За что всем большое спасибо!
Также описал как добавить сервис usbhaspd.service в systemd.
[CODE]
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libusb-0.1-4:i386 linux-tools-generic automake libtool linux-source-"$(uname -r | cut -d'-' -f1)" linux-headers-"$(uname -r)" libelf-dev libjansson-dev flex bison git-all build-essential
cd /usr/src/
sudo tar -xf linux-source-"$(uname -r | cut -d'-' -f1)".tar.bz2
cd ~
mkdir git
cd git
git clone git://git.code.sf.net/p/usb-vhci/vhci_hcd
git clone git://git.code.sf.net/p/usb-vhci/libusb_vhci
git clone https://github.com/sam88651/UsbHasp.git
cd vhci_hcd
mkdir -p linux/"$(uname -r | cut -d'-' -f1)"/drivers/usb/core
cp /usr/src/linux-source-"$(uname -r | cut -d'-' -f1)"/include/linux/usb/hcd.h linux/"$(uname -r | cut -d'-' -f1)"/drivers/usb/core/

// в файлах "usb-vhci-hcd.c" и "usb-vhci-iocifc.c" находим "#define DEBUG" и комментируем эту строку и добавляем строку #include <linux/uaccess.h>
mv usb-vhci-hcd.c usb-vhci-hcd.c_debug && cat usb-vhci-hcd.c_debug | sed 's/^#define DEBUG/\/\/#define DEBUG/g' > usb-vhci-hcd.c
mv usb-vhci-iocifc.c usb-vhci-iocifc.c_debug && cat usb-vhci-iocifc.c_debug | sed 's/^#define DEBUG/#include <linux\/uaccess.h>/g' > usb-vhci-iocifc.c

make KVERSION="$(uname -r)" KSRC=/usr/src/linux-source-"$(uname -r | cut -d'-' -f1)"
Подскажите пожалуйста: после выполнения команды make KVERSION="$(uname -r)" KSRC=/usr/src/linux-source-"$(uname -r | cut -d'-' -f1)"
вываливает ошибку:
Код:
	echo "#define NO_DEV_INIT_NAME" >>conf/usb-vhci.config.h; \
fi
make clean-test
make[2]: Entering directory '/root/git/vhci_hcd'
rm -f test/*.o test/*.ko test/.*.cmd test/.*.flags test/*.mod.c test/Module.symvers test/Module.markers test/modules.order
rm -rf test/.tmp_versions/
make[2]: Leaving directory '/root/git/vhci_hcd'
if make -C /lib/modules/4.15.0-88-generic/build M=/root/git/vhci_hcd/test PWD=/root/git/vhci_hcd/test BUILD_PREFIX= KDIR=/lib/modules/4.15.0-88-generic/build KVERSION=4.15.0-88-generic EXTRA_CFLAGS='-Wno-unused -DEXPORT_SYMTAB -DKBUILD_EXTMOD -DINCLUDE_CORE_HCD=\"/lib/modules/4.15.0-88-generic/build/include/linux/usb/hcd.h\" -DTEST_HAS_TT_FLAG' modules >/dev/null 2>&1; then \
	echo "//#define NO_HAS_TT_FLAG" >>conf/usb-vhci.config.h; \
else \
	echo "#define NO_HAS_TT_FLAG" >>conf/usb-vhci.config.h; \
fi
echo "// end of file" >>conf/usb-vhci.config.h
make[1]: Leaving directory '/root/git/vhci_hcd'
make -C /lib/modules/4.15.0-88-generic/build M=/root/git/vhci_hcd PWD=/root/git/vhci_hcd BUILD_PREFIX= KDIR=/lib/modules/4.15.0-88-generic/build KVERSION=4.15.0-88-generic modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-88-generic'
  CC [M]  /root/git/vhci_hcd/usb-vhci-hcd.o
  CC [M]  /root/git/vhci_hcd/usb-vhci-iocifc.o
/root/git/vhci_hcd/usb-vhci-iocifc.c: In function ‘ioc_register’:
/root/git/vhci_hcd/usb-vhci-iocifc.c:216:5: error: implicit declaration of function ‘copy_to_user’; did you mean ‘copy_to_iter’? [-Werror=implicit-function-declaration]
  if(copy_to_user(arg->bus_id, dname, i))
     ^~~~~~~~~~~~
     copy_to_iter
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /root/git/vhci_hcd/usb-vhci-iocifc.c:25:
/root/git/vhci_hcd/usb-vhci-iocifc.c: In function ‘ioc_fetch_work’:
/root/git/vhci_hcd/usb-vhci-iocifc.c:461:15: error: implicit declaration of function ‘__copy_to_user’; did you mean ‘raw_copy_to_user’? [-Werror=implicit-function-declaration]
   if(unlikely(__copy_to_user(&arg->work.urb, &urb, sizeof urb)))
               ^
./include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
/root/git/vhci_hcd/usb-vhci-iocifc.c: In function ‘ioc_giveback_common’:
/root/git/vhci_hcd/usb-vhci-iocifc.c:599:90: error: macro "access_ok" requires 3 arguments, but only 2 given
    if(!access_ok((void *)iso, iso_count * sizeof(struct usb_vhci_ioc_iso_packet_giveback)))
                                                                                          ^
/root/git/vhci_hcd/usb-vhci-iocifc.c:599:8: error: ‘access_ok’ undeclared (first use in this function)
    if(!access_ok((void *)iso, iso_count * sizeof(struct usb_vhci_ioc_iso_packet_giveback)))
        ^~~~~~~~~
/root/git/vhci_hcd/usb-vhci-iocifc.c:599:8: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /root/git/vhci_hcd/usb-vhci-iocifc.c:25:
/root/git/vhci_hcd/usb-vhci-iocifc.c:624:15: error: implicit declaration of function ‘copy_from_user’; did you mean ‘copy_from_iter’? [-Werror=implicit-function-declaration]
   if(unlikely(copy_from_user(urbp->urb->transfer_buffer, buf, act)))
Мой uname -r
Код:
root@vm-1:~/git/vhci_hcd# uname -r
4.15.0-88-generic
Куда копать?