me
/
guix
Archived
1
0
Fork 0

Revert "gnu: make-linux-libre*: Remove input labels."

This reverts commit dfc6957a5a.  git-bisect
found it broke guix pull on non-x86_64 systems like powerpc64le, for reasons
to investigate.
Maxim Cournoyer 2022-12-09 08:16:07 -05:00
parent f49682a09e
commit 0ffa501f2b
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 41 additions and 41 deletions

View File

@ -777,12 +777,12 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
;;; ;;;
(define* (kernel-config arch #:key variant) (define* (kernel-config arch #:key variant)
"Return a file-like object of the Linux-Libre build configuration file for "Return the absolute file name of the Linux-Libre build configuration file
ARCH and optionally VARIANT, or #f if there is no such configuration." for ARCH and optionally VARIANT, or #f if there is no such configuration."
(let* ((name (string-append (if variant (string-append variant "-") "") (let* ((name (string-append (if variant (string-append variant "-") "")
(if (string=? "i386" arch) "i686" arch) ".conf")) (if (string=? "i386" arch) "i686" arch) ".conf"))
(file (string-append "linux-libre/" name))) (file (string-append "linux-libre/" name)))
(local-file (search-auxiliary-file file)))) (search-auxiliary-file file)))
(define %default-extra-linux-options (define %default-extra-linux-options
`(;; Make the kernel config available at /proc/config.gz `(;; Make the kernel config available at /proc/config.gz
@ -890,9 +890,8 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
(define* (make-linux-libre version gnu-revision hash-string supported-systems (define* (make-linux-libre version gnu-revision hash-string supported-systems
#:key #:key
(extra-version #f) (extra-version #f)
;; A function that takes an arch and a variant, and ;; A function that takes an arch and a variant.
;; return a file-like object. See kernel-config ;; See kernel-config for an example.
;; for an example.
(configuration-file #f) (configuration-file #f)
(defconfig "defconfig") (defconfig "defconfig")
(extra-options %default-extra-linux-options) (extra-options %default-extra-linux-options)
@ -976,20 +975,8 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
#$(and extra-version #$(and extra-version
(string-append "-" extra-version))))) (string-append "-" extra-version)))))
(replace 'configure (replace 'configure
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(let ((config (let ((config (assoc-ref inputs "kconfig")))
#$(match (let ((arch (platform-linux-architecture
(lookup-platform-by-target-or-system
(or (%current-target-system)
(%current-system))))))
(and configuration-file arch
(configuration-file
arch
#:variant (version-major+minor version))))
(#f ;no config for this platform
#f)
((? file-like? config)
config))))
;; Use a custom kernel configuration file or a default ;; Use a custom kernel configuration file or a default
;; configuration file. ;; configuration file.
(if config (if config
@ -997,15 +984,15 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
(copy-file config ".config") (copy-file config ".config")
(chmod ".config" #o666)) (chmod ".config" #o666))
(invoke "make" #$defconfig)) (invoke "make" #$defconfig))
;; Appending works even when the option wasn't in the file. ;; Appending works even when the option wasn't in the
;; The last one prevails if duplicated. ;; file. The last one prevails if duplicated.
(let ((port (open-file ".config" "a")) (let ((port (open-file ".config" "a"))
(extra-configuration #$(config->string extra-options))) (extra-configuration #$(config->string extra-options)))
(display extra-configuration port) (display extra-configuration port)
(close-port port)) (close-port port))
(invoke "make" "oldconfig")))) (invoke "make" "oldconfig"))))
(replace 'install (replace 'install
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(let ((moddir (string-append #$output "/lib/modules")) (let ((moddir (string-append #$output "/lib/modules"))
(dtbdir (string-append #$output "/lib/dtbs"))) (dtbdir (string-append #$output "/lib/dtbs")))
;; Install kernel image, kernel configuration and link map. ;; Install kernel image, kernel configuration and link map.
@ -1020,11 +1007,11 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
;; Install kernel modules ;; Install kernel modules
(mkdir-p moddir) (mkdir-p moddir)
(invoke "make" (invoke "make"
;; Disable depmod because the Guix system's module ;; Disable depmod because the Guix system's
;; directory is an union of potentially multiple ;; module directory is an union of potentially
;; packages. It is not possible to use depmod to ;; multiple packages. It is not possible to use
;; usefully calculate a dependency graph while ;; depmod to usefully calculate a dependency
;; building only one of them. ;; graph while building only one of them.
"DEPMOD=true" "DEPMOD=true"
(string-append "MODULE_DIR=" moddir) (string-append "MODULE_DIR=" moddir)
(string-append "INSTALL_PATH=" #$output) (string-append "INSTALL_PATH=" #$output)
@ -1037,8 +1024,8 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
(version (match versions (version (match versions
((x) x)))) ((x) x))))
;; There are symlinks to the build and source directory. ;; There are symlinks to the build and source directory.
;; Both will point to target /tmp/guix-build* and thus not ;; Both will point to target /tmp/guix-build* and thus
;; be useful in a profile. Delete the symlinks. ;; not be useful in a profile. Delete the symlinks.
(false-if-file-not-found (false-if-file-not-found
(delete-file (delete-file
(string-append moddir "/" version "/build"))) (string-append moddir "/" version "/build")))
@ -1046,22 +1033,35 @@ ARCH and optionally VARIANT, or #f if there is no such configuration."
(delete-file (delete-file
(string-append moddir "/" version "/source")))))))))) (string-append moddir "/" version "/source"))))))))))
(native-inputs (native-inputs
(list perl `(("perl" ,perl)
bc ("bc" ,bc)
openssl ("openssl" ,openssl)
elfutils ;needed to enable CONFIG_STACK_VALIDATION ("elfutils" ,elfutils) ;needed to enable CONFIG_STACK_VALIDATION
flex ("flex" ,flex)
bison ("bison" ,bison)
;; These are needed to compile the GCC plugins. ;; These are needed to compile the GCC plugins.
gmp ("gmp" ,gmp)
mpfr ("mpfr" ,mpfr)
mpc)) ("mpc" ,mpc)
,@(match (let ((arch (platform-linux-architecture
(lookup-platform-by-target-or-system
(or (%current-target-system)
(%current-system))))))
(and configuration-file arch
(configuration-file
arch
#:variant (version-major+minor version))))
(#f ;no config for this platform
'())
((? string? config)
`(("kconfig" ,config))))))
(home-page "https://www.gnu.org/software/linux-libre/") (home-page "https://www.gnu.org/software/linux-libre/")
(synopsis "100% free redistribution of a cleaned Linux kernel") (synopsis "100% free redistribution of a cleaned Linux kernel")
(description "GNU Linux-Libre is a free (as in freedom) variant of the (description "GNU Linux-Libre is a free (as in freedom) variant of the
Linux kernel. It has been modified to remove all non-free binary blobs.") Linux kernel. It has been modified to remove all non-free binary blobs.")
(license license:gpl2) (license license:gpl2)
(properties '((max-silent-time . 3600))))) ;don't timeout on blob scan (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
;;; ;;;