guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building custom kernel modules (e.g. VHBA for CDEmu)


From: Pierre Neidhardt
Subject: Building custom kernel modules (e.g. VHBA for CDEmu)
Date: Mon, 25 Mar 2019 09:42:03 +0100

Hi!

The question of building custom Linux kernel modules was recently
brought up in bug #35758 (packaging CDEmu).

I'll summarize: a typical Makefile to build a kernel module looks like
this:

 --8<---------------cut here---------------start------------->8---
 VHBA_VERSION := 20170610

 KERNELRELEASE ?= $(shell uname -r)
 KDIR ?= /lib/modules/$(KERNELRELEASE)/build
 PWD ?= $(shell pwd)

 obj-m := vhba.o
 ccflags-y := -DVHBA_VERSION=\"$(VHBA_VERSION)\" -Werror

 default: modules
 install: modules_install

 modules modules_install clean:
         $(MAKE) -C $(KDIR) M=$(PWD) $@
 --8<---------------cut here---------------end--------------->8---

The only thing we need, beside a C compiler, is this KDIR, which on Guix
_could_ be found at

  /gnu/store/…-linux-libre-5.0.1/lib/modules/5.0.1/build

Sadly, for us it's a dangling link to
/tmp/guix-build-linux-libre-5.0.1.drv-0/linux-5.0.1.

I presume that the answer is simple: replace the link with the folder.
But that would eat up significantly more disk space.  So we could
replace the link with a link to a new "build" output of the linux-libre
package, which would contain this "build" folder.

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]