ElektraInitiative / lcdproc

Client/server suite for controlling a wide variety of LCD devices
http://lcdproc.org/
GNU General Public License v2.0
2 stars 1 forks source link

have default driver path as default in specification #6

Open markus2330 opened 5 years ago

markus2330 commented 5 years ago

The INSTALL.md currently says to do:

kdb set '/sw/lcdproc/lcdd/#0/current/server/driverpath' /usr/local/lib/lcdproc/

I think the compiled-in path should be default in the specification, making the kdb set only necessary if another path is to be used (or lcdproc is not yet installed).

kodebach commented 5 years ago

The drivers are installed into automake's $pkgdlibdir, so ideally we would set the default to that at compile time. If that isn't possible, the default should be /usr/local/lib/lcdproc/, which is the default for $pkglibdir.

I pushed a commit to the low-level branch, that enables this behaviour. For the specification itself, it might be a bit more complicated to do this.

markus2330 commented 5 years ago

Thank you for the improvement!

Having it in the specification would have the advantage that people can introspect it, and we could check if the (default) folder exists on the system. I keep the issue open for that.

markus2330 commented 4 years ago

@Piankero what is the status here?

kodebach commented 4 years ago

The post-install script takes care of this:

https://github.com/ElektraInitiative/lcdproc/blob/e35c481e2e3fceef401e82e5694f5b4197cbb41d/post-install.sh.in#L47

Running without installing may require manual setup. ~If a specification is already mounted (and compatible with the version of LCDproc you are trying to run), it should work without additional setup.~ see below

markus2330 commented 4 years ago

Any specific reason why the post-install script does not directly modify the "default" value of the specification?

kodebach commented 4 years ago

Modifying the default value might be good idea, you are right. The current post-install would only work for the current user I think.

Another solution would be to either change the install paths of LCDd/the drivers or how the repository is set up (it would easier for a separate build directory). If the relative path from LCDd to the driver directory, is the same in installed an non-installed LCDproc, then we could use something like $ORIGIN/relative/driver/path. I don't know whether that works on every system, but it works with glibc.


If a specification is already mounted (and compatible with the version of LCDproc you are trying to run), it should work without additional setup.

That is actually not quite true... The driver path will be set to something like /usr/local/lib/lcdproc, so without installing again, or changing the driver path, changes to drivers won't take effect.

markus2330 commented 4 years ago

The current post-install would only work for the current user I think.

It is executed as root, so the namespace "system" should be default.

That is actually not quite true... The driver path will be set to something like /usr/local/lib/lcdproc, so without installing again, or changing the driver path, changes to drivers won't take effect.

It is okay if the specification is bound to the installation, the specification will be removed during uninstall. But the system configuration usually survives an uninstall. This problem would be solved when we set the default instead of changing the (system) configuration.

kodebach commented 4 years ago

It is executed as root, so the namespace "system" should be default.

Oh yeah, that would work... Running as non-root works as well, so it doesn't have to be executed as root though.

This problem would be solved when we set the default instead of changing the (system) configuration.

Ok, let's change the post-install.sh script.

ghost commented 4 years ago

Ok, let's change the post-install.sh script.

Do you change that @kodebach ? Or is there something else to change?