[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#27690] [PATCH] build: Allow mounting of entire disks.

From: Ludovic Courtès
Subject: [bug#27690] [PATCH] build: Allow mounting of entire disks.
Date: Mon, 17 Jul 2017 11:28:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)


Danny Milosavljevic <address@hidden> skribis:

> * gnu/build/file-systems.scm (disk-partitions): Also return entire drives.

In the subject line, please write “file-systems:” instead of “build:”
(the latter is for Makefile and configury.)

> --- a/gnu/build/file-systems.scm
> +++ b/gnu/build/file-systems.scm
> @@ -377,11 +377,14 @@ not valid header was found."
>      (string-ref str (- (string-length str) 1)))
>    (define (partition? name major minor)
> -    ;; Select device names that end in a digit, like libblkid's 'probe_all'
> -    ;; function does.  Checking for "/sys/dev/block/MAJOR:MINOR/partition"
> -    ;; doesn't work for partitions coming from mapped devices.
> -    (and (char-set-contains? char-set:digit (last-character name))
> -         (> major 2)))                      ;ignore RAM disks and floppy 
> disks
> +    ;; grub-mkrescue does some funny things for EFI support which
> +    ;; makes it a lot more difficult than one would expect to support
> +    ;; booting an ISO-9660 image from an USB flash drive.
> +    ;; For example there's a buggy (too small) hidden partition in it
> +    ;; which Linux rightfully refuses to mount.
> +    ;; 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

I think you can remove ‘last-character’ and keep the comment about

Have you tested that this doesn’t cause any problems on actual hardware,
like matching things that should really be skipped, and then causing
failures down the road in label/UUID code?

Also, it seems that we’d be departing from what libblkid is doing, per
the comment above.  To me that raises a flag, though if we really need
it that’s fine of course.

Thoughts?  :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]