diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 52d92ba03a..c563cbd988 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -39,6 +39,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages bootloaders) + #:use-module (gnu bootloader) #:use-module (gnu packages) #:use-module (gnu packages assembly) #:use-module (gnu packages base) @@ -48,6 +49,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) + #:use-module (gnu packages crypto) #:use-module (gnu packages disk) #:use-module (gnu packages efi) #:use-module (gnu packages firmware) @@ -55,6 +57,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) + #:use-module (gnu packages gperf) #:use-module (gnu packages guile) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) @@ -596,6 +599,50 @@ (define systemd-source (base32 "1qdyw9g3jgvsbc1aryr11gpc3075w5pg00mqv4pyf3hwixxkwaq6")))) +(define-public systemd-stub + (package + (name "systemd-stub") + (version %systemd-version) + (source systemd-source) + (build-system meson-build-system) + (arguments + (list #:configure-flags + #~(list "-Dmode=release" "-Defi=true" "-Dsbat-distro=guix" + "-Dsbat-distro-generation=1" ; package revision! + "-Dsbat-distro-summary=Guix System" + "-Dsbat-distro-url=https://guix.gnu.org" + #$(string-append "-Dsbat-distro-pkgname=" + (package-name this-package)) + #$(string-append "-Dsbat-distro-version=" + (package-version this-package))) + #:phases + ;; TODO: 32-bit support. + (let* ((stub (string-append "src/boot/efi/linux" (efi-arch) + ".efi.stub"))) + #~(modify-phases %standard-phases + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (invoke "ninja" #$stub "-j" + (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (replace 'install + (lambda _ + (install-file #$stub (string-append #$output + "/libexec")))) + (delete 'check))))) + (supported-systems %efi-supported-systems) + (inputs + (list libcap libxcrypt python-pyelftools `(,util-linux "lib"))) + (native-inputs (list gperf pkg-config python-3 python-jinja2)) + (home-page "https://systemd.io/") + (synopsis "Unified kernel image UEFI stub") + (description + "Simple UEFI boot stub that loads a conjoined kernel image and +supporting data to their proper locations, before chainloading to the +kernel. It supports measured and/or verified boot environments.") + (license license:lgpl2.1+))) + (define-public ukify (package (name "ukify")