trouble compiling linux kernel from source

1

I am trying to compile a kernel from the source tree found at https://github.com/fio-prf/em, and I am getting the following error when I run make:

make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
make[3]: `arch/x86/realmode/rm/realmode.bin' is up to date.
  CC [M]  drivers/md/persistent-data/dm-btree.o
In file included from drivers/md/persistent-data/dm-btree.c:7:
drivers/md/persistent-data/dm-btree-internal.h:39: error: redefinition of ‘struct node’
make[3]: *** [drivers/md/persistent-data/dm-btree.o] Error 1
make[2]: *** [drivers/md/persistent-data] Error 2
make[1]: *** [drivers/md] Error 2
make: *** [drivers] Error 2

I downloaded the source tree to /usr/src/on my machine (running CentOS 6.4). I have never done this before and not very familiar with C, i'm not sure what the issue is.

  • error while running make bzImage

    make[2]: Nothing to be done for `all'.
    make[2]: Nothing to be done for `relocs'.
      HOSTCC  scripts/unifdef
      INSTALL include/asm-generic (35 files)
      INSTALL include/drm (15 files)
      INSTALL include/linux/byteorder (2 files)
      INSTALL include/linux/caif (2 files)
      INSTALL include/linux/can (5 files)
      INSTALL include/linux/dvb (8 files)
      INSTALL include/linux/hdlc (1 file)
      INSTALL include/linux/hsi (1 file)
      INSTALL include/linux/isdn (1 file)
      INSTALL include/linux/mmc (1 file)
      INSTALL include/linux/netfilter/ipset (4 files)
    make[4]: *** No rule to make target `/usr/src/linux-3.6.0-swap/include/linux/netfilter/xt_CONNMARK.h', needed by `/usr/src/linux-3.6.0-swap/usr/include/linux/netfilter/.install'.  Stop.
    make[3]: *** [netfilter] Error 2
    make[2]: *** [linux] Error 2
    make[1]: *** [headers_install] Error 2
    make: *** [vmlinux] Error 2
    

cHam

Posted 2013-08-18T19:02:56.287

Reputation: 165

Why was the kernel not downloaded from kernel.org? – cybernard – 2013-08-18T19:17:02.763

it's a custom build for my job – cHam – 2013-08-18T19:18:14.443

follow the steps below and report errors. I assume you have the dependencies installed? – cybernard – 2013-08-18T19:25:38.340

I have ncurses-devel, that was the only one that was listed as missing originally. I'll run it and post results shortly. – cHam – 2013-08-18T19:33:12.127

Answers

0

Generally here are the steps.
Download from kernel.org
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.7.tar.xz
Extract the kernel
cd /usr/src/linux-3.10.7 (or whatever)
make localmodconfig
if you need to change the default settings "make menuconfig"
make bzImage && make modules && make modules_install && make install

cybernard

Posted 2013-08-18T19:02:56.287

Reputation: 11 200

The steps should be the same/similiar with your kernel. – cybernard – 2013-08-18T19:23:25.287

while running make bzImage I get the error I just added to the bottom of my post. – cHam – 2013-08-18T19:46:24.100

Ok. You need to use "make menuconfig" There is a module called CONNMARK you need to turn on. Find "Netfilter connection tracking support" if it is off turn on. The hit the spacebar till you get <M>

Location: -> Networking support (NET [=y]) │ │ -> Networking options │ │ -> Network packet filtering framework (Netfilter) (NETFILTER [= │ │ -> Core Netfilter Configuration │ │ (1) -> Netfilter connection tracking support (NF_CONNTRACK [=m] – cybernard – 2013-08-18T19:57:03.153

I see: "<M> Netfilter connection tracking support " and "<M> "conntrack" connection tracking match support" – cHam – 2013-08-18T20:17:29.227

but no "(NF_CONNTRACK [=m]" – cHam – 2013-08-18T20:32:12.690

Figured out the issue, for some reason the filenames were incorrect. for example xt_CONNMARK.h was actually xt_connmark.h, changed several filenames with the same problems and seems to be working now. Any ideas why this happened and how I can fix it for future updates? I needed to keep both versions of the files for it to go through, I assume there is a line in a config file someplace that needs to be commented out, but not sure where... – cHam – 2013-08-18T21:27:01.497

unfortunately, they are lower case in the repository. You could try and "git commit" your changes. Either that or contact the owner of that project and ask them to make the changes. – cybernard – 2013-08-18T22:42:37.113