On Wed, Apr 03, 2019 at 09:49:59PM +0200, Pierre Neidhardt wrote: > Thank you Efraim, this is awesome! > > Efraim Flashner writes: > > > For the first one I used the #:extra-options route and compiled a list. > > The second one I tried I created a custom kernel and left #:defconfig as > > #f and inherited that to add a kconfig to the native-inputs. > > Oh, I think I had missed the #:defconfig option when I tried. > > > Once I read a bit more of the kernel documentation it wasn't too bad to > > create a list of what I needed. > > Which documentation in particular? Documentation/admin-guide/README.rst from inside the kernel tarball source. > > > tar xf $(guix build linux-libre -S) > > cd linux-libre > > 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 > > > and fix the formatting > > > > make localmodconfig > > Why fixing the formatting? How? With a second `make localmodconfig'? > 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 > > if that works well enough then add "CONFIG_MODULES=y" to .config and > > you're ready to try it out. > > What does CONFIG_MODULES=y change? (Not on my computer now, can't check > in my local linux checkout.) CONFIG_MODULES=y lets the modules be loaded and installed separately, if I remember correctly. Either way, without it the build errors right at the beginning of the install phase: starting phase `install' The present kernel configuration has modules disabled. Type 'make config' and enable loadable module support. Then build a kernel with module support enabled. make: *** [Makefile:1318: modules_install] Error 1 > > This walkthrough is invaluable in my opinion. So far I was under the > impression that many members of the Guix community were annoyed by > kernel compilation time and had tried to customize it, but it's really > hard. This process would make for an excellent blog article in my > opinion! :D I'll try to go ahead and write it up more nicely then. Custom compiling a kernel sounds really scary, but with Guix's rollbacks and declarative everything it's actually not too bad. Currently this doesn't take into account the initrd. -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted