Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Aug 28, 2008 9:51 am 
Offline
Newbie

Joined: Thu Aug 28, 2008 8:09 am
Posts: 4
hi all,
i'm setting up heartbeat using three linodes. it needs kernel support for ipvs.

so i got the source from http://linode.com/src/2.6.18.8-linode10.tar.bz2 and compiled enabling ipvs.

now i have linux-xenu-2.6.18.8-linode10_custom.1.0_i386.deb in usr/src, could somebody show me how to install this permanently as my kernel in this xen node?

many thanks


Top
   
 Post subject:
PostPosted: Thu Aug 28, 2008 10:25 am 
Offline
Junior Member

Joined: Sat Apr 14, 2007 11:38 am
Posts: 29
I think you can't put your own kernel on the linode, you can only select from those available on the dashboard. But I hear you can create your own kernel modules and insert them into the kernel.

I haven't done this, but I think it goes something like this:
- get the source for the kernel that you are running
- build the module in question (I think I read that you need to use the same compiler as was used to build the kernel that you are running, but this might be wrong)
- load (modprobe) the module
- if it works, set it up so that the module loads at boot (maybe in /etc/modules - that's where it is in debian and relatives anyway)

Have a look at this thread:
http://www.linode.com/forums/viewtopic.php?t=3389


Top
   
 Post subject:
PostPosted: Thu Aug 28, 2008 12:37 pm 
Offline
Junior Member

Joined: Sat Apr 14, 2007 11:38 am
Posts: 29
I was interested in this question and the thread I posted a link to because I also wanted a kernel feature that wasn't provided. For me it was cifs. And now I have it, so it can't be too hard.

My system is Debian, you need to keep that in mind if you can't find stuff where I found it. But most of this is pretty low level, so there shouldn't be too many variations.

[EDIT]Note that you have to redo this whole procedure if you change to a different kernel.[/EDIT]

Here's what I did.
- found out what kernel I'm using
Code:
$ uname -r
2.6.18.8-linode10

- went to /usr/src and became root user
Code:
cd /usr/src
su

got the appropriate source, decompressed it
Code:
# wget http://linode.com/src/2.6.18.8-linode10.tar.bz2
# tar -xvjf 2.6.18.8-linode10.tar.bz2

made a link to the source directory, went in, got the current config
Code:
# ln -s 2.6.18.8-linode10 linux
# cd linux
# cp /proc/config.gz config.gz

unpacked config file, renamed it
Code:
# gunzip config.gz
# mv config .config

configured the kernel
Code:
# make clean
# make menuconfig

(I got held up here for a while as I was missing a dependency for menuconfig - in my case it was the libncurses-dev package - I think. Anyway, if you get errors when you're trying to make menuconfig, check for missing dependencies)

So this is the kernel configuration, and I knew that what I wanted was support for a filesystem (cifs), so that's where I looked. Whatever it is that you want (ipvs) will be somewhere else. If you hit the '/' key in menuconfig, you can search for stuff, but I couldn't find ipvs, so I still don't know what it is.

When I found cifs, I selected it with M, so it would be built as a module, then exited from menuconfig, saving my new configuration.

Then, to finish off I did
Code:
# make modules
# make modules_install
# depmod
# modprobe -f cifs

Like it was said in that other thread I linked to, modprobe would not work without the -f option, as the compiler versions are different. I don't know what implications this will have for trying to load the module automatically at boot, maybe I'll just have to write a custom startup script to load the module with the -f option.

Good luck. As the geeks say, your mileage may vary.


Last edited by bernied on Sat Jan 17, 2009 11:04 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Thu Aug 28, 2008 12:55 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
Nice post, bernied. Good info.

My only variation would be to point out that there's no need to work in /usr/src; all this can be done in your home directory, which means you only need to be root for the last three steps ('make module_install; depmod, modprobe cifs'). Avoiding root access is, IMO, a Good Thing.

Oh, and this only works for Xen linodes. UML can't load modules, IIRC.

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
 Post subject:
PostPosted: Sat Aug 30, 2008 12:36 am 
Offline
Newbie

Joined: Thu Aug 28, 2008 8:09 am
Posts: 4
thank you all for the helpful replies.

ipvs is under network options.

i achieved some success, but again stuck in last two steps.

when i issue..
li23-66:/usr/src/linux# make modules_install
INSTALL fs/cifs/cifs.ko
INSTALL net/ipv4/ipvs/ip_vs_dh.ko
INSTALL net/ipv4/ipvs/ip_vs_ftp.ko
INSTALL net/ipv4/ipvs/ip_vs_lblc.ko
INSTALL net/ipv4/ipvs/ip_vs_lblcr.ko
INSTALL net/ipv4/ipvs/ip_vs_lc.ko
INSTALL net/ipv4/ipvs/ip_vs_nq.ko
INSTALL net/ipv4/ipvs/ip_vs_rr.ko
INSTALL net/ipv4/ipvs/ip_vs_sed.ko
INSTALL net/ipv4/ipvs/ip_vs_sh.ko
INSTALL net/ipv4/ipvs/ip_vs_wlc.ko
INSTALL net/ipv4/ipvs/ip_vs_wrr.ko
if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map 2.6.18.8-linode10; fi

li23-66:/usr/src/linux# modprobe ipvs
FATAL: Module ipvs not found.

but modinfo cifs gives all information about it

i'm successful till this.. then in my dmesg says.. for all ipvs mods..

ip_vs_wlc: version magic '2.6.18.8-linode10 SMP mod_unload Xen PENTIUM4 REGPARM gcc-3.4' should be '2.6.18.8-linode10 SMP mod_unload Xen PENTIUM4 REGPARM gcc-4.0'

is this my gcc version is different with what existing gcc used? i tried gcc4.1 and then tried lowering it to gcc3.4. it seems like gcc4.0 .deb is not available to install in debian.

could somebody show me the things which i have to correct?


Top
   
 Post subject:
PostPosted: Sat Aug 30, 2008 1:25 am 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
ceynet wrote:
ip_vs_wlc: version magic '2.6.18.8-linode10 SMP mod_unload Xen PENTIUM4 REGPARM gcc-3.4' should be '2.6.18.8-linode10 SMP mod_unload Xen PENTIUM4 REGPARM gcc-4.0'

is this my gcc version is different with what existing gcc used? i tried gcc4.1 and then tried lowering it to gcc3.4. it seems like gcc4.0 .deb is not available to install in debian.

could somebody show me the things which i have to correct?

Code:
# modprobe -f ipvs

It still might not work with the gcc version mismatch, but this will force the module to load so you can at least try it out.


Top
   
 Post subject:
PostPosted: Wed Sep 03, 2008 4:43 am 
Offline
Newbie

Joined: Thu Aug 28, 2008 8:09 am
Posts: 4
thank you all..

managed to compile and load the kernel. but one more issue left..

when i insert it in /etc/modules it failed loading..

is there a way i can load the module with -f when my linode boots up?


Top
   
 Post subject:
PostPosted: Wed Sep 03, 2008 5:40 am 
Offline
Newbie

Joined: Thu Aug 28, 2008 8:09 am
Posts: 4
sorry.. for being this dumb.. :)

the following line in /etc/modules loaded the module at boot

-f ip_vs

a big thank to community


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group