Last active
February 7, 2022 18:35
-
-
Save mbakke/cb1b81396c8664a72fd0ef8e1c36aced to your computer and use it in GitHub Desktop.
Bisect Linux with Guix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-modules (gnu) | |
(srfi srfi-1) | |
(srfi srfi-71) | |
(git repository) | |
(git reference) | |
(git oid) | |
(git commit) | |
(git describe) | |
(guix git) | |
(guix packages) | |
(guix git-download) | |
(guix utils) | |
(gnu packages linux)) | |
(define* (describe-checkout checkout | |
#:optional (options (make-describe-options | |
#:strategy 'tags | |
;; Huge performance improvement. | |
#:only-follow-first-parent? #t))) | |
"Get the current HEAD of CHECKOUT as well as its \"pretty name\"." | |
(let* ((repo (repository-open checkout)) | |
(head (reference-target (repository-head repo))) | |
(commit (commit-lookup repo head)) | |
(description (describe-commit commit options))) | |
(repository-close! repo) | |
(values (oid->string head) (describe-format description)))) | |
(define %linux-repo "/home/mbakke/src/linux") | |
(define-public linux/bisect | |
(let ((commit pretty (describe-checkout %linux-repo))) | |
(package | |
(inherit linux-libre) | |
(name "linux") | |
(version (string-drop pretty 1)) | |
(source (git-checkout (url %linux-repo) (commit commit)))))) | |
(operating-system | |
;; [...] | |
(kernel linux/bisect)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment