-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support for RHEL8 * Enhanced Makefile for RHEL8 * Updated README.md * Remove unused KVERSION variable from Makefile
- Loading branch information
Showing
3 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,53 @@ | ||
|
||
RHEL8 := $(shell cat /etc/redhat-release 2>/dev/null | grep -c " 8." ) | ||
ifneq (,$(findstring 1, $(RHEL8))) | ||
RHEL8FLAG := -DRHEL8 | ||
endif | ||
|
||
PWD := $(shell pwd) | ||
KVERSION := $(shell uname -r) | ||
INCLUDE_DIR = /usr/src/linux-headers-$(KVERSION)/ | ||
|
||
ifeq ($(KVER),) | ||
KVER := $(shell uname -r) | ||
endif | ||
|
||
ifneq ($(RUN_DEPMOD),) | ||
DEPMOD := /sbin/depmod -a | ||
else | ||
DEPMOD := true | ||
endif | ||
|
||
ifeq ($(KDIR),) | ||
KDIR := /lib/modules/$(KVER)/build | ||
endif | ||
|
||
|
||
CONFIG_MODULE_SIG=n | ||
MODULE_NAME = gtp5g | ||
|
||
MY_CFLAGS += -g -DDEBUG | ||
MY_CFLAGS += -g -DDEBUG $(RHEL8FLAG) | ||
EXTRA_CFLAGS += -Wno-misleading-indentation -Wuninitialized | ||
CC += ${MY_CFLAGS} | ||
|
||
obj-m := $(MODULE_NAME).o | ||
|
||
all: | ||
make -C $(INCLUDE_DIR) M=$(PWD) modules | ||
MOD_KERNEL_PATH := /kernel/drivers/net | ||
|
||
default: module | ||
|
||
module: | ||
$(MAKE) -C $(KDIR) M=$(PWD) modules | ||
clean: | ||
make -C $(INCLUDE_DIR) M=$(PWD) clean | ||
$(MAKE) -C $(KDIR) M=$(PWD) clean | ||
|
||
install: | ||
$(MAKE) -C $(KDIR) M=$$PWD INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=$(MOD_KERNEL_PATH) modules_install | ||
modprobe udp_tunnel | ||
cp $(MODULE_NAME).ko /lib/modules/`uname -r`/kernel/drivers/net | ||
depmod -a | ||
$(DEPMOD) | ||
modprobe $(MODULE_NAME) | ||
echo "gtp5g" >> /etc/modules | ||
|
||
uninstall: | ||
rmmod $(MODULE_NAME) | ||
rm -f /lib/modules/`uname -r`/kernel/drivers/net/$(MODULE_NAME).ko | ||
depmod -a | ||
rm -f $(DESTDIR)/lib/modules/$(KVER)/$(MOD_KERNEL_PATH)/$(MODULE_NAME).ko | ||
$(DEPMOD) | ||
sed -zi "s/gtp5g\n//g" /etc/modules | ||
rmmod -f $(MODULE_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters