mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-03-04 17:04:21 +00:00
bootloader: uki: Export ‘menu-entry->ukify-args’.
* modules/rosenthal/bootloader/uki.scm (menu-entry->ukify-args): New procedure extracted from... (uefi-uki-configuration-file): ...this procedure.
This commit is contained in:
parent
d241a5bea3
commit
a1a442ce84
@ -13,42 +13,43 @@
|
|||||||
#:use-module (gnu bootloader)
|
#:use-module (gnu bootloader)
|
||||||
;; Guix packages
|
;; Guix packages
|
||||||
#:use-module (rosenthal packages bootloaders)
|
#:use-module (rosenthal packages bootloaders)
|
||||||
#:export (uefi-uki-removable-bootloader))
|
#:export (menu-entry->ukify-args
|
||||||
|
uefi-uki-removable-bootloader))
|
||||||
|
|
||||||
(define script-path "/boot/install-uki.scm")
|
(define script-path "/boot/install-uki.scm")
|
||||||
|
|
||||||
|
(define (menu-entry->ukify-args entry)
|
||||||
|
(let* ((label (menu-entry-label entry))
|
||||||
|
(linux (menu-entry-linux entry))
|
||||||
|
(initrd (menu-entry-initrd entry))
|
||||||
|
(arguments (menu-entry-linux-arguments entry)))
|
||||||
|
#~(list "--os-release" #$label
|
||||||
|
"--linux" #$linux
|
||||||
|
"--initrd" #$initrd
|
||||||
|
"--cmdline" (string-join (list #$@arguments))
|
||||||
|
"--stub"
|
||||||
|
#$(file-append systemd-stub "/libexec/" (systemd-stub-name)))))
|
||||||
|
|
||||||
(define (uefi-uki-configuration-file config entries . rest)
|
(define (uefi-uki-configuration-file config entries . rest)
|
||||||
|
|
||||||
(define (menu-entry->ukify-args entry)
|
|
||||||
(let* ((label (menu-entry-label entry))
|
|
||||||
(linux (menu-entry-linux entry))
|
|
||||||
(initrd (menu-entry-initrd entry))
|
|
||||||
(arguments (menu-entry-linux-arguments entry))
|
|
||||||
(boot (bootloader-configuration-bootloader config))
|
|
||||||
(stub (bootloader-package boot)))
|
|
||||||
#~(list "--os-release" #$label
|
|
||||||
"--linux" #$linux
|
|
||||||
"--initrd" #$initrd
|
|
||||||
"--cmdline" (string-join (list #$@arguments))
|
|
||||||
"--stub" #$(file-append stub "/libexec/" (systemd-stub-name)))))
|
|
||||||
|
|
||||||
(program-file "install-uki"
|
(program-file "install-uki"
|
||||||
(with-imported-modules (source-module-closure '((guix build utils)))
|
(with-imported-modules (source-module-closure '((guix build utils)))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (srfi srfi-1)
|
(use-modules (ice-9 match)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
(let* ((ukify #$(file-append ukify "/bin/ukify"))
|
(let* ((directory (second (command-line)))
|
||||||
(installation-path
|
(installation-path
|
||||||
(format #f "~a/EFI/BOOT/BOOT~a.EFI"
|
(in-vicinity
|
||||||
(second (command-line))
|
directory
|
||||||
#$(cond
|
#$(format #f "/EFI/BOOT/BOOT~a.EFI"
|
||||||
((target-x86-32?) "IA32")
|
(cond
|
||||||
((target-x86-64?) "X64")
|
((target-x86-32?) "IA32")
|
||||||
((target-arm32?) "ARM")
|
((target-x86-64?) "X64")
|
||||||
((target-aarch64?) "AA64")
|
((target-arm32?) "ARM")
|
||||||
((target-riscv64?) "RISCV64")))))
|
((target-aarch64?) "AA64")
|
||||||
|
((target-riscv64?) "RISCV64"))))))
|
||||||
(mkdir-p (dirname installation-path))
|
(mkdir-p (dirname installation-path))
|
||||||
(apply invoke ukify "build" "--output" installation-path
|
(apply invoke #$(file-append ukify "/bin/ukify")
|
||||||
|
"build" "--output" installation-path
|
||||||
#$(menu-entry->ukify-args (first entries))))))))
|
#$(menu-entry->ukify-args (first entries))))))))
|
||||||
|
|
||||||
(define install-uefi-uki
|
(define install-uefi-uki
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user