summary refs log tree commit diff
path: root/gnu/system/image.scm
diff options
context:
space:
mode:
authorPavel Shlyak <p.shlyak@pantherx.org>2022-05-22 16:53:49 +0300
committerMathieu Othacehe <othacehe@gnu.org>2022-05-23 09:17:12 +0200
commitbb662d71e6e3db69114645d690bc033c5ffa1ac5 (patch)
tree80590748d08eccb556232fe53330cd0a9155fb82 /gnu/system/image.scm
parent6e99c020b8c19e140635d1a52815d5b3298ed1ec (diff)
downloadguix-bb662d71e6e3db69114645d690bc033c5ffa1ac5.tar.gz
image: Add bootable flag support.
* gnu/build/image.scm (sexp->partition): Add flags support.
* gnu/system/image.scm (partition->gexp): Ditto.
(system-disk-image): Set the genimage bootable flag if it is part of the
partition flags.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'gnu/system/image.scm')
-rw-r--r--gnu/system/image.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index e86e8c0867..74b81d02f6 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -219,7 +219,8 @@ set to the given OS."
       #$(partition-file-system-options partition)
       #$(partition-label partition)
       #$(and=> (partition-uuid partition)
-               uuid-bytevector)))
+               uuid-bytevector)
+      #$(partition-flags partition)))
 
 (define gcrypt-sqlite3&co
   ;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
@@ -401,17 +402,21 @@ used in the image."
                     (partition-type-values image partition)))
         (let ((label (partition-label partition))
               (image (partition-image partition))
-              (offset (partition-offset partition)))
+              (offset (partition-offset partition))
+              (bootable (if (memq 'boot (partition-flags partition))
+                            "true" "false" )))
           #~(format #f "~/partition ~a {
   ~/~/~a = ~a
   ~/~/image = \"~a\"
   ~/~/offset = \"~a\"
+  ~/~/bootable = \"~a\"
   ~/}"
                     #$label
                     #$partition-type-attribute
                     #$partition-type-value
                     #$image
-                    #$offset))))
+                    #$offset
+                    #$bootable))))
 
     (define (genimage-type-options image-type image)
       (cond