diff mbox

[bug#72457,v5,00/15] Rewrite bootloader subsystem.

Message ID 6e0c4db72a80076590d6faa6ae82f45e6672c16c.camel@lunabee.space
State New
Headers show

Commit Message

Lilah Tascheter Sept. 20, 2024, 4:44 a.m. UTC
untested cause my local tree's a mess rn. has the diff you requested
integrated :)

line counts are off cause it's a diff on the snippet you sent me

- lilah



                              (type 'esp)
                              (offset 'root)
diff mbox

Patch

diff -ru a/gnu/bootloader.scm b/gnu/bootloader.scm
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -5,22 +5,26 @@ 
              (seen    '()))
     (match targets
       ((target rest ...)
-       (let (type (bootloader-target-type target)))
+       (let ((type (bootloader-target-type target)))
          (when (memq type seen)
            (error loc (G_ "target with duplicate type~%") duplicate))
-         (loop rest (cons type seen)))
+         (loop rest (cons type seen))))
       (() #t))))
 
-(define-with-syntax-properties (warn-update-targets (targets
properties))
-  (let ((targets (if (list? targets) targets (list targets)))
+(define-with-syntax-properties (warn-update-targets (value
properties))
+  (let ((targets (if (list? value) value (list value)))
         (loc (source-properties->location properties)))
     (define string->target
       (match-lambda
         ((? bootloader-target? target) target)
         ((? string? s) (if (string-prefix? "/dev" s)
-                           (bootloader-target
-                             (type 'disk)
-                             (device s))
+                           (if (string-rindex s char-set:digit)
+                               (bootloader-target
+                                 (type 'part)
+                                 (device s))
+                               (bootloader-target
+                                 (type 'disk)
+                                 (device s)))
                            (bootloader-target