aidyw / bosto-2g-linux-kernel-module

GNU General Public License v3.0
7 stars 4 forks source link

probelm when using 'make' command #17

Open BozakJay opened 3 years ago

BozakJay commented 3 years ago

When i try to use the "make clean && make" and "sudo make install" commands it tells me that this stuff is missing: 'detatch_usbhid' './bosto_2g.ko'

aidyw commented 3 years ago

Hi, You must ensure you have the 'libusb-1.0.0-dev' package installed.

On Thu, 28 Jan 2021 at 13:24, BozakJay notifications@github.com wrote:

When i try to use the "make clean && make" and "sudo make instal" commands it tells me that this stuff is missing: 'detatch_usbhid' './bosto_2g.ko'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aidyw/bosto-2g-linux-kernel-module/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDJKCHLTQ3Z3ZPEAEUNNDTS4FJQ7ANCNFSM4WW7ADMA .

bonezinger commented 3 years ago

It's not working @aidyw I have libusb-1.0.0-dev installed

sudo apt-get install libusb-1.0.0-dev build-essential linux-headers-generic git 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libusb-1.0-0-dev' for regex 'libusb-1.0.0-dev'
libusb-1.0-0-dev is already the newest version (2:1.0.23-2build1).
build-essential is already the newest version (12.8ubuntu1.1).
git is already the newest version (1:2.25.1-1ubuntu3.1).
linux-headers-generic is already the newest version (5.4.0.67.70).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

make clean doesn't work

make clean && make
make -C /lib/modules/5.4.0-67-generic/build M=/home/bones/bosto/bosto-2g-linux-kernel-module clean
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-67-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-67-generic'
rm detach_usbhid
rm: cannot remove 'detach_usbhid': No such file or directory
make: *** [Makefile:15: clean] Error 1

make by itself works.

make
gcc detach_usbhid.c -I/usr/include/libusb-1.0 -L/lib/-linux-gnu/libusb-1.0.so.0 -lusb-1.0 -o detach_usbhid
make -C /lib/modules/5.4.0-67-generic/build M=/home/bones/bosto/bosto-2g-linux-kernel-module modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-67-generic'
  CC [M]  /home/bones/bosto/bosto-2g-linux-kernel-module/bosto_2g.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /home/bones/bosto/bosto-2g-linux-kernel-module/bosto_2g.mod.o
  LD [M]  /home/bones/bosto/bosto-2g-linux-kernel-module/bosto_2g.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-67-generic'

The problem is that sudo make install will fail after that:

sudo make install
cp ./bosto_2g.ko /lib/modules/5.4.0-67-generic
echo bosto_2g >> /etc/modules
depmod
cp ./load_bosto_2g.sh /usr/local/bin
cp ./detach_usbhid /usr/local/bin
cp ./load_bosto_2g.rules /etc/udev/rules.d
/sbin/udevadm control --reload
make: /sbin/udevadm: Command not found
make: *** [Makefile:27: install] Error 127

I'm on Ubuntu 20.04 LTS. /sbin/udevadm is not present here