mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-03-26 03:34:20 +00:00
bootloader: limine: Simplify error handling in installation script, again.
This commit is contained in:
parent
1233c2154a
commit
68573186b5
@ -59,11 +59,11 @@
|
||||
;; Install unified kernel images and generate Limine configuration.
|
||||
(call-with-output-file (in-vicinity limine-directory "limine.conf.tmp")
|
||||
(lambda (port)
|
||||
(let* ((ukify #$(file-append ukify "/bin/ukify"))
|
||||
(current-label (first '#$labels))
|
||||
(current-args (first (list #$@ukify-args)))
|
||||
(old-labels (cdr '#$labels))
|
||||
(old-args (cdr (list #$@ukify-args))))
|
||||
(let ((ukify #$(file-append ukify "/bin/ukify"))
|
||||
(current-label (first '#$labels))
|
||||
(current-args (first (list #$@ukify-args)))
|
||||
(old-labels (cdr '#$labels))
|
||||
(old-args (cdr (list #$@ukify-args))))
|
||||
(format port "\
|
||||
timeout: 5~%")
|
||||
(with-directory-excursion guix-directory
|
||||
@ -78,30 +78,29 @@ timeout: 5~%")
|
||||
(unless (null? old-labels)
|
||||
(format port "
|
||||
/GNU system, old configurations...~%"))
|
||||
(false-if-exception
|
||||
(let loop ((count 1)
|
||||
(labels old-labels)
|
||||
(args old-args))
|
||||
(let* ((image-name (format #f "OLD-~a.EFI" count)))
|
||||
(unless (null? labels)
|
||||
(with-exception-handler
|
||||
(lambda _
|
||||
(delete-file image-name)
|
||||
;; Exit loop.
|
||||
(loop 0 '() '()))
|
||||
(lambda ()
|
||||
(apply invoke/quiet
|
||||
ukify "build" "--output" image-name
|
||||
(first args))
|
||||
(format port "~
|
||||
(let loop ((count 1)
|
||||
(labels old-labels)
|
||||
(args old-args))
|
||||
(let ((image-name (format #f "OLD-~a.EFI" count)))
|
||||
(unless (null? labels)
|
||||
(catch #t
|
||||
(lambda ()
|
||||
(apply invoke/quiet
|
||||
ukify "build" "--output" image-name
|
||||
(first args))
|
||||
(format port "~
|
||||
//~a
|
||||
protocol: efi
|
||||
path: boot():/EFI/Guix/OLD-~a.EFI~%"
|
||||
(first labels)
|
||||
count)))
|
||||
(loop (1+ count)
|
||||
(cdr labels)
|
||||
(cdr args))))))))
|
||||
(first labels)
|
||||
count))
|
||||
(lambda _
|
||||
(delete-file image-name)
|
||||
;; Exit loop.
|
||||
(loop 0 '() '())))
|
||||
(loop (1+ count)
|
||||
(cdr labels)
|
||||
(cdr args)))))))
|
||||
(rename-file (in-vicinity limine-directory "limine.conf.tmp")
|
||||
(in-vicinity limine-directory "limine.conf"))
|
||||
;; Finally, install Limine.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user