Skip to content

Commit

Permalink
Cleaned up errors in Makefile for when dkms is NOT installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoutoupis committed Aug 14, 2019
1 parent 246ac4d commit df31a80
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .gitignore
@@ -0,0 +1,13 @@
*.o
*.o.*
*.mod
*.mod.*
*.ko
*.cmd
*.mk
*.symvers
*.order
src/rapiddisk
test/rxflush
test/rxio
test/rxioctl
2 changes: 1 addition & 1 deletion CHANGELOG.md
@@ -1,4 +1,4 @@
### Release 6.1 ### ### Release 6.0-1 ###


- kernel: Fix dkms version in module/Makefile. - kernel: Fix dkms version in module/Makefile.
- installer: modified dkms installation/removal procedures - installer: modified dkms installation/removal procedures
Expand Down
11 changes: 9 additions & 2 deletions module/Makefile
Expand Up @@ -27,7 +27,7 @@ endif


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


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


dkms-install: 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) 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.) $(error rapiddisk version $(VERSION) is already installed for kernel $(KVER). Use 'make dkms-uninstall' first.)
else else
[ ! -d $(DKMSDEST) ] && $(MKDIR) $(DKMSDEST) || true [ ! -d $(DKMSDEST) ] && $(MKDIR) $(DKMSDEST) || true
$(CP) $(DKMSFILES) $(DKMSDEST) $(CP) $(DKMSFILES) $(DKMSDEST)
dkms install rapiddisk/$(VERSION) -k $(KVER) . dkms install rapiddisk/$(VERSION) -k $(KVER) .
endif endif
endif


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

endif

0 comments on commit df31a80

Please sign in to comment.