From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#27735: Unbootable images with GuixSD on... "GuixSD" Date: Tue, 18 Jul 2017 20:59:33 +0200 Message-ID: <87lgnlpo4q.fsf@gnu.org> References: <327af9f3-fdfb-7916-f0ea-9aec0fae20f3@tobias.gr> <20170717191731.2d3ad604@scratchpost.org> <87bmoi0xua.fsf@gnu.org> <9b7cffa7-96a4-a799-c207-854bbcc7df04@tobias.gr> 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]:37042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXXj6-0002Ip-Fa for bug-guix@gnu.org; Tue, 18 Jul 2017 15:00:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXXj1-00086D-Ky for bug-guix@gnu.org; Tue, 18 Jul 2017 15:00:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:44261) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXXj1-00085l-HJ for bug-guix@gnu.org; Tue, 18 Jul 2017 15:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dXXj1-0005P0-78 for bug-guix@gnu.org; Tue, 18 Jul 2017 15:00:03 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <9b7cffa7-96a4-a799-c207-854bbcc7df04@tobias.gr> (Tobias Geerinckx-Rice's message of "Tue, 18 Jul 2017 17:09:08 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Tobias Geerinckx-Rice Cc: 27735@debbugs.gnu.org Heya, Tobias Geerinckx-Rice skribis: > On 18/07/17 13:49, Ludovic Court=C3=A8s wrote: >> What about generating a UUID in a deterministic yet somewhat unique >> fashion along these lines (untested): > > Not great, but I can't think of a better way. :-) Yup. >> + (define root-uuid >> + ;; UUID of the root file system, computed in a deterministic fashio= n. >> + (if (string=3D? "iso9660" file-system-type) >> + (let ((pad (compose (cut string-pad <> 2 #\0) >> + number->string))) >> + (string->iso9660-uuid >> + (string-append "1970-01-01-" >> + (pad (hash name 24)) >> + (pad (hash file-system-type 60)) >> + (pad (hash (operating-system-host-name os) 60= ))))) >> + (uint-list->bytevector >> + (list (hash (string-append file-system-type name) >> + (expt 2 64)) >> + (hash (operating-system-host-name os) >> + (expt 2 64))) >> + (endianness little) >> + 8))) >> + > > Why not throw SIZE into this mix as well? Because it can be the symbol 'guess or a number, so that makes things needlessly complicated IMO. > When building without =E2=80=98--image-size=E2=80=99 (the default nowaday= s), it's a > function of the exact size of the entire graph and reasonably sensitive > to most kinds of input changes. The actual size is not known until the derivation is built; we don=E2=80=99t have access to that information here. >> We cannot use the store file name=E2=80=99s hash, unfortunately, because= the >> UUID has to be given on the =E2=80=9Chost side.=E2=80=9D > > That is unfortunate, but a best-effort heuristic will do. Yeah, still better than a hard-coded label I guess. Ludo=E2=80=99.