denisbrodbeck / machineid

Get the unique machine id of any host (without admin privileges)
MIT License
1k stars 143 forks source link

Supporting an alternate source for machine-id for testing purposes? #13

Open CyrilBrulebois opened 3 years ago

CyrilBrulebois commented 3 years ago

Hi,

While packaging your software for Debian, I've noticed that a minimal chroot (which is typical for building purposes) might not have any /etc/machine-id (or the /var/lib/dbus/machine-id counterpart), leading to testsuite failures. Of course, I could just ignore testsuite results (which will be done in the first revision of this package), but it's not ideal.

Would it make sense to support something like an environment variable to point at a different root, or to have an extra file that one could look at? The usual constraint while building Debian package is staying inside $(CURDIR) and having no root privileges.

Thanks for your input.

Cheers, Cyril.

CyrilBrulebois commented 3 years ago

In hindsight, we might go for tweaking upstream sources (in the package that currently depends on this module) to read /etc/machine-id directly, which should be good enough for our purposes.

Feel free to close this bug report.