gnu: Use make-linux-libre.
* gnu/packages/linux.scm (make-linux-libre): New variable. (linux-libre, linux-libre-4.4, linux-libre-4.1): Use make-linux-libre. (kernel-config): Take arch instead of system.master
parent
0a1d8596fd
commit
c258807a85
|
@ -238,35 +238,28 @@ the default @code{nsswitch} and the experimental @code{umich_ldap}.")
|
||||||
(base32
|
(base32
|
||||||
"1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
|
"1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
|
||||||
|
|
||||||
(define* (kernel-config system #:key variant)
|
(define* (kernel-config arch #:key variant)
|
||||||
"Return the absolute file name of the Linux-Libre build configuration file
|
"Return the absolute file name of the Linux-Libre build configuration file
|
||||||
for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
|
for ARCH and optionally VARIANT, or #f if there is no such configuration."
|
||||||
(and-let* ((arch (match system
|
(let* ((name (string-append "linux-libre-"
|
||||||
("i686-linux"
|
(if variant (string-append variant "-") "")
|
||||||
"i686")
|
arch ".conf"))
|
||||||
("x86_64-linux"
|
(file (string-append "gnu/packages/" name)))
|
||||||
"x86_64")
|
(if file-exists? (search-path %load-path file) #f)))
|
||||||
(_
|
|
||||||
#f)))
|
|
||||||
(name (string-append "linux-libre-"
|
|
||||||
(if variant
|
|
||||||
(string-append variant "-")
|
|
||||||
"")
|
|
||||||
arch
|
|
||||||
".conf"))
|
|
||||||
(file (string-append "gnu/packages/" name)))
|
|
||||||
(search-path %load-path file)))
|
|
||||||
|
|
||||||
(define-public linux-libre
|
(define* (make-linux-libre version hash
|
||||||
|
#:key
|
||||||
|
;; A function that takes an arch and a variant.
|
||||||
|
;; See kernel-config for an example.
|
||||||
|
(configuration-file #f)
|
||||||
|
(defconfig "defconfig"))
|
||||||
(package
|
(package
|
||||||
(name "linux-libre")
|
(name "linux-libre")
|
||||||
(version "4.7.3")
|
(version version)
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (linux-libre-urls version))
|
(uri (linux-libre-urls version))
|
||||||
(sha256
|
(sha256 (base32 hash))
|
||||||
(base32
|
|
||||||
"18sy1vh4x66hsk0qbq8g5299my082d530zm8c7xnbakq7350igi6"))
|
|
||||||
(patches (origin-patches %boot-logo-patch))))
|
(patches (origin-patches %boot-logo-patch))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(supported-systems '("x86_64-linux" "i686-linux"))
|
(supported-systems '("x86_64-linux" "i686-linux"))
|
||||||
|
@ -275,11 +268,11 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
|
||||||
("bc" ,bc)
|
("bc" ,bc)
|
||||||
("openssl" ,openssl)
|
("openssl" ,openssl)
|
||||||
("module-init-tools" ,module-init-tools)
|
("module-init-tools" ,module-init-tools)
|
||||||
|
,@(let ((conf (configuration-file
|
||||||
,@(let ((conf (kernel-config
|
(system->linux-architecture
|
||||||
(or (%current-target-system)
|
(or (%current-target-system)
|
||||||
(%current-system))
|
(%current-system)))
|
||||||
#:variant (version-major+minor version))))
|
#:variant (version-major+minor version))))
|
||||||
(if conf
|
(if conf
|
||||||
`(("kconfig" ,conf))
|
`(("kconfig" ,conf))
|
||||||
'()))))
|
'()))))
|
||||||
|
@ -317,7 +310,7 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
|
||||||
(begin
|
(begin
|
||||||
(copy-file config ".config")
|
(copy-file config ".config")
|
||||||
(chmod ".config" #o666))
|
(chmod ".config" #o666))
|
||||||
(system* "make" "defconfig"))
|
(system* "make" ,defconfig))
|
||||||
|
|
||||||
;; Appending works even when the option wasn't in the
|
;; Appending works even when the option wasn't in the
|
||||||
;; file. The last one prevails if duplicated.
|
;; file. The last one prevails if duplicated.
|
||||||
|
@ -364,39 +357,20 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
|
||||||
It has been modified to remove all non-free binary blobs.")
|
It has been modified to remove all non-free binary blobs.")
|
||||||
(license license:gpl2)))
|
(license license:gpl2)))
|
||||||
|
|
||||||
|
(define-public linux-libre
|
||||||
|
(make-linux-libre "4.7.3"
|
||||||
|
"18sy1vh4x66hsk0qbq8g5299my082d530zm8c7xnbakq7350igi6"
|
||||||
|
#:configuration-file kernel-config))
|
||||||
|
|
||||||
(define-public linux-libre-4.4
|
(define-public linux-libre-4.4
|
||||||
(package
|
(make-linux-libre "4.4.20"
|
||||||
(inherit linux-libre)
|
"1fi0pyyzcf643vdsss0d9ld6jqyxw0k76r0a5vpd4mv3dcl37yyq"
|
||||||
(version "4.4.20")
|
#:configuration-file kernel-config))
|
||||||
(source (origin
|
|
||||||
(method url-fetch)
|
|
||||||
(uri (linux-libre-urls version))
|
|
||||||
(sha256
|
|
||||||
(base32
|
|
||||||
"1fi0pyyzcf643vdsss0d9ld6jqyxw0k76r0a5vpd4mv3dcl37yyq"))))
|
|
||||||
(native-inputs
|
|
||||||
(let ((conf (kernel-config (or (%current-target-system)
|
|
||||||
(%current-system))
|
|
||||||
#:variant "4.4")))
|
|
||||||
`(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
|
|
||||||
("kconfig" ,conf))))))
|
|
||||||
|
|
||||||
(define-public linux-libre-4.1
|
(define-public linux-libre-4.1
|
||||||
(package
|
(make-linux-libre "4.1.31"
|
||||||
(inherit linux-libre)
|
"0grffah921k136w1qwcswxv6m810s8q54nr2rk7kyqka3a1b81yw"
|
||||||
(version "4.1.32")
|
#:configuration-file kernel-config))
|
||||||
(source (origin
|
|
||||||
(method url-fetch)
|
|
||||||
(uri (linux-libre-urls version))
|
|
||||||
(sha256
|
|
||||||
(base32
|
|
||||||
"0lkksxpxsw6b8vcgbivn2kp6xbml69yx8frrsfrk49sqigz0xds6"))))
|
|
||||||
(native-inputs
|
|
||||||
(let ((conf (kernel-config (or (%current-target-system)
|
|
||||||
(%current-system))
|
|
||||||
#:variant "4.1")))
|
|
||||||
`(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
|
|
||||||
("kconfig" ,conf))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Reference in New Issue