Skip to content
Permalink
Browse files

Changed the way dkms is installed/removed.

Now `dkms-install` target is used to check if current rapiddisk version is already installed on current kernel. `dkms-remove` uninstall rapiddisk via dkms (this version from this kernel only)
  • Loading branch information...
Shub77 committed Jul 17, 2019
1 parent 09a2627 commit d12569d2a637709470dd38db1f1f69d379095f3d
Showing with 21 additions and 10 deletions.
  1. +7 −3 Makefile
  2. +14 −7 module/Makefile
@@ -16,9 +16,13 @@ uninstall:
clean:
for i in $(SUBDIRS); do cd $$i; make clean; cd ..; done

.PHONY: dkms
dkms:
cd module; make dkms; cd ..
.PHONY: dkms-install
dkms-install:
cd module; make dkms-install; cd ..

.PHONY: dkms-uninstall
dkms-uninstall:
cd module; make dkms-uninstall; cd ..

.PHONY: tools-install
tools-install:
@@ -48,10 +48,17 @@ clean:
rm -rf *.o *.ko *.symvers *.mod.c .*.cmd Module.markers modules.order *.o.*
rm -rf .tmp_versions .rapiddisk.o.d *.unsigned *.sdtinfo.c .ctf/ .cache.mk

.PHONY: dkms
dkms:
sudo mkdir -pv /usr/src/rapiddisk-$(VERSION)/
sudo cp -v * /usr/src/rapiddisk-$(VERSION)/
sudo dkms add -m rapiddisk -v $(VERSION)
sudo dkms build -m rapiddisk -v $(VERSION)
sudo dkms install -m rapiddisk -v $(VERSION)
dkms-install:
ifeq ($(shell dkms status rapiddisk/$(VERSION) -k $(KVER) | grep '$(KVER)' >/dev/null && echo 0 || echo 1 ),0)
$(error rapiddisk version $(VERSION) is already installed for kernel $(KVER). Use 'make dkms-remove' first.)
else
dkms install rapiddisk/$(VERSION) -k $(KVER) .
endif

dkms-uninstall:
ifeq ($(shell dkms status rapiddisk/$(VERSION) -k $(KVER) | grep '$(KVER)' >/dev/null && echo 0 || echo 1 ),0)
dkms remove rapiddisk/$(VERSION) -k $(KVER)
else
$(error rapiddisk version $(VERSION) is not installed for kernel $(KVER).)
endif

0 comments on commit d12569d

Please sign in to comment.
You can’t perform that action at this time.