swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

Paths should be configurable and shouldn't assume Clear Linux conventions

Open incandescant opened this issue 9 years ago • 7 comments

To help ease adoption on non-Clear Linux distributions paths which are currently hard-coded (and defaulting to Clear Linux conventions) should be easily overridden.

The following hard-coded paths are hard-coded to match Clear Linux conventions in swupd-client 3.5.3:

  • BUNDLES_DIR set to "/usr/share/clear/bundles" in configure.ac
  • UPDATE_CA_CERTS_PATH set to "/usr/share/clear/update-ca" in configure.ac
  • SIGNATURE_CA_CERT set to "test-do-not-ship-R0-0.pem" in configure.ac
  • CURLOPT_PINNEDPUBLICKEY set to "/usr/share/clear/update-ca/425b0f6b.key" in curl.c

Several other paths are hardcoded, but with slightly less unusual defaults, including:

  • STATE_DIR set to "/var/lib/swupd" in configure.ac
  • LOG_DIR set to "/var/log/swupd" in configure.ac
  • LOCK_DIR set to "/run/lock" in configure.ac
  • MOTD_FILE set to "/usr/lib/motd.d/001-new-release" in configure.ac

incandescant avatar May 11 '16 18:05 incandescant

would --with-bundles-dir=PATH to replace BUNDLES_DIR be enough? This is easy to do in configure.ac

barbieri avatar May 11 '16 19:05 barbieri

Yes, I think adding --with-* options would be best. For the defaults, I also want to change the "clear" path components to "swupd" instead.

phmccarty avatar May 11 '16 19:05 phmccarty

if you're going to move to swupd then it doesn't make sense to change the defaults I'd say. The confusion at the moment is we have clear in a context that doesn't mean anything. If it was /usr/share/swupd/bundles, it would be immediate to associate that to swupd.

Do you have an idea when you want to move these defaults?

barbieri avatar May 11 '16 20:05 barbieri

I agree that --with-* options would be best. I think there is value in both having sane defaults (/usr/share/swupd/bundles) and allowing the defaults to be overridden (it's entirely possible to build an OS where datadir isn't /usr/share).

I'm happy to patch configure.ac in-line with the discussion here and submit a PR.

incandescant avatar May 11 '16 21:05 incandescant

@incandescant Sure, feel free to submit a fix for this.

phmccarty avatar May 13 '16 17:05 phmccarty

/usr/share/clear/versionstamp as used by swupd's verifytime command is another convention from Clear which should be configurable.

pohly avatar Sep 28 '17 06:09 pohly

Yes, agreed.

phmccarty avatar Oct 10 '17 20:10 phmccarty