unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How to customize the kernel
@ 2017-12-16  2:37 Chris Marusich
  2017-12-18  9:26 ` Andy Wingo
  2017-12-18 12:21 ` Marius Bakke
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Marusich @ 2017-12-16  2:37 UTC (permalink / raw)
  To: guix-devel

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

Hi,

Suppose you want to compile a custom kernel.  Suppose you want to use a
custom kernel configuration.  Currently, none of the logic that builds
linux-libre kernels in Guix is public,, so the implication is that
nobody should be using that to customize their kernel builds.

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?

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.

-- 
Chris

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

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

* Re: How to customize the kernel
  2017-12-16  2:37 How to customize the kernel Chris Marusich
@ 2017-12-18  9:26 ` Andy Wingo
  2017-12-18 12:21 ` Marius Bakke
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2017-12-18  9:26 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

On Sat 16 Dec 2017 03:37, Chris Marusich <cmmarusich@gmail.com> 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?

To build upstream kernels I just do a (package (inherit linux-libre)
...) and include a customized (source) pointing to the upstream kernel.
I don't change the config though.  For what it's worth :)

Andy

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

* Re: How to customize the kernel
  2017-12-16  2:37 How to customize the kernel Chris Marusich
  2017-12-18  9:26 ` Andy Wingo
@ 2017-12-18 12:21 ` Marius Bakke
  2017-12-18 13:45   ` Vincent Legoll
  1 sibling, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2017-12-18 12:21 UTC (permalink / raw)
  To: Chris Marusich, guix-devel

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

Chris Marusich <cmmarusich@gmail.com> 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.

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

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

* Re: How to customize the kernel
  2017-12-18 12:21 ` Marius Bakke
@ 2017-12-18 13:45   ` Vincent Legoll
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent Legoll @ 2017-12-18 13:45 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

Hello,

On Mon, Dec 18, 2017 at 1:21 PM, Marius Bakke <mbakke@fastmail.com> wrote:
>  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---

The above should be put somewhere in the doc, faq, maybe
in a sample system config, or whatever.

Early adopters will probably want to do just that (at least I did,
when I tried GuixSD for the first time).

-- 
Vincent Legoll

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

end of thread, other threads:[~2017-12-18 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-16  2:37 How to customize the kernel Chris Marusich
2017-12-18  9:26 ` Andy Wingo
2017-12-18 12:21 ` Marius Bakke
2017-12-18 13:45   ` Vincent Legoll

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