FedeDP / Clightd

A linux bus interface that lets you change screen brightness, compute captured webcam frames brightness and change screen temperature.
GNU General Public License v3.0
83 stars 10 forks source link

Check for systemd before installing files #19

Closed danyspin97 closed 5 years ago

danyspin97 commented 5 years ago

Destination for additional files, installed along ddcutil support, was dependant on systemd. Systemd installation is checked before calling MODULE_LOAD_DIR.

FedeDP commented 5 years ago

Thanks for the patch! Unfortunately, i don't get this, sorry. You mean that on elogind systems, MODULE_LOAD_DIR would be empty? But it seems to not fix anything in that regards: if we are on an elogind system and we want to install DDCUtil support, we still reach pkg_get_variable(MODULE_LOAD_DIR systemd modulesloaddir).

Is there anything i am missing?

danyspin97 commented 5 years ago

You mean that on elogind systems, MODULE_LOAD_DIR would be empty?

Yea, it would be empty. That's a problem because install need a non empty destination directory and we feed it with a variable that can be empty.

pkg_get_variable is still called and it doesn't fail if systemd is not found (REQUIRED flag is not set). With this PR we check if systemd is installed (SYSTEMD_LIBS_FOUND) before installing the module file. Therefore install is reached only if MODULES_LOAD_DIR is set.

FedeDP commented 5 years ago

I understand now, thanks. Is there a /usr/lib/modules-load.d/ equivalent for non-systemd systems? I'd like to keep this feature (ie: if an user desires DDCUtil support, its modules should be automatically loaded for him/her).

EDIT: quickly googling it...and unfortunately it seems there is no standard way...eg: openrc uses /etc/openrc/conf.d/modules.