unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Building custom kernel modules (e.g. VHBA for CDEmu)
@ 2019-03-25  8:42 Pierre Neidhardt
  2019-04-03  7:49 ` Chris Marusich
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Neidhardt @ 2019-03-25  8:42 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building custom kernel modules (e.g. VHBA for CDEmu)
  2019-03-25  8:42 Building custom kernel modules (e.g. VHBA for CDEmu) Pierre Neidhardt
@ 2019-04-03  7:49 ` Chris Marusich
  2019-04-03  8:09   ` Pierre Neidhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Marusich @ 2019-04-03  7:49 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> 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.

If that's all it takes, then it makes sense to me.  Do we have any
experienced kernel hackers on the list who can comment more on this?

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building custom kernel modules (e.g. VHBA for CDEmu)
  2019-04-03  7:49 ` Chris Marusich
@ 2019-04-03  8:09   ` Pierre Neidhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2019-04-03  8:09 UTC (permalink / raw)
  To: Chris Marusich; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

Actually yesterday Danny posted patch 35110 which implements
`make-linux-module', which answers this issue!

Hurray to Danny! :D

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-03  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-25  8:42 Building custom kernel modules (e.g. VHBA for CDEmu) Pierre Neidhardt
2019-04-03  7:49 ` Chris Marusich
2019-04-03  8:09   ` Pierre Neidhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).