From: ludo@gnu.org (Ludovic Courtès)
To: linux-libre@fsfla.org
Cc: guix-devel@gnu.org
Subject: Coming up with a generic kernel config
Date: Wed, 25 Jun 2014 21:26:22 +0200 [thread overview]
Message-ID: <87vbrooko1.fsf@gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
Hello,
In trying to get a generalist kernel config with Linux-Libre 3.15 for
the GNU system (via GNU Guix), I thought I’d start from ‘allmodconfig’.
Then I figured there are several issues:
1. Serial console is unavailable when booting. I thought that’d be
addressed by explicitly setting CONFIG_SERIAL_8250=y etc. (see
below for the list), but that’s not enough. What am I missing?
2. A whole bunch of test suites that run at startup are enabled by
‘allmodconfig’ (and not ‘defconfig’.) I’ve explicitly added =n
options to disable some of them, but it seems there are still some
lying around. Any idea whether/how these could be systematically
turned off?
For reference, below is my current patch.
Please let me know if this is off-topic.
(And apologies for being such a noob.)
Thanks,
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 5863 bytes --]
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 841ec58..03411d8 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -20,11 +20,14 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages linux)
+ #:use-module (guix utils)
#:use-module ((guix licenses)
#:hide (zlib))
#:use-module (gnu packages)
#:use-module ((gnu packages compression)
#:renamer (symbol-prefix-proc 'guix:))
+ #:use-module ((gnu packages openssl)
+ #:renamer (symbol-prefix-proc 'guix:))
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
#:use-module (gnu packages gperf)
@@ -158,10 +161,47 @@
`insmod', `lsmod', and more.")
(license gpl2+)))
+(define-syntax-rule (string-append* rest ...)
+ "Compile-time string concatenation."
+ (compile-time-value (string-append rest ...)))
+
(define-public linux-libre
(let* ((version "3.15")
+ (common-options
+ (string-append*
+ ;; Require support for loadable modules.
+ "CONFIG_MODULES=y\n"
+ ;; Disable drivers not for this platform.
+ "CONFIG_COMPILE_TEST=n\n"
+ ;; Disable various test suites.
+ "CONFIG_FTRACE_STARTUP_TEST=n\n"
+ "CONFIG_RING_BUFFER_STARTUP_TEST=n\n"
+ "CONFIG_KGDB_TESTS=n\n"
+ "CONFIG_KGDB_TESTS_ON_BOOT=n\n"
+ "CONFIG_DEBUG_NMI_SELFTEST=n\n"
+ ;; FIXME: Try to make sure we can use 'console=ttyS0' early on.
+ "CONFIG_SERIAL_CORE_CONSOLE=y\n"
+ "CONFIG_SERIAL_8250=y\n"
+ "CONFIG_SERIAL_8250_CONSOLE=y\n"
+ "CONFIG_SERIAL_8250_CS=y\n"
+ "CONFIG_SERIAL_8250_PCI=y\n"
+ "CONFIG_PARPORT=y\n"
+ "CONFIG_PARPORT_PC=y\n"
+ "CONFIG_PARPORT_SERIAL=y\n"
+ "CONFIG_NETCONSOLE=y\n"
+ "CONFIG_FRAMEBUFFER_CONSOLE=y\n"
+ ;; Disable some of the debugging facilities.
+ "CONFIG_GCOV_KERNEL=n\n"
+ "CONFIG_MEMTEST=n\n"
+ "CONFIG_USB_DEBUG=n\n"
+ "CONFIG_DEBUG_DEVRES=n\n"
+ "CONFIG_DEBUG_NX_TEST=n\n"
+ "CONFIG_DEBUG_STACK_USAGE=n\n"
+ "CONFIG_DEBUG_STACKOVERFLOW=n\n"
+ ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
+ "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"))
(build-phase
- '(lambda* (#:key system #:allow-other-keys #:rest args)
+ `(lambda* (#:key system #:allow-other-keys #:rest args)
(let ((arch (car (string-split system #\-))))
(setenv "ARCH"
(cond ((string=? arch "i686") "i386")
@@ -169,27 +209,15 @@
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
(let ((build (assoc-ref %standard-phases 'build)))
- (and (zero? (system* "make" "defconfig"))
+ ;; We take options (1) from 'allmodconfig', and (2) from our
+ ;; own set of options. When concatenating option lists, the
+ ;; last one wins.
+ (and (zero? (system* "make" "allmodconfig"))
(begin
;; Appending works even when the option wasn't in the
;; file. The last one prevails if duplicated.
(let ((port (open-file ".config" "a")))
- (display (string-append "CONFIG_NET_9P=m\n"
- "CONFIG_NET_9P_VIRTIO=m\n"
- "CONFIG_VIRTIO_BLK=m\n"
- "CONFIG_SATA_SIS=y\n"
- "CONFIG_VIRTIO_NET=m\n"
- "CONFIG_SIS190=y\n"
- ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
- "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
- "CONFIG_VIRTIO_PCI=m\n"
- "CONFIG_VIRTIO_BALLOON=m\n"
- "CONFIG_VIRTIO_MMIO=m\n"
- "CONFIG_FUSE_FS=m\n"
- "CONFIG_CIFS=m\n"
- "CONFIG_9P_FS=m\n"
- "CONFIG_E1000E=m\n")
- port)
+ (display ,common-options port)
(close-port port))
(zero? (system* "make" "oldconfig")))
@@ -226,17 +254,26 @@
(build-system gnu-build-system)
(native-inputs `(("perl" ,perl)
("bc" ,bc)
- ("module-init-tools" ,module-init-tools)))
+ ("module-init-tools" ,module-init-tools)
+
+ ;; OpenSSL is used to sign modules.
+ ("openssl" ,guix:openssl)))
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
- (ice-9 match))
+ (ice-9 match)
+ (ice-9 rdelim))
#:phases (alist-replace
'build ,build-phase
(alist-replace
'install ,install-phase
(alist-delete 'configure %standard-phases)))
+
+ ;; Shrink all the .ko files. With just --strip-debug, the whole thing
+ ;; is twice as big (350 MiB vs. 160 MiB.)
+ #:strip-flags '("--strip-all")
+
#:tests? #f))
(synopsis "100% free redistribution of a cleaned Linux kernel")
(description
next reply other threads:[~2014-06-25 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 19:26 Ludovic Courtès [this message]
2014-06-25 19:48 ` Coming up with a generic kernel config Sree Harsha Totakura
2014-06-25 20:34 ` Ludovic Courtès
2014-06-27 4:20 ` Mark H Weaver
2014-06-27 9:05 ` Ludovic Courtès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vbrooko1.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=linux-libre@fsfla.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.