mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
build: Allow mounting of entire disks.
* gnu/build/file-systems.scm (disk-partitions): Also return entire drives.
This commit is contained in:
parent
91d94e28ec
commit
9833bcfc08
1 changed files with 9 additions and 8 deletions
|
@ -373,15 +373,16 @@ (define (luks-header-uuid header)
|
||||||
|
|
||||||
(define (disk-partitions)
|
(define (disk-partitions)
|
||||||
"Return the list of device names corresponding to valid disk partitions."
|
"Return the list of device names corresponding to valid disk partitions."
|
||||||
(define (last-character str)
|
|
||||||
(string-ref str (- (string-length str) 1)))
|
|
||||||
|
|
||||||
(define (partition? name major minor)
|
(define (partition? name major minor)
|
||||||
;; Select device names that end in a digit, like libblkid's 'probe_all'
|
;; grub-mkrescue does some funny things for EFI support which
|
||||||
;; function does. Checking for "/sys/dev/block/MAJOR:MINOR/partition"
|
;; makes it a lot more difficult than one would expect to support
|
||||||
;; doesn't work for partitions coming from mapped devices.
|
;; booting an ISO-9660 image from an USB flash drive.
|
||||||
(and (char-set-contains? char-set:digit (last-character name))
|
;; For example there's a buggy (too small) hidden partition in it
|
||||||
(> major 2))) ;ignore RAM disks and floppy disks
|
;; which Linux mounts and then proceeds to fail while trying to
|
||||||
|
;; fall off the edge.
|
||||||
|
;; In any case, partition tables are supposed to be optional so
|
||||||
|
;; here we allow checking entire disks for file systems, too.
|
||||||
|
(> major 2)) ;ignore RAM disks and floppy disks
|
||||||
|
|
||||||
(call-with-input-file "/proc/partitions"
|
(call-with-input-file "/proc/partitions"
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
|
|
Loading…
Reference in a new issue