Building a kernel module for CentOS 6 64bit

I need the dummy network driver for CentOS 6 64bit and I'm having issues. The running kernel release is 2.6.39.1-x86_64-linode19.

I downloaded the kernel source from 'http://www.kernel.org/pub/linux/kernel/ … .1.tar.bz2">http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.1.tar.bz2', extracted it and grabbed the running config from /proc/config.gz. (zcat /proc/config.gz > .config).

I then edited the .config setting CONFIGDUMMY to 'm' and ran make modules. The resulting module would not load without a --force; kernel log reporting "kernel: dummy: no symbol version for modulelayout"

I checked the vermagic of the created module and it doesn't match the string from uname. the vermagic was simply 2.6.39.1. Checking the CONFIGLOCALVERSION from /proc/config.gz, it is in fact set to an empty string. How is possible that uname and the running config don't agree? '2.6.39.1-x8664-linode19' != '2.6.39.1'

Changing the CONFIGLOCALVERSION to "-x8664-linode19" does make the vermagic in the module match, but trying to insert the module produces the same error.

If I --force load the module, it seems to work fine, but I'd rather not hack up the networking init scripts to include a --force.

What am I missing? How do I need to compile a module for a linode?

thanks

4 Replies

Might be better to run the standard CentOS 6 kernel using pv-grub and then use kernel-headers from the repos instead of the kernel.org source.

When asking support for the kernel sources for the 2.6.39 kernel, they pointed me to kernel.org.

I briefly tried using pv-grub with the distro kernel, but it repeatedly failed with pv-grub telling me the partition was corrupt. Do the distro kernels support the Xen hypervisor?

Yes. You need to create a /boot/grub/menu.lst like this:

# boot=/dev/xvda
# kopt=root=/dev/xvda console=tty0 console=hvc0 ro quiet
# groot=(hd0)

default=0
timeout=0

title CentOS 6 (2.6.32-71.29.1.el6.x86_64)
        root (hd0)
        kernel /boot/vmlinuz-2.6.32-71.29.1.el6.x86_64 root=/dev/xvda console=tty0 console=hvc0 ro quiet
        initrd /boot/initramfs-2.6.32-71.29.1.el6.x86_64.img

I was trying to specify a partition on the first drive, that was the issue; thanks.

Any idea on building a module for the linode kernel?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct