summaryrefslogtreecommitdiff
path: root/px/packages/linux.scm
diff options
context:
space:
mode:
authorFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
committerFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
commit47b4c9c854915df93893dbaa993accfacf9027fe (patch)
tree4f9b1742d63fcfbc94cc6b8d84f76c4d00c3a0b7 /px/packages/linux.scm
parent0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff)
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/packages/linux.scm')
-rw-r--r--px/packages/linux.scm397
1 files changed, 206 insertions, 191 deletions
diff --git a/px/packages/linux.scm b/px/packages/linux.scm
index bbb8f09..5a47e6a 100644
--- a/px/packages/linux.scm
+++ b/px/packages/linux.scm
@@ -1,5 +1,6 @@
(define-module (px packages linux)
- #:use-module ((guix licenses) #:prefix license:)
+ #:use-module ((guix licenses)
+ #:prefix license:)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system linux-module)
@@ -19,43 +20,45 @@
#:use-module (nonguix licenses)
#:export (%reterminal-kernel-modules))
-
(define-public brcm80211-firmware
(package
(name "brcm80211-firmware")
(version "20210818-1")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-brcm80211_"
- version "_all.deb"))
- (sha256 (base32 "04wg9fqay6rpg80b7s4h4g2kwq8msbh81lb3nd0jj45nnxrdxy7p"))))
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-brcm80211_"
+ version "_all.deb"))
+ (sha256
+ (base32 "04wg9fqay6rpg80b7s4h4g2kwq8msbh81lb3nd0jj45nnxrdxy7p"))))
(build-system copy-build-system)
(native-inputs (list tar bzip2))
(arguments
- '(#:phases
- (modify-phases %standard-phases
- (replace 'unpack
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((source (assoc-ref inputs "source")))
- (invoke "ar" "x" source)
- (invoke "ls")
- (invoke "tar" "-xvf" "data.tar.xz"))))
- (add-after 'install 'make-symlinks
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (symlink (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt")
- (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.txt"))
- (symlink (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.bin")
- (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.bin"))))))
- #:install-plan
- '(("lib/firmware/" "lib/firmware"))))
+ '(#:phases (modify-phases %standard-phases
+ (replace 'unpack
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((source (assoc-ref inputs "source")))
+ (invoke "ar" "x" source)
+ (invoke "ls")
+ (invoke "tar" "-xvf" "data.tar.xz"))))
+ (add-after 'install 'make-symlinks
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (symlink (string-append out
+ "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt")
+ (string-append out
+ "/lib/firmware/brcm/brcmfmac43455-sdio.txt"))
+ (symlink (string-append out
+ "/lib/firmware/brcm/brcmfmac43455-sdio.bin")
+ (string-append out
+ "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.bin"))))))
+ #:install-plan '(("lib/firmware/" "lib/firmware"))))
(home-page "https://packages.debian.org/sid/firmware-brcm80211")
(synopsis "Binary firmware for Broadcom/Cypress 802.11 wireless cards")
(description "This package contains the binary firmware for wireless
network cards supported by the brcmsmac or brcmfmac driver.")
(license license:expat)))
-
(define-public bluez-firmware
(let ((commit "31ad68831357d2019624004f1f0846475671088f")
@@ -64,24 +67,23 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(name "bluez-firmware")
(version (git-version "0.0.0" revision commit))
(source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/RPi-Distro/bluez-firmware.git")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32 "083s9n7kgyqjpr8jk6xw97fszzqpp3ndss3wjxn7c3snl47m9cy2"))))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/RPi-Distro/bluez-firmware.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "083s9n7kgyqjpr8jk6xw97fszzqpp3ndss3wjxn7c3snl47m9cy2"))))
(build-system copy-build-system)
(arguments
- '(#:install-plan
- '(("broadcom/BCM4345C0.hcd" "lib/firmware/brcm/BCM4345C0.hcd"))))
+ '(#:install-plan '(("broadcom/BCM4345C0.hcd"
+ "lib/firmware/brcm/BCM4345C0.hcd"))))
(home-page "https://github.com/RPi-Distro/bluez-firmware")
(synopsis "Bluetooth firmware")
(description "BlueZ - Bluetooth protocol stack for Linux")
(license license:expat))))
-
(define-public linux-px
(corrupt-linux linux-libre-5.15))
@@ -91,21 +93,17 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(name "linux-firmware")
(version "20210919")))
-
(define (config->string options)
(string-join (map (match-lambda
- ((option . 'm)
- (string-append option "=m"))
- ((option . #t)
- (string-append option "=y"))
- ((option . #f)
- (string-append option "=n")))
- options)
+ ((option quote m)
+ (string-append option "=m"))
+ ((option . #t) (string-append option "=y"))
+ ((option . #f) (string-append option "=n"))) options)
"\n"))
(define %default-extra-linux-options
- `(;; Some very mild hardening.
- ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
+ `( ;Some very mild hardening.
+ ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
;; All kernels should have NAMESPACES options enabled
("CONFIG_NAMESPACES" . #t)
("CONFIG_UTS_NS" . #t)
@@ -149,65 +147,71 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(define-public linux-raspberry-5.15
(package
- (inherit linux-libre-5.15)
- (name "linux-raspberry")
- (version "5.15.32")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/raspberrypi/linux")
- (commit "1.20220331")))
- (file-name (string-append "linux-" version))
- (sha256
- (base32
- "1k18cwnsqdy5ckymy92kp8czckzwgn8wn2zdibzrrg9jxrflx6vl"))))
- (supported-systems '("aarch64-linux"))
- (arguments
- (substitute-keyword-arguments (package-arguments linux-libre-5.15)
- ((#:phases phases)
- #~(modify-phases #$phases
-
- (replace 'configure
- (lambda* (#:key inputs target #:allow-other-keys)
- ;; Avoid introducing timestamps
- (setenv "KCONFIG_NOTIMESTAMP" "1")
- (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
+ (inherit linux-libre-5.15)
+ (name "linux-raspberry")
+ (version "5.15.32")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/raspberrypi/linux")
+ (commit "1.20220331")))
+ (file-name (string-append "linux-" version))
+ (sha256
+ (base32 "1k18cwnsqdy5ckymy92kp8czckzwgn8wn2zdibzrrg9jxrflx6vl"))))
+ (supported-systems '("aarch64-linux"))
+ (arguments
+ (substitute-keyword-arguments (package-arguments linux-libre-5.15)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+
+ (replace 'configure
+ (lambda* (#:key inputs target #:allow-other-keys)
+ ;; Avoid introducing timestamps
+ (setenv "KCONFIG_NOTIMESTAMP" "1")
+ (setenv "KBUILD_BUILD_TIMESTAMP"
+ (getenv "SOURCE_DATE_EPOCH"))
- ;; Other variables useful for reproducibility.
- (setenv "KBUILD_BUILD_USER" "guix")
- (setenv "KBUILD_BUILD_HOST" "guix")
+ ;; Other variables useful for reproducibility.
+ (setenv "KBUILD_BUILD_USER" "guix")
+ (setenv "KBUILD_BUILD_HOST" "guix")
- ;; Set ARCH and CROSS_COMPILE.
- (let ((arch #$(platform-linux-architecture
- (lookup-platform-by-target-or-system
- (or (%current-target-system)
- (%current-system))))))
- (setenv "ARCH" arch)
- (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
+ ;; Set ARCH and CROSS_COMPILE.
+ (let ((arch #$(platform-linux-architecture (lookup-platform-by-target-or-system
+ (or (%current-target-system)
+ (%current-system))))))
+ (setenv "ARCH" arch)
+ (format #t "`ARCH' set to `~a'~%"
+ (getenv "ARCH"))
- (when target
- (setenv "C_INCLUDE_PATH" (string-join
- (cdr (string-split (getenv "C_INCLUDE_PATH") #\:))
- ":"))
+ (when target
+ (setenv "C_INCLUDE_PATH"
+ (string-join (cdr (string-split (getenv
+ "C_INCLUDE_PATH")
+ #\:)) ":"))
- (setenv "CPLUS_INCLUDE_PATH" (string-join
- (cdr (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
- ":"))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join (cdr (string-split (getenv
+ "CPLUS_INCLUDE_PATH")
+ #\:)) ":"))
- (setenv "LIBRARY_PATH" (string-join
- (cdr (string-split (getenv "LIBRARY_PATH") #\:))
- ":"))
- (setenv "CROSS_COMPILE" (string-append target "-"))
- (format #t "`CROSS_COMPILE' set to `~a'~%"
- (getenv "CROSS_COMPILE"))))
- (setenv "KERNEL" "kernel8")
- (invoke "make" "bcm2711_defconfig")
- (let ((port (open-file ".config" "a"))
- (extra-configuration #$(config->string %default-extra-linux-options)))
- (display extra-configuration port)
- (close-port port))
+ (setenv "LIBRARY_PATH"
+ (string-join (cdr (string-split (getenv
+ "LIBRARY_PATH")
+ #\:)) ":"))
+ (setenv "CROSS_COMPILE"
+ (string-append target "-"))
+ (format #t "`CROSS_COMPILE' set to `~a'~%"
+ (getenv "CROSS_COMPILE"))))
+ (setenv "KERNEL" "kernel8")
+ (invoke "make" "bcm2711_defconfig")
+ (let ((port (open-file ".config" "a"))
+ (extra-configuration #$(config->string
+ %default-extra-linux-options)))
+ (display extra-configuration port)
+ (close-port port))
- ))))))))
+ ))))))))
;;;
;;; reTerminal related modules
@@ -217,22 +221,26 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(package
(name "bq24179-charger-linux-module")
(version "0.1")
- (source
- (file-append
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
- (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
- (file-name (git-file-name name version))
- (sha256
- (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
- "/modules/bq24179_charger"))
+ (source
+ (file-append (origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
+ (commit
+ "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
+ (file-name (git-file-name name version))
+ (sha256 (base32
+ "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
+ "/modules/bq24179_charger"))
(build-system linux-module-build-system)
(arguments
- (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux
- (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/bq24179_charger")
- (synopsis "Linux kernel module for bq24179_charger found in Seeed Studio ReTerminal")
+ (list
+ #:tests? #f
+ #:linux linux-raspberry-5.15)) ;no test suite, RPI Linux
+ (home-page
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/bq24179_charger")
+ (synopsis
+ "Linux kernel module for bq24179_charger found in Seeed Studio ReTerminal")
(description "This is the Linux kernel bq24179_charger driver")
(license license:gpl2)))
@@ -241,22 +249,27 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(name "lis3lv02d-linux-module")
(version "0.1")
(source
- (file-append
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
- (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
- (file-name (git-file-name name version))
- (sha256
- (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
- "/modules/lis3lv02d"))
+ (file-append (origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
+ (commit
+ "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
+ (file-name (git-file-name name version))
+ (sha256 (base32
+ "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
+ "/modules/lis3lv02d"))
(build-system linux-module-build-system)
(arguments
- (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux
- (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/lis3lv02d")
- (synopsis "Linux kernel module for GROVE 3-Axis Digital Accelerometer found in Seed Studio ReTerminal")
- (description "This is the Linux kernel GROVE 3-Axis Digital Accelerometer driver")
+ (list
+ #:tests? #f
+ #:linux linux-raspberry-5.15)) ;no test suite, RPI Linux
+ (home-page
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/lis3lv02d")
+ (synopsis
+ "Linux kernel module for GROVE 3-Axis Digital Accelerometer found in Seed Studio ReTerminal")
+ (description
+ "This is the Linux kernel GROVE 3-Axis Digital Accelerometer driver")
(license license:gpl2)))
(define-public ltr30x-linux-module
@@ -264,22 +277,27 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(name "ltr30x-linux-module")
(version "0.1")
(source
- (file-append
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
- (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
- (file-name (git-file-name name version))
- (sha256
- (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
- "/modules/ltr30x"))
+ (file-append (origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
+ (commit
+ "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
+ (file-name (git-file-name name version))
+ (sha256 (base32
+ "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
+ "/modules/ltr30x"))
(build-system linux-module-build-system)
(arguments
- (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux
- (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/ltr30x")
- (synopsis "Linux kernel module for ltr30x ambient light and proximity sensor found in Seed Studio ReTerminal")
- (description "This is the Linux kernel ltr30x ambient light and proximity sensor driver")
+ (list
+ #:tests? #f
+ #:linux linux-raspberry-5.15)) ;no test suite, RPI Linux
+ (home-page
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/ltr30x")
+ (synopsis
+ "Linux kernel module for ltr30x ambient light and proximity sensor found in Seed Studio ReTerminal")
+ (description
+ "This is the Linux kernel ltr30x ambient light and proximity sensor driver")
(license license:gpl2)))
(define-public mipi_dsi-linux-module
@@ -287,22 +305,27 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(name "mipi_dsi-linux-module")
(version "0.1")
(source
- (file-append
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
- (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
- (file-name (git-file-name name version))
- (sha256
- (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
- "/modules/mipi_dsi"))
+ (file-append (origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
+ (commit
+ "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
+ (file-name (git-file-name name version))
+ (sha256 (base32
+ "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
+ "/modules/mipi_dsi"))
(build-system linux-module-build-system)
(arguments
- (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux
- (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/mipi_dsi")
- (synopsis "Linux kernel module for MIPI-DSI panel with touch panel attached to I2C bus found in Seed Studio ReTerminal")
- (description "This is a linux kernel driver for MIPI-DSI panel with touch panel attached to I2C bus.")
+ (list
+ #:tests? #f
+ #:linux linux-raspberry-5.15)) ;no test suite, RPI Linux
+ (home-page
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/mipi_dsi")
+ (synopsis
+ "Linux kernel module for MIPI-DSI panel with touch panel attached to I2C bus found in Seed Studio ReTerminal")
+ (description
+ "This is a linux kernel driver for MIPI-DSI panel with touch panel attached to I2C bus.")
(license license:gpl2)))
(define-public seeed-reterminal-dtoverlays
@@ -311,45 +334,37 @@ network cards supported by the brcmsmac or brcmfmac driver.")
(version "1.9")
(license license:gpl2)
(source
- (file-append
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
- (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
- (file-name (git-file-name name version))
- (sha256
- (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
- "/overlays/rpi"))
+ (file-append (origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git")
+ (commit
+ "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c")))
+ (file-name (git-file-name name version))
+ (sha256 (base32
+ "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5")))
+ "/overlays/rpi"))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (delete 'configure)
- (add-before 'build 'set-prefix-in-makefile
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Modify the makefile so that its
- ;; 'DEST' variable points to "out".
- (let ((out (assoc-ref outputs "out")))
- (substitute* "Makefile"
- (("DEST :=.*")
- (string-append "DEST := "
- out "\n")))
- #true))
- )
- (add-before 'install 'create-dir
- (lambda* (#:key outputs #:allow-other-keys)
- (mkdir-p (assoc-ref outputs "out")))
- )
- ) #:tests? #f))
+ '(#:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'set-prefix-in-makefile
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Modify the makefile so that its
+ ;; 'DEST' variable points to "out".
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "Makefile"
+ (("DEST :=.*")
+ (string-append "DEST := " out "\n"))) #t)))
+ (add-before 'install 'create-dir
+ (lambda* (#:key outputs #:allow-other-keys)
+ (mkdir-p (assoc-ref outputs "out")))))
+ #:tests? #f))
(native-inputs `(("dtc" ,dtc)))
(synopsis "Device Tree overlays for Seed Studio ReTerminal")
- (description
- "Device Tree overlays for Seed Studio ReTerminal")
+ (description "Device Tree overlays for Seed Studio ReTerminal")
(home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/")))
-
(define %reterminal-kernel-modules
- (list bq24179-charger-linux-module
- lis3lv02d-linux-module
- ltr30x-linux-module
- mipi_dsi-linux-module))
+ (list bq24179-charger-linux-module lis3lv02d-linux-module
+ ltr30x-linux-module mipi_dsi-linux-module))