bug-guix
[Top][All Lists]
Advanced

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

bug#27735: Unbootable images with GuixSD on... "GuixSD"


From: Tobias Geerinckx-Rice
Subject: bug#27735: Unbootable images with GuixSD on... "GuixSD"
Date: Tue, 18 Jul 2017 17:09:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Ludo',

On 18/07/17 13:49, Ludovic Courtès 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. :-)

> +  (define root-uuid
> +    ;; UUID of the root file system, computed in a deterministic fashion.
> +    (if (string=? "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?

When building without ‘--image-size’ (the default nowadays), it's a
function of the exact size of the entire graph and reasonably sensitive
to most kinds of input changes.

> We cannot use the store file name’s hash, unfortunately, because the
> UUID has to be given on the “host side.”

That is unfortunate, but a best-effort heuristic will do.

Kind regards,

T G-R

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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