bootloader: limine: Simplify error handling in installation script.

This commit is contained in:
Hilton Chain 2026-03-20 22:57:55 +08:00
parent 0168423b50
commit af150b1f65
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292

View File

@ -60,8 +60,6 @@
(call-with-output-file (in-vicinity limine-directory "limine.conf.tmp")
(lambda (port)
(let* ((ukify #$(file-append ukify "/bin/ukify"))
(script-path (first args))
(minbytes (* 2 (stat:size (stat script-path))))
(current-label (first '#$labels))
(current-args (first (list #$@ukify-args)))
(old-labels (cdr '#$labels))
@ -86,12 +84,10 @@
(unless (null? labels)
(with-exception-handler
(lambda _
(false-if-exception (delete-file image-name))
(delete-file image-name)
;; Exit loop.
(loop 0 '() '()))
(lambda ()
(when (< (free-disk-space ".") minbytes)
(raise-exception 'insuffcient-disk-space))
(apply invoke/quiet
ukify "build" "--output" image-name
(first args))