From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYKZ7-0008PL-9c for guix-patches@gnu.org; Thu, 20 Jul 2017 19:09:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYKZ4-0006mK-VT for guix-patches@gnu.org; Thu, 20 Jul 2017 19:09:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYKZ4-0006m8-Rf for guix-patches@gnu.org; Thu, 20 Jul 2017 19:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dYKZ4-0002iK-Mo for guix-patches@gnu.org; Thu, 20 Jul 2017 19:09:02 -0400 Subject: [bug#27705] [PATCH v4 2/4] build: Allow mounting of entire disks. Resent-Message-ID: From: Danny Milosavljevic Date: Fri, 21 Jul 2017 01:06:46 +0200 Message-Id: <20170720230648.8205-3-dannym@scratchpost.org> In-Reply-To: <20170720230648.8205-1-dannym@scratchpost.org> References: <20170720230648.8205-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27705@debbugs.gnu.org * gnu/build/file-systems.scm (disk-partitions): Also return entire drives. --- gnu/build/file-systems.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index b6930497d..462ed9b7f 100644 --- 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 (call-with-input-file "/proc/partitions" (lambda (port)