From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX2Kx-00016E-S6 for guix-patches@gnu.org; Mon, 17 Jul 2017 05:29:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX2Ks-0003Ow-Tw for guix-patches@gnu.org; Mon, 17 Jul 2017 05:29:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:40542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX2Ks-0003Op-Q6 for guix-patches@gnu.org; Mon, 17 Jul 2017 05:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dX2Ks-0005Di-HT for guix-patches@gnu.org; Mon, 17 Jul 2017 05:29:02 -0400 Subject: [bug#27690] [PATCH] build: Allow mounting of entire disks. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170714083215.9889-1-dannym@scratchpost.org> Date: Mon, 17 Jul 2017 11:28:25 +0200 In-Reply-To: <20170714083215.9889-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Fri, 14 Jul 2017 10:32:15 +0200") Message-ID: <87a843cszq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Danny Milosavljevic Cc: 27690@debbugs.gnu.org Hello, Danny Milosavljevic skribis: > * gnu/build/file-systems.scm (disk-partitions): Also return entire drives. In the subject line, please write =E2=80=9Cfile-systems:=E2=80=9D instead o= f =E2=80=9Cbuild:=E2=80=9D (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))) >=20=20 > (define (partition? name major minor) > - ;; Select device names that end in a digit, like libblkid's 'probe_a= ll' > - ;; function does. Checking for "/sys/dev/block/MAJOR:MINOR/partitio= n" > - ;; 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 =E2=80=98last-character=E2=80=99 and keep the commen= t about /sys/dev/block. Have you tested that this doesn=E2=80=99t cause any problems on actual hard= ware, like matching things that should really be skipped, and then causing failures down the road in label/UUID code? Also, it seems that we=E2=80=99d be departing from what libblkid is doing, = per the comment above. To me that raises a flag, though if we really need it that=E2=80=99s fine of course. Thoughts? :-) Thanks, Ludo=E2=80=99.