gnu: linux-libre: Add i686 and x86_64 full-blown configs.

Thanks to Jason Self <jself@gnu.org> for the kernel configs.

* gnu/packages/linux.scm (kernel-config): New procedure.
  (linux-libre)[build-phase]: Copy it to .config.  Reduce the list of
  things appended to .config.
  [native-inputs]: Add "kconfig" input.
* gnu/packages/linux-libre-i686.conf,
  gnu/packages/linux-libre-x86_64.conf: New files, from
  <http://jxself.org/x86-32.txt> and <http://jxself.org/x86-64.txt>.
* Makefile.am (KCONFIGS): New variable.
  (nobase_dist_guilemodule_DATA): Add it.
This commit is contained in:
Ludovic Courtès 2014-07-10 00:31:31 +02:00
parent ed09bb11cd
commit a94546ecc4
5 changed files with 15466 additions and 32 deletions

View File

@ -102,10 +102,14 @@ endif BUILD_DAEMON_OFFLOAD
guix/scripts/download.go: guix/build/download.go guix/scripts/download.go: guix/build/download.go
guix/download.go: guix/build/download.go guix/download.go: guix/build/download.go
# Linux-Libre configurations.
KCONFIGS = \
gnu/packages/linux-libre-i686.conf \
gnu/packages/linux-libre-x86_64.conf
GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
nobase_dist_guilemodule_DATA = $(MODULES) nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS)
nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
# Do we need to provide our own non-broken (srfi srfi-37) module? # Do we need to provide our own non-broken (srfi srfi-37) module?

View File

@ -26,6 +26,7 @@
(gnu packages xorg) (gnu packages xorg)
(gnu packages avahi) (gnu packages avahi)
(gnu packages linux)
(gnu services networking) (gnu services networking)
(gnu services avahi) (gnu services avahi)
@ -47,7 +48,8 @@
(device "dummy") (device "dummy")
(type "dummy")) (type "dummy"))
;; %fuse-control-file-system ; needs fuse.ko ;; %fuse-control-file-system ; needs fuse.ko
%binary-format-file-system)) ;; %binary-format-file-system ; needs binfmt.ko
))
(users (list (user-account (users (list (user-account
(name "guest") (name "guest")
@ -83,4 +85,4 @@ You can log in as 'guest' or 'root' with no password.
;; Explicitly allow for empty passwords. ;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t)) (base-pam-services #:allow-empty-passwords? #t))
(packages (cons* xterm avahi %base-packages))) (packages (cons* strace xterm avahi %base-packages)))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,9 @@
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system trivial)) #:use-module (guix build-system trivial)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match))
(define-public (system->linux-architecture arch) (define-public (system->linux-architecture arch)
"Return the Linux architecture name for ARCH, a Guix system name such as "Return the Linux architecture name for ARCH, a Guix system name such as
@ -168,6 +170,21 @@
(base32 (base32
"1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06")))) "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
(define (kernel-config system)
"Return the absolute file name of the Linux-Libre build configuration file
for SYSTEM."
(define (lookup file)
(let ((file (string-append "gnu/packages/" file)))
(search-path %load-path file)))
(match system
("i686-linux"
(lookup "linux-libre-i686.conf"))
("x86_64-linux"
(lookup "linux-libre-x86_64.conf"))
(_
(error "unsupported architecture" system))))
(define-public linux-libre (define-public linux-libre
(let* ((version "3.15") (let* ((version "3.15")
(build-phase (build-phase
@ -182,35 +199,34 @@
(else arch))) (else arch)))
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
(let ((build (assoc-ref %standard-phases 'build))) (let ((build (assoc-ref %standard-phases 'build))
(and (zero? (system* "make" "defconfig")) (config (assoc-ref inputs "kconfig")))
(begin (copy-file config ".config")
;; Appending works even when the option wasn't in the (chmod ".config" #o666)
;; 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)
(close-port port))
(zero? (system* "make" "oldconfig"))) ;; 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_VIRTIO_NET=m\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")
port)
(close-port port))
;; Call the default `build' phase so `-j' is correctly (zero? (system* "make" "oldconfig"))
;; passed.
(apply build #:make-flags "all" args))))) ;; Call the default `build' phase so `-j' is correctly
;; passed.
(apply build #:make-flags "all" args))))
(install-phase (install-phase
`(lambda* (#:key inputs outputs #:allow-other-keys) `(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
@ -241,7 +257,9 @@
(native-inputs `(("perl" ,perl) (native-inputs `(("perl" ,perl)
("bc" ,bc) ("bc" ,bc)
("module-init-tools" ,module-init-tools) ("module-init-tools" ,module-init-tools)
("patch/freedo+gnu" ,%boot-logo-patch))) ("patch/freedo+gnu" ,%boot-logo-patch)
("kconfig" ,(kernel-config (or (%current-target-system)
(%current-system))))))
(arguments (arguments
`(#:modules ((guix build gnu-build-system) `(#:modules ((guix build gnu-build-system)
(guix build utils) (guix build utils)