From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Building custom kernel modules (e.g. VHBA for CDEmu) Date: Mon, 25 Mar 2019 09:42:03 +0100 Message-ID: <87lg13cplw.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:60761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8LBH-0002ox-J9 for guix-devel@gnu.org; Mon, 25 Mar 2019 04:42:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8LBG-0008Az-G7 for guix-devel@gnu.org; Mon, 25 Mar 2019 04:42:07 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:41307) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8LBG-0008AT-7J for guix-devel@gnu.org; Mon, 25 Mar 2019 04:42:06 -0400 Received: from bababa (lfbn-1-12225-33.w90-92.abo.wanadoo.fr [90.92.41.33]) (Authenticated sender: pierre@atlas.engineer) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 20F6C100009 for ; Mon, 25 Mar 2019 08:42:04 +0000 (UTC) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 :=3D 20170610 KERNELRELEASE ?=3D $(shell uname -r) KDIR ?=3D /lib/modules/$(KERNELRELEASE)/build PWD ?=3D $(shell pwd) obj-m :=3D vhba.o ccflags-y :=3D -DVHBA_VERSION=3D\"$(VHBA_VERSION)\" -Werror default: modules install: modules_install modules modules_install clean: $(MAKE) -C $(KDIR) M=3D$(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/=E2=80=A6-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? =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlyYlFsACgkQm9z0l6S7 zH9DYwf/W5hUw0hZnbj89k39v/TRpaAQJCzd0CI/4X/OHpiKPNRA6/x+xZ/imGx6 UR/ArqpNIdd7oGH0GvktVgm7vUIlGpvxcACzCIEVD4CBZ7lxOdFxbXSEdo55l1KB 8BwCpfXw0KBk51F8BcQhsXVjXlBG0ZEc6C79QNUtAfSegfBjKJd1k53bxnw2AyDw XJ71AGNg1Ldr8oM0q8bEaaUKH/iiNyP3hGTy30V3fbC9MV5vjTvVENe0GNaDE0z0 yOYXsNplSkj6/vf+IPDRQ+iDEUNfweECD0UcIZjD4ZOjtpuzA+Hh8+BPXg9PcBow M/BWqC+UDxLVUU6/VpArH4TQCfIipw== =IFIh -----END PGP SIGNATURE----- --=-=-=--