Skip to content

Instantly share code, notes, and snippets.

@mbakke
Last active February 7, 2022 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbakke/cb1b81396c8664a72fd0ef8e1c36aced to your computer and use it in GitHub Desktop.
Save mbakke/cb1b81396c8664a72fd0ef8e1c36aced to your computer and use it in GitHub Desktop.
Bisect Linux with Guix
(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