Skip to main content
Topic: custom kernel modules (Read 1440 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

custom kernel modules

There has been a security update from intel for my HP workstational and I need to update the "bios" and uefi.  The security upgrade from HP has a kernel module

Code: [Select]
[ruben@flatbush hpuefi-mod-1.0.3]$ make
make -C /lib/modules/4.9.67-1-lts/build SUBDIRS=/home/ruben/src/hp_bios/non-rpms/hpuefi-mod-1.0.3 modules
make[1]: Entering directory '/usr/lib/modules/4.9.67-1-lts/build'
  CC [M]  /home/ruben/src/hp_bios/non-rpms/hpuefi-mod-1.0.3/hpuefi.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/ruben/src/hp_bios/non-rpms/hpuefi-mod-1.0.3/hpuefi.mod.o
  LD [M]  /home/ruben/src/hp_bios/non-rpms/hpuefi-mod-1.0.3/hpuefi.ko
make[1]: Leaving directory '/usr/lib/modules/4.9.67-1-lts/build'
[ruben@flatbush hpuefi-mod-1.0.3]$ sudo make install
[sudo] password for ruben:
install -D -m 0644 hpuefi.ko /lib/modules/4.9.67-1-lts/kernel/drivers/hpuefi/hpuefi.ko
depmod
install -D -m 0744 mkdevhpuefi /lib/modules/4.9.67-1-lts/kernel/drivers/hpuefi


How do I carry this forward with the next kernel upgrade?

Re: custom kernel modules

Reply #1
You may probably want to take a look into DKMS , pay special attention to the example at the bottom of the wiki page

Re: custom kernel modules

Reply #2
:(

That example is confusing.  There is no discussion of dkms.conf and then the example edits this file with sed to  new location and its is now not clear if all packages need this routine in addition to the  kernel specific code.

With regard to what I am looking at, the source files themselves are from HP, and install  module binaries after compilation directly into the kernel source tree and aren't compatable to be drop in replacements to be placed into  /usr/src

So it looks like I need to hack the HP tarballs, drop the new file into /usr/src and then make the package file for dmks which is a wrapper for mdprobe and depmode.  Is that about right?

 

Re: custom kernel modules

Reply #3
Knowing nothing about the module in question I would say that you just need to replicate the same steps that you are doing now to compile/install the module manually.

Don't take the PKGBUILD file as a must to be template, it is just a guide, you can add whatever logic that you want into the build and package functions, you can even remove the build step completely if you don't need it.

About the dkms.conf I think it is pretty much self explanatory
Code: [Select]
PACKAGE_NAME="@_PKGBASE@"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]="make --uname_r=$kernelver"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="@_PKGBASE@"
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
AUTOINSTALL="yes"

You just need to change the DEST_MODULE_LOCATION to whatever you need to

Anyway there are more resources that you can check about DKMS, for example the Github project page: https://github.com/dell/dkms and specifically about dkms.conf

There is plenty of content all over the Internet that you can consult, just a few
https://help.ubuntu.com/community/DKMS
http://www.forshee.me/2012/03/16/introduction-to-creating-dkms-packages.html
http://www.linuxjournal.com/article/6896