[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to customize the kernel
From: |
Marius Bakke |
Subject: |
Re: How to customize the kernel |
Date: |
Mon, 18 Dec 2017 13:21:25 +0100 |
User-agent: |
Notmuch/0.25.3 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) |
Chris Marusich <address@hidden> 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.
signature.asc
Description: PGP signature