LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Why module can't loaded? (https://www.linuxquestions.org/questions/linux-server-73/why-module-cant-loaded-4175616698/)

luofeiyu 10-31-2017 02:42 AM

Why module can't loaded?
 
OS :centos 7
Code:

yum install -y ipset
ipset create vader hash:ip 
ipset v6.29: Kernel error received: Operation not permitted
iptables -I INPUT -m set --match-set vader src -j DROP
iptables v1.4.21: Kernel module xt_set is not loaded in.

No module in my centos.
Code:

lsmod
Module                  Size  Used by
cat /proc/modules
nothing as output

Module can't be installed.
Code:

modprobe  xt_set
lsmod
Module                  Size  Used by
Nothing as output

How to add module for my centos ,and how to make ipset run for me?

Keruskerfuerst 10-31-2017 03:26 AM

Have a look at the modules under /usr/src/modules or /lib/modules.

luofeiyu 10-31-2017 03:37 AM

ls /usr/src/modules
ls: cannot access /usr/src/modules: No such file or directory
ls /lib/modules
ls: cannot access /lib/modules: No such file or directory

Keruskerfuerst 10-31-2017 04:06 AM

Can you install the kernel sources?
And compile the kernel with the modules yourself?

luofeiyu 10-31-2017 04:50 AM

The centos is on my vps ,how to compile the kernel with the modules myself?

Keruskerfuerst 10-31-2017 05:21 AM

1. Install kernel sources.
2. Open a terminal
3. Login as root
4. "make menuconfig"
5. Select all nessecary options - help is availale. You can also ask here. Search in Internet for more specific howtos to configure the kernel
6. Install the kernel and the modules. "make install"

luofeiyu 10-31-2017 07:15 AM

1.install kernel sources
Code:

sudo yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto
yum install -y  gcc
yum install -y  bc
yum install -y  python-devel
yum install -y  newt-devel
yum install -y  elfutils-devel
yum install -y  zlib-devel
yum install -y  binutils-devel
yum install -y  bison 
yum install -y  audit-libs-devel
yum install -y  numactl-devel
yum install -y  pciutils-devel
yum install -y  gettext
yum install -y  ncurses-devel
rpmbuild -bp --target=$(uname -m) kernel.spec
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
cat /etc/redhat-release
7.2.1511
wget  http://vault.centos.org/7.2.1511/updates/Source/SPackages/kernel-3.10.0-327.36.3.el7.src.rpm
rpm -i kernel-3.10.0-327.36.3.el7.src.rpm  2>&1 | grep -v exist
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec

To reboot my vps.

2. Open a terminal
3. Login as root

4. make menuconfig
make: *** No rule to make target `menuconfig'. Stop.

How to do then?

Keruskerfuerst 10-31-2017 08:06 AM

4. make menuconfig

before you can make this, you must change the directory.
cd /usr/src/linux

luofeiyu 10-31-2017 08:13 AM

cd /usr/src/linux
-bash: cd: /usr/src/linux: No such file or directory
ls /usr/src
debug kernels
cd /usr/src/debug
make menuconfig
make: *** No rule to make target `menuconfig'. Stop.
cd /usr/src/kernels
make menuconfig
make: *** No rule to make target `menuconfig'. Stop.

Keruskerfuerst 10-31-2017 08:36 AM

Can you post the content of the directory /usr/src ?

luofeiyu 10-31-2017 09:35 AM

tree /usr/src
/usr/src
├── debug
└── kernels

Keruskerfuerst 10-31-2017 10:07 AM

It is nessecary to install the kernel source.

Keruskerfuerst 10-31-2017 12:07 PM

And read some information about configuring the kernel, e.g.: http://how-to.wikia.com/wiki/How_to_...e_Linux_kernel
or use google to find some information about that.

luofeiyu 10-31-2017 07:17 PM

[root@localhost ~]# ls rpmbuild/SOURCES
centos.cer kernel-3.10.0-s390x-debug.config
centos-kpatch.x509 kernel-3.10.0-s390x-kdump.config
centos-ldup.x509 kernel-3.10.0-x86_64.config
check-kabi kernel-3.10.0-x86_64-debug.config
cpupower.config kernel-abi-whitelists-327.tar.bz2
cpupower.service linux-3.10.0-327.36.3.el7.tar.xz
debrand-rh-i686-cpu.patch linux-kernel-test.patch
debrand-rh_taint.patch Makefile.common
debrand-single-cpu.patch Module.kabi_ppc64
extra_certificates Module.kabi_ppc64le
kernel-3.10.0-ppc64.config Module.kabi_s390x
kernel-3.10.0-ppc64-debug.config Module.kabi_x86_64
kernel-3.10.0-ppc64le.config secureboot.cer
kernel-3.10.0-ppc64le-debug.config sign-modules
kernel-3.10.0-s390x.config x509.genkey

How to do then ?

Keruskerfuerst 11-01-2017 02:42 AM

You have to configure the kernel.

Keruskerfuerst 11-03-2017 08:27 AM

This is done by checking the processor architecture.
And the pci-e bus by lspci-v.


All times are GMT -5. The time now is 06:52 AM.