aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-31 15:55:38 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-31 15:55:38 +0200
commit1bb784ea05b2eeac13f7355ae2f51fbd302a36b7 (patch)
treec5072a59fdd8f8e59995cb8b93f603bf52fcf753
parentb0e3635e0a4fbc605ecbcf2afc76f3111a1afe42 (diff)
downloadguix-1bb784ea05b2eeac13f7355ae2f51fbd302a36b7.tar.gz
guix-1bb784ea05b2eeac13f7355ae2f51fbd302a36b7.zip
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.
-rw-r--r--guix/build/linux-initrd.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm
index 3873ade13e..1c44c5c5c7 100644
--- a/guix/build/linux-initrd.scm
+++ b/guix/build/linux-initrd.scm
@@ -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