Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to compile a module, that I initially forgot, to my running 2.6.9 kernel. My first idea was to rebuild the entire kernel so I did make mrproper and clean so I no longer have the compiled version of my kernel. Before installing the new kernel I was thinking that I also had to recompile my nvidia, vmware and cisco vpn kernel modules and decided to keep my existing kernel. Simply compiling the necessary module to the righ place in /lib/modules/... unfortunately gives me:
FATAL: Error inserting snd_intel8x0m (/lib/modules/2.6.9/kernel/sound/pci/snd-intel8x0m.ko): Invalid module format
and dmesg: snd_intel8x0m: disagrees about version of symbol struct_module
since the running kernel and the new module are both from the 2.6.9 source it must have something to do with the buidl number of the kernel or something
Can somebody tell me how I can build this module so with the correct version numbers for the running kernel?
Do you have the exact matching kernel sources/headers installed for whatever kernel you happen to be running ? Redhat et al. often have unusual flavours that you'll have to get the sources for from one of their mirrors, rather then kernel.org...
Maenho said 2.6.9, so it's almost certainly a vanilla kernel.
You shouldn't have to recompile these separate modules until you boot the new kernel. Just compile and install the new kernel, then reboot into the new kernel, and install extra drivers/modules.
indeed it's a plain vanilla kernel. The sources for the running kernel are the exact same ones I used for compiling the module. In fact I used the same source tree, did make mrproper, make clean and compiled exactly the same kernel as the one that is running but added the extra module in the .config. I thought I could just copy the extra module to the right location, run depmod and modprobe the new module into the running kernel, this way avoiding to install the new kernel and the hassle of searching the nivida, vmware, cisco vpn installers.
I think the error comes from the fact that 'module versioning' is turned on in the running kernel. I read somewhere this means that all version numbers of the kernel (including build number) have to be the same for both kernel and module. I was hoping that there was a way to compile the module specifically for the running kernel (with the exact version numbers) since that's what the nvidia or vmware installers seem to do.
You shouldn't have to make clean or anything if you just want to recompile the kernel. All you do is probably waste time. No point in recompiling stuff you've already compiled.
Every kernel module has to be compiled for the specific kernel, i.e., 2.6.9 build 2 will not be able to run with a module form 2.6.9 build 1. I know that every time I recompile my kernel, I have to reinstall the NVIDIA video driver (this is the only driver that's not built into the kernel that I use). And 'module versioning' ought to have nothing to do with this. I don't have it enabled, and I still have to reinstall nvidia everytime. You shouldn't be able to compile for the running kernel unless the sources on the hard drive are unmodified from when you booted it.
In file included from ip_gre.c:16:
/lib/modules/2.4.26/build/include/linux/sched.h:807: error: conflicting types for `kernel_thread'
/usr/include/asm/processor.h:432: error: previous declaration of `kernel_thread'
In file included from /lib/modules/2.4.26/build/include/linux/skbuff.h:26,
from ip_gre.c:19:
/lib/modules/2.4.26/build/include/linux/mm.h:379:1: warning: "page_address" redefined
In file included from /lib/modules/2.4.26/build/include/linux/mm.h:26,
from /lib/modules/2.4.26/build/include/linux/skbuff.h:26,
from ip_gre.c:19:
/usr/include/asm/pgtable.h:270:1: warning: this is the location of the previous definition
In file included from /lib/modules/2.4.26/build/include/net/checksum.h:33,
from ip_gre.c:38:
/usr/include/asm/checksum.h:72:30: missing terminating " character
In file included from /lib/modules/2.4.26/build/include/net/checksum.h:33,
from ip_gre.c:38:
/usr/include/asm/checksum.h: In function `ip_fast_csum':
/usr/include/asm/checksum.h:73: error: parse error before "movl"
/usr/include/asm/checksum.h:75:17: invalid suffix "f" on integer constant
/usr/include/asm/checksum.h:82:17: invalid suffix "b" on integer constant
/usr/include/asm/checksum.h:90:13: missing terminating " character
/usr/include/asm/checksum.h:105:17: missing terminating " character
/usr/include/asm/checksum.h: In function `csum_fold':
/usr/include/asm/checksum.h:106: error: parse error before "addl"
/usr/include/asm/checksum.h:108:17: missing terminating " character
/usr/include/asm/checksum.h:121:13: missing terminating " character
/usr/include/asm/checksum.h: In function `csum_tcpudp_nofold':
/usr/include/asm/checksum.h:122: error: parse error before "addl"
/usr/include/asm/checksum.h:126:9: missing terminating " character
/usr/include/asm/checksum.h:128: error: `__x' undeclared (first use in this function)
/usr/include/asm/checksum.h:128: error: (Each undeclared identifier is reported only once
/usr/include/asm/checksum.h:128: error: for each function it appears in.)
/usr/include/asm/checksum.h: At top level:
/usr/include/asm/checksum.h:128: error: parse error before ')' token
/usr/include/asm/checksum.h:161:17: missing terminating " character
/usr/include/asm/checksum.h: In function `csum_ipv6_magic':
/usr/include/asm/checksum.h:162: error: parse error before "addl"
/usr/include/asm/checksum.h:173:17: missing terminating " character
/usr/include/asm/checksum.h:176: error: `__x' undeclared (first use in this function)
/usr/include/asm/checksum.h: At top level:
/usr/include/asm/checksum.h:176: error: parse error before ')' token
/usr/include/asm/checksum.h:176: error: parse error before "__u32"
make: *** [ip_gre.o] Error 1
Seeing that the easy way won't do it, I tried the hard way:
Code:
make mrproper; make menuconfig (setting gre tunneling to M); make dep; make clean; make bzImage; make modules
Then I try
Code:
insmod ip_gre
but I get:
Code:
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __dev_get_by_name_Rsmp_89306b80
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol netdev_finish_unregister_Rsmp_92f02b33
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __ip_select_ident_Rsmp_6aab02db
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __dev_get_by_index_Rsmp_528af64b
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __write_lock_failed
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __kfree_skb_Rsmp_9ff9ebf4
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol inet_del_protocol_Rsmp_35227ee6
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol skb_checksum_Rsmp_54602e1e
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol netif_rx_Rsmp_ad8f73a2
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol csum_partial_Rsmp_9a3de8f8
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol sysctl_ip_default_ttl_Rsmp_f6388c56
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol irq_stat_Rsmp_a18a615a
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol ip_finish_output_Rsmp_f87694fd
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol register_netdev_Rsmp_0ac6d484
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol icmp_send_Rsmp_99af1722
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol inet_add_protocol_Rsmp_b0a15bc8
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol sprintf_Rsmp_1d26aa98
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol skb_realloc_headroom_Rsmp_85881137
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __read_lock_failed
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol unregister_netdev_Rsmp_74922a21
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol printk_Rsmp_1b7d4074
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol kfree_Rsmp_037a0cba
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol netdev_state_change_Rsmp_640e72c5
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol skb_under_panic_Rsmp_9d22b4db
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol ip_route_output_key_Rsmp_2100b1e0
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol sock_wfree_Rsmp_1736bd0e
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol kmalloc_Rsmp_93d4cfe6
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol do_softirq_Rsmp_f0a529b7
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol ip_send_check_Rsmp_a37b7441
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol __pskb_pull_tail_Rsmp_2769b848
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol jiffies_Rsmp_0da02d67
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol ip_fragment_Rsmp_954822be
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol unregister_netdevice_Rsmp_549cff3b
/lib/modules/2.4.264/kernel/net/ipv4/ip_gre.o: unresolved symbol register_netdevice_Rsmp_a7085730
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.