From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: GuixSD bootable ISO-9669 image Date: Fri, 12 May 2017 17:33:21 +0200 Message-ID: <87o9uyqeda.fsf@gnu.org> References: <20170418141719.llp77itz7vyq5rij@abyayala> <87k26hwxt0.fsf@gmail.com> <8760i0m7vg.fsf@gnu.org> <87pog3u3ms.fsf@gmail.com> <87k26afl07.fsf_-_@gmail.com> <20170427190840.79bcaa76@scratchpost.org> <20170427220009.1d0d4607@scratchpost.org> <20170428101844.540ce399@scratchpost.org> <87efw7igen.fsf@gnu.org> <20170502220904.3f27ce9f@scratchpost.org> <871ss72cd2.fsf@gnu.org> <20170507213711.4eaec310@scratchpost.org> <87wp9rmo4d.fsf@gnu.org> <20170512013019.49c3d33d@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9CZM-0007XL-QI for guix-devel@gnu.org; Fri, 12 May 2017 11:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9CZJ-0001Lg-Mr for guix-devel@gnu.org; Fri, 12 May 2017 11:33:28 -0400 In-Reply-To: <20170512013019.49c3d33d@scratchpost.org> (Danny Milosavljevic's message of "Fri, 12 May 2017 01:30:19 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel@gnu.org Hi, Danny Milosavljevic skribis: >>I=E2=80=99d prefer to add a special =E2=80=98iso-9660-uuid=E2=80=99 form = similar to =E2=80=98uuid=E2=80=99 in (gnu system file-systems). >> That way we could detect that we get a valid UUID at macro-expansion >> time or system-instantiation time, rather than end up with an error at >> boot time. > > Hmm, I've never seen that macro before. Should it be used in config.scm ? Yes, see . > Right now config.scm could have: > > (file-systems (cons* (file-system > (device "1234-5678-....") ^^ This is wrong, should be (uuid "1234-=E2=80=A6"). > Which kind of UUID is it then? Should string->uuid try to be clever abou= t it? Or a new function string->uuid-like ? =E2=80=98uuid=E2=80=99 and =E2=80=98string->uuid=E2=80=99 are for DCE UUIDs= , see (gnu build file-systems). I think it should remain this way: =E2=80=98string->uuid=E2= =80=99 shouldn=E2=80=99t try to guess what kind of UUID it=E2=80=99s given; doing = that could lead to hard-to-debug problems. > find-partition-by-uuid right now uses read-partition-uuid and then uses b= ytevector=3D?. Right, file system UUIDs are represented as bytevectors internally in (gnu build file-systems). > So all these forms should continue to be bytevectors. Then it would work= fine without lots of changes. > > So something like this? > > - Add "string->uuid-like" and use it in canonical-title (instead of using= "string->uuid"). > - string->uuid-like would have a case analysis by some weird markers, the= n parse the uuid using the right parser into a bytevector with length typic= al-for-this-filesystem-but-not-unique. > - Modify uuid->string to have a case analysis by the bytevector length, t= hen print the uuid using the right printer into a string typical-for-this-f= ilesystem. This will fail to detect ISO9660 correctly because these are th= e same length as real uuids (Linux uses 16 bytes of the 17-byte iso9660-uui= d) > - Leave the uuid macro as-is since it should already do the right thing t= hen? > - Add a new macro fat32-uuid, and a new macro iso9660-uuid. I don=E2=80=99t like the idea of a polymorphical =E2=80=98string->uuid-like= =E2=80=99. I would prefer to have: fat32-uuid->string (already exists) string->fat32-uuid fat32-uuid macro iso9660-uuid->string string->iso9660-uuid iso9660-uuid macro Then users should pick the right one, usually the macro, and get an error when they pass an invalid UUID. WDYT? Thanks, Ludo=E2=80=99.