graysky2 / modprobed-db

Keeps track of EVERY kernel module that has ever been probed. Useful for those of us who make localmodconfig :)
https://wiki.archlinux.org/index.php/Modprobed-db
179 stars 16 forks source link

Any chance of having a /usr/local install option? #25

Closed vaskark closed 1 week ago

vaskark commented 1 week ago

I've tried changing some of the Makefile options but it seems the modprobed-db.skel file is still causing some issues. It would be nice if it fully worked in /usr/local.

Thanks.

graysky2 commented 1 week ago

The issue is that line 11 in the script is a hard-coded path... you can build the latest version with:

make PREFIX=/usr/local
make DESTDIR=/usr/local install

That should work. Please try it and let me know.

vaskark commented 1 week ago

Doesn't work.

make PREFIX=/usr/local sudo make DESTDIR=/usr/local install:

Installing main script and skel config...
install -p -d "/usr/local/usr/bin"
install -p -d "/usr/local/usr/share/modprobed-db"
install -p -m755 common/modprobed-db "/usr/local/usr/bin/modprobed-db"
install -p -m644 common/modprobed-db.skel "/usr/local/usr/share/modprobed-db/modprobed-db.skel"
install -p -d "/usr/local/usr/share/bash-completion/completions"
install -p -m644 common/bash-completion "/usr/local/usr/share/bash-completion/completions/modprobed-db"
install -p -d "/usr/local/usr/share/zsh/site-functions"
install -p -m644 common/zsh-completion "/usr/local/usr/share/zsh/site-functions/_modprobed-db"
install -p -d "/usr/local/usr/lib/systemd/user"
install -p -m644 init/modprobed-db.service "/usr/local/usr/lib/systemd/user/modprobed-db.service"
install -p -m644 init/modprobed-db.timer "/usr/local/usr/lib/systemd/user/modprobed-db.timer"
Installing manpage...
install -p -d "/usr/local/usr/share/man/man8"
install -p -m644 doc/modprobed-db.8 "/usr/local/usr/share/man/man8/modprobed-db.8"

It's going into /usr/local/USR/ ...

And even if I just do it the regular way, the uninstall errors out:

rm: cannot remove '/usr/share/man/man8/modprobed-db.8.gz': No such file or directory
make: *** [Makefile:50: uninstall] Error 1

Lose the .gz in Makefile.

vaskark commented 1 week ago

In Makefile:

INITDIR_SYSTEMD = /usr/lib/systemd/user

should be

INITDIR_SYSTEMD=$(PREIFX)/lib/systemd/user

And the service file binary path needs to be aware of $PREFIX.

Sorry for all the posts :)

graysky2 commented 1 week ago

You're right, thanks. Please try latest commit.

vaskark commented 1 week ago

Using make PREFIX=/usr/local and make DESTDIR=/usr/local still puts the files in/usr/local/usr/ ...

I've found that if I edit PREFIX in the Makefile to /usr/local, then make andsudo make install it installs perfectly. Uninstall is perfect, too.

graysky2 commented 1 week ago

I see that as well... I do not know how to pass the custom value of PREFIX to the install step

vaskark commented 1 week ago

Lol me neither.

I might just use a custom branch for the Makefile for the time being.

Btw, thanks for all your hard work.

graysky2 commented 1 week ago

OK, enjoy