Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install as dkms module #31

Closed
YusDyr opened this issue Apr 1, 2015 · 8 comments
Closed

Can't install as dkms module #31

YusDyr opened this issue Apr 1, 2015 · 8 comments

Comments

@YusDyr
Copy link

YusDyr commented Apr 1, 2015

I can't install dkms module in Ubuntu (14.10).

# git clone git://git.code.sf.net/p/ipt-netflow/code ipt-netflow
Cloning into 'ipt-netflow'...
remote: Counting objects: 992, done.
remote: Compressing objects: 100% (891/891), done.
remote: Total 992 (delta 669), reused 152 (delta 101)
Receiving objects: 100% (992/992), 266.67 KiB | 204.00 KiB/s, done.
Resolving deltas: 100% (669/669), done.
Checking connectivity... готово.
# ./configure --enable-natevents --enable-aggregation
Kernel version: 3.13.0-46-generic (uname)
Kernel sources: /lib/modules/3.13.0-46-generic/build (found)
Checking for presence of include/linux/llist.h... Yes
Iptables binary version: 1.4.19.1 (detected from /usr/local/sbin/iptables)
pkg-config for version 1.4.19.1 exists: Yes
Checking for presence of xtables.h... Yes (using pkg-config)
Iptables include flags: -I/usr/local/include   (pkg-config)
Iptables module path: /usr/local/lib/xtables (pkg-config)
Searching for net-snmp-config... No.
Searching for net-snmp agent... Yes.
! You have net-snmp agent but not development package.
! net-snmp agent will not be built, to fix:
!   run:  apt-get install libsnmp-dev
Checking for DKMS... Yes.
! You are already have module installed via DKMS
!   it will be uninstalled on 'make install' and
!   current version of module installed afterwards.
! Use --disable-dkms option if don't want this.
Creating Makefile.. done.

  If you need some options enabled run ./configure --help
  Now run: make all install
# make all install
Compiling for kernel 3.13.0-46-generic
make -C /lib/modules/3.13.0-46-generic/build M=/root/src/ipt-netflow modules CONFIG_DEBUG_INFO=y
make[1]: Вход в каталог `/usr/src/linux-headers-3.13.0-46-generic'
  CC [M]  /root/src/ipt-netflow/ipt_NETFLOW.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /root/src/ipt-netflow/ipt_NETFLOW.mod.o
  LD [M]  /root/src/ipt-netflow/ipt_NETFLOW.ko
make[1]: Выход из каталога `/usr/src/linux-headers-3.13.0-46-generic'
gcc -O2 -Wall -Wunused -DXTABLES  -I/usr/local/include   -fPIC -o libipt_NETFLOW_sh.o -c libipt_NETFLOW.c
gcc -shared -o libipt_NETFLOW.so libipt_NETFLOW_sh.o
gcc -O2 -Wall -Wunused -DXTABLES  -I/usr/local/include   -fPIC -o libip6t_NETFLOW_sh.o -c libipt_NETFLOW.c
gcc -shared -o libip6t_NETFLOW.so libip6t_NETFLOW_sh.o
 *
make -C /lib/modules/3.13.0-46-generic/build M=/root/src/ipt-netflow modules_install INSTALL_MOD_PATH=
make[1]: Вход в каталог `/usr/src/linux-headers-3.13.0-46-generic'
  INSTALL /root/src/ipt-netflow/ipt_NETFLOW.ko
Can't read private key
  DEPMOD  3.13.0-46-generic
make[1]: Выход из каталога `/usr/src/linux-headers-3.13.0-46-generic'
/sbin/depmod -a
 *
install -D libipt_NETFLOW.so /usr/local/lib/xtables/libipt_NETFLOW.so
install -D libip6t_NETFLOW.so /usr/local/lib/xtables/libip6t_NETFLOW.so
 *
Installing into DKMS...
! You have different version of module installed into DKMS.
! That version was automatically installed by this script,
! thus, is safe to remove. No worries.
! Removing from dkms...

------------------------------
Deleting module version: 2.0-53-g8e42ff3-dirty
completely from the DKMS tree.
------------------------------
Done.
! Removing source tree from /usr/src/ipt-netflow-2.0-53-g8e42ff3-dirty
! Installing 2.1-14-g22ddee7 into DKMS...

Creating symlink /var/lib/dkms/ipt-netflow/2.1-14-g22ddee7/source ->
                /usr/src/ipt-netflow-2.1-14-g22ddee7

DKMS: add completed.
rm libipt_NETFLOW_sh.o libip6t_NETFLOW_sh.o
# dkms status
ipt-netflow, 2.1-14-g22ddee7: added
# LANG=C dkms install -m ipt-netflow/2.1-14-g22ddee7

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:
Kernel version: 3.13.0-46-generic (uname)
Kernel sources: /lib/modules/3.13.0-46-generic/build (dkms)
Checking for presence of include/linux/llist.h... Yes
Iptables binary version: 1.4.21 (detected from /sbin/iptables)
pkg-config for version 1.4.21 exists: No (reported: 1.4.19.1)
Checking for presence of xtables.h... Yes
Searching for iptables-1.4.21 sources..
! Can not find iptables source directory, you may try setting it with --ipt-src=
! This is not fatal error, yet. Will be just using default include dir.
Iptables include flags: none (default)
Iptables module path: /usr/local/lib/xtables
/tmp/iptables-1.4.19.1/libxtables (from iptables binary)
Searching for net-snmp-config... No.
Searching for net-snmp agent... Yes.
! You have net-snmp agent but not development package.
! net-snmp agent will not be built, to fix:
!   run:  apt-get install libsnmp-dev
Checking for DKMS... Yes.
Creating Makefile.. sed: -e expression #1, char 348: unterminated `s' command
done.

  If you need some options enabled run ./configure --help
  Now run: make all install


