Skip to content

Instantly share code, notes, and snippets.

@7171u
Last active July 7, 2020 10:17
Show Gist options
  • Save 7171u/dd77833a008f0965280f to your computer and use it in GitHub Desktop.
Save 7171u/dd77833a008f0965280f to your computer and use it in GitHub Desktop.
Random Linux
For a linux kernel below 3.2.0-22.25
yum install kernel-devel automake autoconf gcc glib make ncurses-devel ncurses sysfsutils
yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto
yum install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
yum install newt-devel python-devel zlib-devel
Download sysfsutils-2.1.0.tar.gz
tar xvf sysfsutils-2.1.0.tar.gz
cd sysfsutils-2.1.0
./configure
make
make install
#Module build
Download the correct linux-`uname -r`.tar.bz2 from vault.centos.org
Login as a diffrent user other than root
tar xvf linux-`uname -r`.tar.bz2 -C ~/
cp /usr/src/kernels/<uname -r>/Module.symvers ~/linux-`uname -r`
cd ~/linux-`uname -r`
make oldconfig
make menuconfig
>>Device Drivers>>Statging>USBIP ( Select M)
make prepare
make M=drivers/staging/usbip/
sudo cp drivers/staging/usbip/*.ko /lib/modules/`uname -r`/extra/
sudo modprobe vhci-hcd
sudo modprobe usbip_common_mod
sudo modprobe usbip
#Binary file build
Download http://sourceforge.net/projects/usbip/files/usbip/0.1.7/usbip-0.1.7.tar.gz/download
tar xvf usbip-0.1.7.tar.gz -C /tmp
cd /tmp/usbip-0.1.7/src/
./autogen.sh
make
ls
./configure
make
sudo make install
Ref:
http://sourceforge.net/p/usbip/discussion/418507/thread/86706429/
http://askubuntu.com/questions/14627/no-symbol-version-for-module-layout-when-trying-to-load-usbhid-ko
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/900384
http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
http://wiki.centos.org/HowTos/BuildingKernelModules
@ainur-fa
Copy link

ainur-fa commented Jul 7, 2020

On CentOS 6.6 (and probably all others) you also need to:
make scripts
Before compiling the module, else you'll get a failure like:
/bin/sh: scripts/genksyms/genksyms: No such file or directory

And before "sudo modprobe vhci-hcd" you also need to
depmod -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment