summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorSergio Pastor Pérez <sergio.pastorperez@gmail.com>2026-07-08 15:11:31 +0200
committerVagrant Cascadian <vagrant@debian.org>2026-08-27 00:05:07 -0700
commit7fedc3da26f48a4cd68f3e82784920cea71726be (patch)
tree138472296e6d94cd2742e46e55774e405d02509c /gnu
parent7b017250d937e08137dcb33dd67c97d6332534b7 (diff)
gnu: linux: Add linux-debian.
* gnu/packages/linux.scm (linux-debian-patches): New variable. (linux-debian-6.12-version): New variable. (debian-patches-6.12): New variable. (linux-debian-6.12-pristine-source): New variable. (linux-debian-6.12-source): New variable. (default-linux-debian-initrd-modules): New variable. (make-linux-debian*): New variable. (linux-debian-6.12): New variable. (linux-debian): New variable. * gnu/tests/base.scm (%test-linux-debian-6.12): New test.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/linux.scm144
-rw-r--r--gnu/tests/base.scm4
2 files changed, 148 insertions, 0 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 252328f4230..97644dcc52f 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -174,6 +174,7 @@
174 #:use-module (gnu packages nss) 174 #:use-module (gnu packages nss)
175 #:use-module (gnu packages onc-rpc) 175 #:use-module (gnu packages onc-rpc)
176 #:use-module (gnu packages oneapi) 176 #:use-module (gnu packages oneapi)
177 #:use-module (gnu packages patchutils)
177 #:use-module (gnu packages pciutils) 178 #:use-module (gnu packages pciutils)
178 #:use-module (gnu packages perl) 179 #:use-module (gnu packages perl)
179 #:use-module (gnu packages photo) 180 #:use-module (gnu packages photo)
@@ -772,6 +773,52 @@ GEXP)."
772 (list %boot-logo-patch 773 (list %boot-logo-patch
773 %linux-libre-arm-export-__sync_icache_dcache-patch))) 774 %linux-libre-arm-export-__sync_icache_dcache-patch)))
774 775
776
777;; Debian sources.
778
779(define (linux-debian-patches version hash)
780 (package
781 (name "linux-debian-patches")
782 (version version)
783 (source (origin
784 (method git-fetch)
785 (uri (git-reference
786 (url "https://salsa.debian.org/kernel-team/linux.git")
787 (commit (string-append "debian/" version))))
788 (file-name (git-file-name name version))
789 (sha256 hash)))
790 (build-system copy-build-system)
791 (arguments
792 (list
793 #:install-plan
794 ''(("debian/patches" "")
795 ("debian/config" ""))))
796 (home-page "Debian patches")
797 (synopsis "Debian patches")
798 (description "Debian patches")
799 (license license:gpl2)))
800
801(define-public linux-debian-6.12-version "6.12.95")
802(define debian-patches-6.12
803 (linux-debian-patches
804 (string-append linux-debian-6.12-version "-1")
805 (base32 "0mfygp0pc4h8wk4rx874anxv1al5vhprj2m64zfry1z5akwg8mn0")))
806(define-public linux-debian-6.12-pristine-source
807 (let ((version linux-debian-6.12-version)
808 (hash (base32 "1xmrsi0kimirky4cailnkkrbd72pp9n8irfx6lfmss8yrcgwbs59")))
809 (make-linux-source
810 version (%upstream-linux-source version hash)
811 (delay
812 #~(begin
813 (format #t "Patching kernel...~%")
814 (setenv "QUILT_PATCHES" #$(file-append debian-patches-6.12
815 "/patches"))
816 (invoke #$(file-append quilt "/bin/quilt") "push" "-a"))))))
817
818(define-public linux-debian-6.12-source
819 (source-with-patches linux-debian-6.12-pristine-source
820 (search-patches "linux-shmem-hurd-xattr.patch")))
821
775 822
776;;; 823;;;
777;;; Kernel headers. 824;;; Kernel headers.
@@ -1332,12 +1379,109 @@ Linux kernel. It has been modified to remove all non-free binary blobs.")
1332 (properties (append %linux-libre-timeout-properties 1379 (properties (append %linux-libre-timeout-properties
1333 (package-properties linux)))))) 1380 (package-properties linux))))))
1334 1381
1382(define default-linux-debian-initrd-modules
1383 ;; Default set of modules that need to be available in the initrd when
1384 ;; booting Linux-debian.
1385 (let* ((generic `("ext4" "crc32c_generic" ; Compiled as a module by 'CONFIG_EXT4_FS=m'.
1386 "usb-storage" "uas" ;for the installation image etc.
1387 "usbhid" "hid-generic" ;keyboards during early boot
1388 "dm-crypt" "xts" "serpent_generic" "wp512" ;for encrypted root partitions
1389 "nls_iso8859-1" ;for `mkfs.fat`, et.al
1390 ,@virtio-modules))
1391 (others (cons*
1392 "hid-apple"
1393 generic)))
1394 `(("x86_64-linux" . ,others)
1395 ("i686-linux" . ,others)
1396 ("armhf-linux" . ,others)
1397 ("aarch64-linux" . ,others)
1398 ("mips64el-linux" . ,others)
1399 ("powerpc-linux" . ,others)
1400 ("powerpc64le-linux" . ,others)
1401 ("riscv64-linux" . ,generic))))
1402
1403(define* (make-linux-debian* version source supported-systems
1404 #:key
1405 (extra-version #f)
1406 ;; A function that takes an arch and a variant.
1407 ;; See kernel-config for an example.
1408 (configuration-file #f)
1409 (defconfig "defconfig")
1410 (extra-options (append
1411 ;; Required for enabling CIRRUS
1412 '(("CONFIG_PCI" . #t)
1413 ("CONFIG_DRM" . #t)
1414 ;; Required for QEMU virt
1415 ;; support.
1416 ("CONFIG_DRM_CIRRUS_QEMU" . m)
1417 ("CONFIG_DRM_VIRTIO_GPU" . m)
1418 ("CONFIG_DRM_BOCHS" . m))
1419 (default-extra-linux-options version))))
1420 (package
1421 (inherit (make-linux* version source supported-systems
1422 default-linux-debian-initrd-modules
1423 #:extra-version extra-version
1424 #:configuration-file configuration-file
1425 #:defconfig defconfig
1426 #:extra-options extra-options))
1427 (name (if extra-version
1428 (string-append "linux-debian-" extra-version)
1429 "linux-debian"))
1430 (home-page "https://www.debian.org")
1431 (synopsis "Debian's free redistribution of a cleaned Linux kernel")
1432 (description "Linux-Debian is a free (as in freedom) variant of the
1433Linux kernel. It has been modified to remove all non-free binary blobs
1434following the @uref{https://www.debian.org/social_contract#guidelines,
1435DFSDG}.")
1436 (license license:gpl2)))
1335 1437
1336 1438
1337;;; 1439;;;
1338;;; Generic kernel packages. 1440;;; Generic kernel packages.
1339;;; 1441;;;
1340 1442
1443(define-public linux-debian-6.12
1444 (make-linux-debian* linux-debian-6.12-version
1445 linux-debian-6.12-source
1446 '("x86_64-linux" "armhf-linux" "aarch64-linux"
1447 "powerpc64le-linux" "riscv64-linux")
1448 #:defconfig
1449 ;; XXX: this snippet merges the different configuration
1450 ;; files provided by Debian to construct a Debian
1451 ;; configuration for the given architecture. The
1452 ;; complete Debian configuration is composed by a
1453 ;; generic configuration 'config/config', an
1454 ;; architecture specific one ('armhf', 'arm64',
1455 ;; 'riscv64', 'amd64') that follows debian architecture
1456 ;; naming and sometimes an additionaly configuration
1457 ;; following the pattern 'kernelarch-xxx'.
1458 (delay
1459 #~(let* ((arch->debian-arch
1460 (lambda (arch)
1461 ;; Case comparison is done with 'eqv?'
1462 ;; which doesn't work with strings.
1463 (case (string->symbol arch)
1464 ((arm) '("kernelarch-arm" "armhf"))
1465 ((arm64) '("arm64"))
1466 ((powerpc) '("kernelarch-powerpc" "ppc64el"))
1467 ((riscv) '("riscv64"))
1468 ((x86_64) '("kernelarch-x86" "amd64"))
1469 (else '()))))
1470 (arch-confs (arch->debian-arch (getenv "ARCH"))))
1471 (apply invoke "scripts/kconfig/merge_config.sh"
1472 #$(file-append debian-patches-6.12
1473 "/config/config")
1474 (map (lambda (arch-conf)
1475 (string-append #$debian-patches-6.12
1476 "/config/"
1477 arch-conf
1478 "/config"))
1479 arch-confs))
1480 (invoke #$(file-append gnu-make "/bin/make")
1481 "olddefconfig")))))
1482
1483(define-public linux-debian linux-debian-6.12)
1484
1341(define-public linux-libre-7.2 1485(define-public linux-libre-7.2
1342 (make-linux-libre* linux-libre-7.2-version 1486 (make-linux-libre* linux-libre-7.2-version
1343 linux-libre-7.2-gnu-revision 1487 linux-libre-7.2-gnu-revision
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 0476400a4b9..4546703b20e 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -58,6 +58,7 @@
58 %test-linux-libre-6.12 58 %test-linux-libre-6.12
59 %test-linux-libre-6.6 59 %test-linux-libre-6.6
60 %test-linux-libre-6.1 60 %test-linux-libre-6.1
61 %test-linux-debian-6.12
61 %test-halt 62 %test-halt
62 %test-root-unmount 63 %test-root-unmount
63 %test-cleanup 64 %test-cleanup
@@ -677,6 +678,9 @@ test \"$BASHRC_D_OK\" = yes"))
677(define %test-linux-libre-6.1 678(define %test-linux-libre-6.1
678 (test-basic-os linux-libre-6.1)) 679 (test-basic-os linux-libre-6.1))
679 680
681(define %test-linux-debian-6.12
682 (test-basic-os linux-debian-6.12))
683
680 684
681;;; 685;;;
682;;; Halt. 686;;; Halt.