Building module:
cleaning build area....
make KERNELRELEASE=3.13.0-46-generic ipt_NETFLOW.ko....(bad exit status: 2)
ERROR (dkms apport): binary package for ipt-netflow: 2.1-14-g22ddee7 not found
Error! Bad return status for module build on kernel: 3.13.0-46-generic (x86_64)
Consult /var/lib/dkms/ipt-netflow/2.1-14-g22ddee7/build/make.log for more information.
# cat /var/lib/dkms/ipt-netflow/2.1-14-g22ddee7/build/make.log
DKMS make.log for ipt-netflow-2.1-14-g22ddee7 for kernel 3.13.0-46-generic (x86_64)
Wed Apr  1 11:25:10 MSK 2015
make: *** No rule to make target `ipt_NETFLOW.ko'.  Stop.
@aabc aabc self-assigned this Apr 1, 2015
@aabc
Copy link
Owner

aabc commented Apr 6, 2015

I installed Ubuntu 14.04.2 LTS to test this. But, 'it works for me':

@ubu:~/ipt-netflow# LANG=C dkms install -m ipt-netflow/2.1-16-g2837ec1

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:
Kernel version: 3.16.0-33-generic (uname)
Kernel sources: /lib/modules/3.16.0-33-generic/build (dkms)
Checking for presence of include/linux/llist.h... Yes
Iptables binary version: 1.4.21 (detected from /sbin/iptables)
pkg-config for version 1.4.21 exists: Yes
Checking for presence of xtables.h... Yes (using pkg-config)
Iptables include flags:   (pkg-config)
Iptables module path: /lib/xtables (pkg-config)
Searching for net-snmp-config... No.
Searching for net-snmp agent... Yes.
! You have net-snmp agent but not development package.
! net-snmp agent will not be built, to fix:
!   run:  apt-get install libsnmp-dev
Checking for DKMS... Yes.
Creating Makefile.. done.

  If you need some options enabled run ./configure --help
  Now run: make all install


Building module:
cleaning build area....
make KERNELRELEASE=3.16.0-33-generic ipt_NETFLOW.ko.....
cleaning build area....

DKMS: build completed.

ipt_NETFLOW.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/3.16.0-33-generic/updates/dkms/

depmod.....

DKMS: install completed.
@ubu:~/ipt-netflow# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

@aabc
Copy link
Owner

aabc commented Apr 6, 2015

I'm falling back to analysing your output.

Iptables binary version: 1.4.21 (detected from /sbin/iptables)
pkg-config for version 1.4.21 exists: No (reported: 1.4.19.1)
Checking for presence of xtables.h... Yes
Searching for iptables-1.4.21 sources..
! Can not find iptables source directory, you may try setting it with --ipt-src=
! This is not fatal error, yet. Will be just using default include dir.
Iptables include flags: none (default)
Iptables module path: /usr/local/lib/xtables
/tmp/iptables-1.4.19.1/libxtables (from iptables binary)

Why is pkg-config reporting iptables/xtables version 1.4.19.1 while binary is actually 1.4.21?

You have some manually installed iptables somewhere?

Please show pkg-config xtables --modversion. How much pkg-configs do you have? Please show whereis pkg-config and whereis iptables output.

Why in first configure run pkg-config reporting proper version 1.4.21 but from dkms it's different? It seems, like your system configuration is messed up. Please provide more details.

My preliminary guess, is that you have several pkg-configs and iptableses installed via package system (apt-get install into /usr/bin) and manually (make install into /usr/local/), which confuse build system. And my preliminary suggestion is—remove either packages or manual installs.

@YusDyr
Copy link
Author

YusDyr commented Apr 7, 2015

Yes, you were absolutely right! I have had two different version of iptables (in /sbin/ and /usr/local/sbin/iptables) and so two different xtables.pc in pkg-config. After I fix it, all OK finally.

Are there any possibility to take into account ./configure flags in dkms.conf? As far as I see, dkms.conf doesn't respect it and dkms module so can't me modified accordingly.

@aabc
Copy link
Owner

aabc commented Apr 7, 2015

In fact, it should already save configure flags. If not, it's bug (but in my test with Ubuntu it passed args correctly).

dkms.conf have line PRE_BUILD="./configure --from-dkms-conf=$kernel_source_dir", and configure, if called with --from-dkms-conf, extracts CARGS variable from Makefile, which contains configure options.

@YusDyr
Copy link
Author

YusDyr commented Apr 7, 2015

How can I check it? In other words, if I made ./configure --enable-natevents --disable-snmp-agent && make all install and dkms install -m ipt-netflow/2.1-14-g22ddee7 after, it makes dkms module with nat-events support and snmp-agent absent. Right?

@aabc
Copy link
Owner

aabc commented Apr 7, 2015

if I made ./configure --enable-natevents --disable-snmp-agent && make all install and dkms install -m ipt-netflow/2.1-14-g22ddee7 after, it makes dkms module with nat-events support and snmp-agent absent. Right?

SNMP agent is not part of the kernel module, it's separate thing (net-snmp module) not related to the linux kernel, and will not be installed via DKMS.
About nat-events, yes, you are right.

To check cat /proc/net/stat/ipt_netflow and look at the first line, it will contain list of enabled options, and you should see 'nel' if natevent are enabled.

@aabc
Copy link
Owner

aabc commented Apr 9, 2015

@YusDyr Did you verify that there is no problem with respect of configure options? I plan to close this issue.

@YusDyr
Copy link
Author

YusDyr commented Apr 9, 2015

You definetly can close it, thank you!

@aabc aabc added the invalid label Apr 9, 2015
@aabc aabc closed this as completed Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants