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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Release 6.1 ###
### Release 6.0-1 ###

- kernel: Fix dkms version in module/Makefile.
- installer: modified dkms installation/removal procedures
Expand Down
11 changes: 9 additions & 2 deletions module/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.