Skip to content

Commit

Permalink
Fix make install issue on Ubuntu (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-ywliu authored Jan 20, 2022
1 parent fd7db41 commit b4eb107
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@ endif

PWD := $(shell pwd)

CONFIG_MODULE_SIG=n
MODULE_NAME = gtp5g

ifneq ($(RHEL8FLAG),)
INSTALL := $(MAKE) -C $(KDIR) M=$$PWD INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=$(MOD_KERNEL_PATH) modules_install
else
INSTALL := cp $(MODULE_NAME).ko $(DESTDIR)/lib/modules/$(KVER)/$(MOD_KERNEL_PATH)

This comment has been minimized.

Copy link
@louisroyer

louisroyer Jan 28, 2022

Contributor

This should be moved after line 40 because $(KVER) and $(MOD_KERNEL_PATH) are not initialized yet, resulting in cp $(MODULE_NAME).ko $(DESTDIR)/lib/modules// which will error.

This comment has been minimized.

Copy link
@free5gc-org

free5gc-org Jan 29, 2022

Contributor

Fixed in v0.4.4

RUN_DEPMOD := true
endif

ifeq ($(KVER),)
KVER := $(shell uname -r)
endif
KVER := $(shell uname -r)
endif

ifneq ($(RUN_DEPMOD),)
DEPMOD := /sbin/depmod -a
else
DEPMOD := true
endif
DEPMOD := /sbin/depmod -a
else
DEPMOD := true
endif

ifeq ($(KDIR),)
KDIR := /lib/modules/$(KVER)/build
endif


CONFIG_MODULE_SIG=n
MODULE_NAME = gtp5g
KDIR := /lib/modules/$(KVER)/build
endif

MY_CFLAGS += -g -DDEBUG $(RHEL8FLAG)
EXTRA_CFLAGS += -Wno-misleading-indentation -Wuninitialized
Expand All @@ -40,7 +46,7 @@ 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
$(INSTALL)
modprobe udp_tunnel
$(DEPMOD)
modprobe $(MODULE_NAME)
Expand Down

0 comments on commit b4eb107

Please sign in to comment.