summaryrefslogtreecommitdiff
path: root/nongnu/packages/linux.scm
diff options
context:
space:
mode:
Diffstat (limited to 'nongnu/packages/linux.scm')
-rw-r--r--nongnu/packages/linux.scm382
1 files changed, 264 insertions, 118 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm
index 106786b..ba16623 100644
--- a/nongnu/packages/linux.scm
+++ b/nongnu/packages/linux.scm
@@ -1,24 +1,25 @@
+;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2019 Timotej Lazar <timotej.lazar@araneo.si>
;;; Copyright © 2020, 2021 James Smith <jsubuntuxp@disroot.org>
-;;; Copyright © 2020, 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2020, 2021, 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2020, 2022 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2020, 2021, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2020, 2021, 2022 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2021 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
-;;;
-;;; This program is free software: you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation, either version 3 of the License, or
-;;; (at your option) any later version.
-;;;
-;;; This program is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+;;; Copyright © 2021 Risto Stevcev <me@risto.codes>
+;;; Copyright © 2021 aerique <aerique@xs4all.nl>
+;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 Remco van 't Veer <remco@remworks.net>
+;;; Copyright © 2022 Simen Endsjø <simendsjo@gmail.com>
+;;; Copyright © 2022 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2023 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2023 Jelle Licht <jlicht@fsfe.org>
(define-module (nongnu packages linux)
#:use-module (gnu packages)
@@ -29,6 +30,7 @@
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix download)
+ #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
@@ -36,72 +38,101 @@
#:use-module (guix build-system trivial)
#:use-module (ice-9 match)
#:use-module (nonguix licenses)
+ #:use-module (srfi srfi-1)
#:export (corrupt-linux))
-(define (linux-urls version)
- "Return a list of URLS for Linux VERSION."
- (list (string-append "https://www.kernel.org/pub/linux/kernel/v"
- (version-major version) ".x/linux-" version ".tar.xz")))
-
-(define (corrupt-linux freedo version hash)
- (package
- (inherit freedo)
- (name "linux")
- (version version)
- (source (origin
- (method url-fetch)
- (uri (linux-urls version))
- (sha256 (base32 hash))))
- (home-page "https://www.kernel.org/")
- (synopsis "Linux kernel with nonfree binary blobs included")
- (description
- "The unmodified Linux kernel, including nonfree blobs, for running Guix
-System on hardware which requires nonfree software to function.")))
-
-(define-public linux-5.14
- (corrupt-linux linux-libre-5.14 "5.14.14"
- "0snh17ah49wmfmazy6x42rhvl484h657y0iq4l09a885sjb4xzsd"))
+(define (linux-url version)
+ "Return a URL for Linux VERSION."
+ (string-append "mirror://kernel.org"
+ "/linux/kernel/v" (version-major version) ".x"
+ "/linux-" version ".tar.xz"))
+
+(define* (corrupt-linux freedo #:key (name "linux") (configs '()))
+
+ ;; TODO: This very directly depends on guix internals.
+ ;; Throw it all out when we manage kernel hashes.
+ (define gexp-inputs (@@ (guix gexp) gexp-inputs))
+
+ (define extract-gexp-inputs
+ (compose gexp-inputs force origin-uri))
+
+ (define (find-source-hash sources url)
+ (let ((versioned-origin
+ (find (lambda (source)
+ (let ((uri (origin-uri source)))
+ (and (string? uri) (string=? uri url)))) sources)))
+ (if versioned-origin
+ (origin-hash versioned-origin)
+ #f)))
+
+ (let* ((version (package-version freedo))
+ (url (linux-url version))
+ (pristine-source (package-source freedo))
+ (inputs (map gexp-input-thing (extract-gexp-inputs pristine-source)))
+ (sources (filter origin? inputs))
+ (hash (find-source-hash sources url)))
+ (package
+ (inherit
+ (customize-linux
+ #:name name
+ #:source (origin
+ (method url-fetch)
+ (uri url)
+ (hash hash))
+ #:configs configs))
+ (version version)
+ (home-page "https://www.kernel.org/")
+ (synopsis "Linux kernel with nonfree binary blobs included")
+ (description
+ "The unmodified Linux kernel, including nonfree blobs, for running Guix System
+on hardware which requires nonfree software to function."))))
+
+(define-public linux-6.2
+ (corrupt-linux linux-libre-6.2))
+
+(define-public linux-6.1
+ (corrupt-linux linux-libre-6.1))
+
+(define-public linux-5.15
+ (corrupt-linux linux-libre-5.15))
(define-public linux-5.10
- (corrupt-linux linux-libre-5.10 "5.10.75"
- "0jrhhk89587caw54nhnwms93kq33qdm75x5f18cp61xrxxgjyaqa"))
+ (corrupt-linux linux-libre-5.10))
(define-public linux-5.4
- (corrupt-linux linux-libre-5.4 "5.4.145"
- "1yb8vk5sbnyswylkpqw5i4n9cmnmlrfmbrnmy3nif579q8p7ixsw"))
+ (corrupt-linux linux-libre-5.4))
(define-public linux-4.19
- (corrupt-linux linux-libre-4.19 "4.19.206"
- "1h44lvzxd0cngj71bk8qba9dz7jlqj68ir6xjwfafglb81ppgsxp"))
+ (corrupt-linux linux-libre-4.19))
(define-public linux-4.14
- (corrupt-linux linux-libre-4.14 "4.14.246"
- "0fpgig84shpas1jc0h4s3aw9brkcq1as84gjbk4bfhc48bpi4mlw"))
+ (corrupt-linux linux-libre-4.14))
+
+(define-public linux linux-6.2)
+;; linux-lts points to the *newest* released long-term support version.
+(define-public linux-lts linux-5.15)
-(define-public linux-4.9
- (corrupt-linux linux-libre-4.9 "4.9.282"
- "059fin4si93ya13xy831w84q496ksxidpd3kyw38918sfy4p6wk7"))
+(define-public linux-arm64-generic-6.0
+ (corrupt-linux linux-libre-arm64-generic #:name "linux-arm64-generic"))
-(define-public linux-4.4
- (corrupt-linux linux-libre-4.4 "4.4.283"
- "1d9v4h4cbc4i371lhhwpxbmg88gna6xyi2ahfvv0clz60802y982"))
+(define-public linux-arm64-generic-5.15
+ (corrupt-linux linux-libre-arm64-generic #:name "linux-arm64-generic"))
-(define-public linux linux-5.14)
-;; linux-lts points to the *newest* released long-term support version.
-(define-public linux-lts linux-5.10)
+(define-public linux-arm64-generic linux-arm64-generic-6.0)
+
+(define-public linux-arm64-generic-lts linux-arm64-generic-5.15)
(define-public linux-firmware
(package
(name "linux-firmware")
- (version "20210919")
+ (version "20230310")
(source (origin
(method url-fetch)
- (uri (string-append "https://git.kernel.org/pub/scm/linux/kernel"
- "/git/firmware/linux-firmware.git/snapshot/"
- "linux-firmware-" version ".tar.gz"))
+ (uri (string-append "mirror://kernel.org/linux/kernel/firmware/"
+ "linux-firmware-" version ".tar.xz"))
(sha256
(base32
- "1fy6alg7pz5bc09vq0icmgbwqpribws6nyc6k2pkip8jljmxvlr0"))))
+ "1clrh5bkfd8ifjmfwj3sbkr8ihh28sx6phs17jnyr8cc2zjx8s2r"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f
@@ -171,16 +202,30 @@ advanced 3D.")))
(define-public raspberrypi-firmware
(package
(name "raspberrypi-firmware")
- (version "1.20210527")
+ (version "1.20220331")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/raspberrypi/firmware")
(commit version)))
+ (modules '((guix build utils)
+ (ice-9 ftw)
+ (srfi srfi-26)))
+ (snippet
+ '(begin
+ (for-each (lambda (name)
+ (delete-file-recursively name))
+ `("documentation" "extra" ".github" "hardfp" "modules" "opt" "README.md"
+ ,@(map (lambda (name)
+ (string-append "boot/" name))
+ (scandir "boot" (cut (file-name-predicate "^(kernel.*|COPYING\\.linux)$") <> #f)))))))
(file-name (git-file-name name version))
(sha256
(base32
- "08lgg90k6lhqm3ccg7db0lrrng0pgf63dvbrxpfpwm1pswrc5vf5"))))
+ "1hd1vkghkgdlmw04fap28f68nsf7d7i8dq6h9r4xa0h9y4f6j6ag"))))
+ (arguments
+ '(#:install-plan
+ '(("boot/" "."))))
(build-system copy-build-system)
(synopsis "Firmware for the Raspberry Pi boards")
(description "Pre-compiled binaries of the current Raspberry Pi kernel
@@ -412,6 +457,26 @@ support for 5GHz and 802.11ac, among others.")
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware"
"/linux-firmware.git/plain/LICENCE.iwlwifi_firmware")))))
+(define-public i915-firmware
+ (package
+ (inherit linux-firmware)
+ (name "i915-firmware")
+ (arguments
+ `(#:license-file-regexp "LICENCE.i915"
+ ,@(substitute-keyword-arguments (package-arguments linux-firmware)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'select-firmware
+ ,(select-firmware "^i915/")))))))
+ (home-page "https://01.org/linuxgraphics/gfx-docs/drm/gpu/i915.html")
+ (synopsis "Nonfree firmware for Intel integrated graphics")
+ (description "This package contains the various firmware for Intel
+integrated graphics chipsets, including GuC, HuC and DMC.")
+ (license
+ (nonfree (string-append
+ "https://git.kernel.org/pub/scm/linux/kernel/git/firmware"
+ "/linux-firmware.git/plain/LICENCE.i915")))))
+
(define-public realtek-firmware
(package
(inherit linux-firmware)
@@ -422,7 +487,8 @@ support for 5GHz and 802.11ac, among others.")
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'select-firmware
- ,(select-firmware "^(rtlwifi|rtl_nic|rtl_bt)/")))))))
+ ,(select-firmware
+ "^(rtlwifi|rtl_nic|rtl_bt|rtw88|rtw89)/")))))))
(home-page "https://wireless.wiki.kernel.org/en/users/drivers/rtl819x")
(synopsis "Nonfree firmware for Realtek ethernet, wifi, and bluetooth chips")
(description
@@ -512,8 +578,8 @@ package contains nonfree firmware for the following chips:
(deprecated-package "rtl-bt-firmware" realtek-firmware))
(define-public rtl8192eu-linux-module
- (let ((commit "cdf1b06b7bff49042f42d0294610d3f3780ee62b")
- (revision "1"))
+ (let ((commit "865656c3a1d1aee8c4ba459ce7608756d17c712f")
+ (revision "5"))
(package
(name "rtl8192eu-linux-module")
(version (git-version "0.0.0" revision commit))
@@ -526,7 +592,7 @@ package contains nonfree firmware for the following chips:
(file-name (git-file-name name version))
(sha256
(base32
- "1afscxmjmapvm8hcd0blp1fn5lxg92rhpiqkgj89x53shfsp12d6"))))
+ "08nq0wlrpzm8n2g14c4jlxs0crr6s5ls1n14bc17zmpy9vlarhfx"))))
(build-system linux-module-build-system)
(arguments
`(#:make-flags
@@ -544,8 +610,122 @@ package contains nonfree firmware for the following chips:
(synopsis "Linux driver for Realtek RTL8192EU wireless network adapters")
(description "This is Realtek's RTL8192EU Linux driver for wireless
network adapters.")
+ ;; Rejected by Guix beause it contains a binary blob in:
+ ;; hal/rtl8192e/hal8192e_fw.c
(license gpl2))))
+(define-public rtl8821ce-linux-module
+ (let ((commit "538c34671b391340e0ae23ff11bde77b6588496c")
+ (revision "9"))
+ (package
+ (name "rtl8821ce-linux-module")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tomaspinho/rtl8821ce")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0p7xj032bp3h6wp27dhf2j42bgd4gvpk7w95n830awbj07c04dss"))))
+ (build-system linux-module-build-system)
+ (arguments
+ (list #:make-flags
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "KSRC="
+ (assoc-ref %build-inputs
+ "linux-module-builder")
+ "/lib/modules/build"))
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* (#:key (make-flags '()) (parallel-build? #t)
+ #:allow-other-keys)
+ (apply invoke "make"
+ `(,@(if parallel-build?
+ `("-j" ,(number->string (parallel-job-count)))
+ '())
+ ,@make-flags)))))
+ #:tests? #f)) ; no test suite
+ (home-page "https://github.com/tomaspinho/rtl8821ce")
+ (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
+ (description "This is Realtek's RTL8821CE Linux driver for wireless
+network adapters.")
+ ;; Rejected by Guix beause it contains a binary blob in:
+ ;; hal/rtl8821c/hal8821c_fw.c
+ (license gpl2))))
+
+(define-public rtl8812au-aircrack-ng-linux-module
+ (let ((commit "08589e2f8c18d4de18a28d92c74d0a2191bb86b9")
+ (revision "10"))
+ (package
+ (inherit rtl8821ce-linux-module)
+ (name "rtl8812au-aircrack-ng-linux-module")
+ (version (git-version "5.6.4.2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/aircrack-ng/rtl8812au")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "07yiya5ckm578pwxdm5nnyq45vnw4zjbd31a5365l9cwbpfji67s"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ ;; Remove bundled tarballs, APKs, word lists, speadsheets,
+ ;; and other unnecessary unlicenced things.
+ (for-each delete-file-recursively (list "android"
+ "docs"
+ "tools"))))))
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (home-page "https://github.com/aircrack-ng/rtl8812au")
+ (synopsis "Linux driver for Realtek USB wireless network adapters")
+ (description
+ "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
+network adapters, modified by the aircrack-ng project to support monitor mode
+and frame injection. It provides a @code{88XXau} kernel module that supports
+RTL8812AU, RTL8821AU, and RTL8814AU chips.")
+ ;; Rejected by Guix beause it contains a binary blob in:
+ ;; hal/rtl8812a/hal8812a_fw.c
+ (license gpl2+))))
+
+(define-public r8168-linux-module
+ (package
+ (name "r8168-linux-module")
+ (version "8.051.02")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mtorromeo/r8168")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16mpr0np6xbmzdnwg4p3q6yli2gh032k98g4vplya33hrn50vh52"))))
+ (arguments
+ (list #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'enter-src-directory
+ (lambda _
+ (chdir "src")))
+ ;; Needed to compile module for linux >= 6.1
+ (add-before 'build 'fix-build
+ (lambda _
+ (substitute* "r8168.h"
+ (("netif_napi_add\\(ndev, &priv->napi, function, weight\\)")
+ "netif_napi_add(ndev, &priv->napi, function)")))))))
+ (build-system linux-module-build-system)
+ (home-page "https://github.com/mtorromeo/r8168")
+ (synopsis "Linux driver for Realtek PCIe network adapters")
+ (description
+ "Linux driver for Realtek PCIe network adapters. If the r8169 kernel module is
+giving you trouble, you can try this module.")
+ (license gpl2)))
+
(define broadcom-sta-version "6.30.223.271")
(define broadcom-sta-x86_64-source
@@ -598,25 +778,15 @@ network adapters.")
(package
(name "broadcom-sta")
(version broadcom-sta-version)
- (source #f)
+ (source
+ (match (or (%current-target-system) (%current-system))
+ ("x86_64-linux" broadcom-sta-x86_64-source)
+ (_ broadcom-sta-i686-source)))
(build-system linux-module-build-system)
(arguments
- `(#:linux ,linux
- #:tests? #f
- #:phases
- (modify-phases %standard-phases
- (replace 'unpack
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((source (assoc-ref inputs "broadcom-sta-source")))
- (invoke "tar" "xf" source)
- (chdir ((@@ (guix build gnu-build-system) first-subdirectory) "."))
- #t))))))
+ `(#:linux ,linux-lts
+ #:tests? #f))
(supported-systems '("i686-linux" "x86_64-linux"))
- (native-inputs
- `(("broadcom-sta-source"
- ,(match (or (%current-target-system) (%current-system))
- ("x86_64-linux" broadcom-sta-x86_64-source)
- (_ broadcom-sta-i686-source)))))
(home-page "https://www.broadcom.com/support/802.11")
(synopsis "Broadcom 802.11 Linux STA wireless driver")
(description "This package contains Broadcom's IEEE 802.11a/b/g/n/ac hybrid
@@ -659,9 +829,7 @@ releases.")
"1b1qjwxjk4y91l3iz157kms8601n0mmiik32cs6w9b1q4sl4pxx9"))))
(build-system trivial-build-system)
(arguments
- `(#:modules ((guix build utils)
- (ice-9 rdelim)
- (ice-9 regex))
+ `(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils)
@@ -738,7 +906,7 @@ chipsets from Broadcom:
(define-public intel-microcode
(package
(name "intel-microcode")
- (version "20210608")
+ (version "20230214")
(source
(origin
(method git-fetch)
@@ -749,7 +917,7 @@ chipsets from Broadcom:
(commit (string-append "microcode-" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "08nk353z2lcqsjbm2qdsfapfgrvlfw0rj7r9scr9pllzkjj5n9x3"))))
+ (base32 "047m1c7bap19cqxpqy2xlzngn8i8jfk44ffbkmkhw4nfrval81sb"))))
(build-system copy-build-system)
(arguments
`(#:install-plan
@@ -791,46 +959,24 @@ documented in the respective processor revision guides.")
(define-public sof-firmware
(package
(name "sof-firmware")
- (version "1.6.1")
+ (version "2.2.3")
(source
(origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/thesofproject/sof-bin")
- (commit (string-append "stable-v" version))))
- (file-name (git-file-name name version))
+ (method url-fetch)
+ (uri (string-append "https://github.com/thesofproject/sof-bin/releases/download/v"
+ version "/sof-bin-v" version ".tar.gz"))
(sha256
- (base32 "1zg5fki8skmmx84p4ws8x2m13bm13fb3kvlhz7zsnmdg6ra06az6"))))
+ (base32
+ "0hnvzbjgib8f0m2gw345vk0p4h9ba34g7vciih1jgcz2y5kgs7sr"))))
(build-system copy-build-system)
(arguments
`(#:install-plan
- (let* ((base
- (string-append "lib/firmware/intel/sof/v" ,version))
- (dest "lib/firmware/intel/sof")
- (tplg
- (string-append "lib/firmware/intel/sof-tplg-v" ,version))
- (dest-tplg "lib/firmware/intel/sof-tplg")
- (fw-file (lambda* (file #:optional subdir)
- (list (string-append base "/"
- (or subdir "")
- file "-v" ,version ".ri")
- (string-append dest "/" file ".ri"))))
- (unsigned fw-file)
- (intel-signed (lambda (file)
- (fw-file file "intel-signed/"))))
- (list (unsigned "sof-bdw")
- (unsigned "sof-byt")
- (unsigned "sof-cht")
- (intel-signed "sof-apl")
- (intel-signed "sof-cnl")
- (intel-signed "sof-ehl")
- (intel-signed "sof-icl")
- (intel-signed "sof-tgl")
- (list tplg dest-tplg)))))
+ (list (list (string-append "sof-v" ,version) "lib/firmware/intel/sof")
+ (list (string-append "sof-tplg-v" ,version) "lib/firmware/intel/sof-tplg"))))
(home-page "https://www.sofproject.org")
(synopsis "Sound Open Firmware")
(description "This package contains Linux firmwares and topology files for
-audio DSPs that can be found on the Intel Skylake architecture. Those
-firmware can be built for source but need to be signed by Intel in order to be
+audio DSPs that can be found on the Intel Skylake architecture. This
+firmware can be built from source but need to be signed by Intel in order to be
loaded by Linux.")
(license bsd-3)))