How to edit custom kernel settings

L

L30

Guest
I have p2v an old linux server running a legacy application. The host is ESXi 6.0. Now i need to add the nic driver however it is a custom kernel 2.4.6
Is there a way to just add the driver for the nic without having to recompile the kernel?

if i have to recompile, is there a way to edit current kernel just adding the NIC without changing anything else.
 


OP
B

Bethlehem

Guest
I don't think you're going to have much luck, that's a 15 year old kernel. VMware was barely a baby with their VMware Workstation at the time that kernel came out. Ahhh I remember it well. The product was free then, but you had to get a license from them (free as well). That was the first time I had Windows on a computer in my home. But anyhow......

I ran into this once a few years back. Client had a proprietary LOB app that tied into their EMR. Server was supplied by the vendor and the vendor had gone under years before. We upgraded the client to an ESX host and did a P2V on their servers (same as you). That's when I found out the hard way that the E1000 NIC driver wouldn't run. Kernel was some 2.4.8pre3 or something. Would be another year before the kernel was supported properly.
Compiled a 2.4.37 on there and went on with life. Too much trouble trying to do it any other way. I remember trying a 3.0.x kernel but there wa some kind of softirq issue.....
 
OP
L

L30

Guest
Similar history here...
This machine has 2x kernels. When I boot the system with one kernel the NIC is recognized however the LOB does not work. When I boot from the Custom kernel the NIC is not recognized and the LOB works fine.
In this scenario and as the support for the LOB is long gone, what would be my best option without having to recompile the kernel as the LOB has some dependencies on modules which i am not sure how to install in a new kernel if needed.
I am not a linux expert. Correction kernel version is 2.4.26
 
OP
B

Bethlehem

Guest
I'm going to hop on my lab and check something out.
I think there is an option for a NIC that might suite you, but only available if you configure the VM a certain way or something.... gimme a bit.
 
OP
B

Bethlehem

Guest
Cross your fingers and see if the pcnet32 module exists on that linux install.
Up until esxi 5.x there is a NIC called "Flexible" that emulates the old AMD79c970 PCNet32 VLANCE, which is just a 10MB NIC but hey, it's better than nothing! It is probably still there in ESX 6.x but to be quite honest after going through all this I just got too lazy to look and see for sure. :p
Now, the option to use "Flexible" is not always available. I guess vSphere figures if you are installing something 'newer', then why the hell would you want an old 10MB NIC. You can either create a new VM configuration and then attach the disk to it, or fiddle with your current to get it to allow you to chose the Flexible virtual NIC.

Here are the steps "I" took, to get to where I needed to confirm this.
Fired with the New Virtual Machine wizard and went through the steps to configure a new 'custom' virtual machine.
For 'Guest OS' I had to chose 'Other Linux (32-bit). Anything else and I was not presented with the option I needed when it came time to configure the NIC. I can't say I tried them all, but I clicked though 4 or 5 different ones just to see what would happen.
Lo-and-behold, when I got to 'Nic 1 Type' there it was in all its glory... Flexible.
And the rest, is history.

Now, if you don't know how to load a kernel module and/or make it persistent, that' another story.
modprobe(8) is your friend there.

If you look at the image below it will show the settings I used.

esxi.jpg
 
OP
B

Bethlehem

Guest
I am not a linux expert. Correction kernel version is 2.4.26
Well I wish I had seen that little smidgen BEFORE I hit the lab. I'm pretty sure the e1000 NIC is supported in that kernel. The module should be named either e1000e or e1000. Load that into the kernel and forget about my last post.
OK, I'm tired. It's only 9:30 here in Hawai'i but I'm calling it a night!
 
OP
L

L30

Guest
thanks for all the effort. I can see the e1000 is supported by the kernel but the biggest issue here is that the module is not even compiled to run in the custom kernel. Whoever compile this customized kernel, removed everything, leaving only some modules. Looks like I will have to try and recompile the kernel to add the e1000 module. Many thanks again..
 
OP
B

Bethlehem

Guest
Should be able to grab the source, compile, and then just load the module without messing with the kernel or the existng modules.
 
OP
L

L30

Guest
I have download the kernel source from kernel org as there were no source to be found in the current kernel.
I then ran make menuconfig, make dep, make modules_install, make install. However it created a new kernel without the important modules for the LOB.
How can I edit the current kernel just to select the corresponding NIC I need?
Cheers.
 
OP
B

Bethlehem

Guest
Truth is you could have probably gone into the source and compiled the kernel module only I think.
Something similar to this:
Code:
gcc -DMODULE -D__KERNEL__ -O6 -c module.c

Wait... no, that's not true. You have a clean source. So, you would have had to compile a kernel. But not necessarily use that new kernel.
We have no idea what patches the vendor did to the running kernel in order to get their module(s) to work. So there's no guarantee that their module(s) will even load properly in a new kernel. So long as you have the correct version of kernel source..................
OK, so you did the make menu config and did some basic stuff, making sure that module was included; make dep; make modules....
Could have ended it there, found your module, put it in the modules directory of your running kernel, did a 'depmod -a' and then `modprobe module_name`

Boot your old kernel.
Go to /lib/modules/new_modules_directory
Find the e1000 modules
copy it to /lib/modules/old_modules_directory
(make sure you put it in correct subdirectory)
depmod -a
modprobe e1000
cross fingers???
 
OP
L

L30

Guest
Truth is you could have probably gone into the source and compiled the kernel module only I think.
Something similar to this:
Code:
gcc -DMODULE -D__KERNEL__ -O6 -c module.c

Wait... no, that's not true. You have a clean source. So, you would have had to compile a kernel. But not necessarily use that new kernel.
We have no idea what patches the vendor did to the running kernel in order to get their module(s) to work. So there's no guarantee that their module(s) will even load properly in a new kernel. So long as you have the correct version of kernel source..................
OK, so you did the make menu config and did some basic stuff, making sure that module was included; make dep; make modules....
Could have ended it there, found your module, put it in the modules directory of your running kernel, did a 'depmod -a' and then `modprobe module_name`

Boot your old kernel.
Go to /lib/modules/new_modules_directory
Find the e1000 modules
copy it to /lib/modules/old_modules_directory
(make sure you put it in correct subdirectory)
depmod -a
modprobe e1000
cross fingers???

Have copied the e1000.o to the current kernel directory however when i run
depmod -a
upload_2016-5-31_14-48-6.png


modproble e1000
upload_2016-5-31_14-42-52.png
 
OP
B

Bethlehem

Guest
Been a while since I've seen that. My first thought is that the running kernel is a different patch level than the source that the kernel came from.
You can try to force it to load.
Code:
insmod-f /path/to/module
 
OP
L

L30

Guest
Thanks again. Have tried insmod -f however below error comes up and machine does not boot after that.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top