From: Marius Bakke <mbakke@fastmail.com>
To: Efraim Flashner <efraim@flashner.co.il>,
guix-devel@gnu.org, Pierre Neidhardt <mail@ambrevar.xyz>,
Ludovic Courts <ludo@gnu.org>,
Chris Marusich <cmmarusich@gmail.com>
Subject: Re: [BLOG] custom kernel config
Date: Thu, 16 May 2019 16:29:56 +0200 [thread overview]
Message-ID: <87h89uo4kb.fsf@devup.no> (raw)
In-Reply-To: <20190515180945.GA7636@macbook41>
[-- Attachment #1: Type: text/plain, Size: 4545 bytes --]
Hi Efraim,
Efraim Flashner <efraim@flashner.co.il> writes:
> I've cleaned up the blog post a bit and run it through a spell checker.
> I'm unsure about Linux-Libre vs linux-libre, regarding talking about the
> kernel and the package. I think I glossed over it well enough that I
> didn't actually get a custom kernel up and running on my laptop, but for
> the purpose of the blog post I don't think it's actually necessary.
>
> --
> Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted
> title: Creating and using a custom Linux kernel on Guix System
> date: 2019-05-20 00:00
> author: Efraim Flashner
> tags: kernel, customization
> ---
>
> Guix is, at its core, a source based distribution with substitutes, and
> as such building packages from their source code is an expected part of
> regular package installations and upgrades. Given this starting point,
> it makes sense that efforts are made to reduce the amount of time spent
> compiling packages, and recent changes and upgrades to the building and
> distribution of substitutes continues to be a topic of discussion within
> Guix. One of the packages which I prefer to not build myself is the
> Linux-Libre kernel. The kernel, while not requiring an overabundance of
> RAM to build, does take a very long time on my build machine (which my
> children argue is actually their Kodi computer), and I will often delay
> reconfiguring my laptop while I want for a substitute to be prepared by
> the official build farm. The official kernel configuration, as is the
> case with many GNU/Linux distributions, errs on the side of
> inclusiveness, and this is really what causes the build to take such a
> long time when I build the package for myself.
>
> The Linux kernel, however, can also just be described as a package
> installed on my machine, and as such can be customized just like any
> other package. The procedure is a little bit different, although this
> is primarily due to the nature of how the package definition is written.
>
> The linux-libre kernel package definition is actually a procedure which
> creates a package.
>
> ```scheme
> (define* (make-linux-libre version hash supported-systems
> #:key
> ;; A function that takes an arch and a variant.
> ;; See kernel-config for an example.
> (extra-version #f)
> (configuration-file #f)
> (defconfig "defconfig")
> (extra-options %default-extra-linux-options)
> (patches (list %boot-logo-patch)))
> ...)
> ```
>
> The current linux-libre package is for the 5.1.x series, and is
> declared like this:
>
> ```scheme
> (define-public linux-libre
> (make-linux-libre %linux-libre-version
> %linux-libre-hash
> '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
> #:patches %linux-libre-5.1-patches
> #:configuration-file kernel-config))
> ```
>
> Any keys which are not assigned values inherit their default value from
> the make-linux-libre definition. When comparing the two snippets above,
> you may notice that the code comment in the first doesn't actually refer
> to the extra-version keyword; it is actually for configuration-file.
> Because of this, it is not actually easy to include a custom kernel
> configuration from the definition, but don't worry, there are other ways
> to work with what we do have.
Thank you for writing this! I'm sure many would-be power users are
stymied by the weird Scheme interfaces :-)
I just want to point out an (IMO) easier way to provide a custom kernel
configuration, that does not involve the "make-linux-libre" procedure:
--8<---------------cut here---------------start------------->8---
(define-public linux-libre/custom
(package
(inherit linux-libre)
(native-inputs
`(("kconfig" ,(local-file "kernel.config"))
,@(alist-delete "kconfig"
(package-native-inputs linux-libre))))))
--8<---------------cut here---------------end--------------->8---
At the end of the day, Linux-Libre is just a regular package that can be
inherited and overridden like any other :-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2019-05-16 14:30 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 18:04 custom kernel config Efraim Flashner
2019-04-01 18:30 ` Pierre Neidhardt
2019-04-02 5:37 ` Efraim Flashner
2019-04-02 8:04 ` Pierre Neidhardt
2019-04-02 14:49 ` Efraim Flashner
2019-04-01 19:46 ` Ludovic Courtès
2019-04-02 14:50 ` Efraim Flashner
2019-04-03 8:08 ` Chris Marusich
2019-04-03 19:04 ` Efraim Flashner
2019-04-03 19:49 ` Pierre Neidhardt
2019-04-03 20:27 ` Efraim Flashner
2019-04-04 8:44 ` Chris Marusich
2019-04-07 14:36 ` Efraim Flashner
2019-04-07 17:25 ` Pierre Neidhardt
2019-04-08 14:52 ` Ludovic Courtès
2019-04-08 15:03 ` Pierre Neidhardt
2019-05-01 7:54 ` Pierre Neidhardt
2019-05-06 3:46 ` Chris Marusich
2019-05-06 8:01 ` Efraim Flashner
2019-05-06 8:34 ` Pierre Neidhardt
2019-05-01 9:31 ` Mark H Weaver
2019-05-01 14:15 ` Ludovic Courtès
2019-05-15 18:09 ` [BLOG] " Efraim Flashner
2019-05-16 11:10 ` Pierre Neidhardt
2019-05-16 19:15 ` Efraim Flashner
2019-05-16 11:48 ` Pierre Neidhardt
2019-05-16 14:29 ` Marius Bakke [this message]
2019-05-16 14:33 ` Pierre Neidhardt
2019-05-16 19:14 ` Efraim Flashner
2019-05-17 0:15 ` Mark H Weaver
2019-05-17 7:50 ` Efraim Flashner
2019-05-20 14:57 ` Ludovic Courtès
2019-05-20 17:38 ` Efraim Flashner
2019-05-21 10:07 ` Ludovic Courtès
2019-05-21 12:46 ` zimoun
2019-05-18 2:04 ` ison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h89uo4kb.fsf@devup.no \
--to=mbakke@fastmail.com \
--cc=cmmarusich@gmail.com \
--cc=efraim@flashner.co.il \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=mail@ambrevar.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).