Skip to content
Permalink
Browse files

Cleaned up errors in Makefile for when dkms is NOT installed.

  • Loading branch information...
pkoutoupis committed Aug 14, 2019
1 parent 246ac4d commit df31a80e2181d54c5b76dd2ce49fc50c486776db
Showing with 23 additions and 3 deletions.
  1. +13 −0 .gitignore
  2. +1 −1 CHANGELOG.md
  3. +9 −2 module/Makefile
@@ -0,0 +1,13 @@
*.o
*.o.*
*.mod
*.mod.*
*.ko
*.cmd
*.mk
*.symvers
*.order
src/rapiddisk
test/rxflush
test/rxio
test/rxioctl
@@ -1,4 +1,4 @@
### Release 6.1 ###
### Release 6.0-1 ###

- kernel: Fix dkms version in module/Makefile.
- installer: modified dkms installation/removal procedures
@@ -27,7 +27,7 @@ endif

MKDIR := mkdir -pv
CP := cp -v
DKMSFILES := $(shell ls *.c) dkms.conf Makefile
DKMSFILES := rapiddisk.c rapiddisk-cache.c dkms.conf Makefile
DKMSDEST := /usr/src/rapiddisk-$(VERSION)

obj-m += rapiddisk.o
@@ -52,18 +52,25 @@ clean:
rm -rf .tmp_versions .rapiddisk.o.d *.unsigned *.sdtinfo.c .ctf/ .cache.mk

dkms-install:
ifeq (, $(shell which dkms))
$(error "No dkms.")
else
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-uninstall' first.)
else
[ ! -d $(DKMSDEST) ] && $(MKDIR) $(DKMSDEST) || true
$(CP) $(DKMSFILES) $(DKMSDEST)
dkms install rapiddisk/$(VERSION) -k $(KVER) .
endif
endif

dkms-uninstall:
ifeq (, $(shell which dkms))
$(error "No dkms.")
else
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

endif

0 comments on commit df31a80

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