~ruther/guix-local

1bb784ea05b2eeac13f7355ae2f51fbd302a36b7 — Ludovic Courtès 11 years ago b0e3635
linux-initrd: Gracefully deal with partitions with no label.

* guix/build/linux-initrd.scm (partition-label-predicate): Check whether
  'ext2-superblock-volume-name' returns #f, and return #f if it does.
1 files changed, 3 insertions(+), 2 deletions(-)

M guix/build/linux-initrd.scm
M guix/build/linux-initrd.scm => guix/build/linux-initrd.scm +3 -2
@@ 180,8 180,9 @@ return #t if that partition's volume name is LABEL."
    (let* ((device (string-append "/dev/" part))
           (sblock (read-ext2-superblock device)))
      (and sblock
           (string=? (ext2-superblock-volume-name sblock)
                     label)))))
           (let ((volume (ext2-superblock-volume-name sblock)))
             (and volume
                  (string=? volume label)))))))

(define (find-partition-by-label label)
  "Return the first partition found whose volume name is LABEL, or #f if none