Driver/Module build

General support questions
Post Reply
harrywangca
Posts: 107
Joined: 2016/01/12 23:27:04
Location: Vista California

Driver/Module build

Post by harrywangca » 2023/06/21 22:28:15

Hello Everyone,

Years ago I built a kernel and put into a production. Right now customer needs to upgrade a hardware and I need to build a new driver for this upgrade hardware. But there is a problem to me, before I built the kernel to put to production, but I lost my kernel build configuration file (.config), if I download the same version kernel, create a new .config file and rebuilt kernel, then based on this to build the new driver, but the new driver won't be inserted into the production, I tried insmod and modprobe, all are failed with unknown symbol or invalid module.

I know if I have the original .config file which was used to build the kernel, it will work.

Can any one help how to solve this kind of issue?

Thank you!!!
Harry

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Driver/Module build

Post by Whoever » 2023/06/22 04:20:39

Depending on how you built the kernel, you may have a pseudo file: /proc/config.gz which contains the .config file.

Why are you not using a pre-built kernel?

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Driver/Module build

Post by jlehtone » 2023/06/22 21:14:51

harrywangca wrote:
2023/06/21 22:28:15
... upgrade a hardware and I need to build a new driver for this upgrade hardware.
Is that so exotic hardware that nobody else has kernel module for it?

How do say dkms or folks at ELRepo build kernel modules? I don't think that they rebuild the kernel in that process.

User avatar
toracat
Site Admin
Posts: 7518
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Driver/Module build

Post by toracat » 2023/06/24 01:33:57

You can always get to the kernel config file by looking into the /boot directory. For example the current config is:

/boot/config-3.10.0-1160.92.1.el7.x86_64
CentOS Forum FAQ

Post Reply