image: Raise an error when an image lacks a bootable partition.

* gnu/system/image.scm (find-root-partition): Raise an error when 'find'
returns #f.
This commit is contained in:
Ludovic Courtès 2022-07-01 10:38:37 +02:00
parent ed19bc87e4
commit 05a759ab36
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -275,7 +275,9 @@ (define (root-partition? partition)
(define (find-root-partition image)
"Return the root partition of the given IMAGE."
(srfi-1:find root-partition? (image-partitions image)))
(or (srfi-1:find root-partition? (image-partitions image))
(raise (formatted-message
(G_ "image lacks a partition with the 'boot' flag")))))
(define (root-partition-index image)
"Return the index of the root partition of the given IMAGE."