[parted-devel] reproducible output

Brian C. Lane bcl at redhat.com
Wed Jun 19 19:16:37 BST 2019


On Fri, Jun 14, 2019 at 01:52:14PM -0700, John Gilmore wrote:
> Brian, would you object to accepting a patch that added a command-line
> option to parted, that would make its small number of "random" values
> predictable?  Perhaps the option would set a pseudo-random seed, or
> perhaps it would just set those random values to zeroes.

According to comments in misc.c zeros could be mis-interpreted so it
would have to be something else, like the failure value for
generate_random_uint32 of 0xffffffff

It looks like we're using uuid_generate everywhere so setting a seed
isn't possible as far as I know. It tries really hard to actually be
random :)

> That would allow things like scripts that build OS distributions to use
> Parted to format and partition a blank bootable disk image, and then
> mount it and start to fill it in, while making it possible to build the
> same exact bit-for-bit identical distribution from its source code on
> anyone's machine.
> 
> Thanks for considering the idea.
> 
> 	John
> 
> PS:  I've been on the parted list for years, and also been working on
> bit-for-bit reproducibility of software releases for years.
> 

Are partitions really part of the problem? When I've read about
reproducible builds it has been the binaries that have been the focus.

I'm just not sure if it makes sense to make this part of parted. Some of
that is my natural reluctance to add more switches to the cmdline.

It may make sense to use an environmental variable instead of a switch,
that way it could be overridden without needing to change the tooling
that uses parted/libparted. Is there a standard for forcing a UUID value
like there is with SOURCE_DATE_EPOCH for time? FORCE_UUID or something
like that?

https://reproducible-builds.org/docs/randomness/ only talks about
seeding a PRNG. I don't see any benefit to using a seed, the results are
still a controlled value.

I'd also like to log when this happens to make things easier to debug,
but parted really doesn't have any way to do that other and stuffing a
print into the library, which would be a bad idea. Maybe only print it
when running in interactive mode.

So I guess I've talked myself into this :) Comments welcome from
others...

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted



More information about the parted-devel mailing list