guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom kernel config


From: Efraim Flashner
Subject: Re: custom kernel config
Date: Sun, 7 Apr 2019 17:36:48 +0300
User-agent: Mutt/1.11.4 (2019-03-13)

On Thu, Apr 04, 2019 at 01:44:48AM -0700, Chris Marusich wrote:
> Efraim Flashner <address@hidden> writes:
> 
> > On Wed, Apr 03, 2019 at 09:49:59PM +0200, Pierre Neidhardt wrote:
> >> Thank you Efraim, this is awesome!
> 
> I second this remark!  It's really helpful to see how you're doing it.
> Thank you for taking the time to share with us!
> 
> >> > tar xf $(guix build linux-libre -S)
> >> > cd linux-libre<tab>
> >> > touch .config
> >> > guix environment linux-libre
> >> >     make localmodconfig
> >> >
> >> > copy that into .config
> >> 
> >> Copy what into .config?
> >
> > the .config you just created at the root of the source tarball
> 
> I think there is some confusion here.  When I run "touch .config" and
> then run "make localmodconfig", the .config file is not modified.
> Perhaps you meant that we need to take the stdout from "make
> localmodconfig", save it, and copy it (after massaging it) back into the
> .config file?

Yeah, basically

> 
> > running make localconfig spits out a bunch of pseudo-error messages
> > about modules that are missing in .config. If you copy that whole
> > message, minus the lines starting with 'WARING', into .config and
> > then format it as UPERCASE_OPTION=(y|m) it gives the kernel a config
> > that is usable for it.
> >
> > so turning lines that look like:
> > module nouveau did not have configs CONFIG_DRM_NOUVEAU
> >
> > into lines that look like:
> > CONFIG_DRM_NOUVEAU=m
> 
> I read up a little on the various targets.  The documentation you
> mentioned was helpful, "make help" was helpful, the Makefile source was
> somewhat helpful, and the contents of
> ./scripts/kconfig/streamline_config.pl were helpful for understanding
> the intent of the "localmodconfig" target.
> 
> It sounds like the intended use of "localmodconfig" target is to modify
> an existing, non-empty .config file.  With that in mind, how does the
> procedure you describe compare to something like the following?
> 
> 1) Invoke "guix repl".  Then run this to determine the config that would
> normally be used to configure the default linux-libre kernel:
> 
>   scheme@(guix-user)> (assoc "kconfig" (package-native-inputs linux-libre))
>   $1 = ("kconfig" 
> "/gnu/store/cwghfr06cadj2ss1ya6whgczpcba58z3-guix-module-union/share/guile/site/2.2/gnu/packages/aux-files/linux-libre/5.0-x86_64.conf")
> 
> 2) Copy that file out of the store into .config.
> 
> 3) Run "make olddefconfig" to non-interactively update the .config file.
> 
> 4) Run "make localmodconfig" to streamline the .config based on what's
> currently loaded.  I expected this target to also be non-interactive,
> but to my surprise it still asked me to choose what to set for a few
> options.
> 
> If you do it this way, you don't have to fix up formatting.  However,
> maybe it doesn't produce the same kind of configuration you had in mind.
> What do you think?
> 

This doesn't create a config that is as small as possible, which is what
I was looking for.

> > Currently this doesn't take into account the initrd.
> 
> Do you mean that there are modules or configuration which the initrd
> might need, which this procedure might accidentally disable?
> 

Yeah. I get different errors about missing ahci.ko or scsi.ko, so it's
going to take a bit more work.

> -- 
> Chris

I've started writing up a blog post about it (which I've attached), but
it doesn't work as-is.  More work incoming later I guess.


-- 
Efraim Flashner   <address@hidden>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: custom-kernel.md
Description: Text document

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]