installer: Raise condition when mklabel fails.

* gnu/installer/parted.scm (mklabel): Do it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Josselin Poiret 2022-01-15 14:50:03 +01:00 committed by Mathieu Othacehe
parent af59e53631
commit 0a74509a69
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 8 additions and 2 deletions

View File

@ -635,8 +635,14 @@ determined by MAX-LENGTH-COLUMN procedure."
(define (mklabel device type-name)
"Create a partition table on DEVICE. TYPE-NAME is the type of the partition
table, \"msdos\" or \"gpt\"."
(let ((type (disk-type-get type-name)))
(disk-new-fresh device type)))
(let* ((type (disk-type-get type-name))
(disk (disk-new-fresh device type)))
(or disk
(raise
(condition
(&error)
(&message (message (format #f "Cannot create partition table of type
~a on device ~a." type-name (device-path device)))))))))
;;