electrified / asus-wmi-sensors

Linux HWMON (lmsensors) sensors driver for various ASUS Ryzen and Threadripper motherboards
GNU General Public License v2.0
251 stars 30 forks source link

If build with no dkms, breaks build even after install dkms #58

Open dtgriscom opened 4 years ago

dtgriscom commented 4 years ago

I'm using Ubuntu 18.04.4. I cloned this repository, and tried

sudo make dkms

But, got an error:

make: dkms: Command not found
Makefile:91: recipe for target 'dkms' failed
make: *** [dkms] Error 127

I installed dkms, and then tried to make this again, but got a different error:

mkdir: cannot create directory ‘/usr/src/asus-wmi-sensors-b6c25d2’: File exists
Makefile:91: recipe for target 'dkms' failed
make: *** [dkms] Error 1

So, the first failed make had created the directory, but subsequent makes fail if the directory exists. I tried make clean, but it didn't remove the created directory. I finally hand-deleted the directory, and the sudo make dkms got a lot further (it ended up failing, but that'll be a different report).

Suggestions:

KeithMyers commented 4 years ago

I've fallen into this Catch-22 myself a few times. Always had to remove the flubbed original try at the dkms install before being successful.

TeamFahQ commented 4 years ago

Try sudo make dkms -i

The -i flag will ignore the file exists error

dtgriscom commented 4 years ago

Telling make to ignore all errors wouldn't feel safe to me as an end-user; it would be far better to have the Makefile itself be more robust.

Given that the directory name is built using git describe --long --always, there's virtually no chance that automatically deleting the directory would cause harm, right?

TeamFahQ commented 4 years ago

I see your point. But it was just a suggestion.

So, the commands:

To make the module sudo make dkms

To clean the build directory sudo make clean

To uninstall the module sudo make dkms_clean

electrified commented 4 years ago

I will add a check to the makefile to ensure DKMS is installed.