From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: How to customize the kernel Date: Mon, 18 Dec 2017 13:21:25 +0100 Message-ID: <877etk6xbu.fsf@fastmail.com> References: <87shcb9z4y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQuQJ-0007ks-TQ for guix-devel@gnu.org; Mon, 18 Dec 2017 07:21:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQuQD-00032a-OI for guix-devel@gnu.org; Mon, 18 Dec 2017 07:21:35 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44241) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eQuQD-00031w-JV for guix-devel@gnu.org; Mon, 18 Dec 2017 07:21:29 -0500 In-Reply-To: <87shcb9z4y.fsf@gmail.com> 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: Chris Marusich , guix-devel@gnu.org --=-=-= Content-Type: text/plain Chris Marusich writes: > Is anyone building custom kernels? How are you doing it? Are you just > using the "make-linux-libre" procedure anyway, despite the fact that it > supposedly isn't public? Did you copy it and just modify it to suit > your needs? Or did you do something totally different? Here is my approach: --8<---------------cut here---------------end--------------->8--- (define-module (my packages) #:use-module (gnu packages linux)) (define kernel-config (string-append (dirname (current-filename)) "/kernel.config")) (define-public my-kernel (package (inherit linux-libre) (native-inputs `(("kconfig" ,kernel-config) ,@(alist-delete "kconfig" (package-native-inputs linux-libre)))))) (use-modules (my packages)) (operating-system [...] (kernel my-kernel) --8<---------------cut here---------------end--------------->8--- This lets me keep the kernel .config in version control along with the system configuration. > I am new to compiling the Linux kernel, so it is doubly difficult to > learn how I should do it using Guix. Any tips would be greatly > appreciated. I'm guessing one tip might be, "Try building a few Linux > kernels on a more normal distribution, not using Guix, a few times to > get the hang of doing it the 'traditional' way first." I have not > really done that yet. Working with custom kernels in Guix is simpler than in many other distros IMO. Suppose you have a patched Linux-Libre tree, then you could add e.g.: (source "/path/to/custom/kernel") to the package declaration above. Be aware that rolling back to the previous generation might not work if your computer implodes ;-) For starting out, I would recommend copying the GuixSD default config[*] to /your/kernel/tree/.config and run: guix environment linux-libre --ad-hoc ncurses -- make nconfig This will present a nice ncurses-based interface for configuring the kernel. Note that if the kernel major+minor is higher than the .config (see top of file), you should run `make oldconfig` first which gives an interactive "wizard" that walks you through all the new options. Good luck! :-) [*] You can also start from `make defconfig` if you feel adventurous. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlo3ssUACgkQoqBt8qM6 VPqbjAgAya1sVMdabPcmXpxKO+uVjW7lURClB3DmJnoDN91h5Zuc9XchtOi8cQ1d 1PsSnyNCgwQaLyyRuuw7YkRvNS70Zofr9NmiK/tqrcfDEdNRDtHeUCUZTb70hRDi JWb80/vTWYcvIn6AjEOHyzkF25bUwnwsqJMPCeOgdu6+CJ23kewneVL3JMzcbd+U eBIIfy1Ox45IOz1iVo96bv7UpkoqrcZpwIBUDrjhsRdLY27XxETJ9Grb6HvS1qGv oyCOjVHihkuNbAf/MniKt0czcYdGGdmmJnXEJYqJbVZjiIMWI/saO2fV7WORrwnM 0MQFwG/m+reC46EptUlMXPZCg8xqGw== =d/K2 -----END PGP SIGNATURE----- --=-=-=--